@duplicati/ngclient 0.0.145 → 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.
@@ -0,0 +1 @@
1
+ import{a as He}from"./chunk-DELLEGXW.js";import{a as Ve}from"./chunk-VTSUHAP5.js";import{a as ze,c as Y,e as ee,i as te,k as Ge,s as ie}from"./chunk-N5SC4SKW.js";import{A as We,a as De,d as Re,e as Ie,f as Ae,l as Z,n as Be,p as Le,t as ke}from"./chunk-H7K35UUX.js";import{h as $e}from"./chunk-NOPMCS2Z.js";import{ea as we}from"./chunk-RUXCS4ZK.js";import{Ab as c,Ac as J,B as _e,Bb as p,Bc as ye,Cb as K,H as se,Hc as xe,Ib as le,Jb as W,Oc as A,Pc as B,Qb as Pe,Ra as g,Rb as Te,Sb as $,Tb as be,Tc as de,Ub as Ee,Uc as P,Vc as pe,Wb as w,Yb as u,Zb as Q,_ as X,_b as I,bb as q,ea as v,ec as ae,fa as F,fc as Me,gb as G,gc as ce,hc as U,ic as x,lc as E,mc as ve,n as he,nc as Fe,oa as b,oc as Se,qc as V,r as j,rc as H,sc as z,tb as me,ub as S,vb as N,x as ge,xb as fe,yb as Ce,yc as Ne,zb as y,zc as Oe}from"./chunk-HNWRQABR.js";import{a as oe,b as re}from"./chunk-EUDKD2JW.js";var et=["treeContainer"],tt=["formRef"],it=[[["label"]],[["label"]],[["input"]]],nt=["label","label","input"],ot=o=>({children:o,level:0}),je=o=>({$implicit:o}),rt=(o,t)=>({children:o,level:t}),st=()=>({maxWidth:"700px",width:"100%"}),lt=(o,t)=>t.id;function at(o,t){if(o&1){let e=W();c(0,"sh-button-group")(1,"button",19),w("click",function(){v(e);let n=u();return F(n.pathDiscoveryMethod.set("browse"))}),$(2,4),p(),c(3,"button",19),w("click",function(){v(e);let n=u();return F(n.pathDiscoveryMethod.set("path"))}),$(4,5),p()()}if(o&2){let e=u();g(),x("active",e.pathDiscoveryMethod()==="browse"),g(2),x("active",e.pathDiscoveryMethod()==="path")}}function ct(o,t){o&1&&K(0,"sh-progress-bar",12)}function dt(o,t){o&1&&(c(0,"sh-icon",24),E(1,"caret-down"),p())}function pt(o,t){o&1&&K(0,"sh-icon",24)}function ut(o,t){o&1&&(c(0,"sh-icon",24),E(1,"caret-right"),p())}function ht(o,t){o&1&&(c(0,"sh-icon",22),E(1,"folder-open"),p())}function gt(o,t){o&1&&(c(0,"sh-icon",22),E(1,"folder-user"),p())}function _t(o,t){o&1&&(c(0,"sh-icon",22),E(1,"file"),p())}function mt(o,t){o&1&&(c(0,"sh-icon",22),E(1,"folder"),p())}function ft(o,t){if(o&1&&(S(0,dt,2,0,"sh-icon",24)(1,pt,1,0,"sh-icon",24)(2,ut,2,0,"sh-icon",24),S(3,ht,2,0,"sh-icon",22)(4,gt,2,0,"sh-icon",22)(5,_t,2,0,"sh-icon",22)(6,mt,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;N(e.children.length?0:e.cls==="file"?1:2),g(3),N(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Ct(o,t){o&1&&(c(0,"sh-icon",22),E(1,"desktop-tower"),p())}function Pt(o,t){o&1&&le(0)}function Tt(o,t){if(o&1&&G(0,Pt,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=ce(7);y("ngTemplateOutlet",n)("ngTemplateOutletContext",J(5,je,ye(2,rt,e.children,i.level+1)))}}function bt(o,t){if(o&1){let e=W();c(0,"div",20,3),w("click",function(){v(e);let n=u().$implicit,r=u(2);return F(r.toggleNode(n.id,n))}),c(2,"div",21),S(3,ft,7,2)(4,Ct,2,0,"sh-icon",22),p(),c(5,"div",23),w("click",function(n){v(e);let r=u().$implicit,a=u(2);return F(a.toggleSelectedNode(n,r))}),E(6),p()(),S(7,Tt,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();x("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),g(2),x("file",e.cls==="file"),g(),N(e.id!=="/"?3:4),g(3),Fe(" ",e.text," "),g(),N(e.children.length>0?7:-1)}}function Et(o,t){if(o&1&&S(0,bt,8,17),o&2){let e=t.$implicit,i=u(2);N(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Mt(o,t){if(o&1&&(c(0,"sh-list"),fe(1,Et,1,1,null,null,lt),p()),o&2){let e=t.$implicit;U("padding-left",e.level*.25,"rem"),g(),Ce(e.children)}}function vt(o,t){o&1&&le(0)}function Ft(o,t){if(o&1){let e=W();c(0,"sh-toggle",25),w("click",function(){v(e);let n=u();return F(n._showHiddenNodes.set(!n._showHiddenNodes()))}),$(1,6),p()}if(o&2){let e=u();x("active",e._showHiddenNodes()),g(),be(e.showFiles()?"files":"folders"),Ee(1)}}function St(o,t){if(o&1){let e=W();c(0,"button",26),w("click",function(){v(e);let n=u();return F(n.openCreateFolderDialog())}),$(1,7),p()}if(o&2){let e=u();y("disabled",!e.isCurrentPathFolder())}}function Nt(o,t){if(o&1){let e=W();c(0,"sh-dialog",27),z("isOpenChange",function(n){v(e);let r=u();return H(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),F(n)}),c(1,"header",28)(2,"h2"),$(3,8),p()(),c(4,"div",29)(5,"div"),E(6," Folder will be created under "),c(7,"pre"),E(8),p()(),c(9,"sh-form-field")(10,"textarea",30),z("ngModelChange",function(n){v(e);let r=u();return H(r.createFolderPath,n)||(r.createFolderPath=n),F(n)}),p()()(),c(11,"footer",31)(12,"button",32),w("click",function(){v(e);let n=u();return F(n.closeCreateFolderDialog(!1))}),E(13,"Cancel"),p(),c(14,"button",33),w("click",function(){v(e);let n=u();return F(n.closeCreateFolderDialog(!0))}),Pe(15,9),K(16,"sh-icon"),Te(),p()()()}if(o&2){let e,i=u();V("isOpen",i.createFolderDialogOpen),y("options",Oe(5,st)),g(8),ve(i.currentPath()),g(2),V("ngModel",i.createFolderPath),g(4),y("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var Xe=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(Xe||{}),M="/",ue=class o{#t=X($e);#n=X(Ve);#d=X(Ie);multiSelect=P(!1);disabled=P(!1);showFiles=P(!1);selectFiles=P(!1);accepts=P(null);startingPath=P(null);rootPaths=P([]);initialNodes=P([]);backupSettings=P(null);pathRefreshTrigger=P(!1);showHiddenNodes=P(!1);enableCreateFolder=P(!1);hideShortcuts=P(!1);includes=de();excludes=de();_showHiddenNodes=b(!1);createFolderDialogOpen=b(!1);createFolderPath=b(null);treeContainerRef=pe("treeContainer");formRef=pe("formRef");pathDiscoveryMethod=b("browse");isLoading=b(!1);currentPath=b("/");#o=b(null);treeSearchQuery=b("");treeNodes=b([]);isWindows=A(()=>this.#n.systemInfo()?.OSType==="Windows");pathDelimiter=A(()=>this.isWindows()?"\\":"/");filterGroups=this.#n.filterGroups();isByBackupSettings=A(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=A(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Xe;treeStructure=A(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let m=f.slice(1,-1),d=this.filterGroups?.FilterGroups[m];if(d&&d.length){let O=d.map(C=>`-${C}`);i.splice(l,1,...O)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),_=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let h=this.#s(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:h,isIndeterminate:!1,cls:this.#e(l,_)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let h=new Map,f=l?.id;a&&(l.accepted=!0),h.set(l.id,l);let m=r.length>0?n.filter(d=>d.parentPath.startsWith(l.id)):n;for(let d of m){let C=(r.length>0?d.id.replace(f??"",""):d.id).split(_).filter(Boolean),T="",D=l;for(let L of C){if(T+=L+_,!h.has(T)){let ne=d.hidden===!0&&t?0:this.#s(i,d.id,d.cls,D),R={id:d.id,isIndeterminate:this.isIndeterminate(i,d.id),evalState:ne,parentPath:T,resolvedpath:d.cls=="folder"?this.#r(d.resolvedpath):T,hidden:d.hidden,text:d.text,cls:d.cls,children:[]};a&&(R.accepted=this.matchAccepts(a,R)),h.set(T,R),D.children.push(R)}D=h.get(T)}}return l}),s});#r(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#s(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),_=t.filter(h=>!h.startsWith("-")&&!h.startsWith("+")),s=t.filter(h=>h.startsWith("-")||h.startsWith("+")),l=this.multiSelect();if(_.length===0)return r;for(let h=0;h<_.length;h++){let f=_[h];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let h=0;h<s.length;h++){let f=s[h],m=f.slice(1),d=f.startsWith("-")?-1:1;if(this.#e(m,a)){if(i!=="folder")continue;if(e===m){r=d;break}}if(m.startsWith("*")&&m.endsWith(`*${a}`)){if(i!=="folder")continue;let C=m.slice(1,-2);if(C==="")break;if(e?.includes(C+a)){r=d;break}}if(m.startsWith("[.*")&&m.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let C=m.slice(3,-7);if(new RegExp(C).test(e)){r=d;break}}if(m.startsWith("[")&&m.endsWith("]")){let C=m.slice(1,-1),T=this.translateCSharpRegex(C);if(new RegExp(`${T}`).test(e)){r=d;break}}if(m.startsWith("*.")){if(i!=="file"||m.replace("*.","").length===0)continue;if(this.#l(e,m,!0)){r=d;break}}if(m==="")continue;if(m===e){r=d;break}if(this.#l(e,m,!0)){r=d;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#l(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=B(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=B(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=B(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=B(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#g(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,M)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?M:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,_=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(_&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=_?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==M&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#r(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#a()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let _=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=_?_[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(He,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#a(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#u(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(j(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(j(n=>n.Files??[]))}}#c(t){return this.isByBackupSettings()?this.#h(t):this.#u(t)}#g(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),n=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean),r=n.map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,h)=>{let f=s.slice(0,h+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let _=a.map(s=>this.#c(s).pipe(j(l=>({status:"success",value:l,url:s})),_e(l=>he({status:"error",value:l,url:s}))));ge(_).pipe(se(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),h=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let m=l.flatMap(O=>O.value.map(C=>{let T=C.id,D=C.id.startsWith("%")&&C.id.endsWith("%")?C.resolvedpath+e:C.id,L=T&&T.split(e).filter(Boolean).slice(0,-1).join(e),ne=T&&T.split(e).filter(Boolean).join(e),R=e+ne,Ke=n.findIndex(k=>this.multiSelect()?R.startsWith(k):R===k)>-1,Qe=n.findIndex(k=>k===T)>-1,Ue=i.findIndex(k=>k===R)>-1;return re(oe({},C),{cls:this.#e(D,e)||D==M?"folder":"file",parentPath:L.startsWith("%")?L:e+L,isSelected:Ke&&!Ue||Qe})})),d=[...new Map([...f,...m].map(O=>[O.id,O])).values()];return this.#a(),this.hideShortcuts()?d.filter(O=>!O.id.startsWith("%")):d})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=M){let i=this.pathDelimiter();this.isLoading.set(!0),this.#c(e).pipe(se(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(_=>_!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let _=r.map(l=>{let h=this.#e(l.id,i)?"folder":"file";return re(oe({},l),{cls:h,parentPath:e})}),s=[...new Map([...a,..._].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=q({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(ae(i.treeContainerRef,et,5),ae(i.formRef,tt,5)),e&2&&Me(2)},hostVars:2,hostBindings:function(e,i){e&2&&x("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:nt,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(Q(it),S(0,at,5,4,"sh-button-group"),c(1,"div",10),I(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,ct,1,0,"sh-progress-bar",12),G(6,Mt,3,2,"ng-template",null,1,xe)(8,vt,1,0,"ng-container",13),p(),c(9,"div",14),S(10,Ft,2,3,"sh-toggle",15),S(11,St,2,1,"button",16),p()(),c(12,"div",17,2)(14,"sh-form-field"),I(15,1,["ngProjectAs","label",5,["label"]]),I(16,2,["ngProjectAs","input",5,["input"]]),p()(),S(17,Nt,17,6,"sh-dialog",18)),e&2){let n=ce(7);N(i.multiSelect()?-1:0),g(),x("hidden",i.pathDiscoveryMethod()!=="browse"),g(2),x("visualize-accepted",i.accepts()),g(2),N(i.isLoading()?5:-1),g(3),y("ngTemplateOutlet",n)("ngTemplateOutletContext",J(15,je,J(13,ot,i.treeStructure()))),g(2),N(!i.accepts()&&!i.isByBackupSettings()?10:-1),g(),N(i.enableCreateFolder()?11:-1),g(),x("hidden",i.pathDiscoveryMethod()!=="path"),g(5),N(i.createFolderDialogOpen()?17:-1)}},dependencies:[Ae,We,De,Z,Be,Le,Re,we,ie,Y,ee,te],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};var Ot=[[["label"]],[["","prefix",""]],[["","suffix",""]]],yt=["label","[prefix]","[suffix]"];function xt(o,t){if(o&1&&E(0),o&2){let e=t.$implicit,i=u();Se("",e.label,"",i.hasPerSecond()?"/s":"")}}var wt=["throttle-upload","throttle-download"],Dt=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Rt=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},qe=class o{customId=P();inputType=P();timespan=b(0);unit=b("MB");sizeOptions=b(Dt);readonly=b(!1);hasPerSecond=A(()=>{let t=this.inputType();return t&&wt.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=B(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Rt(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=q({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Ne([{provide:ze,useExisting:o,multi:!0}])],ngContentSelectors:yt,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(Q(Ot),c(0,"div",0),I(1,0,["ngProjectAs","label",5,["label"]]),p(),c(2,"sh-form-field")(3,"input",1),z("ngModelChange",function(r){return H(i.timespan,r)||(i.timespan=r),r}),p(),I(4,1),I(5,2),p(),c(6,"sh-select",2)(7,"input",3),z("ngModelChange",function(r){return H(i.unit,r)||(i.unit=r),r}),p(),G(8,xt,1,2,"ng-template"),p()),e&2&&(g(2),me("readonly",i.readonly()||void 0),g(),y("id",i.customId()),V("ngModel",i.timespan),y("disabled",i.readonly()),g(3),U("--miw",0),y("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),g(),V("ngModel",i.unit))},dependencies:[ke,Z,ie,Y,Ge,ee,te],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};export{ue as a,Rt as b,qe as c};
@@ -1,3 +1,3 @@
1
- import{a as de,b as me}from"./chunk-OMMUXRXE.js";import{a as ce}from"./chunk-N6ABN43N.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{b as re,c as ae,e as le,i as se,k as _e,s as pe}from"./chunk-N5SC4SKW.js";import{A as ne,C as ie,a as Q,g as W,l as Y,o as Z,t as ee,z as te}from"./chunk-H7K35UUX.js";import{ea as J}from"./chunk-RUXCS4ZK.js";import{Ab as a,Bb as s,Cb as w,Gb as v,Hb as V,Hc as D,Ib as T,Jb as g,Oc as k,Qb as b,Ra as p,Rb as $,Sb as X,Uc as R,Wb as C,Xc as q,Yb as l,_ as K,bb as U,ea as m,fa as u,gb as f,gc as x,ic as B,lc as d,mc as G,nc as A,oa as M,tc as H,ub as h,uc as z,vb as O,vc as S,wb as N,xb as P,yb as E,zb as c,zc as j}from"./chunk-HNWRQABR.js";import{a as I,b as L}from"./chunk-EUDKD2JW.js";var ge=()=>({updateOn:"blur"});function fe(t,i){if(t&1){let e=g();a(0,"button",13),C("click",function(){m(e);let n=l();return u(n.showTextArea.set(!1))}),b(1,5),w(2,"sh-icon"),$(),s()}}function xe(t,i){if(t&1){let e=g();a(0,"button",17,0),C("click",function(){let n=m(e).$implicit,r=l(3);return u(r.addSetting(n))}),d(2),s()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),p(2),A(" ",e.name," ")}}function Se(t,i){if(t&1&&(a(0,"h3",9),d(1),s(),P(2,xe,3,3,"button",16,N)),t&2){let e=i.$implicit;p(),G(e.displayName),p(),E(e.options)}}function Te(t,i){if(t&1){let e=g();a(0,"sh-menu")(1,"button",18)(2,"sh-icon"),d(3,"dots-three-vertical"),s()(),v(4,15),a(5,"button",13),C("click",function(){m(e);let n=l(2);return u(n.addFreeTextSetting())}),b(6,7),w(7,"sh-icon"),$(),s(),a(8,"button",19),C("click",function(){m(e);let n=l(2);return u(n.showTextArea.set(!0))}),a(9,"sh-icon"),d(10,"link"),s(),d(11," Edit contents as text "),s(),V(),s()}}function he(t,i){if(t&1&&(a(0,"sh-menu",14)(1,"button",11),b(2,6),w(3,"sh-icon"),$(),s(),v(4,15),P(5,Se,4,1,null,null,N),V(),s(),h(7,Te,12,0,"sh-menu")),t&2){let e=l();c("searchable",!0),p(5),E(e.nonSelectedOptionsGrouped()),p(2),O(e.hasFreeTextSettings()?7:-1)}}function Oe(t,i){if(t&1){let e=g();a(0,"textarea",20),C("ngModelChange",function(n){m(e);let r=l();return u(r.updateSettingsFromText(n))}),s()}if(t&2){let e=l();c("ngModel",e.settingsAsText())("ngModelOptions",j(2,ge))}}function Fe(t,i){t&1&&(a(0,"div",21),d(1,"Add a setting above to get started."),s())}function we(t,i){t&1&&(a(0,"sh-icon",29),d(1," warning-octagon "),s())}function Ve(t,i){if(t&1&&(a(0,"sh-icon",30),d(1,"archive"),s()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.deprecatedDescription)}}function ye(t,i){if(t&1&&(a(0,"sh-icon",31),d(1,"question"),s()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.longDescription)}}function Ie(t,i){if(t&1&&(h(0,we,2,0,"sh-icon",29),a(1,"span"),d(2),s(),h(3,Ve,2,1,"sh-icon",30)(4,ye,2,1,"sh-icon",31)),t&2){let e=l().$implicit,o=S(1);O(o?0:-1),p(),B("deprecated",e.FormView.deprecatedDescription),p(),G(e.FormView.shortDescription),p(),O(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Le(t,i){t&1&&T(0)}function Me(t,i){if(t&1){let e=g();a(0,"div",23)(1,"label"),f(2,Le,1,0,"ng-container",32),s(),a(3,"div")(4,"sh-form-field")(5,"input",33),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateFreeTextSettingName(r,n))}),s(),a(6,"sh-icon",34),d(7,"rectangle-dashed"),s()()(),a(8,"div")(9,"sh-form-field")(10,"input",33),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(11,"sh-icon",34),d(12,"textbox"),s()()()()}if(t&2){let e=l().$implicit,o=x(3);p(2),c("ngTemplateOutlet",o),p(3),c("ngModel",e.Name),p(5),c("ngModel",e.Value())}}function Ne(t,i){t&1&&T(0)}function Pe(t,i){if(t&1){let e=g();a(0,"app-file-tree",24)(1,"label",35),f(2,Ne,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function Ee(t,i){if(t&1){let e=g();a(0,"app-file-tree",25),w(1,"label",35),a(2,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=S(0);c("startingPath",e.Value()),p(),c("for",o),p(),c("id",o)("ngModel",e.Value())}}function ve(t,i){t&1&&T(0)}function be(t,i){t&1&&(a(0,"sh-icon",34),d(1,"link"),s())}function $e(t,i){t&1&&(a(0,"sh-icon",34),d(1,"textbox"),s())}function Ae(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,ve,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),h(4,be,2,0,"sh-icon",34)(5,$e,2,0,"sh-icon",34),s()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value()),p(),O(e.FormView.type==="Path"?4:5)}}function De(t,i){t&1&&T(0)}function ke(t,i){if(t&1){let e=g();a(0,"sh-icon",39),C("click",function(){m(e);let n=l(2).$implicit;return u(n.showPassword=!n.showPassword)}),d(1," eye "),s()}}function Re(t,i){if(t&1){let e=g();a(0,"sh-icon",39),C("click",function(){m(e);let n=l(2).$implicit;return u(n.showPassword=!n.showPassword)}),d(1," eye-slash "),s()}}function Be(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,De,1,0,"ng-container",32),s(),a(3,"input",37),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(4,"sh-icon",34),d(5,"password"),s(),h(6,ke,2,0,"sh-icon",38)(7,Re,2,0,"sh-icon",38),s()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),p(3),O(e.showPassword?6:7)}}function Ge(t,i){t&1&&T(0)}function ze(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ke(t,i){if(t&1){let e=g();a(0,"sh-select",40)(1,"label",35),f(2,Ge,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()(),f(4,ze,1,1,"ng-template",null,2,D)}if(t&2){let e=x(5),o=l().$implicit,n=x(3),r=S(0);c("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),p(),c("for",r),p(),c("ngTemplateOutlet",n),p(),c("id",r)("ngModel",o.Value())}}function Ue(t,i){t&1&&T(0)}function Xe(t,i){if(t&1){let e=g();a(0,"app-size",41),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ue,1,0,"ng-container",32),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),p(),c("for",n),p(),c("ngTemplateOutlet",o)}}function He(t,i){t&1&&T(0)}function je(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,He,1,0,"ng-container",32),s(),a(3,"input",42),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(4,"sh-icon",34),d(5,"numpad"),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function qe(t,i){t&1&&T(0)}function Je(t,i){if(t&1){let e=g();a(0,"sh-toggle",27)(1,"label",35),f(2,qe,1,0,"ng-container",32),s(),a(3,"input",43),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function Qe(t,i){t&1&&T(0)}function We(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ye(t,i){if(t&1){let e=g();a(0,"sh-select",44)(1,"label",35),f(2,Qe,1,0,"ng-container",32),s(),a(3,"input",45),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()(),f(4,We,1,1,"ng-template",null,3,D)}if(t&2){let e=x(5),o=l().$implicit,n=x(3),r=S(0);c("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),p(),c("for",r),p(),c("ngTemplateOutlet",n),p(),c("ngModel",o.Value())}}function Ze(t,i){t&1&&T(0)}function et(t,i){if(t&1){let e=g();a(0,"app-timespan",41),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ze,1,0,"ng-container",32),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),p(),c("for",n),p(),c("ngTemplateOutlet",o)}}function tt(t,i){if(t&1){let e=g();H(0)(1),f(2,Ie,5,5,"ng-template",null,1,D),a(4,"div",22),h(5,Me,13,3,"div",23)(6,Pe,4,9,"app-file-tree",24)(7,Ee,3,4,"app-file-tree",25)(8,Ae,6,5,"sh-form-field")(9,Be,8,6,"sh-form-field")(10,Ke,6,7)(11,Xe,3,5,"app-size",26)(12,je,6,4,"sh-form-field")(13,Je,4,4,"sh-toggle",27)(14,Ye,6,6)(15,et,3,5,"app-timespan",26),a(16,"button",28),C("click",function(){let n=m(e).$implicit,r=l(2);return u(r.removeSetting(n))}),a(17,"sh-icon"),d(18,"x-bold"),s()()()}if(t&2){let e=i.$implicit,o=i.$index,n=l(2);z("destination-"+e.Name+o),p(),z(n.inAppOptions(e.Name)),p(4),O(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function nt(t,i){if(t&1&&(h(0,Fe,2,0,"div",21),P(1,tt,19,3,null,null,N)),t&2){let e=l();O(e.selectedSettings().length===0?0:-1),p(),E(e.selectedSettings())}}var ue=class t{#e=K(oe);options=q.required();hiddenOptions=R([]);hasFreeTextSettings=R(!1);applicationOptions=R();showTextArea=M(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=k(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let r=this.allOptions().find(F=>F.name===n.Name?.replace("--","")),_=n.Value??"";if(r&&i.includes(r.name))return null;if(r){if(r.type==="Boolean"&&(_=this.isTrue(_)),r.type==="Integer"&&(_=parseInt(_)||0),r.type==="Enumeration"&&r.options){let F=_?.trim().toLowerCase(),y=r.options.find(Ce=>(Ce??"").trim().toLocaleLowerCase()===F);y&&(_=y)}return L(I({},n),{Value:M(_),FormView:r})}else if(this.hasFreeTextSettings())return L(I({},n),{Value:M(_),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=k(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>L(I({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=k(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
1
+ import{a as me}from"./chunk-TK5QY2QD.js";import{a as ce,c as de}from"./chunk-23CWXAU4.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{b as re,c as ae,e as le,i as se,k as _e,s as pe}from"./chunk-N5SC4SKW.js";import{A as ne,C as ie,a as Q,g as W,l as Y,o as Z,t as ee,z as te}from"./chunk-H7K35UUX.js";import{ea as J}from"./chunk-RUXCS4ZK.js";import{Ab as a,Bb as s,Cb as w,Gb as v,Hb as V,Hc as D,Ib as T,Jb as g,Oc as k,Qb as b,Ra as p,Rb as $,Sb as X,Uc as R,Wb as C,Xc as q,Yb as l,_ as K,bb as U,ea as m,fa as u,gb as f,gc as x,ic as B,lc as d,mc as G,nc as A,oa as M,tc as H,ub as h,uc as z,vb as O,vc as S,wb as N,xb as P,yb as E,zb as c,zc as j}from"./chunk-HNWRQABR.js";import{a as I,b as L}from"./chunk-EUDKD2JW.js";var ge=()=>({updateOn:"blur"});function fe(t,i){if(t&1){let e=g();a(0,"button",13),C("click",function(){m(e);let n=l();return u(n.showTextArea.set(!1))}),b(1,5),w(2,"sh-icon"),$(),s()}}function xe(t,i){if(t&1){let e=g();a(0,"button",17,0),C("click",function(){let n=m(e).$implicit,r=l(3);return u(r.addSetting(n))}),d(2),s()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),p(2),A(" ",e.name," ")}}function Se(t,i){if(t&1&&(a(0,"h3",9),d(1),s(),P(2,xe,3,3,"button",16,N)),t&2){let e=i.$implicit;p(),G(e.displayName),p(),E(e.options)}}function Te(t,i){if(t&1){let e=g();a(0,"sh-menu")(1,"button",18)(2,"sh-icon"),d(3,"dots-three-vertical"),s()(),v(4,15),a(5,"button",13),C("click",function(){m(e);let n=l(2);return u(n.addFreeTextSetting())}),b(6,7),w(7,"sh-icon"),$(),s(),a(8,"button",19),C("click",function(){m(e);let n=l(2);return u(n.showTextArea.set(!0))}),a(9,"sh-icon"),d(10,"link"),s(),d(11," Edit contents as text "),s(),V(),s()}}function he(t,i){if(t&1&&(a(0,"sh-menu",14)(1,"button",11),b(2,6),w(3,"sh-icon"),$(),s(),v(4,15),P(5,Se,4,1,null,null,N),V(),s(),h(7,Te,12,0,"sh-menu")),t&2){let e=l();c("searchable",!0),p(5),E(e.nonSelectedOptionsGrouped()),p(2),O(e.hasFreeTextSettings()?7:-1)}}function Oe(t,i){if(t&1){let e=g();a(0,"textarea",20),C("ngModelChange",function(n){m(e);let r=l();return u(r.updateSettingsFromText(n))}),s()}if(t&2){let e=l();c("ngModel",e.settingsAsText())("ngModelOptions",j(2,ge))}}function Fe(t,i){t&1&&(a(0,"div",21),d(1,"Add a setting above to get started."),s())}function we(t,i){t&1&&(a(0,"sh-icon",29),d(1," warning-octagon "),s())}function Ve(t,i){if(t&1&&(a(0,"sh-icon",30),d(1,"archive"),s()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.deprecatedDescription)}}function ye(t,i){if(t&1&&(a(0,"sh-icon",31),d(1,"question"),s()),t&2){let e=l(2).$implicit;c("shTooltip",e.FormView.longDescription)}}function Ie(t,i){if(t&1&&(h(0,we,2,0,"sh-icon",29),a(1,"span"),d(2),s(),h(3,Ve,2,1,"sh-icon",30)(4,ye,2,1,"sh-icon",31)),t&2){let e=l().$implicit,o=S(1);O(o?0:-1),p(),B("deprecated",e.FormView.deprecatedDescription),p(),G(e.FormView.shortDescription),p(),O(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Le(t,i){t&1&&T(0)}function Me(t,i){if(t&1){let e=g();a(0,"div",23)(1,"label"),f(2,Le,1,0,"ng-container",32),s(),a(3,"div")(4,"sh-form-field")(5,"input",33),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateFreeTextSettingName(r,n))}),s(),a(6,"sh-icon",34),d(7,"rectangle-dashed"),s()()(),a(8,"div")(9,"sh-form-field")(10,"input",33),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(11,"sh-icon",34),d(12,"textbox"),s()()()()}if(t&2){let e=l().$implicit,o=x(3);p(2),c("ngTemplateOutlet",o),p(3),c("ngModel",e.Name),p(5),c("ngModel",e.Value())}}function Ne(t,i){t&1&&T(0)}function Pe(t,i){if(t&1){let e=g();a(0,"app-file-tree",24)(1,"label",35),f(2,Ne,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function Ee(t,i){if(t&1){let e=g();a(0,"app-file-tree",25),w(1,"label",35),a(2,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=S(0);c("startingPath",e.Value()),p(),c("for",o),p(),c("id",o)("ngModel",e.Value())}}function ve(t,i){t&1&&T(0)}function be(t,i){t&1&&(a(0,"sh-icon",34),d(1,"link"),s())}function $e(t,i){t&1&&(a(0,"sh-icon",34),d(1,"textbox"),s())}function Ae(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,ve,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),h(4,be,2,0,"sh-icon",34)(5,$e,2,0,"sh-icon",34),s()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value()),p(),O(e.FormView.type==="Path"?4:5)}}function De(t,i){t&1&&T(0)}function ke(t,i){if(t&1){let e=g();a(0,"sh-icon",39),C("click",function(){m(e);let n=l(2).$implicit;return u(n.showPassword=!n.showPassword)}),d(1," eye "),s()}}function Re(t,i){if(t&1){let e=g();a(0,"sh-icon",39),C("click",function(){m(e);let n=l(2).$implicit;return u(n.showPassword=!n.showPassword)}),d(1," eye-slash "),s()}}function Be(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,De,1,0,"ng-container",32),s(),a(3,"input",37),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(4,"sh-icon",34),d(5,"password"),s(),h(6,ke,2,0,"sh-icon",38)(7,Re,2,0,"sh-icon",38),s()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),p(3),O(e.showPassword?6:7)}}function Ge(t,i){t&1&&T(0)}function ze(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ke(t,i){if(t&1){let e=g();a(0,"sh-select",40)(1,"label",35),f(2,Ge,1,0,"ng-container",32),s(),a(3,"input",36),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()(),f(4,ze,1,1,"ng-template",null,2,D)}if(t&2){let e=x(5),o=l().$implicit,n=x(3),r=S(0);c("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),p(),c("for",r),p(),c("ngTemplateOutlet",n),p(),c("id",r)("ngModel",o.Value())}}function Ue(t,i){t&1&&T(0)}function Xe(t,i){if(t&1){let e=g();a(0,"app-size",41),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ue,1,0,"ng-container",32),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),p(),c("for",n),p(),c("ngTemplateOutlet",o)}}function He(t,i){t&1&&T(0)}function je(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",35),f(2,He,1,0,"ng-container",32),s(),a(3,"input",42),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s(),a(4,"sh-icon",34),d(5,"numpad"),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function qe(t,i){t&1&&T(0)}function Je(t,i){if(t&1){let e=g();a(0,"sh-toggle",27)(1,"label",35),f(2,qe,1,0,"ng-container",32),s(),a(3,"input",43),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);p(),c("for",n),p(),c("ngTemplateOutlet",o),p(),c("id",n)("ngModel",e.Value())}}function Qe(t,i){t&1&&T(0)}function We(t,i){if(t&1&&d(0),t&2){let e=i.$implicit;A(" ",e," ")}}function Ye(t,i){if(t&1){let e=g();a(0,"sh-select",44)(1,"label",35),f(2,Qe,1,0,"ng-container",32),s(),a(3,"input",45),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),s()(),f(4,We,1,1,"ng-template",null,3,D)}if(t&2){let e=x(5),o=l().$implicit,n=x(3),r=S(0);c("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),p(),c("for",r),p(),c("ngTemplateOutlet",n),p(),c("ngModel",o.Value())}}function Ze(t,i){t&1&&T(0)}function et(t,i){if(t&1){let e=g();a(0,"app-timespan",41),C("ngModelChange",function(n){m(e);let r=l().$implicit,_=l(2);return u(_.updateSettingValue(r,n))}),a(1,"label",35),f(2,Ze,1,0,"ng-container",32),s()()}if(t&2){let e=l().$implicit,o=x(3),n=S(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),p(),c("for",n),p(),c("ngTemplateOutlet",o)}}function tt(t,i){if(t&1){let e=g();H(0)(1),f(2,Ie,5,5,"ng-template",null,1,D),a(4,"div",22),h(5,Me,13,3,"div",23)(6,Pe,4,9,"app-file-tree",24)(7,Ee,3,4,"app-file-tree",25)(8,Ae,6,5,"sh-form-field")(9,Be,8,6,"sh-form-field")(10,Ke,6,7)(11,Xe,3,5,"app-size",26)(12,je,6,4,"sh-form-field")(13,Je,4,4,"sh-toggle",27)(14,Ye,6,6)(15,et,3,5,"app-timespan",26),a(16,"button",28),C("click",function(){let n=m(e).$implicit,r=l(2);return u(r.removeSetting(n))}),a(17,"sh-icon"),d(18,"x-bold"),s()()()}if(t&2){let e=i.$implicit,o=i.$index,n=l(2);z("destination-"+e.Name+o),p(),z(n.inAppOptions(e.Name)),p(4),O(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function nt(t,i){if(t&1&&(h(0,Fe,2,0,"div",21),P(1,tt,19,3,null,null,N)),t&2){let e=l();O(e.selectedSettings().length===0?0:-1),p(),E(e.selectedSettings())}}var ue=class t{#e=K(oe);options=q.required();hiddenOptions=R([]);hasFreeTextSettings=R(!1);applicationOptions=R();showTextArea=M(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=k(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let r=this.allOptions().find(F=>F.name===n.Name?.replace("--","")),_=n.Value??"";if(r&&i.includes(r.name))return null;if(r){if(r.type==="Boolean"&&(_=this.isTrue(_)),r.type==="Integer"&&(_=parseInt(_)||0),r.type==="Enumeration"&&r.options){let F=_?.trim().toLowerCase(),y=r.options.find(Ce=>(Ce??"").trim().toLocaleLowerCase()===F);y&&(_=y)}return L(I({},n),{Value:M(_),FormView:r})}else if(this.hasFreeTextSettings())return L(I({},n),{Value:M(_),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=k(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>L(I({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=k(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
2
  `));updateSettingsFromText(i){if(typeof i!="string")return;let e=i.split(`
3
3
  `).map(n=>n.trim()).filter(n=>n.length>0),o=[];for(let n of e){let[r,_]=n.split("=").map(F=>F.trim());r&&r.trim().length>0&&_!==void 0&&o.push({Name:`${r}`,Value:_})}this.options.update(()=>o)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(_=>_.Name===i.Name);if(i.FormView.type==="Boolean")return n[r].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[r].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let _=e?.trim().toLowerCase()??"",F=i.FormView.options.find(y=>(y??"").trim().toLocaleLowerCase()===_);if(F)return n[r].Value=F,n}return n[r].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(_=>_.Name===i.Name);return n[r].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=U({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:9,vars:3,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let r;return r=$localize`By adding this option it will override the matching global option`,[["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disallowToggle"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","remove-btn",3,"click"],["shTooltip",r,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"]]},template:function(e,o){e&1&&(a(0,"sh-toggle-card",8),v(1,9)(2),X(3,4),V(),a(4,"div",10),h(5,fe,3,0,"button",11)(6,he,8,2),s(),V(),h(7,Oe,1,3,"textarea",12)(8,nt,3,1),s()),e&2&&(c("disallowToggle",!0),p(5),O(o.showTextArea()?5:6),p(2),O(o.showTextArea()?7:8))},dependencies:[pe,ae,_e,re,le,se,ce,te,Y,W,Z,ie,Q,ee,ne,de,me,J],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr 2.5rem;gap:.5rem;position:relative;z-index:1}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{ue as a};
@@ -1 +1 @@
1
- import{a as xt,b as Lt,c as Rt,d as Ut,e as wt}from"./chunk-QYI4IMJE.js";import"./chunk-7IQY6U5W.js";import"./chunk-OMMUXRXE.js";import{a as Pt}from"./chunk-KDYD6LMI.js";import{h as Bt}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import{a as $}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as b,e as v,f as At,g as $t,i as k,j as Mt,r as yt,s as G}from"./chunk-N5SC4SKW.js";import{b as St,d as Ct}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as U,b as ht,d as It,e as Nt,g as ft,h as Ot,l as w,o as Et}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as F,Cb as c,Gb as Ft,Hb as rt,Jb as g,Oa as it,Oc as L,Qb as u,Ra as r,Rb as _,Sb as B,Tb as z,Tc as gt,Ub as H,Uc as pt,Vb as X,Vc as mt,Wb as D,Yb as l,Zb as lt,_ as C,_b as ct,bb as f,ea as d,ec as ut,fa as T,fc as _t,ia as nt,ic as dt,lc as x,mc as W,oa as I,qc as O,rc as E,sc as A,tc as j,ub as m,uc as q,vb as S,vc as R,wb as ot,wc as Q,xb as at,yb as st,yc as Tt,zb as h,zc as Dt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var kt=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:kt,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,n){if(t&1&&(lt(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),x(4),F(),s(5,"div",4),x(6),F(),s(7,"div",5),ct(8),F()()),t&2){let i=n.destination();r(2),h("src",Q(i.icon),it)("alt",Q(i.displayName)),r(2),W(i.displayName),r(2),W(i.description)}},dependencies:[Ot],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function Kt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let i=d(t).$implicit,a=l();return T(a.setDestination.emit(i.key))}),u(2,0),c(3,"sh-icon"),_(),F()()}if(o&2){let t=e.$implicit;h("destination",t)}}var K=class o{#i=C(Lt);setDestination=gt();destinationSearchTerm=I("");destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let e=new Set(this.destinationTypeOptionsInFocus()),t=this.destinationTypeOptions(),n=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((a,N)=>{let y=e.has(a.key),P=e.has(N.key);return y&&!P?-1:!y&&P?1:0});return n?i.filter(a=>a.displayName.toLowerCase().includes(n)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let e;e=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",e,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,n){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return E(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),F()(),s(2,"div",2),at(3,Kt,4,1,"app-destination-list-item",3,ot),F()),t&2&&(r(),O("ngModel",n.destinationSearchTerm),r(2),st(n.destinationTypeOptionsFocused()))},dependencies:[M,G,b,v,k,w,ft,U],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Vt=["formRef"],zt=()=>({maxWidth:"700px",width:"100%"});function Ht(o,e){if(o&1){let t=g();u(0,1,1),s(1,"button",28),D("click",function(){d(t);let i=l();return T(i.testDestination(0,!0))}),F(),_()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function Xt(o,e){if(o&1){let t=g();u(0,1,2),s(1,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(2,"sh-icon"),F(),_()}}function Wt(o,e){if(o&1){let t=g();u(0,1,4),s(1,"button",29),D("click",function(){d(t);let i=l(2);return T(i.copyTargetUrl())}),c(2,"sh-icon"),F(),_()}}function jt(o,e){if(o&1){let t=g();u(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),Ft(4,30),s(5,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(6,"sh-icon"),F(),m(7,Wt,3,0,"button",17),rt(),F(),_()}if(o&2){l();let t=R(0);r(7),S(t?7:-1)}}function qt(o,e){o&1&&(s(0,"sh-alert"),u(1,4),c(2,"sh-icon",31),_(),F())}function Qt(o,e){o&1&&(s(0,"sh-alert",18),u(1,5),c(2,"sh-icon",31),_(),F())}function Yt(o,e){if(o&1&&(s(0,"sh-alert",19),u(1,6),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Jt(o,e){if(o&1&&(s(0,"sh-alert",20),u(1,7),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Zt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){d(t);let i=l();return T(i.removeDestination())}),B(2,8),F()()}if(o&2){l();let t=R(14);h("destination",t)}}function te(o,e){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(i){d(t);let a=l();return T(a.setDestination(i))}),F()}}function ee(o,e){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(i){d(t);let a=l();return E(a.targetUrlModel,i)||(a.targetUrlModel=i),T(i)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel)}}function ne(o,e){o&1&&(u(0,3,1),c(1,"sh-icon",26),_())}function ie(o,e){o&1&&(u(0,3,2),c(1,"sh-icon"),_())}function oe(o,e){o&1&&(s(0,"h2"),B(1,11),F())}function ae(o,e){o&1&&(s(0,"h2"),B(1,12),F())}function se(o,e){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(i){d(t);let a=l();return E(a.targetUrlDialogOpen,i)||(a.targetUrlDialogOpen=i),T(i)}),s(1,"header",35),m(2,oe,2,0,"h2")(3,ae,2,0,"h2"),s(4,"sh-alert",19),B(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(i){d(t);let a=l();return E(a.targetUrlCtrl,i)||(a.targetUrlCtrl=i),T(i)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!1))}),x(11,"Cancel"),F(),s(12,"button",39),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!0))}),u(13,10),c(14,"sh-icon"),_(),F()()()}if(o&2){let t=l(),n=R(0);O("isOpen",t.targetUrlDialogOpen),h("options",Dt(4,zt)),r(2),S(n?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new yt,we=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),be=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>V.group({destinationType:V.control(o),custom:e,dynamic:t,advanced:n}),Y=class o{#i=C(Ct);#o=C(St);#t=C(Bt);#e=C(Nt);#a=C(xt);injector=C(nt);formRef=mt.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=L(()=>{let e=this.targetUrlModel();if(!e)return null;let t=e.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=L(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let e=this.targetUrlModel();this.targetUrlCtrl.set(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!e||t===n||!t||this.#t.setTargetUrl(t)}testDestination(e,t,n){let i=this.targetUrlModel();i&&(this.#t.setTestState("testing"),this.#a.testDestination(i,e,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let N=i.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(i+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(i+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(e){this.#t.setTargetUrl(`${e}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let e=this.#t.isNew(),t=this.testSignal();if(!e){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&ut(n.formRef,Vt,5),t&2&&_t()},features:[Tt([{provide:Ut,useClass:Rt}])],decls:27,vars:11,consts:()=>{let e;e=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,e=X(e);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=X(n);let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let y;y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`Change`;let J;J=$localize`Be careful, this will overwrite everything you have in your destination.`;let Z;Z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let tt;tt=$localize`Set target URL`;let et;return et=$localize`Edit target URL`,[["formRef",""],e,t,n,i,a,N,y,P,J,Z,tt,et,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let i=g();j(0),s(1,"form",13,0),D("submit",function(){return d(i),T(n.next())}),s(3,"header")(4,"h3",14),u(5,1),s(6,"div",15),m(7,Ht,2,3,"button",16),m(8,Xt,3,0,"button",17)(9,jt,8,1,"sh-menu"),F(),_(),F(),m(10,qt,3,0,"sh-alert")(11,Qt,3,0,"sh-alert",18)(12,Yt,3,1,"sh-alert",19)(13,Jt,3,1,"sh-alert",20),j(14),m(15,Zt,3,1,"app-destination-list-item",21),F(),m(16,te,1,0,"app-destination-list"),m(17,ee,1,1,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return d(i),T(n.goBack())}),u(20,2),c(21,"sh-icon"),_(),F(),s(22,"button",25),u(23,3),m(24,ne,2,0,"sh-icon",26)(25,ie,2,0,"sh-icon"),_(),F()()(),m(26,se,15,5,"sh-dialog",27)}if(t&2){let i=q(!!n.targetUrlModel());r(7),S(i?7:-1),r(),S(i?9:8),r(2),S(n.testSignal()=="testing"?10:n.testSignal()=="success"?11:n.testSignal()=="warning"?12:n.testSignal()=="error"?13:-1),r(4);let a=q(n.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(i?-1:16),r(),S(i?17:-1),r(5),h("disabled",n.testSignal()=="testing"||!i),r(2),S(n.testSignal()=="testing"?24:25),r(2),S(n.targetUrlDialogOpen()?26:-1)}},dependencies:[wt,K,M,G,Mt,b,v,At,k,$t,w,Et,U,It,ht],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;overflow:hidden;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{we as createDestinationForm,be as createDestinationFormGroup,Y as default};
1
+ import{a as xt,b as Lt,c as Rt,d as Ut,e as wt}from"./chunk-PJLMDJTH.js";import"./chunk-7IQY6U5W.js";import"./chunk-TK5QY2QD.js";import{a as Pt}from"./chunk-KDYD6LMI.js";import{h as Bt}from"./chunk-MQI3XY6Q.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import{a as $}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as b,e as v,f as At,g as $t,i as k,j as Mt,r as yt,s as G}from"./chunk-N5SC4SKW.js";import{b as St,d as Ct}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as U,b as ht,d as It,e as Nt,g as ft,h as Ot,l as w,o as Et}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as F,Cb as c,Gb as Ft,Hb as rt,Jb as g,Oa as it,Oc as L,Qb as u,Ra as r,Rb as _,Sb as B,Tb as z,Tc as gt,Ub as H,Uc as pt,Vb as X,Vc as mt,Wb as D,Yb as l,Zb as lt,_ as C,_b as ct,bb as f,ea as d,ec as ut,fa as T,fc as _t,ia as nt,ic as dt,lc as x,mc as W,oa as I,qc as O,rc as E,sc as A,tc as j,ub as m,uc as q,vb as S,vc as R,wb as ot,wc as Q,xb as at,yb as st,yc as Tt,zb as h,zc as Dt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var kt=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:kt,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,n){if(t&1&&(lt(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),x(4),F(),s(5,"div",4),x(6),F(),s(7,"div",5),ct(8),F()()),t&2){let i=n.destination();r(2),h("src",Q(i.icon),it)("alt",Q(i.displayName)),r(2),W(i.displayName),r(2),W(i.description)}},dependencies:[Ot],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function Kt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let i=d(t).$implicit,a=l();return T(a.setDestination.emit(i.key))}),u(2,0),c(3,"sh-icon"),_(),F()()}if(o&2){let t=e.$implicit;h("destination",t)}}var K=class o{#i=C(Lt);setDestination=gt();destinationSearchTerm=I("");destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let e=new Set(this.destinationTypeOptionsInFocus()),t=this.destinationTypeOptions(),n=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((a,N)=>{let y=e.has(a.key),P=e.has(N.key);return y&&!P?-1:!y&&P?1:0});return n?i.filter(a=>a.displayName.toLowerCase().includes(n)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let e;e=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",e,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,n){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return E(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),F()(),s(2,"div",2),at(3,Kt,4,1,"app-destination-list-item",3,ot),F()),t&2&&(r(),O("ngModel",n.destinationSearchTerm),r(2),st(n.destinationTypeOptionsFocused()))},dependencies:[M,G,b,v,k,w,ft,U],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Vt=["formRef"],zt=()=>({maxWidth:"700px",width:"100%"});function Ht(o,e){if(o&1){let t=g();u(0,1,1),s(1,"button",28),D("click",function(){d(t);let i=l();return T(i.testDestination(0,!0))}),F(),_()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function Xt(o,e){if(o&1){let t=g();u(0,1,2),s(1,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(2,"sh-icon"),F(),_()}}function Wt(o,e){if(o&1){let t=g();u(0,1,4),s(1,"button",29),D("click",function(){d(t);let i=l(2);return T(i.copyTargetUrl())}),c(2,"sh-icon"),F(),_()}}function jt(o,e){if(o&1){let t=g();u(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),Ft(4,30),s(5,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(6,"sh-icon"),F(),m(7,Wt,3,0,"button",17),rt(),F(),_()}if(o&2){l();let t=R(0);r(7),S(t?7:-1)}}function qt(o,e){o&1&&(s(0,"sh-alert"),u(1,4),c(2,"sh-icon",31),_(),F())}function Qt(o,e){o&1&&(s(0,"sh-alert",18),u(1,5),c(2,"sh-icon",31),_(),F())}function Yt(o,e){if(o&1&&(s(0,"sh-alert",19),u(1,6),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Jt(o,e){if(o&1&&(s(0,"sh-alert",20),u(1,7),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Zt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){d(t);let i=l();return T(i.removeDestination())}),B(2,8),F()()}if(o&2){l();let t=R(14);h("destination",t)}}function te(o,e){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(i){d(t);let a=l();return T(a.setDestination(i))}),F()}}function ee(o,e){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(i){d(t);let a=l();return E(a.targetUrlModel,i)||(a.targetUrlModel=i),T(i)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel)}}function ne(o,e){o&1&&(u(0,3,1),c(1,"sh-icon",26),_())}function ie(o,e){o&1&&(u(0,3,2),c(1,"sh-icon"),_())}function oe(o,e){o&1&&(s(0,"h2"),B(1,11),F())}function ae(o,e){o&1&&(s(0,"h2"),B(1,12),F())}function se(o,e){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(i){d(t);let a=l();return E(a.targetUrlDialogOpen,i)||(a.targetUrlDialogOpen=i),T(i)}),s(1,"header",35),m(2,oe,2,0,"h2")(3,ae,2,0,"h2"),s(4,"sh-alert",19),B(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(i){d(t);let a=l();return E(a.targetUrlCtrl,i)||(a.targetUrlCtrl=i),T(i)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!1))}),x(11,"Cancel"),F(),s(12,"button",39),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!0))}),u(13,10),c(14,"sh-icon"),_(),F()()()}if(o&2){let t=l(),n=R(0);O("isOpen",t.targetUrlDialogOpen),h("options",Dt(4,zt)),r(2),S(n?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new yt,we=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),be=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>V.group({destinationType:V.control(o),custom:e,dynamic:t,advanced:n}),Y=class o{#i=C(Ct);#o=C(St);#t=C(Bt);#e=C(Nt);#a=C(xt);injector=C(nt);formRef=mt.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=L(()=>{let e=this.targetUrlModel();if(!e)return null;let t=e.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=L(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let e=this.targetUrlModel();this.targetUrlCtrl.set(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!e||t===n||!t||this.#t.setTargetUrl(t)}testDestination(e,t,n){let i=this.targetUrlModel();i&&(this.#t.setTestState("testing"),this.#a.testDestination(i,e,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let N=i.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(i+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(i+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(e){this.#t.setTargetUrl(`${e}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let e=this.#t.isNew(),t=this.testSignal();if(!e){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&ut(n.formRef,Vt,5),t&2&&_t()},features:[Tt([{provide:Ut,useClass:Rt}])],decls:27,vars:11,consts:()=>{let e;e=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,e=X(e);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=X(n);let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let y;y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`Change`;let J;J=$localize`Be careful, this will overwrite everything you have in your destination.`;let Z;Z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let tt;tt=$localize`Set target URL`;let et;return et=$localize`Edit target URL`,[["formRef",""],e,t,n,i,a,N,y,P,J,Z,tt,et,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let i=g();j(0),s(1,"form",13,0),D("submit",function(){return d(i),T(n.next())}),s(3,"header")(4,"h3",14),u(5,1),s(6,"div",15),m(7,Ht,2,3,"button",16),m(8,Xt,3,0,"button",17)(9,jt,8,1,"sh-menu"),F(),_(),F(),m(10,qt,3,0,"sh-alert")(11,Qt,3,0,"sh-alert",18)(12,Yt,3,1,"sh-alert",19)(13,Jt,3,1,"sh-alert",20),j(14),m(15,Zt,3,1,"app-destination-list-item",21),F(),m(16,te,1,0,"app-destination-list"),m(17,ee,1,1,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return d(i),T(n.goBack())}),u(20,2),c(21,"sh-icon"),_(),F(),s(22,"button",25),u(23,3),m(24,ne,2,0,"sh-icon",26)(25,ie,2,0,"sh-icon"),_(),F()()(),m(26,se,15,5,"sh-dialog",27)}if(t&2){let i=q(!!n.targetUrlModel());r(7),S(i?7:-1),r(),S(i?9:8),r(2),S(n.testSignal()=="testing"?10:n.testSignal()=="success"?11:n.testSignal()=="warning"?12:n.testSignal()=="error"?13:-1),r(4);let a=q(n.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(i?-1:16),r(),S(i?17:-1),r(5),h("disabled",n.testSignal()=="testing"||!i),r(2),S(n.testSignal()=="testing"?24:25),r(2),S(n.targetUrlDialogOpen()?26:-1)}},dependencies:[wt,K,M,G,Mt,b,v,At,k,$t,w,Et,U,It,ht],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;overflow:hidden;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{we as createDestinationForm,be as createDestinationFormGroup,Y as default};
@@ -1,3 +1,3 @@
1
- import{a as Ee}from"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import{a as fe}from"./chunk-NJEX2N4Q.js";import{h as O}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import{a as Se}from"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as T}from"./chunk-O64ZZGQZ.js";import{a as se}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as le,e as me,f as de,j as _e,n as ce,o as ue,p as pe,q as Ce,r as ge,s as Ne,t as Me}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as q,d as Z,e as J}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as Q,e as Y,g as ee,k as te,l as ne,p as ie,t as oe}from"./chunk-H7K35UUX.js";import{g as ae,h as re}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as a,Bb as n,Cb as r,Gb as A,Hb as h,Jb as v,Pc as j,Qb as N,Ra as m,Rb as M,Sb as u,Tb as G,Ub as U,Wb as x,Yb as f,_ as c,bb as $,ea as S,fa as E,ic as w,oa as F,qc as K,rc as X,sc as z,ub as b,vb as B,wb as k,xb as R,xc as V,yb as y,yc as H,zb as C,zc as W}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Fe=()=>["backup"];function Ae(s,t){s&1&&r(0,"sh-progress-bar",12)}function he(s,t){if(s&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),s&2){let e=t.$implicit,l=t.$index;m(),C("id",V("filter-",l))("formControl",e)}}function Te(s,t){if(s&1){let e=v();a(0,"form",13)(1,"sh-select",14)(2,"label",15),u(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),u(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),u(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),u(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),u(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),u(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),A(25,26),u(26,7),h(),A(27,27),R(28,he,2,3,"sh-form-field",null,k),h(),n()(),a(30,"p"),N(31,8),r(32,"a",28),M(),n(),a(33,"app-options-list",29),z("optionsChange",function(o){S(e);let p=f();return X(p.settings,o)||(p.settings=o),E(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=f();return E(o.submit())}),N(36,9),r(37,"sh-icon"),M(),n()()}if(s&2){let e=f();C("formGroup",e.baseCmdForm),m(),C("options",e.commandOptions()??W(10,Fe))("inlineSearch",!0),m(14),C("formGroup",e.standardFields),m(9),C("disallowToggle",!0),m(4),y(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),C("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),G(e.baseCmdForm.value.command),U(36)}}var d=new ge,Oe=["Bytes","KB","MB","GB","TB","PB"],P=class s{#e=c(O);#t=c(re);#n=c(Z);#i=c(q);#o=c(ae);#a=c(se);#l=c(Y);#r=T(this.#i.params);commandOptions=T(this.#o.getApiV1Commandline());sizeOptions=F(Oe);isSubmitting=F(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=j(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#s())}#s(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",l=t.arguments?.split(`
2
- `).filter(i=>i.length>0)??[],o=this.standardFields.value,p=o.filters??[],g=[t.command,e,...l,`--backup-name=${o["backup-name"]}`,`--dbpath=${o.dbpath}`,`--backup-id=${o["backup-id"]}`,...p.filter(i=>i).map(i=>i.startsWith("-")?`--exclude=${i?.slice(1)}`:`--include=${i}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(i=>`${i.Name.startsWith("--")?"":"--"}${i.Name}=${i.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:g}).subscribe(i=>{i.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",i.ID])})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
- `)??""})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=$({type:s,selectors:[["app-commandline"]],features:[H([O])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`Command`;let l;l=$localize`TargetUrl`;let o;o=$localize`Commandline Arguments`;let p;p=$localize`Advanced options`;let g;g=$localize`Backup ID`;let i;i=$localize`Backup Name`;let I;I=$localize`Filters`;let D;D=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#32\uFFFD"}:START_LINK:Read more${"\uFFFD/#32\uFFFD"}:CLOSE_LINK:`;let L;return L=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,l,o,p,g,i,I,D,L,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["id","arguments","autocomplete","off","formControlName","arguments"],["for","backup-id"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],["href","#",1,"sh-primary"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,l){e&1&&(r(0,"app-status-bar"),a(1,"section")(2,"div",10)(3,"button",11),N(4,0),r(5,"sh-icon"),M(),n()(),b(6,Ae,1,0,"sh-progress-bar",12)(7,Te,38,11),n()),e&2&&(m(6),B(l.finishedLoading()?7:6))},dependencies:[Ne,_e,le,me,de,fe,Ee,Se,Me,ce,ue,Ce,pe,J,ne,ee,te,oe,ie,Q],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}"],changeDetection:0})};export{P as default};
1
+ import{a as Ee}from"./chunk-4DNWEJIW.js";import"./chunk-TK5QY2QD.js";import{a as fe}from"./chunk-NJEX2N4Q.js";import{h as T}from"./chunk-MQI3XY6Q.js";import"./chunk-23CWXAU4.js";import{a as Se}from"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import{b as h}from"./chunk-O64ZZGQZ.js";import{a as le}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as se,e as me,f as de,j as _e,n as ce,o as ue,p as pe,q as Ce,r as ge,s as Ne,t as Me}from"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as q,d as J,e as Q}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as Y,e as Z,g as ee,k as te,l as ne,p as ie,t as oe}from"./chunk-H7K35UUX.js";import{g as ae,h as re}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as a,Bb as n,Cb as r,Gb as F,Hb as A,Jb as v,Pc as j,Qb as N,Ra as m,Rb as M,Sb as u,Tb as G,Ub as U,Wb as x,Yb as f,_ as c,bb as $,ea as S,fa as E,ic as w,oa as L,qc as K,rc as X,sc as V,ub as b,vb as k,wb as B,xb as R,xc as z,yb as y,yc as H,zb as C,zc as W}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var Fe=()=>["backup"];function Ae(l,t){l&1&&r(0,"sh-progress-bar",12)}function he(l,t){if(l&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),l&2){let e=t.$implicit,s=t.$index;m(),C("id",z("filter-",s))("formControl",e)}}function Te(l,t){if(l&1){let e=v();a(0,"form",13)(1,"sh-select",14)(2,"label",15),u(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),u(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),u(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),u(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),u(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),u(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),F(25,26),u(26,7),A(),F(27,27),R(28,he,2,3,"sh-form-field",null,B),A(),n()(),a(30,"p"),N(31,8),r(32,"a",28),M(),n(),a(33,"app-options-list",29),V("optionsChange",function(o){S(e);let p=f();return X(p.settings,o)||(p.settings=o),E(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=f();return E(o.submit())}),N(36,9),r(37,"sh-icon"),M(),n()()}if(l&2){let e=f();C("formGroup",e.baseCmdForm),m(),C("options",e.commandOptions()??W(10,Fe))("inlineSearch",!0),m(14),C("formGroup",e.standardFields),m(9),C("disallowToggle",!0),m(4),y(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),C("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),G(e.baseCmdForm.value.command),U(36)}}var d=new ge,O=class l{#e=c(T);#t=c(re);#n=c(J);#i=c(q);#o=c(ae);#a=c(le);#s=c(Z);#r=h(this.#i.params);commandOptions=h(this.#o.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=j(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",s=t.arguments?.split(`
2
+ `).filter(i=>i.length>0)??[],o=this.standardFields.value,p=o.filters??[],g=[t.command,e,...s,`--backup-name=${o["backup-name"]}`,`--dbpath=${o.dbpath}`,`--backup-id=${o["backup-id"]}`,...p.filter(i=>i).map(i=>i.startsWith("-")?`--exclude=${i?.slice(1)}`:`--include=${i}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(i=>`${i.Name.startsWith("--")?"":"--"}${i.Name}=${i.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:g}).subscribe(i=>{i.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",i.ID])})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
+ `)??""})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=$({type:l,selectors:[["app-commandline"]],features:[H([T])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`Command`;let s;s=$localize`TargetUrl`;let o;o=$localize`Commandline Arguments`;let p;p=$localize`Advanced options`;let g;g=$localize`Backup ID`;let i;i=$localize`Backup Name`;let P;P=$localize`Filters`;let I;I=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#32\uFFFD"}:START_LINK:Read more${"\uFFFD/#32\uFFFD"}:CLOSE_LINK:`;let D;return D=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,s,o,p,g,i,P,I,D,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["id","arguments","autocomplete","off","formControlName","arguments"],["for","backup-id"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],["href","#",1,"sh-primary"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,s){e&1&&(r(0,"app-status-bar"),a(1,"section")(2,"div",10)(3,"button",11),N(4,0),r(5,"sh-icon"),M(),n()(),b(6,Ae,1,0,"sh-progress-bar",12)(7,Te,38,11),n()),e&2&&(m(6),k(s.finishedLoading()?7:6))},dependencies:[Ne,_e,se,me,de,fe,Ee,Se,Me,ce,ue,Ce,pe,Q,ne,ee,te,oe,ie,Y],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}"],changeDetection:0})};export{O as default};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-62QANGOE.js";import"./chunk-ESUPNSKH.js";import{g as J}from"./chunk-PN3U7MRX.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import{b as q}from"./chunk-DNDTLTUM.js";import"./chunk-QDFDQHU3.js";import{a as Z}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import{a as V}from"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{a as H}from"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as w}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as W,h as X,p as z,s as B}from"./chunk-H7K35UUX.js";import{h as j}from"./chunk-NOPMCS2Z.js";import{qa as k}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as s,Cb as S,Dc as d,Ec as m,Gb as u,Hb as T,Oc as b,Qb as v,Ra as _,Rb as D,Sb as r,Tb as I,Ub as x,Yb as g,_ as R,bb as y,ga as C,ha as f,lc as M,oa as L,oc as h,ub as p,vb as O,zb as P}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),u(1,16),r(2,2),T(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(u(0),r(1,8),T())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(u(0),r(1,9),T())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),v(2,5),S(3,"sh-spinner",23),D(),s(),i(4,"div",24),S(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),I((e=c.statusData())==null?null:e.statusText),x(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var F=class n{#i=R(j);#s=R(V);#t=R(Z);#n=R(J);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=L("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#a(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#a(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let N;N=$localize`Files processed:`;let G;G=$localize`Size processed:`;let $;$=$localize`N/A`;let A;return A=$localize`N/A`,[t,e,o,l,E,c,N,G,$,A,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),p(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),S(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,z,B,W,X,q,H,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{F as default};
1
+ import{a as K}from"./chunk-62QANGOE.js";import"./chunk-ESUPNSKH.js";import{g as J}from"./chunk-DAYBMF7U.js";import"./chunk-4DNWEJIW.js";import"./chunk-TK5QY2QD.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import{b as q}from"./chunk-DNDTLTUM.js";import"./chunk-QDFDQHU3.js";import{a as Z}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import{a as V}from"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{a as H}from"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as w}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as W,h as X,p as z,s as B}from"./chunk-H7K35UUX.js";import{h as j}from"./chunk-NOPMCS2Z.js";import{qa as k}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as s,Cb as S,Dc as d,Ec as m,Gb as u,Hb as T,Oc as b,Qb as v,Ra as _,Rb as D,Sb as r,Tb as I,Ub as x,Yb as g,_ as R,bb as y,ga as C,ha as f,lc as M,oa as L,oc as h,ub as p,vb as O,zb as P}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),u(1,16),r(2,2),T(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(u(0),r(1,8),T())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(u(0),r(1,9),T())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),v(2,5),S(3,"sh-spinner",23),D(),s(),i(4,"div",24),S(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),I((e=c.statusData())==null?null:e.statusText),x(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var F=class n{#i=R(j);#s=R(V);#t=R(Z);#n=R(J);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=L("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#a(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#a(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let N;N=$localize`Files processed:`;let G;G=$localize`Size processed:`;let $;$=$localize`N/A`;let A;return A=$localize`N/A`,[t,e,o,l,E,c,N,G,$,A,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),p(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),S(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,z,B,W,X,q,H,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{F as default};
@@ -1 +1 @@
1
- import{a as Ue}from"./chunk-L6CWVBZ6.js";import{a as se}from"./chunk-N6ABN43N.js";import{a as ne}from"./chunk-DDWLL7XA.js";import{b as pe}from"./chunk-O64ZZGQZ.js";import{a as Ve}from"./chunk-UIJYCGKA.js";import{a as K}from"./chunk-DELLEGXW.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{a as xe}from"./chunk-UP5EOICU.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-N5SC4SKW.js";import{b as R,d as N}from"./chunk-LVP2TPMO.js";import{A as Be,a as A,e as ve,g as k,l as Ae,p as ke,q as we,t as Ge}from"./chunk-H7K35UUX.js";import{h as w}from"./chunk-NOPMCS2Z.js";import{la as ie}from"./chunk-RUXCS4ZK.js";import{Ab as r,B as Oe,Bb as l,Cb as c,Dc as ae,Ec as $e,F as H,Fc as De,Gb as L,H as O,Hb as $,Jb as j,L as fe,Oc as le,P as he,Pc as v,Q,Qb as m,Ra as d,Rb as g,Sb as S,Tb as Ne,Ub as Pe,V as Ce,Wb as f,Yb as D,_ as p,bb as M,ea as h,fa as C,gb as Re,i as Se,ic as Ie,lc as q,nc as Me,o as Te,oa as _,oc as ye,qc as Z,rc as ee,sc as te,ub as y,vb as b,x as re,y as Ee,yc as be,zb as F,zc as Le}from"./chunk-HNWRQABR.js";var He=new X,Ke=()=>He.group({passphrase:He.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),S(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),S(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),m(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),m(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(F("formGroup",t.encryptionForm),d(8),Z("options",t.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,k,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"sh-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=D().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),S(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"sh-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),S(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"sh-select",12),f("cleared",function(){h(e);let o=D();return C(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){h(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"sh-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();F("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),F("ngModelOptions",Le(6,Ze)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(N);#s=p(R);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=v(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=v(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=v(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(H(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Se;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[be([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return h(o),C(t.next())}),r(2,"h3",7),S(3,1),l(),y(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return h(o),C(t.back())}),m(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),m(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(F("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Ne(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,se,k,A,Ge,ke,ie,xe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(N);#e=p(R);#o=p(oe);#n=p(ve);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=Ke();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=v(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(K,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(K,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(he(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(K,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(K,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),me=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Fe;return Fe=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,ge,Fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return h(o),C(t.submit())}),r(2,"h3",14),S(3,1),l(),r(4,"app-toggle-card",15),L(5,16),S(6,2),$(),r(7,"sh-radio",17),m(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),m(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),S(19,5),$(),r(20,"sh-radio",17),m(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),m(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),L(27,16),S(28,8),$(),r(29,"sh-toggle",25),m(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),m(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return h(o),C(t.goBack())}),m(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),m(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;F("formGroup",t.optionsForm),d(4),F("disallowToggle",!0),d(9),F("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),F("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,k,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,me as b,Ke as c,_e as d,Je as e,de as f,P as g};
1
+ import{a as Ue}from"./chunk-4DNWEJIW.js";import{a as se}from"./chunk-23CWXAU4.js";import{a as ne}from"./chunk-DDWLL7XA.js";import{b as pe}from"./chunk-O64ZZGQZ.js";import{a as Ve}from"./chunk-UIJYCGKA.js";import{a as K}from"./chunk-DELLEGXW.js";import{a as oe}from"./chunk-VTSUHAP5.js";import{a as xe}from"./chunk-UP5EOICU.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-N5SC4SKW.js";import{b as R,d as N}from"./chunk-LVP2TPMO.js";import{A as Be,a as A,e as ve,g as k,l as Ae,p as ke,q as we,t as Ge}from"./chunk-H7K35UUX.js";import{h as w}from"./chunk-NOPMCS2Z.js";import{la as ie}from"./chunk-RUXCS4ZK.js";import{Ab as r,B as Oe,Bb as l,Cb as c,Dc as ae,Ec as $e,F as H,Fc as De,Gb as L,H as O,Hb as $,Jb as j,L as fe,Oc as le,P as he,Pc as v,Q,Qb as m,Ra as d,Rb as g,Sb as S,Tb as Ne,Ub as Pe,V as Ce,Wb as f,Yb as D,_ as p,bb as M,ea as h,fa as C,gb as Re,i as Se,ic as Ie,lc as q,nc as Me,o as Te,oa as _,oc as ye,qc as Z,rc as ee,sc as te,ub as y,vb as b,x as re,y as Ee,yc as be,zb as F,zc as Le}from"./chunk-HNWRQABR.js";var He=new X,Ke=()=>He.group({passphrase:He.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),S(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),S(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),m(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),m(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(F("formGroup",t.encryptionForm),d(8),Z("options",t.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,k,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"sh-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=D().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),S(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"sh-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),S(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"sh-select",12),f("cleared",function(){h(e);let o=D();return C(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){h(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"sh-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();F("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),F("ngModelOptions",Le(6,Ze)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(N);#s=p(R);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=v(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=v(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=v(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(H(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Se;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[be([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return h(o),C(t.next())}),r(2,"h3",7),S(3,1),l(),y(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return h(o),C(t.back())}),m(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),m(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(F("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Ne(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,se,k,A,Ge,ke,ie,xe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(N);#e=p(R);#o=p(oe);#n=p(ve);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=Ke();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=v(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(K,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(K,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(he(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(K,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(K,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),me=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Fe;return Fe=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,ge,Fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return h(o),C(t.submit())}),r(2,"h3",14),S(3,1),l(),r(4,"app-toggle-card",15),L(5,16),S(6,2),$(),r(7,"sh-radio",17),m(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),m(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),S(19,5),$(),r(20,"sh-radio",17),m(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),m(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),L(27,16),S(28,8),$(),r(29,"sh-toggle",25),m(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),m(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return h(o),C(t.goBack())}),m(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),m(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;F("formGroup",t.optionsForm),d(4),F("disallowToggle",!0),d(9),F("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),F("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,k,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,me as b,Ke as c,_e as d,Je as e,de as f,P as g};
@@ -1 +1 @@
1
- import{a,b,c}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"./chunk-N5SC4SKW.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
1
+ import{a,b,c}from"./chunk-MQI3XY6Q.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-N5SC4SKW.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-PN3U7MRX.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-DAYBMF7U.js";import"./chunk-4DNWEJIW.js";import"./chunk-TK5QY2QD.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1 +1 @@
1
- import{a}from"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import"./chunk-N6ABN43N.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-N5SC4SKW.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as OptionsListComponent};
1
+ import{a}from"./chunk-4DNWEJIW.js";import"./chunk-TK5QY2QD.js";import"./chunk-23CWXAU4.js";import"./chunk-DELLEGXW.js";import"./chunk-VTSUHAP5.js";import"./chunk-N5SC4SKW.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as OptionsListComponent};
@@ -1 +1 @@
1
- import{g as ht}from"./chunk-PN3U7MRX.js";import{a as pt,b as Ot,c as Ct,d as mt,e as Rt}from"./chunk-QYI4IMJE.js";import"./chunk-7IQY6U5W.js";import"./chunk-L6CWVBZ6.js";import"./chunk-OMMUXRXE.js";import{a as Dt}from"./chunk-KDYD6LMI.js";import{h as Et}from"./chunk-MSLKIHQQ.js";import"./chunk-N6ABN43N.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import{a as m}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as _t,e as ct,f as ut,g as Tt,i as gt,j as St,s as dt}from"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import{b as nt,d as it}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as ot,b as at,d as st,e as rt,l as Ft,o as lt}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as r,Cb as g,Gb as w,Hb as b,Jb as p,Oc as v,Qb as u,Ra as F,Rb as T,Sb as N,Tb as f,Ub as $,Vb as B,Vc as et,Wb as d,Yb as l,_ as O,bb as j,ea as _,ec as Q,fa as c,fc as q,ia as K,ic as Y,lc as I,mc as k,nc as J,oa as C,qc as A,rc as M,sc as y,ub as D,vb as E,wb as P,xb as x,yb as L,yc as Z,zb as h,zc as tt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var It=["formRef"],Nt=()=>({maxWidth:"700px",width:"100%"});function ft(i,n){if(i&1){let t=p();u(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),r(),T()}if(i&2){let t=l();F(),Y("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function $t(i,n){if(i&1){let t=p();u(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),r(),T()}}function At(i,n){i&1&&(s(0,"sh-alert"),u(1,5),g(2,"sh-icon",31),T(),r())}function Mt(i,n){i&1&&(s(0,"sh-alert",21),u(1,6),g(2,"sh-icon",31),T(),r())}function yt(i,n){if(i&1&&(s(0,"sh-alert",22),u(1,7),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),u(1,8),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function xt(i,n){if(i&1){let t=p();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),u(1,9),g(2,"strong")(3,"br")(4,"span",33),T(),r()}if(i&2){let t,o=l();F(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=p();s(0,"div",39),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),I(2),r(),s(3,"p"),I(4),r()()}if(i&2){let t=n.$implicit;F(2),k(t.displayName),F(2),k(t.description)}}function wt(i,n){if(i&1){let t=p();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),r()}if(i&2){let t=n.$implicit;F(2),J(" ",t.displayName," ")}}function bt(i,n){if(i&1&&(s(0,"div",34),x(1,Lt,5,2,"div",35,P),r(),s(3,"sh-menu",36)(4,"button",37),N(5,10),r(),w(6,19),x(7,wt,3,1,"button",38,P),b(),r()),i&2){let t=l();F(),L(t.destinationTypeOptionsFocused()),F(2),h("searchable",!0),F(4),L(t.destinationTypeOptions())}}function Bt(i,n){if(i&1){let t=p();s(0,"app-single-destination",41),y("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),r()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function kt(i,n){i&1&&(u(0,4,1),g(1,"sh-icon",28),T())}function vt(i,n){i&1&&(u(0,4,2),g(1,"sh-icon"),T())}function Gt(i,n){if(i&1){let t=p();s(0,"sh-dialog",42),y("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),N(3,11),r(),s(4,"sh-alert",22),N(5,12),r()(),s(6,"div",44)(7,"sh-form-field")(8,"textarea",45),y("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),r()()(),s(9,"footer",46)(10,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(11,"Cancel"),r(),s(12,"button",47),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),u(13,13),g(14,"sh-icon"),T(),r()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),h("options",tt(3,Nt)),F(8),A("ngModel",t.targetUrlCtrl)}}var G=class i{#i=O(it);#o=O(nt);#e=O(rt);#a=O(pt);injector=O(K);#t=O(ht);#s=O(Ot);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=C(null);targetUrlInitial=C(null);targetUrlDialogOpen=C(!1);toggleNewDestination=C(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=C(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=v(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=v(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Dt(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let R=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(m,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=j({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&Q(o.formRef,It,5),t&2&&q()},features:[Z([Et,{provide:mt,useClass:Ct}])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=B(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=B(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let R;R=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let W;W=$localize`All destinations`;let z;z=$localize`Edit target URL`;let H;H=$localize`Be careful, this will overwrite everything you have in your destination.`;let X;return X=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,R,U,V,W,z,H,X,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled","loader"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"sh-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["shButton","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=p();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),u(4,2),s(5,"div",16),D(6,ft,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),r(),w(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),r(),D(13,$t,3,0,"button",18),b(),r()(),T(),r(),D(14,At,3,0,"sh-alert")(15,Mt,3,0,"sh-alert",21)(16,yt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,xt,5,1,"p"),r(),D(19,bt,9,1),D(20,Bt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),u(23,3),g(24,"sh-icon"),T(),r(),s(25,"button",27),u(26,4),D(27,kt,2,0,"sh-icon",28)(28,vt,2,0,"sh-icon"),T(),r()()(),D(29,Gt,15,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();F(6),E(e?6:-1),F(7),E(e?13:-1),F(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),F(4),E(e?18:-1),F(),E(e?-1:19),F(),E(e?20:-1),F(5),h("disabled",o.testSignal()=="testing"||!e),F(2),E(o.testSignal()=="testing"?27:28),F(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,dt,St,_t,ct,ut,gt,Tt,Ft,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{G as default};
1
+ import{g as ht}from"./chunk-DAYBMF7U.js";import{a as pt,b as Ot,c as Ct,d as mt,e as Rt}from"./chunk-PJLMDJTH.js";import"./chunk-7IQY6U5W.js";import"./chunk-4DNWEJIW.js";import"./chunk-TK5QY2QD.js";import{a as Dt}from"./chunk-KDYD6LMI.js";import{h as Et}from"./chunk-MQI3XY6Q.js";import"./chunk-23CWXAU4.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import{a as m}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as _t,e as ct,f as ut,g as Tt,i as gt,j as St,s as dt}from"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import{b as nt,d as it}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as ot,b as at,d as st,e as rt,l as Ft,o as lt}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as r,Cb as g,Gb as w,Hb as b,Jb as p,Oc as v,Qb as u,Ra as F,Rb as T,Sb as N,Tb as f,Ub as $,Vb as B,Vc as et,Wb as d,Yb as l,_ as O,bb as j,ea as _,ec as Q,fa as c,fc as q,ia as K,ic as Y,lc as I,mc as k,nc as J,oa as C,qc as A,rc as M,sc as y,ub as D,vb as E,wb as P,xb as x,yb as L,yc as Z,zb as h,zc as tt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var It=["formRef"],Nt=()=>({maxWidth:"700px",width:"100%"});function ft(i,n){if(i&1){let t=p();u(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),r(),T()}if(i&2){let t=l();F(),Y("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function $t(i,n){if(i&1){let t=p();u(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),r(),T()}}function At(i,n){i&1&&(s(0,"sh-alert"),u(1,5),g(2,"sh-icon",31),T(),r())}function Mt(i,n){i&1&&(s(0,"sh-alert",21),u(1,6),g(2,"sh-icon",31),T(),r())}function yt(i,n){if(i&1&&(s(0,"sh-alert",22),u(1,7),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),u(1,8),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function xt(i,n){if(i&1){let t=p();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),u(1,9),g(2,"strong")(3,"br")(4,"span",33),T(),r()}if(i&2){let t,o=l();F(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=p();s(0,"div",39),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),I(2),r(),s(3,"p"),I(4),r()()}if(i&2){let t=n.$implicit;F(2),k(t.displayName),F(2),k(t.description)}}function wt(i,n){if(i&1){let t=p();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),r()}if(i&2){let t=n.$implicit;F(2),J(" ",t.displayName," ")}}function bt(i,n){if(i&1&&(s(0,"div",34),x(1,Lt,5,2,"div",35,P),r(),s(3,"sh-menu",36)(4,"button",37),N(5,10),r(),w(6,19),x(7,wt,3,1,"button",38,P),b(),r()),i&2){let t=l();F(),L(t.destinationTypeOptionsFocused()),F(2),h("searchable",!0),F(4),L(t.destinationTypeOptions())}}function Bt(i,n){if(i&1){let t=p();s(0,"app-single-destination",41),y("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),r()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function kt(i,n){i&1&&(u(0,4,1),g(1,"sh-icon",28),T())}function vt(i,n){i&1&&(u(0,4,2),g(1,"sh-icon"),T())}function Gt(i,n){if(i&1){let t=p();s(0,"sh-dialog",42),y("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),N(3,11),r(),s(4,"sh-alert",22),N(5,12),r()(),s(6,"div",44)(7,"sh-form-field")(8,"textarea",45),y("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),r()()(),s(9,"footer",46)(10,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(11,"Cancel"),r(),s(12,"button",47),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),u(13,13),g(14,"sh-icon"),T(),r()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),h("options",tt(3,Nt)),F(8),A("ngModel",t.targetUrlCtrl)}}var G=class i{#i=O(it);#o=O(nt);#e=O(rt);#a=O(pt);injector=O(K);#t=O(ht);#s=O(Ot);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=C(null);targetUrlInitial=C(null);targetUrlDialogOpen=C(!1);toggleNewDestination=C(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=C(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=v(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=v(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Dt(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let R=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(m,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=j({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&Q(o.formRef,It,5),t&2&&q()},features:[Z([Et,{provide:mt,useClass:Ct}])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=B(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=B(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let R;R=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let W;W=$localize`All destinations`;let z;z=$localize`Edit target URL`;let H;H=$localize`Be careful, this will overwrite everything you have in your destination.`;let X;return X=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,R,U,V,W,z,H,X,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled","loader"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"sh-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["shButton","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=p();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),u(4,2),s(5,"div",16),D(6,ft,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),r(),w(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),r(),D(13,$t,3,0,"button",18),b(),r()(),T(),r(),D(14,At,3,0,"sh-alert")(15,Mt,3,0,"sh-alert",21)(16,yt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,xt,5,1,"p"),r(),D(19,bt,9,1),D(20,Bt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),u(23,3),g(24,"sh-icon"),T(),r(),s(25,"button",27),u(26,4),D(27,kt,2,0,"sh-icon",28)(28,vt,2,0,"sh-icon"),T(),r()()(),D(29,Gt,15,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();F(6),E(e?6:-1),F(7),E(e?13:-1),F(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),F(4),E(e?18:-1),F(),E(e?-1:19),F(),E(e?20:-1),F(5),h("disabled",o.testSignal()=="testing"||!e),F(2),E(o.testSignal()=="testing"?27:28),F(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,dt,St,_t,ct,ut,gt,Tt,Ft,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{G as default};