@duplicati/ngclient 0.0.146 → 0.0.147

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.
@@ -1 +1 @@
1
- import{b as be,c as ve}from"./chunk-4TDUWDRL.js";import{a as he}from"./chunk-QDFDQHU3.js";import{a as I}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import{a as D}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-VTSUHAP5.js";import{a as de}from"./chunk-UP5EOICU.js";import"./chunk-Z3EPZZGY.js";import{a as b,b as v,c as ue,d as k}from"./chunk-UKQFDBNO.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-LVP2TPMO.js";import{a as ee}from"./chunk-43JMN2ZY.js";import{c as le}from"./chunk-H7K35UUX.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-NOPMCS2Z.js";import{a as ge}from"./chunk-TDKBGGNK.js";import{la as Y,qa as Z}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{a as ye}from"./chunk-DFMGS3IN.js";import{b as fe}from"./chunk-6OPAGPKF.js";import{A as x,B as G,Cb as z,H as w,Jc as q,Kc as X,N as J,P as R,Pc as Q,R as B,V as M,Y as $,_ as s,bb as _,f as W,i as j,ia as K,n as F,o as U,oa as d,r as S}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=s(b);#s=s(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ee=()=>{let e=s(k);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(v),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-FCRM5DER.js")},{path:"logout",loadComponent:()=>import("./chunk-MVNLSG6Z.js")},{path:"",canActivate:[Ee],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-AJTK6HBC.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZNWZFRFW.js")},{path:"add-backup",loadComponent:()=>import("./chunk-FZHTJSDJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-M6WWZKV7.js")},{path:"backup/import",loadComponent:()=>import("./chunk-FUOS2UGQ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-7EBTJOD7.js"),loadChildren:()=>import("./chunk-UAOG26QT.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-7EBTJOD7.js"),loadChildren:()=>import("./chunk-UAOG26QT.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-QITXA3NT.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-J3ONM4TQ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-53RHCPJ3.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-2UCO57JQ.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-DLMKZACT.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-NJZSEKTD.js")},{path:"from-config",loadComponent:()=>import("./chunk-VHE3K2F5.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-F3RCXLD4.js"),loadChildren:()=>import("./chunk-A4HR75JB.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-F3RCXLD4.js"),loadChildren:()=>import("./chunk-A4HR75JB.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-F3RCXLD4.js"),loadChildren:()=>import("./chunk-A4HR75JB.js")},{path:"settings",loadComponent:()=>import("./chunk-RSJYY3JM.js")},{path:"about",loadComponent:()=>import("./chunk-WS76KLII.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-E66CBA5F.js")},{path:"changelog",loadComponent:()=>import("./chunk-SFSB73YO.js")},{path:"libraries",loadComponent:()=>import("./chunk-TIWH4NKT.js")},{path:"system-info",loadComponent:()=>import("./chunk-IFW3O4YJ.js")},{path:"server-settings",loadComponent:()=>import("./chunk-TKO3OH2C.js")},{path:"logs",loadChildren:()=>import("./chunk-B2D4QGDJ.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-R5RIFWZO.js")}]}]}]}]}];var P=null,Te=(e,t)=>{let o=s(k),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),V=e,H=e.headers.has("custom-proxy-check")||O===ue;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),V=e.clone({headers:c})}return t(V).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(P??=o.refreshToken().pipe(J()),P.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>P=null))):U(()=>({error:c,message:f}))}))};var Ne="1.0.0",we=`portal-proxy-client-${D()}`,Oe=1,N=class e{#o=1e3;#s=s(h);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:t,publicKey:"",clientVersion:Ne,protocolVersion:Oe},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=D(),g={from:we,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Me(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(p=>{a.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(y=>{C.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});p.next(g),p.complete()})})}var ke=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Me(o,e,t).subscribe(i)}),i}return Me(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([ke,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:ve()},he,I,fe,Z,de,Y,ge,ye]};ee(E,Ie);
1
+ import{b as be,c as ve}from"./chunk-4TDUWDRL.js";import{a as he}from"./chunk-QDFDQHU3.js";import{a as I}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import{a as D}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-VTSUHAP5.js";import{a as de}from"./chunk-UP5EOICU.js";import"./chunk-Z3EPZZGY.js";import{a as b,b as v,c as ue,d as k}from"./chunk-UKQFDBNO.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-LVP2TPMO.js";import{a as ee}from"./chunk-43JMN2ZY.js";import{c as le}from"./chunk-H7K35UUX.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-NOPMCS2Z.js";import{a as ge}from"./chunk-TDKBGGNK.js";import{la as Y,qa as Z}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{a as ye}from"./chunk-DFMGS3IN.js";import{b as fe}from"./chunk-6OPAGPKF.js";import{A as x,B as G,Cb as z,H as w,Jc as q,Kc as X,N as J,P as R,Pc as Q,R as B,V as M,Y as $,_ as s,bb as _,f as W,i as j,ia as K,n as F,o as U,oa as d,r as S}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=s(b);#s=s(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ee=()=>{let e=s(k);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(v),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-FCRM5DER.js")},{path:"logout",loadComponent:()=>import("./chunk-MVNLSG6Z.js")},{path:"",canActivate:[Ee],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-AJTK6HBC.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZNWZFRFW.js")},{path:"add-backup",loadComponent:()=>import("./chunk-FZHTJSDJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-M6WWZKV7.js")},{path:"backup/import",loadComponent:()=>import("./chunk-FUOS2UGQ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-LBI35OS4.js"),loadChildren:()=>import("./chunk-X35RIHQ2.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-LBI35OS4.js"),loadChildren:()=>import("./chunk-X35RIHQ2.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-QITXA3NT.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-J3ONM4TQ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-AZ7AMASU.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-2UCO57JQ.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-DLMKZACT.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-NJZSEKTD.js")},{path:"from-config",loadComponent:()=>import("./chunk-VHE3K2F5.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-ZAIUME2O.js"),loadChildren:()=>import("./chunk-WODA6N4N.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-ZAIUME2O.js"),loadChildren:()=>import("./chunk-WODA6N4N.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-ZAIUME2O.js"),loadChildren:()=>import("./chunk-WODA6N4N.js")},{path:"settings",loadComponent:()=>import("./chunk-Z6NPBMOP.js")},{path:"about",loadComponent:()=>import("./chunk-WS76KLII.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-E66CBA5F.js")},{path:"changelog",loadComponent:()=>import("./chunk-SFSB73YO.js")},{path:"libraries",loadComponent:()=>import("./chunk-TIWH4NKT.js")},{path:"system-info",loadComponent:()=>import("./chunk-IFW3O4YJ.js")},{path:"server-settings",loadComponent:()=>import("./chunk-TKO3OH2C.js")},{path:"logs",loadChildren:()=>import("./chunk-B2D4QGDJ.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-R5RIFWZO.js")}]}]}]}]}];var P=null,Te=(e,t)=>{let o=s(k),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),V=e,H=e.headers.has("custom-proxy-check")||O===ue;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),V=e.clone({headers:c})}return t(V).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(P??=o.refreshToken().pipe(J()),P.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>P=null))):U(()=>({error:c,message:f}))}))};var Ne="1.0.0",we=`portal-proxy-client-${D()}`,Oe=1,N=class e{#o=1e3;#s=s(h);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:t,publicKey:"",clientVersion:Ne,protocolVersion:Oe},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=D(),g={from:we,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Me(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(p=>{a.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(y=>{C.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});p.next(g),p.complete()})})}var ke=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Me(o,e,t).subscribe(i)}),i}return Me(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([ke,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:ve()},he,I,fe,Z,de,Y,ge,ye]};ee(E,Ie);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.146",
2
+ "version": "0.0.147",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-A4HR75JB.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-NEEEYVL7.js")},{path:"encryption",loadComponent:()=>import("./chunk-S2DE2CVG.js")},{path:"select-files",loadComponent:()=>import("./chunk-2J72DAGY.js")},{path:"options",loadComponent:()=>import("./chunk-JISUMMWT.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-MIXCKY7O.js")}],t=o;export{t as default};
package/chunk-HIIPI6XR.js DELETED
@@ -1 +0,0 @@
1
- import{a as v,c as N,e as E,i as O,k as P,s as D}from"./chunk-N5SC4SKW.js";import{l as S,o as X,t as Y}from"./chunk-H7K35UUX.js";import{Ab as p,Bb as s,Gb as L,Hb as x,Jb as W,Oc as m,Pc as f,Ra as a,Sb as I,Tb as F,Ub as A,Uc as g,Wb as j,Yb as b,Zb as T,_b as d,bb as C,ea as $,fa as w,gb as z,hc as G,lc as U,oa as l,oc as k,qc as c,rc as h,sc as _,tb as M,wb as B,xb as R,yb as V,yc as y,zb as u}from"./chunk-HNWRQABR.js";var Q=[[["label"]],[["","prefix",""]],[["","suffix",""]]],ee=["label","[prefix]","[suffix]"];function te(i,e){if(i&1&&U(0),i&2){let t=e.$implicit,n=b();k("",t.label,"",n.hasPerSecond()?"/s":"")}}var ne=[{value:"bytes",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],ie=["throttle-upload","throttle-download"],H=class i{customId=g();inputType=g();timespan=l(0);unit=l("MB");sizeOptions=l(ne);readonly=l(!1);hasPerSecond=m(()=>{let e=this.inputType();return e&&ie.includes(e)});onChange=()=>{};onTouched=()=>{};onChangeEffect=f(()=>{this.onChange(this.getValue())});writeValue(e){if(e){let t=e.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);t?queueMicrotask(()=>{this.timespan.set(parseInt(t[1],10)),this.unit.set(t[2].toUpperCase())}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.readonly.set(e)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[y([{provide:v,useExisting:i,multi:!0}])],ngContentSelectors:ee,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(t,n){t&1&&(T(Q),p(0,"div",0),d(1,0,["ngProjectAs","label",5,["label"]]),s(),p(2,"sh-form-field")(3,"input",1),_("ngModelChange",function(o){return h(n.timespan,o)||(n.timespan=o),o}),s(),d(4,1),d(5,2),s(),p(6,"sh-select",2)(7,"input",3),_("ngModelChange",function(o){return h(n.unit,o)||(n.unit=o),o}),s(),z(8,te,1,2,"ng-template"),s()),t&2&&(a(2),M("readonly",n.readonly()||void 0),a(),u("id",n.customId()),c("ngModel",n.timespan),u("disabled",n.readonly()),a(3),G("--miw",0),u("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),a(),c("ngModel",n.unit))},dependencies:[Y,S,D,N,P,E,O],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 oe=[[["label"]],[["","prefix",""]],[["","suffix",""]]],ae=["label","[prefix]","[suffix]"];function se(i,e){if(i&1){let t=W();p(0,"button",7),j("click",function(){let r=$(t).$implicit,o=b();return w(o.updateUnit(r.value))}),I(1,1),s()}if(i&2){let t=e.$implicit;a(),F(t.label),A(1)}}var le=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],re=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],ue=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],K=class i{customId=g();inputType=g();timespan=l(0);#e="D";unit=l(this.#e);unitLabel=m(()=>{let e=this.timeOptions(),t=e.findIndex(n=>n.value===this.unit());return e[t]?.label??this.unit()});isShortTime=m(()=>{let e=this.inputType();return e&&ue.includes(e.replace("--",""))});timeOptions=m(()=>this.isShortTime()?le:re);readonly=l(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=f(()=>{this.onChange(this.getValue())});inputTypeEffect=f(()=>{let e=this.timeOptions(),t=this.isShortTime()?"s":"D";this.#e=t,this.unit.set(t)});updateUnit(e){this.unit.set(e)}writeValue(e){let t=this.isShortTime();if(e){let n=t?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,r=e.match(n);r?(this.timespan.set(parseInt(r[1],10)),this.unit.set(r[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.readonly.set(e)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[y([{provide:v,useExisting:i,multi:!0}])],ngContentSelectors:ae,decls:11,vars:6,consts:()=>{let e;e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let t;return t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`,[e,t,["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(t,n){t&1&&(T(oe),d(0,0,["ngProjectAs","label",5,["label"]]),p(1,"sh-form-field")(2,"input",2),_("ngModelChange",function(o){return h(n.timespan,o)||(n.timespan=o),o}),s(),d(3,1),d(4,2),s(),p(5,"sh-menu",3)(6,"button",4),I(7,0),s(),L(8,5),R(9,se,2,1,"button",6,B),x(),s()),t&2&&(a(),M("readonly",n.readonly()||void 0),a(),u("id",n.customId()),c("ngModel",n.timespan),u("disabled",n.readonly()),a(3),u("openIndicator",!0),a(2),F(n.unitLabel()),A(7),a(2),V(n.timeOptions()))},dependencies:[X,S,D,N,P,E,O],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{H as a,K as b};
package/chunk-MSLKIHQQ.js DELETED
@@ -1 +0,0 @@
1
- import{a as ut}from"./chunk-N6ABN43N.js";import{a as Oe}from"./chunk-DDWLL7XA.js";import{a as rt,b as Ke,c as _t}from"./chunk-2QJC4PGQ.js";import{b as re}from"./chunk-O64ZZGQZ.js";import{a as ot}from"./chunk-DELLEGXW.js";import{a as he}from"./chunk-VTSUHAP5.js";import{b as Te,c as Q,d as fe,e as Z,f as Ae,h as st,i as ae,j as Pe,k as Ne,n as at,o as De,p as lt,q as Me,r as ye,s as le,t as Re}from"./chunk-N5SC4SKW.js";import{b as oe,d as z}from"./chunk-LVP2TPMO.js";import{A as Ee,C as nt,a as j,b as Je,e as et,g as se,l as q,p as tt,t as Y}from"./chunk-H7K35UUX.js";import{h as it}from"./chunk-NOPMCS2Z.js";import{Ab as a,Bb as l,Cb as m,Gb as B,H as Ie,Hb as k,Jb as b,Oc as L,Pc as ie,Qb as C,Ra as _,Rb as F,Sb as f,Tc as ke,Uc as Ve,V as ge,Vb as xe,Vc as Se,Wb as E,Yb as u,_ as M,bb as H,ea as d,ec as me,fa as p,fc as Ce,gb as Ye,gc as be,ic as Fe,lc as G,mc as ve,nc as Ze,oa as g,qc as w,rc as $,sc as I,tb as Qe,ub as y,vb as R,wb as Le,xb as Ue,yb as Ge,zb as T,zc as Be}from"./chunk-HNWRQABR.js";import{a as x,b as W}from"./chunk-EUDKD2JW.js";var we=class s{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||s)};static \u0275prov=ge({token:s,factory:s.\u0275fac,providedIn:"root"})};function mt(s,t){if(s&1){let e=b();a(0,"div",24)(1,"sh-form-field")(2,"label",25),f(3,7),l(),a(4,"input",26,0),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),p(i)}),E("focus",function(){d(e);let i=be(5);return p(i.showPicker())}),l(),a(6,"sh-icon",27),G(7,"clock"),l()(),a(8,"sh-form-field"),m(9,"label",28),a(10,"input",29,1),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),p(i)}),E("focus",function(){d(e);let i=be(11);return p(i.showPicker())}),l(),a(12,"sh-icon",27),G(13,"calendar"),l()()(),a(14,"div",24)(15,"sh-form-field")(16,"label",30),f(17,8),l(),a(18,"input",31),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),p(i)}),l()(),a(19,"sh-select",32)(20,"input",33),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),p(i)}),l()()(),a(21,"app-toggle-card",34),B(22,35),f(23,9),k(),a(24,"div",36)(25,"sh-toggle",19),C(26,10),a(27,"input",20),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),p(i)}),l(),F(),l(),a(28,"sh-toggle",19),C(29,11),a(30,"input",20),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),p(i)}),l(),F(),l(),a(31,"sh-toggle",19),C(32,12),a(33,"input",20),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),p(i)}),l(),F(),l(),a(34,"sh-toggle",19),C(35,13),a(36,"input",20),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),p(i)}),l(),F(),l(),a(37,"sh-toggle",19),C(38,14),a(39,"input",20),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),p(i)}),l(),F(),l(),a(40,"sh-toggle",19),C(41,15),a(42,"input",20),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),p(i)}),l(),F(),l(),a(43,"sh-toggle",19),C(44,16),a(45,"input",20),I("ngModelChange",function(i){d(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),p(i)}),l(),F(),l()()()}if(s&2){let e=u();_(4),w("ngModel",e.scheduleFields.nextTime().time),_(6),w("ngModel",e.scheduleFields.nextTime().date),_(8),w("ngModel",e.scheduleFields.runAgain().repeatValue),_(),T("options",e.unitOptions)("isClearable",!1),_(),w("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),T("disallowToggle",!0),_(6),w("ngModel",e.scheduleFields.runAgain().allowedDays.mon),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.tue),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.wed),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.thu),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.fri),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.sat),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var Ct=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],te={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Xe=class s{#e=M(J);#t=M(z);#i=M(oe);unitOptions=Ct;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=H({type:s,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let r;r=$localize`Next time`;let c;c=$localize`Run again every`;let h;h=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let X;return X=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,c,h,S,O,P,U,K,v,X,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(a(0,"h3",17),f(1,2),l(),a(2,"div",18)(3,"sh-toggle",19),C(4,3),a(5,"input",20),I("ngModelChange",function(o){return $(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),F(),l(),a(6,"p"),f(7,4),l()(),y(8,mt,46,14),a(9,"div",21)(10,"button",22),E("click",function(){return n.goBack()}),C(11,5),m(12,"sh-icon"),F(),l(),a(13,"button",23),E("click",function(){return n.next()}),C(14,6),m(15,"sh-icon"),F(),l()()),e&2&&(_(5),w("ngModel",n.scheduleFields.autoRun),_(3),R(n.scheduleFields.autoRun()?8:-1))},dependencies:[le,Q,Ne,Te,Z,ae,q,Ee,j,se,Y,Oe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Ft(s,t){if(s&1&&(B(0,4),G(1),k()),s&2){let e,n=u();_(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function St(s,t){if(s&1&&(B(0,5),G(1),k()),s&2){let e,n=u();_(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}var Et=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],$e=class s{path=Ve.required();osType=Ve();pathChange=ke();remove=ke();internalPath=g("");pathType=g("-Expression");currentExpressionOption=L(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});expressionOptions=L(()=>{let e=this.osType()==="Windows"?"\\":"/";return Et.map(n=>n.value==="-Folder"||n.value==="+Folder"?W(x({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?W(x({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?W(x({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?W(x({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?W(x({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?W(x({},n),{startsWith:"*.",endsWith:""}):W(x({},n),{startsWith:"",endsWith:""}))});pathEffect=ie(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=H({type:s,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:9,vars:6,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"expression-input"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""],[1,"filter-removal",3,"click"],[1,"sh-primary"]]},template:function(e,n){if(e&1&&(a(0,"sh-select",0)(1,"input",1),I("ngModelChange",function(o){return $(n.pathType,o)||(n.pathType=o),o}),E("ngModelChange",function(){return n.updateFilter()}),l()(),a(2,"sh-form-field",2)(3,"input",3),I("ngModelChange",function(o){return $(n.internalPath,o)||(n.internalPath=o),o}),E("ngModelChange",function(){return n.updateFilter()}),l(),y(4,Ft,2,1,"ng-container",4),y(5,St,2,1,"ng-container",5),l(),a(6,"div",6),E("click",function(){return n.removeFilter()}),a(7,"sh-icon",7),G(8,"x-circle"),l()()),e&2){let i,o;T("options",n.expressionOptions())("isClearable",!1),_(),w("ngModel",n.pathType),_(2),w("ngModel",n.internalPath),_(),R(!((i=n.currentExpressionOption())==null||i.startsWith==null)&&i.startsWith.length?4:-1),_(),R(!((o=n.currentExpressionOption())==null||o.endsWith==null)&&o.endsWith.length?5:-1)}},dependencies:[le,Q,Z,ae,Y,q,j],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var ht=["formRef"],ct=()=>({standalone:!0});function Tt(s,t){if(s&1){let e=b();a(0,"sh-form-field",42)(1,"input",43),I("ngModelChange",function(i){d(e);let o=u(2);return $(o.editingPath,i)||(o.editingPath=i),p(i)}),l()(),a(2,"button",44),E("click",function(){d(e);let i=u(2);return p(i.updatePath())}),a(3,"sh-icon"),G(4,"floppy-disk"),l()(),a(5,"button",44),E("click",function(){d(e);let i=u(2);return p(i.cancelEditPath())}),a(6,"sh-icon"),G(7,"x-bold"),l()()}if(s&2){let e=u(2);_(),w("ngModel",e.editingPath),T("ngModelOptions",Be(2,ct))}}function ft(s,t){if(s&1){let e=b();a(0,"sh-form-field",42),m(1,"input",45),l(),a(2,"button",44),E("click",function(){d(e);let i=u().$implicit,o=u();return p(o.editPath(i))}),a(3,"sh-icon"),G(4,"pen"),l()(),a(5,"button",44),E("click",function(){d(e);let i=u().$implicit,o=u();return p(o.removePath(i))}),a(6,"sh-icon"),G(7,"trash-simple"),l()()}if(s&2){let e=u().$implicit;Qe("readonly",!0),_(),T("ngModel",e)("ngModelOptions",Be(3,ct))}}function At(s,t){if(s&1&&(a(0,"div",30),y(1,Tt,8,3)(2,ft,8,4),l()),s&2){let e=t.$implicit,n=u();_(),R(n.oldPath()===e?1:2)}}function Pt(s,t){if(s&1){let e=b();a(0,"app-new-filter",47),E("pathChange",function(i){let o=d(e).$index,r=u(2);return p(r.patchPathAt(i,o))})("remove",function(){let i=d(e).$index,o=u(2);return p(o.removePathAt(i))}),l()}if(s&2){let e=t.$implicit,n=u(2);T("path",e)("osType",n.osType()??"")}}function Nt(s,t){if(s&1&&Ue(0,Pt,1,2,"app-new-filter",46,Le),s&2){let e=u();Ge(e.pathArray())}}function Dt(s,t){if(s&1&&(a(0,"div",41)(1,"sh-form-field"),m(2,"input",48),l(),a(3,"sh-select",49),m(4,"input",50),l()()),s&2){let e=u();_(3),T("options",e.sizeOptions())("isClearable",!1)}}var V=new ye,Mt=["Bytes","KB","MB","GB","TB","PB"],dt=(s={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(s.path),excludes:V.group({hidden:V.control(s.excludes.hidden),system:V.control(s.excludes.system),temporary:V.control(s.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),ze=class s{#e=M(J);#t=M(z);#i=M(oe);formRef=Se.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new st("");filesLargerThan=L(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=g(Mt);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=L(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=L(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=g(null);editingPath=g(null);addingNewPath=g(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().map((c,h)=>h===e?`${t}`:`${c}`).join("\0"),r=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(r)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,c)=>c!==t).join("\0"),o=[n,i].filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=H({type:s,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&me(n.formRef,ht,5),e&2&&Ce()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let c;c=$localize`Folder path`;let h;h=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let O;O=$localize`Paths`;let P;P=$localize`Add a path directly from your machine.`;let U;U=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let X;X=$localize`Exclude`;let D;D=$localize`Choose if there’s any files you want to exclude.`;let ee;ee=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let A;A=$localize`Edit path`;let qe;return qe=$localize`Select an option...`,[["formRef",""],r,c,h,S,O,P,U,K,v,X,D,ee,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"small"],["type","text","placeholder",A,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",qe]]},template:function(e,n){if(e&1){let i=b();a(0,"form",16,0),E("submit",function(){return d(i),p(n.next())}),a(2,"div",17)(3,"h3",18),f(4,1),l(),a(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),m(8,"input",21),l(),a(9,"div",22)(10,"button",23),E("click",function(){return d(i),p(n.goBack())}),C(11,3),m(12,"sh-icon"),F(),l(),a(13,"button",24),C(14,4),m(15,"sh-icon"),F(),l()()(),a(16,"div",25)(17,"app-toggle-card",26),B(18,27),f(19,5),k(),a(20,"p",28),f(21,6),l(),a(22,"div",29),Ue(23,At,3,1,"div",30,Le),a(25,"div",31)(26,"sh-form-field"),m(27,"input",32),l(),a(28,"button",33),E("click",function(){return d(i),p(n.addNewPath())}),a(29,"sh-icon"),G(30,"plus"),l()()()()(),a(31,"app-toggle-card",26),B(32,27),f(33,7),k(),a(34,"p",28),f(35,8),l(),a(36,"button",34),E("click",function(){return d(i),p(n.addFilter())}),f(37,9),l(),y(38,Nt,2,0),l(),a(39,"app-toggle-card",35),B(40,27),f(41,10),k(),a(42,"p",28),f(43,11),l(),a(44,"sh-toggle",36),C(45,12),m(46,"input",37),F(),l(),a(47,"sh-toggle",36),C(48,13),m(49,"input",38),F(),l(),a(50,"sh-toggle",36),C(51,14),m(52,"input",39),F(),l(),a(53,"sh-toggle",40),E("click",function(){return d(i),p(n.toggleFilesLargerThan())}),f(54,15),l(),y(55,Dt,5,2,"div",41),l()()()}if(e&2){let i;T("formGroup",n.sourceDataForm),_(5),T("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),T("disallowToggle",!0),_(6),Ge(n.nonFilterPaths()),_(4),T("formControl",n.newPathCtrl),_(4),T("disallowToggle",!0),_(7),R((i=n.pathSignal())!=null&&i.length?38:-1),_(),T("disallowToggle",!0),_(14),Fe("active",n.filesLargerThan()),_(2),R(n.filesLargerThan()?55:-1)}},dependencies:[le,Pe,Q,Ne,Te,Z,Ae,ae,Re,at,De,Me,lt,q,j,se,Ee,Y,$e,ut,Oe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var pt="1W:1D,4W:1W,12M:1M",J=class s{#e=M(z);#t=M(he);#i=M(et);#n=M(it);#s=M(we);generalForm=gt();sourceDataForm=dt();scheduleFields={autoRun:g(te.autoRun),nextTime:g(te.nextTime),runAgain:g(te.runAgain)};settings=g([]);optionsFields={remoteVolumeSize:g("50MB"),backupRetention:g("all"),backupRetentionTime:g(""),backupRetentionVersions:g(0),backupRetentionCustom:g("")};targetUrlModel=g(null);backupMetadata=g(null);isDraft=g(!1);backupId=g(null);backupName=L(()=>this.generalFormSignal()?.name??"");isSubmitting=g(!1);finishedLoading=g(!1);backupDefaults=g(null);applicationOptions=g(null);isNew=L(()=>this.backupId()==="new");osType=L(()=>this.#t.systemInfo()?.OSType);selectedOptions=g([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=L(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=g("");#a=g(null);#l=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#a.asReadonly();#d=ie(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#a.set(null))});setTestState(t,e){this.#o.set(t),this.#a.set(e??null)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=L(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=L(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(Ie(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{t||this.exit(!1)},error:i=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(Ie(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{t||this.exit(!1)},error:i=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(ot,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(c=>`${c.Include?"":"-"}${c.Expression}`)??[],i=t.Settings?.find(c=>c.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(c=>c.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",c=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",h={name:t.Name??"",description:t.Description??""};e&&e!==""&&(h.name=e),n&&n!==""&&(h.description=n),r&&r!==""&&(h.encryption=r),o&&o!==""&&(h.password=o,h.repeatPassword=o),c&&c!==""&&(h.compression=c),this.generalForm.patchValue(h)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#s.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>x(x({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===pt)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#s.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([P,U])=>U).map(([P,U])=>P):[],c=n.path?.split("\0")??[],h=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([P,U])=>U&&P!=="filesLargerThan").map(([P])=>P),O=n.excludes?.filesLargerThan;return S.length&&h.push({Name:"--exclude-files-attributes",Value:S.join(",")}),O&&O.size!==null&&O.unit!==null&&h.push({Name:"--skip-files-larger-than",Value:`${O.size}${O.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:c.filter(P=>!P.startsWith("-")),Settings:h,Filters:c.filter(P=>P.startsWith("-")).map((P,U)=>({Order:U,Include:!1,Expression:P.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:pt});break}let c=[...t,...n],h=this.settings().filter(S=>!c.includes(S.Name)).map(S=>{let O=S.Value;return typeof S.Value=="number"&&(O=S.Value.toString()),typeof S.Value=="boolean"&&(O=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:O}});return[...i,...o,...r,...h]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(te.autoRun),this.scheduleFields.nextTime.set(te.nextTime),this.scheduleFields.runAgain.set(te.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=ge({token:s,factory:s.\u0275fac,providedIn:"root"})};var yt=["formRef"];function Rt(s,t){s&1&&(a(0,"sh-alert",17),C(1,5),m(2,"sh-icon",26),F(),l())}function Ot(s,t){if(s&1&&G(0),s&2){let e=t.$implicit;Ze(" ",e.DisplayName," ")}}function wt(s,t){if(s&1&&m(0,"sh-progress-bar",40),s&2){let e=u(3);Fe("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),T("value",e.calculatePasswordStrength()*(100/5))}}function $t(s,t){s&1&&(a(0,"span",35),f(1,10),l())}function It(s,t){s&1&&(C(0,8,1),m(1,"sh-icon"),F())}function Lt(s,t){s&1&&(C(0,8,2),m(1,"sh-icon"),F())}function Ut(s,t){s&1&&(C(0,11,1),m(1,"sh-icon",42),F())}function Gt(s,t){s&1&&(C(0,11,2),m(1,"sh-icon"),F())}function xt(s,t){if(s&1){let e=b();a(0,"button",41),E("click",function(){d(e);let i=u(3);return p(i.copyPassword())}),C(1,11),y(2,Ut,2,0)(3,Gt,2,0),F(),l()}if(s&2){let e=u(3);_(2),R(e.copiedPassword()?2:3)}}function bt(s,t){s&1&&(a(0,"sh-alert",39),f(1,12),l())}function vt(s,t){if(s&1){let e=b();a(0,"div",30)(1,"sh-form-field")(2,"label",31),C(3,7),m(4,"sup"),F(),l(),m(5,"input",32),l(),y(6,wt,1,9,"sh-progress-bar",33),a(7,"sh-form-field"),m(8,"input",34),y(9,$t,2,0,"span",35),l(),a(10,"div",36)(11,"button",37),E("click",function(){d(e);let i=u(2);return p(i.showPassword.set(!i.showPassword()))}),C(12,8),y(13,It,2,0)(14,Lt,2,0),F(),l(),a(15,"button",37),E("click",function(){d(e);let i=u(2);return p(i.generatePassword())}),C(16,9),m(17,"sh-icon"),F(),l(),y(18,xt,4,1,"button",38),l(),y(19,bt,2,0,"sh-alert",39),l()}if(s&2){let e=u(2);_(5),T("type",e.showPassword()?"text":"password"),_(),R(e.generalForm.value.password?6:-1),_(2),T("type",e.showPassword()?"text":"password"),_(),R(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),R(e.showPassword()?13:14),_(5),R(e.showCopyPassword()?18:-1),_(),R(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Bt(s,t){if(s&1&&(a(0,"sh-select",27)(1,"label",28),f(2,6),l(),m(3,"input",29),Ye(4,Ot,1,1,"ng-template"),l(),y(5,vt,20,7,"div",30)),s&2){let e=u();T("options",e.encryptionOptions())("isClearable",!1),_(5),R(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function kt(s,t){if(s&1&&(a(0,"button",24),C(1,13),m(2,"sh-icon"),F(),l()),s&2){let e=u();T("disabled",e.nameAndDescriptionValid()===!1)}}function Vt(s,t){if(s&1&&(a(0,"button",25),C(1,14),m(2,"sh-icon"),F(),l()),s&2){let e=u();T("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ne=new ye,gt=(s={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ne.group({name:ne.control(s.name,[fe.required]),description:ne.control(s.description),encryption:ne.control(s.encryption,[_t()]),password:ne.control(s.password,[Ke(t=>t?.value.encryption!=="",[fe.required])]),repeatPassword:ne.control(s.repeatPassword,[Ke(t=>t?.value.encryption!=="",[fe.required])]),compression:ne.control(s.compression)}),pe={Key:"-",DisplayName:"None"},je=class s{#e=M(z);#t=M(oe);#i=M(rt);#n=M(J);#s=M(he);formRef=Se.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=g(!1);copiedPassword=g(!1);showCopyPassword=g(!1);noneOptionKey=pe.Key;encryptionEffect=ie(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=L(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=L(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=H({type:s,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&me(n.formRef,yt,5),e&2&&Ce()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let h;h=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let O;O=$localize`Encryption`;let P;P=$localize`Password`;let U;U=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=xe(v);let X;X=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let D;D=$localize`Passwords do not match`;let ee;ee=$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:`,ee=xe(ee);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,r,c,h,O,K,v,X,D,ee,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",U,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=b();a(0,"form",15,0),E("submit",function(){return d(i),p(n.next())}),a(2,"h3",16),f(3,1),l(),y(4,Rt,3,0,"sh-alert",17),a(5,"sh-form-field")(6,"label",18),C(7,2),m(8,"sup"),F(),l(),m(9,"input",19),l(),a(10,"sh-form-field")(11,"label",20),f(12,3),l(),m(13,"textarea",21),l(),y(14,Bt,6,3),a(15,"div",22)(16,"button",23),E("click",function(){return d(i),p(n.exit())}),C(17,4),m(18,"sh-icon"),F(),l(),y(19,kt,3,1,"button",24)(20,Vt,3,1,"button",25),l()()}if(e&2){let i;T("formGroup",n.generalForm),_(4),R(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),R(n.isNew()?14:-1),_(5),R(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,Pe,Q,Z,Ae,De,Me,q,Y,se,j,tt,Je,nt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{gt as a,pe as b,je as c,te as d,Xe as e,dt as f,ze as g,J as h};
package/chunk-N6ABN43N.js DELETED
@@ -1 +0,0 @@
1
- import{a as Ie}from"./chunk-DELLEGXW.js";import{a as Re}from"./chunk-VTSUHAP5.js";import{c as ke,e as Le,i as Ae,s as $e}from"./chunk-N5SC4SKW.js";import{A as we,a as Me,d as ve,e as Ne,f as Se,l as Oe,n as xe,p as ye}from"./chunk-H7K35UUX.js";import{h as De}from"./chunk-NOPMCS2Z.js";import{ea as be}from"./chunk-RUXCS4ZK.js";import{Ab as d,Ac as j,B as le,Bb as g,Bc as Te,Cb as H,H as Q,Hc as Fe,Ib as U,Jb as L,Oc as $,Pc as W,Qb as he,Ra as m,Rb as pe,Sb as A,Tb as ue,Tc as ie,Ub as _e,Uc as E,Vc as ne,Wb as y,Yb as u,Zb as ge,_ as V,_b as G,bb as ae,ea as b,ec as J,fa as M,fc as fe,gb as K,gc as Y,hc as me,ic as x,lc as F,mc as Ce,n as re,nc as Pe,oa as O,qc as Z,r as B,rc as ee,sc as te,ub as v,vb as N,x as se,xb as ce,yb as de,zb as k,zc as Ee}from"./chunk-HNWRQABR.js";import{a as X,b as q}from"./chunk-EUDKD2JW.js";var je=["treeContainer"],ze=["formRef"],Xe=[[["label"]],[["label"]],[["input"]]],qe=["label","label","input"],Qe=o=>({children:o,level:0}),We=o=>({$implicit:o}),Ke=(o,t)=>({children:o,level:t}),Ue=()=>({maxWidth:"700px",width:"100%"}),Je=(o,t)=>t.id;function Ye(o,t){if(o&1){let e=L();d(0,"sh-button-group")(1,"button",19),y("click",function(){b(e);let n=u();return M(n.pathDiscoveryMethod.set("browse"))}),A(2,4),g(),d(3,"button",19),y("click",function(){b(e);let n=u();return M(n.pathDiscoveryMethod.set("path"))}),A(4,5),g()()}if(o&2){let e=u();m(),x("active",e.pathDiscoveryMethod()==="browse"),m(2),x("active",e.pathDiscoveryMethod()==="path")}}function Ze(o,t){o&1&&H(0,"sh-progress-bar",12)}function et(o,t){o&1&&(d(0,"sh-icon",24),F(1,"caret-down"),g())}function tt(o,t){o&1&&H(0,"sh-icon",24)}function it(o,t){o&1&&(d(0,"sh-icon",24),F(1,"caret-right"),g())}function nt(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder-open"),g())}function ot(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder-user"),g())}function rt(o,t){o&1&&(d(0,"sh-icon",22),F(1,"file"),g())}function st(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder"),g())}function lt(o,t){if(o&1&&(v(0,et,2,0,"sh-icon",24)(1,tt,1,0,"sh-icon",24)(2,it,2,0,"sh-icon",24),v(3,nt,2,0,"sh-icon",22)(4,ot,2,0,"sh-icon",22)(5,rt,2,0,"sh-icon",22)(6,st,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;N(e.children.length?0:e.cls==="file"?1:2),m(3),N(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function at(o,t){o&1&&(d(0,"sh-icon",22),F(1,"desktop-tower"),g())}function ct(o,t){o&1&&U(0)}function dt(o,t){if(o&1&&K(0,ct,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=Y(7);k("ngTemplateOutlet",n)("ngTemplateOutletContext",j(5,We,Te(2,Ke,e.children,i.level+1)))}}function ht(o,t){if(o&1){let e=L();d(0,"div",20,3),y("click",function(){b(e);let n=u().$implicit,r=u(2);return M(r.toggleNode(n.id,n))}),d(2,"div",21),v(3,lt,7,2)(4,at,2,0,"sh-icon",22),g(),d(5,"div",23),y("click",function(n){b(e);let r=u().$implicit,a=u(2);return M(a.toggleSelectedNode(n,r))}),F(6),g()(),v(7,dt,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();x("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),m(2),x("file",e.cls==="file"),m(),N(e.id!=="/"?3:4),m(3),Pe(" ",e.text," "),m(),N(e.children.length>0?7:-1)}}function pt(o,t){if(o&1&&v(0,ht,8,17),o&2){let e=t.$implicit,i=u(2);N(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function ut(o,t){if(o&1&&(d(0,"sh-list"),ce(1,pt,1,1,null,null,Je),g()),o&2){let e=t.$implicit;me("padding-left",e.level*.25,"rem"),m(),de(e.children)}}function _t(o,t){o&1&&U(0)}function gt(o,t){if(o&1){let e=L();d(0,"sh-toggle",25),y("click",function(){b(e);let n=u();return M(n._showHiddenNodes.set(!n._showHiddenNodes()))}),A(1,6),g()}if(o&2){let e=u();x("active",e._showHiddenNodes()),m(),ue(e.showFiles()?"files":"folders"),_e(1)}}function ft(o,t){if(o&1){let e=L();d(0,"button",26),y("click",function(){b(e);let n=u();return M(n.openCreateFolderDialog())}),A(1,7),g()}if(o&2){let e=u();k("disabled",!e.isCurrentPathFolder())}}function mt(o,t){if(o&1){let e=L();d(0,"sh-dialog",27),te("isOpenChange",function(n){b(e);let r=u();return ee(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),M(n)}),d(1,"header",28)(2,"h2"),A(3,8),g()(),d(4,"div",29)(5,"div"),F(6," Folder will be created under "),d(7,"pre"),F(8),g()(),d(9,"sh-form-field")(10,"textarea",30),te("ngModelChange",function(n){b(e);let r=u();return ee(r.createFolderPath,n)||(r.createFolderPath=n),M(n)}),g()()(),d(11,"footer",31)(12,"button",32),y("click",function(){b(e);let n=u();return M(n.closeCreateFolderDialog(!1))}),F(13,"Cancel"),g(),d(14,"button",33),y("click",function(){b(e);let n=u();return M(n.closeCreateFolderDialog(!0))}),he(15,9),H(16,"sh-icon"),pe(),g()()()}if(o&2){let e,i=u();Z("isOpen",i.createFolderDialogOpen),k("options",Ee(5,Ue)),m(8),Ce(i.currentPath()),m(2),Z("ngModel",i.createFolderPath),m(4),k("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var Be=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(Be||{}),T="/",oe=class o{#t=V(De);#n=V(Re);#d=V(Ne);multiSelect=E(!1);disabled=E(!1);showFiles=E(!1);selectFiles=E(!1);accepts=E(null);startingPath=E(null);rootPaths=E([]);initialNodes=E([]);backupSettings=E(null);pathRefreshTrigger=E(!1);showHiddenNodes=E(!1);enableCreateFolder=E(!1);hideShortcuts=E(!1);includes=ie();excludes=ie();_showHiddenNodes=O(!1);createFolderDialogOpen=O(!1);createFolderPath=O(null);treeContainerRef=ne("treeContainer");formRef=ne("formRef");pathDiscoveryMethod=O("browse");isLoading=O(!1);currentPath=O("/");#o=O(null);treeSearchQuery=O("");treeNodes=O([]);isWindows=$(()=>this.#n.systemInfo()?.OSType==="Windows");pathDelimiter=$(()=>this.isWindows()?"\\":"/");filterGroups=this.#n.filterGroups();isByBackupSettings=$(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=$(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Be;treeStructure=$(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==T),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let _=f.slice(1,-1),c=this.filterGroups?.FilterGroups[_];if(c&&c.length){let S=c.map(C=>`-${C}`);i.splice(l,1,...S)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),p=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let h=this.#s(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:h,isIndeterminate:!1,cls:this.#e(l,p)?"folder":"file"}}):s=[{id:T,resolvedpath:T,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let h=new Map,f=l?.id;a&&(l.accepted=!0),h.set(l.id,l);let _=r.length>0?n.filter(c=>c.parentPath.startsWith(l.id)):n;for(let c of _){let C=(r.length>0?c.id.replace(f??"",""):c.id).split(p).filter(Boolean),P="",w=l;for(let R of C){if(P+=R+p,!h.has(P)){let z=c.hidden===!0&&t?0:this.#s(i,c.id,c.cls,w),D={id:c.id,isIndeterminate:this.isIndeterminate(i,c.id),evalState:z,parentPath:P,resolvedpath:c.cls=="folder"?this.#r(c.resolvedpath):P,hidden:c.hidden,text:c.text,cls:c.cls,children:[]};a&&(D.accepted=this.matchAccepts(a,D)),h.set(P,D),w.children.push(D)}w=h.get(P)}}return l}),s});#r(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===T?t:t+e:T}#s(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),p=t.filter(h=>!h.startsWith("-")&&!h.startsWith("+")),s=t.filter(h=>h.startsWith("-")||h.startsWith("+")),l=this.multiSelect();if(p.length===0)return r;for(let h=0;h<p.length;h++){let f=p[h];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let h=0;h<s.length;h++){let f=s[h],_=f.slice(1),c=f.startsWith("-")?-1:1;if(this.#e(_,a)){if(i!=="folder")continue;if(e===_){r=c;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(i!=="folder")continue;let C=_.slice(1,-2);if(C==="")break;if(e?.includes(C+a)){r=c;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let C=_.slice(3,-7);if(new RegExp(C).test(e)){r=c;break}}if(_.startsWith("[")&&_.endsWith("]")){let C=_.slice(1,-1),P=this.translateCSharpRegex(C);if(new RegExp(`${P}`).test(e)){r=c;break}}if(_.startsWith("*.")){if(i!=="file"||_.replace("*.","").length===0)continue;if(this.#l(e,_,!0)){r=c;break}}if(_==="")continue;if(_===e){r=c;break}if(this.#l(e,_,!0)){r=c;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#l(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=W(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=W(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===T)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=W(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=W(()=>{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.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,T)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?T:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===T||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==T),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,p=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(p&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=p?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==T&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#r(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#a()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let p=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=p?p[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(Ie,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#a(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#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}#p(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#u(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(B(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(B(n=>n.Files??[]))}}#c(t){return this.isByBackupSettings()?this.#u(t):this.#p(t)}#_(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),n=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean),r=n.map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[T];r.forEach(s=>{s.forEach((l,h)=>{let f=s.slice(0,h+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let p=a.map(s=>this.#c(s).pipe(B(l=>({status:"success",value:l,url:s})),le(l=>re({status:"error",value:l,url:s}))));se(p).pipe(Q(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),h=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let _=l.flatMap(S=>S.value.map(C=>{let P=C.id,w=C.id.startsWith("%")&&C.id.endsWith("%")?C.resolvedpath+e:C.id,R=P&&P.split(e).filter(Boolean).slice(0,-1).join(e),z=P&&P.split(e).filter(Boolean).join(e),D=e+z,Ve=n.findIndex(I=>this.multiSelect()?D.startsWith(I):D===I)>-1,He=n.findIndex(I=>I===P)>-1,Ge=i.findIndex(I=>I===D)>-1;return q(X({},C),{cls:this.#e(w,e)||w==T?"folder":"file",parentPath:R.startsWith("%")?R:e+R,isSelected:Ve&&!Ge||He})})),c=[...new Map([...f,..._].map(S=>[S.id,S])).values()];return this.#a(),this.hideShortcuts()?c.filter(S=>!S.id.startsWith("%")):c})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=T){let i=this.pathDelimiter();this.isLoading.set(!0),this.#c(e).pipe(Q(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(p=>p!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let p=r.map(l=>{let h=this.#e(l.id,i)?"folder":"file";return q(X({},l),{cls:h,parentPath:e})}),s=[...new Map([...a,...p].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=ae({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(J(i.treeContainerRef,je,5),J(i.formRef,ze,5)),e&2&&fe(2)},hostVars:2,hostBindings:function(e,i){e&2&&x("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:qe,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(ge(Xe),v(0,Ye,5,4,"sh-button-group"),d(1,"div",10),G(2,0,["ngProjectAs","label",5,["label"]]),d(3,"div",11,0),v(5,Ze,1,0,"sh-progress-bar",12),K(6,ut,3,2,"ng-template",null,1,Fe)(8,_t,1,0,"ng-container",13),g(),d(9,"div",14),v(10,gt,2,3,"sh-toggle",15),v(11,ft,2,1,"button",16),g()(),d(12,"div",17,2)(14,"sh-form-field"),G(15,1,["ngProjectAs","label",5,["label"]]),G(16,2,["ngProjectAs","input",5,["input"]]),g()(),v(17,mt,17,6,"sh-dialog",18)),e&2){let n=Y(7);N(i.multiSelect()?-1:0),m(),x("hidden",i.pathDiscoveryMethod()!=="browse"),m(2),x("visualize-accepted",i.accepts()),m(2),N(i.isLoading()?5:-1),m(3),k("ngTemplateOutlet",n)("ngTemplateOutletContext",j(15,We,j(13,Qe,i.treeStructure()))),m(2),N(!i.accepts()&&!i.isByBackupSettings()?10:-1),m(),N(i.enableCreateFolder()?11:-1),m(),x("hidden",i.pathDiscoveryMethod()!=="path"),m(5),N(i.createFolderDialogOpen()?17:-1)}},dependencies:[Se,we,Me,Oe,xe,ye,ve,be,$e,ke,Le,Ae],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};export{oe as a};
package/chunk-RSJYY3JM.js DELETED
@@ -1 +0,0 @@
1
- import{a as te}from"./chunk-7IQY6U5W.js";import{a as pt}from"./chunk-NJEX2N4Q.js";import"./chunk-O64ZZGQZ.js";import{a as Tt}from"./chunk-4TDUWDRL.js";import{a as gt}from"./chunk-EBIM5FBM.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import{a as ct}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import{a as K}from"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as Q,e as Z,i as J,m as St,s as Y,t as ee}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import{a as nt}from"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{A as _t,C as dt,a as H,b as W,e as it,g as q,k as ot,l as j,p as st,q as at,r as lt,t as rt}from"./chunk-H7K35UUX.js";import{h as L}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as i,B as $,Bb as o,Cb as I,H as R,Jb as P,Oa as qe,Oc as D,Pc as G,Qb as X,Ra as r,Rb as V,Sb as l,Tb as se,Ub as ae,V as We,Vb as Ze,Vc as tt,Wb as g,Yb as S,_ as N,a as Ue,b as Be,bb as w,c as He,ea as u,ec as Je,fa as m,fc as Ye,gb as oe,hb as je,ic as M,lc as O,mc as z,n as b,nc as U,oa as c,qc as y,rb as Ke,rc as v,sb as Qe,sc as A,ub as C,vb as E,wc as et,zb as f,zc as B}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Ct=["formRef"],Et=()=>[import("./chunk-OPUHTC2R.js").then(s=>s.OptionsListComponent)];function Nt(s,e){s&1&&(i(0,"sh-alert",3),l(1,1),o())}function ft(s,e){if(s&1){let t=P();i(0,"app-options-list",5),A("optionsChange",function(a){u(t);let _=S();return v(_.settings,a)||(_.settings=a),m(a)}),o()}if(s&2){let t=S();y("options",t.settings),f("hasFreeTextSettings",!0)}}var Mt=["Bytes","KB","MB","GB","TB","PB"],x=class s{#e=N(te);#t=N(L);formRef=tt.required("formRef");settings=c([]);isSubmitting=c(!1);isLoadingOptions=c(!0);saved=c(!1);sizeOptions=c(Mt);lastRecievedServerSettings=c({});serverSettingsEffect=G(()=>{let e=this.#e.serverSettings();if(e===void 0)return;this.lastRecievedServerSettings.set(e),this.isLoadingOptions.set(!0);let t=Object.entries(e);t.forEach(([n,a],_)=>{if(n.startsWith("--")){let T=n.substring(2);this.settings.update(p=>(p.some(h=>h.Name===T)||p.push({Name:T,Value:a}),p))}_===t.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let e=this.settings(),t=this.lastRecievedServerSettings(),n=e.map(p=>p.Name),_=Object.keys(t).filter(p=>p.startsWith("--")).filter(p=>!n.includes(p.replace("--",""))),T=e.reduce((p,h)=>(p[`--${h.Name}`]=h.Value,p),{});_.forEach(p=>{T[p]=null}),this.#t.patchApiV1Serversettings({requestBody:T}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#e.refreshServerSettings(),this.saved.set(!0),setTimeout(()=>{this.saved.set(!1)},3e3)}})}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=w({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(t,n){t&1&&Je(n.formRef,Ct,5),t&2&&Ye()},decls:8,vars:4,consts:()=>{let e;e=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Save settings `;let t;return t=$localize`Settings saved`,[e,t,[1,"actions"],[1,"success"],["shButton","","type","button",1,"raised","primary",3,"click"],[3,"optionsChange","options","hasFreeTextSettings"]]},template:function(t,n){t&1&&(i(0,"div",2),C(1,Nt,2,0,"sh-alert",3),i(2,"button",4),g("click",function(){return n.submit()}),X(3,0),I(4,"sh-icon"),V(),o()(),je(5,ft,1,2),Ke(6,5,Et)),t&2&&(r(),E(n.saved()?1:-1),r(),M("loader",n.isSubmitting()),r(4),Qe(!n.isLoadingOptions()))},dependencies:[ee,q,H,W],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40.625rem;justify-self:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end;margin-bottom:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}"],changeDetection:0})};var F=class s{#e=N(it);#t=N(L);#o=N(K);repeatRegisterTimer=null;state=c("unknown");claimUrl=c(null);registerUrl=c("");status=D(()=>{let e=this.state();return e==="enabled"?"Remote control is enabled but not connected":e==="connected"?"Remote control is connected":e==="registering"?"Registering machine...":e==="registeringfaulted"?"Registration failed":e==="registered"?"Registered, waiting for accept":e==="disabled"?"Remote control is configured but not enabled":e==="unknown"?"...loading...":"Remote control is not set up"});sysInfoEffect=G(()=>{let e=this.#o.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});#n(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("enabled"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive");let t=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:n=>this.#n(n),error:n=>this.#i(n)})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#t.getApiV1RemotecontrolStatus().subscribe({next:n=>this.#n(n),error:n=>this.#i(n)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:n=>this.#n(n)})}#i(e){this.#t.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#n(t)})}refreshRemoteControlStatus(){this.#t.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}beginRemoteRegistration(){this.state.set("registering"),this.#t.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:this.registerUrl()}}).subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}cancelRemoteRegistration(){this.#t.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#t.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#t.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#n(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#e.open(ct,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the remote control registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:t=>{t&&e.#t.deleteApiV1RemotecontrolRegistration().subscribe({next:n=>e.#n(n),error:n=>e.#i(n)})}})}static \u0275fac=function(t){return new(t||s)};static \u0275prov=We({token:s,factory:s.\u0275fac,providedIn:"root"})};function Pt(s,e){if(s&1){let t=P();i(0,"sh-form-field",10)(1,"input",11),A("ngModelChange",function(a){u(t);let _=S(2);return v(_.registerUrl,a)||(_.registerUrl=a),m(a)}),o()(),i(2,"button",12),g("click",function(){u(t);let a=S(2);return m(a.register())}),l(3,0),o()}if(s&2){let t=S(2);r(),y("ngModel",t.registerUrl)}}function Ot(s,e){if(s&1&&(i(0,"div",8)(1,"label"),l(2,1),o(),i(3,"a",13),O(4),o()()),s&2){let t=S(2);r(3),f("href",et(t.claimUrl()),qe),r(),z(t.claimUrl())}}function Rt(s,e){s&1&&(i(0,"div",8)(1,"label"),l(2,2),o()())}function It(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.cancel())}),l(1,3),o()}}function yt(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.disable())}),l(1,4),o()}}function vt(s,e){if(s&1){let t=P();i(0,"button",12),g("click",function(){u(t);let a=S(2);return m(a.enable())}),l(1,5),o(),i(2,"button",14),g("click",function(){u(t);let a=S(2);return m(a.delete())}),l(3,6),o()}}function At(s,e){if(s&1&&(i(0,"div",7),C(1,Pt,4,1),C(2,Ot,5,3,"div",8),C(3,Rt,3,0,"div",8),C(4,It,2,0,"button",9),C(5,yt,2,0,"button",9),C(6,vt,4,0),o()),s&2){let t=S();r(),E(t.state()==="inactive"?1:-1),r(),E(t.state()==="registered"?2:-1),r(),E(t.state()==="registering"?3:-1),r(),E(t.state()==="registering"||t.state()==="registeringfaulted"||t.state()==="registered"?4:-1),r(),E(t.state()==="connected"||t.state()==="enabled"?5:-1),r(),E(t.state()==="disabled"?6:-1)}}var ne=class s{#e=N(F);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=w({type:s,selectors:[["app-remote-control"]],decls:1,vars:1,consts:()=>{let e;e=$localize`Register for remote control`;let t;t=$localize`Machine is now registered, open this link to add it to your account:`;let n;n=$localize`Registering, please wait...`;let a;a=$localize`Cancel registration`;let _;_=$localize`Disable remote control`;let T;T=$localize`Enable remote control`;let p;return p=$localize`Delete remote control setup`,[e,t,n,a,_,T,p,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","sh-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],["type","button","shButton","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","shButton","",1,"raised","error",3,"click"]]},template:function(t,n){t&1&&C(0,At,7,6,"div",7),t&2&&E(n.state()!=="unknown"?0:-1)},dependencies:[Y,Q,Z,J,j],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}"],changeDetection:0})};function mt(...s){let e=c(...s);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}var re=()=>({standalone:!0});function Gt(s,e){s&1&&(i(0,"sh-icon",69),O(1,"check"),o())}function bt(s,e){s&1&&(i(0,"sh-icon",70),O(1,"prohibit"),o())}function $t(s,e){if(s&1){let t=P();i(0,"button",74),g("click",function(){u(t);let a=S(2);return m(a.updatePassphrase())}),l(1,34),o()}if(s&2){let t=S(2);M("loader",t.isUpdating())}}function wt(s,e){if(s&1){let t=P();i(0,"button",75),g("click",function(){u(t);let a=S(2);return m(a.updatePassphrase())}),l(1,35),o()}if(s&2){let t=S(2);M("loader",t.isUpdating()),f("disabled",!0)}}function Lt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",65),l(2,31),o(),i(3,"input",66),A("ngModelChange",function(a){u(t);let _=S();return v(_.passphrase,a)||(_.passphrase=a),m(a)}),o()(),i(4,"sh-form-field")(5,"label",67),l(6,32),o(),i(7,"input",68),A("ngModelChange",function(a){u(t);let _=S();return v(_.repeatPassphrase,a)||(_.repeatPassphrase=a),m(a)}),o(),C(8,Gt,2,0,"sh-icon",69)(9,bt,2,0,"sh-icon",70),o(),i(10,"div",48)(11,"button",71),g("click",function(){u(t);let a=S();return m(a.cancelPasswordChange())}),l(12,33),o(),C(13,$t,2,2,"button",72)(14,wt,2,3,"button",73),o()}if(s&2){let t=S();r(3),y("ngModel",t.passphrase),r(4),f("disabled",t.passphrase().length===0),y("ngModel",t.repeatPassphrase),r(),E(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?8:9),r(3),M("loader",t.isUpdating()),r(2),E(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?13:14)}}function Ft(s,e){s&1&&(i(0,"sh-icon",76),O(1,"check"),o())}function Dt(s,e){if(s&1){let t=P();i(0,"div",48)(1,"button",71),g("click",function(){u(t);let a=S();return m(a.openPassphraseForm())}),l(2,36),o(),C(3,Ft,2,0,"sh-icon",76),o()}if(s&2){let t=S();r(3),E(t.passwordUpdated()?3:-1)}}function xt(s,e){if(s&1){let t=P();i(0,"sh-form-field")(1,"label",77),l(2,37),o(),i(3,"textarea",78),A("ngModelChange",function(a){u(t);let _=S();return v(_.allowedHostnames,a)||(_.allowedHostnames=a),m(a)}),o()(),i(4,"sh-alert",79),l(5,38),o(),i(6,"button",74),g("click",function(){u(t);let a=S();return m(a.updateAllowedHostnames())}),l(7,39),o()}if(s&2){let t=S();r(3),y("ngModel",t.allowedHostnames),r(3),M("loader",t.updatingAllowedHosts())}}function kt(s,e){if(s&1&&O(0),s&2){let t,n=S();U(" ",(t=n.sysinfo())==null?null:t.ServerVersion," ")}}function Xt(s,e){s&1&&I(0,"sh-progress-bar",53)}function Vt(s,e){if(s&1&&O(0),s&2){let t=e.$implicit;U(" ",t.label," ")}}function zt(s,e){if(s&1&&O(0),s&2){let t=e.$implicit;U(" ",t.label," ")}}function Ut(s,e,t){let n=mt(s),a=n[Ue];t?.equal&&(a.equal=t.equal);let _;return n.set=T=>{clearTimeout(_),_=setTimeout(()=>Be(a,T),e)},n.update=T=>{clearTimeout(_),_=setTimeout(()=>He(a,T),e)},n}var Bt=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],Ht=[{value:"none",label:$localize`System default (information)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"none",label:$localize`None / disabled`}],_e=class s{#e=N(gt);#t=N(K);#o=N(L);#n=N(te);#i=N(F);#s=N(nt);#a=this.#s.getItem("locale")??"en-US";sysinfo=this.#t.systemInfo;isDarkMode=this.#e.isDarkMode;editAs=c("list");previousLang=this.#a;langCtrl=c(this.#a);usageStatistics=c("");updatingUsageStatistics=c(!1);remoteControlStatus=this.#i.status;updatingChannel=c(!1);updateChannel=c("");setNewChannel(e){let t=this.updateChannel();this.updateChannel.set(e),this.#o.patchApiV1Serversettings({requestBody:{"update-channel":e}}).pipe(R(()=>this.updatingChannel.set(!1)),$(()=>(this.updateChannel.set(t),b(null)))).subscribe()}allowRemoteAccess=c(!1);allowedHostnames=c("");loadedAllowedHostnames=c("");updatingRemoteAccess=c(!1);updatingAllowedHosts=c(!1);updateRemoteAccess(){let e=this.allowRemoteAccess(),t=!e;this.allowRemoteAccess.set(t),this.#o.patchApiV1Serversettings({requestBody:{"server-listen-interface":t?"any":"loopback"}}).pipe(R(()=>this.updatingRemoteAccess.set(!1)),$(()=>(this.allowRemoteAccess.set(e),b(null)))).subscribe()}updateAllowedHostnames(){let e=this.loadedAllowedHostnames(),t=this.allowedHostnames();this.updatingAllowedHosts.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"server-listen-interface":"any","allowed-hostnames":t}}).pipe(R(()=>this.updatingAllowedHosts.set(!1)),$(()=>(this.allowedHostnames.set(e),b(null)))).subscribe()}updatingDisableTrayIconLogin=c(!1);disableTrayIconLogin=c(!1);saveDisableTrayIconLogin(){let e=this.disableTrayIconLogin(),t=!e;this.updatingDisableTrayIconLogin.set(!0),this.disableTrayIconLogin.set(t),this.#o.patchApiV1Serversettings({requestBody:{"disable-tray-icon-login":t?"True":"False"}}).pipe(R(()=>this.updatingDisableTrayIconLogin.set(!1)),$(()=>(this.disableTrayIconLogin.set(e),b(null)))).subscribe()}showPassphraseForm=c(!1);isUpdating=c(!1);passphrase=c("");repeatPassphrase=c("");passwordUpdated=c(!1);updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(R(()=>this.isUpdating.set(!1))).subscribe({next:()=>{this.showPassphraseForm.set(!1),this.passwordUpdated.set(!0),setTimeout(()=>{this.passwordUpdated.set(!1)},3e3)}}))}openPassphraseForm(){this.showPassphraseForm.set(!0)}cancelPasswordChange(){this.showPassphraseForm.set(!1)}languageOptions=c(Tt);usageStatisticsOptions=c(Ht);timeTypeOptions=c(Bt);timeType=c("none");timeValue=Ut(0,300);timeRange=D(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=G(()=>{let e=this.timeValue(),t=this.#n.serverSettings();!t||t["startup-delay"]===""&&this.timeType()==="none"||this.updateStartupDelay()});updateLocale(e){!e||e===""||e===this.previousLang||(this.#s.setItem("locale",e),window.location.reload())}updateStartupDelay(){let e=this.timeValue(),t=this.timeType(),n="";t!=="none"&&e!==0&&(n=`${e}${t}`),this.#o.patchApiV1Serversettings({requestBody:{"startup-delay":n}}).subscribe()}updateTimeType(e){this.timeType()==="none"&&this.timeValue.set(0),this.timeType.set(e)}updateUsageStatistics(e){let t=this.usageStatistics();!e||e===""||e===t||(this.usageStatistics.set(e),this.updatingUsageStatistics.set(!0),this.#o.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.usageStatistics()==="none"?"":this.usageStatistics()}}).pipe(R(()=>this.updatingUsageStatistics.set(!1)),$(()=>(this.usageStatistics.set(t),b(null)))).subscribe())}serverSettingsEffect=G(()=>{let e=this.#n.serverSettings();if(e===void 0)return;let t=e["startup-delay"],n=t.slice(-1),a=t.slice(0,-1),_=["s","m","h"];this.disableTrayIconLogin.set(e["disable-tray-icon-login"]!=="False"),this.updateChannel.set(e["update-channel"]),this.allowRemoteAccess.set(e["server-listen-interface"]==="any"),this.allowedHostnames.set(e["allowed-hostnames"]),this.loadedAllowedHostnames.set(e["allowed-hostnames"]),this.usageStatistics.set(e["usage-reporter-level"]===""?"none":e["usage-reporter-level"]),this.timeType.set(t==""?"none":_.includes(n)?n:"none"),this.timeValue.set(t==""?0:parseInt(a))});setDarkMode(){this.#e.setDarkMode()}setLightMode(){this.#e.setLightMode()}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=w({type:s,selectors:[["app-settings"]],decls:132,vars:46,consts:()=>{let e;e=$localize`Settings`;let t;t=$localize`Configure your backup settings.`;let n;n=$localize`Remote access control`;let a;a=$localize`Color theme`;let _;_=$localize`Customize your application theme`;let T;T=$localize`Passwords`;let p;p=$localize`Change server passphrase`;let h;h=$localize`Language`;let de;de=$localize`Select a language for the platform`;let ce;ce=$localize`Allow remote access (requires restart)`;let Se;Se=$localize` By allowing remote access, the server listens to requests from any machine on your network. If you enable this option, make sure you are always using the computer on a secure firewall protected network. `;let ge;ge=$localize`Allow remote access`;let pe;pe=$localize`Prevent tray icon automatic log-in`;let Te;Te=$localize` By default, the tray icon will open the user interface with a token that unlocks the user interface. This ensures that you can access the user interface from the tray icon, while requiring others to enter a password. If you prefer having to type in the password, even when accessing the user interface from the tray icon, enable this option. `;let ue;ue=$localize`Prevent tray icon automatic log-in`;let me;me=$localize`Update channel`;let Ce;Ce=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) `;let Ee;Ee=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Ne;Ne=$localize`Stable`;let fe;fe=$localize`Official releases`;let Me;Me=$localize`Beta`;let he;he=$localize` Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. `;let Pe;Pe=$localize` Experimental `;let Oe;Oe=$localize`Specific builds for developers only. Not for use with important data.`;let Re;Re=$localize`Canary`;let Ie;Ie=$localize`Individual builds for developers only. Not for use with important data.`;let ye;ye=$localize`Pause after startup or hibernation`;let ve;ve=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let Ae;Ae=$localize`Usage statistics`;let k;k=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#119\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#119\uFFFD"}:CLOSE_LINK:${"[\uFFFD#120\uFFFD\uFFFD/#120\uFFFD|\uFFFD#121\uFFFD\uFFFD/#121\uFFFD]"}:LINE_BREAK:${"[\uFFFD#120\uFFFD\uFFFD/#120\uFFFD|\uFFFD#121\uFFFD\uFFFD/#121\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,k=Ze(k);let Ge;Ge=$localize`Advanced options`;let be;be=$localize`Enter new password`;let $e;$e=$localize`Repeat password`;let ie;ie=$localize`Password have to be filled and have to match`;let we;we=$localize`Passphrase`;let Le;Le=$localize`Repeat passphrase`;let Fe;Fe=$localize`Cancel`;let De;De=$localize` Update passphrase `;let xe;xe=$localize` Update passphrase `;let ke;ke=$localize`Change password`;let Xe;Xe=$localize`Allowed hostnames`;let Ve;Ve=$localize` To prevent various DNS based attacks, Duplicati limits the allowed hostnames to the ones listed here. Direct IP access and localhost is always allowed. Multiple hostnames can be supplied with a semicolon separator. If any of the allowed hostnames is an asterisk (*), all hostnames are allowed and this feature is disabled. If the field is empty, only IP address and localhost access is allowed. `;let ze;return ze=$localize` Update allowed hostnames `,[e,t,n,a,_,T,p,h,de,ce,Se,ge,pe,Te,ue,me,Ce,Ee,Ne,fe,Me,he,Pe,Oe,Re,Ie,ye,ve,Ae,k,Ge,we,Le,Fe,De,xe,ke,Xe,Ve,ze,[1,"content"],[1,"title"],[1,"left"],[1,"right"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","passphrase-form"],[1,"actions"],["value","value","label","label",3,"options","isClearable","inlineSearch"],["type","text",3,"ngModelChange","ngModel","ngModelOptions"],[1,"right","remote-access-form"],[1,"primary","raised",3,"click"],[1,"indeterminate","primary"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"primary","raised"],[1,"field-row"],[1,"raised","primary",3,"unit"],["type","range",3,"ngModelChange","min","max","disabled","ngModel","ngModelOptions"],["label","label","value","value",3,"options","isClearable"],["type","text",3,"ngModelChange","ngModel"],["href","#"],["label","label","value","value",3,"options","isLoading"],[1,"advanced-settings"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",be,"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",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",ie,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",ie,1,"raised","primary",3,"click","disabled"],[1,"sh-success"],["for","allowedHostnames"],["type","text","id","allowedHostnames",3,"ngModelChange","ngModel"],["type","primary"]]},template:function(t,n){if(t&1&&(I(0,"app-status-bar"),i(1,"div",40)(2,"header")(3,"div",41)(4,"h2"),l(5,0),o(),i(6,"p"),l(7,1),o()()(),i(8,"section")(9,"div",42)(10,"h3"),l(11,2),o(),i(12,"p"),O(13),o()(),i(14,"div",43),I(15,"app-remote-control"),o()(),i(16,"section")(17,"div",42)(18,"h3"),l(19,3),o(),i(20,"p"),l(21,4),o()(),i(22,"div",43)(23,"div",44)(24,"img",45),g("click",function(){return n.setLightMode()}),o(),i(25,"img",46),g("click",function(){return n.setDarkMode()}),o()()()(),i(26,"section")(27,"div",42)(28,"h3"),l(29,5),o(),i(30,"p"),l(31,6),o()(),i(32,"div",47),C(33,Lt,15,7)(34,Dt,4,1,"div",48),o()(),i(35,"section")(36,"div",42)(37,"h3"),l(38,7),o(),i(39,"p"),l(40,8),o()(),i(41,"div",43)(42,"sh-select",49)(43,"input",50),g("ngModelChange",function(_){return n.updateLocale(_)}),o()()()(),i(44,"section")(45,"div",42)(46,"h3"),l(47,9),o(),i(48,"p"),l(49,10),o()(),i(50,"div",51)(51,"sh-toggle",52),g("click",function(){return n.updateRemoteAccess()}),i(52,"label"),l(53,11),o()(),C(54,xt,8,3),o()(),i(55,"section")(56,"div",42)(57,"h3"),l(58,12),o(),i(59,"p"),l(60,13),o()(),i(61,"div",43)(62,"sh-toggle",52),g("click",function(){return n.saveDisableTrayIconLogin()}),i(63,"label"),l(64,14),o()()()(),i(65,"section")(66,"div",42)(67,"h3"),l(68,15),o(),i(69,"p"),C(70,kt,1,1),o(),C(71,Xt,1,0,"sh-progress-bar",53),o(),i(72,"div",54)(73,"div",55),g("click",function(){return n.setNewChannel("")}),i(74,"sh-radio",56),l(75,16),o(),i(76,"p"),l(77,17),o()(),i(78,"div",55),g("click",function(){return n.setNewChannel("stable")}),i(79,"sh-radio",56),l(80,18),o(),i(81,"p"),l(82,19),o()(),i(83,"div",55),g("click",function(){return n.setNewChannel("beta")}),i(84,"sh-radio",56),l(85,20),o(),i(86,"p"),l(87,21),o()(),i(88,"div",55),g("click",function(){return n.setNewChannel("experimental")}),i(89,"sh-radio",56),l(90,22),o(),i(91,"p"),l(92,23),o()(),i(93,"div",55),g("click",function(){return n.setNewChannel("canary")}),i(94,"sh-radio",56),l(95,24),o(),i(96,"p"),l(97,25),o()()()()(),I(98,"sh-divider"),i(99,"div",40)(100,"section")(101,"div",42)(102,"h3"),l(103,26),o(),i(104,"p"),l(105,27),o()(),i(106,"div",43)(107,"div",57)(108,"sh-range-slider",58)(109,"input",59),A("ngModelChange",function(_){return v(n.timeValue,_)||(n.timeValue=_),_}),o()(),i(110,"sh-select",60)(111,"input",61),g("ngModelChange",function(_){return n.updateTimeType(_)}),o(),oe(112,Vt,1,1,"ng-template"),o()()()(),i(113,"section")(114,"div",42)(115,"h3"),l(116,28),o(),i(117,"p"),X(118,29),I(119,"a",62)(120,"br")(121,"br"),V(),o()(),i(122,"div",43)(123,"sh-select",63)(124,"input",50),g("ngModelChange",function(_){return n.updateUsageStatistics(_)}),o(),oe(125,zt,1,1,"ng-template"),o()()()(),i(126,"div",40)(127,"section")(128,"div",64)(129,"h3"),l(130,30),o(),I(131,"app-advanced-options-settings"),o()()()),t&2){let a,_,T;r(13),z(n.remoteControlStatus()),r(11),M("active",!n.isDarkMode()),r(),M("active",n.isDarkMode()),r(8),E(n.showPassphraseForm()?33:34),r(9),f("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),r(),f("ngModel",n.langCtrl())("ngModelOptions",B(43,re)),r(8),M("active",n.allowRemoteAccess()),r(3),E(n.allowRemoteAccess()?54:-1),r(8),M("active",n.disableTrayIconLogin()),r(8),E(n.updateChannel()!==""&&((a=n.sysinfo())!=null&&a.ServerVersion)?70:-1),r(),E(n.updatingChannel()?71:-1),r(3),M("active",n.updateChannel()===""),r(),se((_=n.sysinfo())==null?null:_.DefaultUpdateChannel),ae(75),r(2),se((T=n.sysinfo())==null?null:T.ServerVersionType),ae(77),r(2),M("active",n.updateChannel()==="stable"),r(5),M("active",n.updateChannel()==="beta"),r(5),M("active",n.updateChannel()==="experimental"),r(5),M("active",n.updateChannel()==="canary"),r(14),f("unit",n.timeType()==="none"?"s":n.timeType()),r(),f("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),y("ngModel",n.timeValue),f("ngModelOptions",B(44,re)),r(),f("options",n.timeTypeOptions())("isClearable",!1),r(),f("ngModel",n.timeType()),r(12),f("options",n.usageStatisticsOptions())("isLoading",n.updatingUsageStatistics()),r(),f("ngModel",n.usageStatistics())("ngModelOptions",B(45,re))}},dependencies:[Y,Q,St,Z,J,ee,pt,ne,x,q,at,lt,st,_t,dt,j,H,ot,W,rt],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0;background:var(--base-1);border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-4)}section[_ngcontent-%COMP%]:first-of-type{border-top:0}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] sh-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.passphrase-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:1rem}.passphrase-form[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.remote-access-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:15rem;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-8)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] sh-radio[_ngcontent-%COMP%]{color:var(--base-8);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-9)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.advanced-settings[_ngcontent-%COMP%]{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;gap:1rem}"],changeDetection:0})};export{Ut as debounceSignal,_e as default};
package/chunk-UAOG26QT.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-A6VGO6B5.js")},{path:"destination",loadComponent:()=>import("./chunk-PKGSUIIS.js")},{path:"source-data",loadComponent:()=>import("./chunk-BPJCKQYP.js")},{path:"schedule",loadComponent:()=>import("./chunk-UIIHBXLB.js")},{path:"options",loadComponent:()=>import("./chunk-UBAVXJ6S.js")}];export{o as default};
package/chunk-UBAVXJ6S.js DELETED
@@ -1 +0,0 @@
1
- import{a as le}from"./chunk-EAV46VM2.js";import{a as se,b as ae}from"./chunk-HIIPI6XR.js";import{h as ie}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as Z,e as J,i as ee,k as ne,s as te,t as oe}from"./chunk-N5SC4SKW.js";import{b as V,d as H}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as q,g as Y,l as Q,t as j}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as t,Bb as i,Cb as g,Jb as F,Oc as I,Qb as S,Ra as c,Rb as O,Sb as r,Vc as W,Wb as M,Yb as p,_ as C,bb as x,ea as P,ec as G,fa as f,fc as K,ic as U,oa as v,qc as u,rc as d,sc as m,ub as h,vb as N,zb as T,zc as X}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var _e=["formRef"],re=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function ce(s,l){s&1&&(S(0,1,1),g(1,"sh-icon",20),O())}function pe(s,l){s&1&&(t(0,"p",21),r(1,6),i())}function ue(s,l){s&1&&(t(0,"p"),r(1,7),i())}function de(s,l){if(s&1){let n=F();t(0,"p"),r(1,8),i(),t(2,"app-timespan",18),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionTime,a)||(o.optionsFields.backupRetentionTime=a),f(a)}),t(3,"label",30),r(4,9),i()()}if(s&2){let n=p();c(2),T("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function me(s,l){if(s&1){let n=F();t(0,"p"),r(1,10),i(),t(2,"sh-form-field")(3,"label",31),r(4,11),i(),t(5,"input",32),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionVersions,a)||(o.optionsFields.backupRetentionVersions=a),f(a)}),i()()}if(s&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Se(s,l){s&1&&(t(0,"p"),r(1,12),i())}function Oe(s,l){if(s&1){let n=F();t(0,"p"),r(1,13),i(),t(2,"sh-form-field")(3,"p"),r(4,14),i(),t(5,"label",33),r(6,15),i(),t(7,"input",34),m("ngModelChange",function(a){P(n);let o=p();return d(o.optionsFields.backupRetentionCustom,a)||(o.optionsFields.backupRetentionCustom=a),f(a)}),i()()}if(s&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var Te=["Bytes","KB","MB","GB","TB","PB"],ge=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],Ce=1024*1024*1024*2,Pe=1024*1024*5,E=class s{#e=C(ie);#n=C(H);#t=C(V);formRef=W.required("formRef");selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=v(ge);sizeSplit=I(()=>{let n=this.optionsFields.remoteVolumeSize().match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return{value:n?parseInt(n[1],10):0,unit:n?n[2].toUpperCase():"MB"}});exceededVolumeSize=I(()=>{let l=this.sizeSplit().value,n=this.sizeSplit().unit;if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,Te.indexOf(n));return e>Ce||e<Pe});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=x({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&G(e.formRef,_e,5),n&2&&K()},decls:30,vars:16,consts:()=>{let l;l=$localize`Options`;let n;n=$localize` Remote volume size ${"\uFFFD*7:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*7:1\uFFFD"}:CLOSE_BLOCK_IF:`;let e;e=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#11\uFFFD"}:START_LINK: Read more ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-square-out${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#11\uFFFD"}:CLOSE_LINK:`;let a;a=$localize`Backup retention`;let o;o=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let b;b=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let A;A=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let R;R=$localize`Nothing will be deleted. The backup size will grow with each change.`;let y;y=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let $;$=$localize`Time to keep versions`;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let w;w=$localize`Number of versions`;let D;D=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let B;B=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let L;L=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let z;return z=$localize`Retention expression`,[l,n,e,a,o,b,A,R,y,$,k,w,D,B,L,z,[1,"title-30"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],[1,"warning"],[1,"warn"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"sh-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch","isClearable"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(t(0,"section")(1,"h3",16),r(2,0),i(),t(3,"div",17)(4,"app-size",18),m("ngModelChange",function(o){return d(e.optionsFields.remoteVolumeSize,o)||(e.optionsFields.remoteVolumeSize=o),o}),t(5,"label",19),S(6,1),h(7,ce,2,0,"sh-icon",20),O(),i()(),h(8,pe,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),g(12,"sh-icon",23),i(),O(),i()(),t(13,"sh-select",24)(14,"label",19),r(15,3),i(),t(16,"input",25),m("ngModelChange",function(o){return d(e.optionsFields.backupRetention,o)||(e.optionsFields.backupRetention=o),o}),i()(),h(17,ue,2,0,"p")(18,de,5,2)(19,me,6,1)(20,Se,2,0,"p")(21,Oe,8,1),t(22,"app-options-list",26),m("optionsChange",function(o){return d(e.settings,o)||(e.settings=o),o}),i(),t(23,"div",27)(24,"button",28),M("click",function(){return e.goBack()}),S(25,4),g(26,"sh-icon"),O(),i(),t(27,"button",29),M("click",function(){return e.submit()}),S(28,5),g(29,"sh-icon"),O(),i()()()),n&2&&(c(4),T("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),N(e.exceededVolumeSize()?7:-1),c(),N(e.exceededVolumeSize()?8:-1),c(5),T("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),N(e.optionsFields.backupRetention()==="all"?17:e.optionsFields.backupRetention()==="time"?18:e.optionsFields.backupRetention()==="versions"?19:e.optionsFields.backupRetention()==="smart"?20:e.optionsFields.backupRetention()==="custom"?21:-1),c(5),u("options",e.settings),T("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",X(15,re)),c(5),U("loader",e.isSubmitting()))},dependencies:[te,Z,ne,J,ee,oe,le,Y,q,j,se,ae,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{E as default};