@duplicati/ngclient 0.0.225 → 0.0.227
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.
- package/assets/images/backup-from-config.png +0 -0
- package/assets/images/backup-from-remote.png +0 -0
- package/assets/sh-bold.woff2 +0 -0
- package/assets/sh.woff2 +0 -0
- package/assets/ship.css +2 -0
- package/chunk--rqB0ojD.js +2 -0
- package/chunk-5zEiKCqR.js +1 -0
- package/chunk-B-ryE8KW.js +2 -0
- package/chunk-B6nCQM-G.js +1 -0
- package/chunk-B6ugJDDx.js +1 -0
- package/chunk-B7PRtY7v.js +1 -0
- package/chunk-B88MJ6Up.js +1 -0
- package/chunk-BAbAUjHY.js +2 -0
- package/chunk-BCT9ajP9.js +1 -0
- package/chunk-BKLJMYh2.js +1 -0
- package/chunk-BMGXb3gX.js +1 -0
- package/chunk-BNf0YAwH.js +2 -0
- package/chunk-BOII3Fdm.js +1 -0
- package/chunk-BPpheyQK.js +2 -0
- package/chunk-BS8yAz3P.js +2 -0
- package/chunk-BUF3tczf.js +14 -0
- package/chunk-BYoKu9PJ.js +1 -0
- package/chunk-BaWD8G-f.js +1 -0
- package/chunk-BeAI10wv.js +1 -0
- package/chunk-BffC_BAn.js +2 -0
- package/chunk-BjNuU0J_.js +2 -0
- package/chunk-BlIcwFlf.js +1 -0
- package/chunk-BqjWEFHw.js +1 -0
- package/chunk-BthLY9tf.js +1 -0
- package/chunk-BuyCr2eD.js +1 -0
- package/chunk-BxxX98wy.js +2 -0
- package/chunk-Bzp0ULy_.js +61 -0
- package/chunk-C-G3pKB4.js +2 -0
- package/chunk-C08PrcBX.js +1 -0
- package/chunk-C4pJCbq-.js +1 -0
- package/chunk-CDRHCSvU.js +2 -0
- package/chunk-CJRbWZfg.js +2 -0
- package/chunk-CM11IMzh.js +1 -0
- package/chunk-CMs999gl.js +2 -0
- package/chunk-CU-RYihf.js +2 -0
- package/chunk-CUxvfCTH.js +2 -0
- package/chunk-Cc1_FUvV.js +1 -0
- package/chunk-CdZVal1F.js +2 -0
- package/chunk-CeFh90sX.js +1 -0
- package/chunk-ChwFViRh.js +1 -0
- package/chunk-ClHWI9-i.js +2 -0
- package/chunk-ClfSJEUJ.js +1 -0
- package/chunk-CnAb3OKU.js +1 -0
- package/chunk-CtLFpDTP.js +3 -0
- package/chunk-CuU6b3lp.js +2 -0
- package/chunk-Cw8vFX0e.js +1 -0
- package/chunk-CxPG-KgI.js +3 -0
- package/chunk-Cz4OqhOZ.js +1 -0
- package/chunk-D-epCTmE.js +1 -0
- package/chunk-D0t-kgLy.js +2 -0
- package/chunk-DNJQ-AbV.js +3 -0
- package/chunk-DNSvQk_3.js +2 -0
- package/chunk-DWwNINBJ.js +2 -0
- package/chunk-DddAUzMY.js +1 -0
- package/chunk-DnD9XTM4.js +2 -0
- package/chunk-Do6_xsGi.js +4 -0
- package/chunk-DofVJ9gn.js +1 -0
- package/chunk-Dt8gZPT-.js +2 -0
- package/chunk-DtQIjLqL.js +1 -0
- package/chunk-DuO9_dH0.js +1 -0
- package/chunk-G-I5c1Dk.js +2 -0
- package/chunk-IEVZ0UN6.js +1 -0
- package/chunk-M5tldLvJ.js +1 -0
- package/chunk-N7vpDAsp.js +2 -0
- package/chunk-PA5BGFyW.js +1 -0
- package/chunk-QlYDF-EM.js +1 -0
- package/chunk-SWsliUUy.js +4 -0
- package/chunk-SgcWXTYZ.js +2 -0
- package/chunk-XMwSOila.js +1 -0
- package/chunk-ZVDEaGd0.js +1 -0
- package/chunk-birClroL.js +2 -0
- package/chunk-bx0aDvCZ.js +2 -0
- package/chunk-g_QJ3SVt.js +2 -0
- package/chunk-r4LfAQnM.js +3 -0
- package/chunk-wycXedbJ.js +2 -0
- package/chunk-ySdaWJYB.js +2 -0
- package/chunk-ya_5JcKA.js +1 -0
- package/index.html +2 -2
- package/locale/messages.da.json +11 -20
- package/locale/messages.de.json +110 -85
- package/locale/messages.de_CH.json +86 -61
- package/locale/messages.de_DE.json +160 -92
- package/locale/messages.en.json +173 -63
- package/locale/messages.en_US.json +922 -0
- package/locale/messages.fr.json +86 -61
- package/locale/messages.fr_CA.json +160 -92
- package/locale/messages.fr_FR.json +160 -92
- package/locale/messages.it.json +91 -66
- package/locale/messages.it_IT.json +160 -92
- package/locale/messages.json +173 -63
- package/locale/messages.nl_BE.json +160 -92
- package/locale/messages.nl_NL.json +177 -111
- package/locale/messages.pl.json +22 -45
- package/locale/messages.zh-Hans.json +222 -85
- package/locale/messages.zh-Hant.json +222 -85
- package/locale/messages.zh.json +222 -85
- package/locale/messages.zh_CN.json +225 -88
- package/locale/messages.zh_HK.json +222 -85
- package/locale/messages.zh_TW.json +643 -19
- package/main-TZVLLK67.js +16 -0
- package/package.json +1 -1
- package/ship-ui-assets/mcp/components.json +4369 -2788
- package/styles-WQUFQGYX.css +1 -0
- package/chunk-2EX5HS5X.js +0 -1
- package/chunk-2KD757N6.js +0 -1
- package/chunk-2YUSBRXY.js +0 -1
- package/chunk-35FMFK4I.js +0 -1
- package/chunk-3DHD6GQL.js +0 -1
- package/chunk-3HYQMG65.js +0 -2
- package/chunk-3PARK7B7.js +0 -1
- package/chunk-3V25RAVK.js +0 -1
- package/chunk-4ISFDBI3.js +0 -2
- package/chunk-5FQ7HESA.js +0 -1
- package/chunk-5QGFYH2A.js +0 -3
- package/chunk-5UJN5SN4.js +0 -2
- package/chunk-6DX35WDO.js +0 -1
- package/chunk-6Q6SSTBK.js +0 -1
- package/chunk-6WX2UOAN.js +0 -1
- package/chunk-7CGTOI24.js +0 -1
- package/chunk-7VQ67PEZ.js +0 -1
- package/chunk-A23UTI46.js +0 -1
- package/chunk-AR5SEBWX.js +0 -1
- package/chunk-B4QFOJXL.js +0 -1
- package/chunk-BPHX6VXP.js +0 -1
- package/chunk-CJKZ27FM.js +0 -1
- package/chunk-COEGVUM3.js +0 -1
- package/chunk-CQJRBQ6I.js +0 -1
- package/chunk-E4CYVUYG.js +0 -1
- package/chunk-EBKOJDCT.js +0 -1
- package/chunk-EVEI25GQ.js +0 -2
- package/chunk-EXAZ4QZR.js +0 -1
- package/chunk-G7TNRWOU.js +0 -1
- package/chunk-GA3CAVSK.js +0 -2
- package/chunk-GKAMSAN5.js +0 -1
- package/chunk-GNKCBZMS.js +0 -1
- package/chunk-HDDAGHHE.js +0 -2
- package/chunk-HLHUPBCV.js +0 -1
- package/chunk-HPXIWKIK.js +0 -1
- package/chunk-HS3UDQIJ.js +0 -1
- package/chunk-HWOUAWOE.js +0 -1
- package/chunk-IDJ52K34.js +0 -1
- package/chunk-ITN4L52Q.js +0 -1
- package/chunk-J7GH3G72.js +0 -1
- package/chunk-JBX7YYME.js +0 -1
- package/chunk-JCXT6U5P.js +0 -1
- package/chunk-JNZJE3GC.js +0 -1
- package/chunk-K5XGRFWJ.js +0 -4
- package/chunk-KGK4RY3J.js +0 -1
- package/chunk-KNSQLQC6.js +0 -1
- package/chunk-KUNX5APQ.js +0 -1
- package/chunk-KX3UP3HV.js +0 -1
- package/chunk-KZYRTI62.js +0 -1
- package/chunk-LXTSZI4K.js +0 -1
- package/chunk-MKI54WTC.js +0 -1
- package/chunk-MSIH2OJ5.js +0 -1
- package/chunk-N5XYG3QW.js +0 -1
- package/chunk-NE255HQN.js +0 -1
- package/chunk-NQAD2FBX.js +0 -1
- package/chunk-NUV5LHQV.js +0 -1
- package/chunk-O2HQIEE4.js +0 -1
- package/chunk-O2L2FRYE.js +0 -11
- package/chunk-OP7MDR2B.js +0 -1
- package/chunk-OSGHJCUU.js +0 -1
- package/chunk-OYU6OBKA.js +0 -1
- package/chunk-P2EIEVFT.js +0 -1
- package/chunk-PDZNQW6F.js +0 -1
- package/chunk-PEOYNJJM.js +0 -1
- package/chunk-PMF4FTBF.js +0 -1
- package/chunk-PNQ5BDQN.js +0 -1
- package/chunk-PNRFCYAE.js +0 -2
- package/chunk-POVWDK74.js +0 -1
- package/chunk-QW23XWNE.js +0 -1
- package/chunk-SKLSR5GH.js +0 -1
- package/chunk-T7RMSUHE.js +0 -1
- package/chunk-TSVSMVY4.js +0 -1
- package/chunk-TV7OB7Y4.js +0 -1
- package/chunk-TWWAK5M6.js +0 -1
- package/chunk-TXCVGOPN.js +0 -2
- package/chunk-UIVZWXBK.js +0 -1
- package/chunk-UNQKMTFM.js +0 -1
- package/chunk-V2M5YF4E.js +0 -1
- package/chunk-V2UO7ES2.js +0 -1
- package/chunk-VOXTAZLZ.js +0 -1
- package/chunk-VQLI7RDY.js +0 -60
- package/chunk-VTOEFKZG.js +0 -1
- package/chunk-VZNLMGYP.js +0 -2
- package/chunk-XUCXLLB4.js +0 -1
- package/chunk-XWML36YQ.js +0 -1
- package/chunk-Y47NRSCA.js +0 -1
- package/chunk-YF6JHIN5.js +0 -1
- package/chunk-YS4B2B5N.js +0 -1
- package/chunk-ZGQ2WCM2.js +0 -1
- package/chunk-ZSAEIKEB.js +0 -1
- package/chunk-ZXBKGNJU.js +0 -1
- package/main-S64CL44W.js +0 -1
- package/styles-S2CJL4OY.css +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {y,F,m}from'./chunk-IEVZ0UN6.js';import {r as rn,S as Se,m as mt$1,_ as _t$1}from'./chunk-BAbAUjHY.js';import {I}from'./chunk-BPpheyQK.js';import {J}from'./chunk-birClroL.js';import'./chunk-bx0aDvCZ.js';import {F as Fe$1,P as Pe,b as Ce,C,g,d as d$1,w as we$1,E as Ee,V as Ve,A as Ae,G,M as Me$1}from'./chunk-CtLFpDTP.js';import {N as Nt$1,m as m$2}from'./chunk-CxPG-KgI.js';import {v as ve}from'./chunk-B-ryE8KW.js';import {x}from'./chunk-CDRHCSvU.js';import'./chunk-CMs999gl.js';import {D}from'./chunk-CdZVal1F.js';import {T,e as ee,aw as W,m as m$1,B as y1,U as Ue,G as Ga$1,N as Nt,d as dw,v,f as N,u as ue,Q as Qi$1,F as Fg,X as XT,H as Hl,o as oT,O as Og,j as mg,P as Pg,p as DD,z as gg,D as DE,i as iT,y as TD,t as tC,$ as $g,K as lC,a6 as be,k as gT,q as PC,aP as Ul,aQ as Wl,s as sm,I as Qg,w as im,c9 as E,C as Bu,aZ as ee$1,af as m1,b as g1,L as oC,ak as cm,al as BC,ac as h1,ai as m$3,aj as l,l as HC,a1 as cT,a2 as lT,bH as Te,ca as Iy,aG as pt$1,aV as ry,ay as $u,a$ as Vs,b0 as ty,at as h,bs as ei,_ as _t,ab as C$2,bM as vy,cb as Ju,n as nC,S as Sd,x as xd,bw as eE,Y as iC,a3 as QC,ae as Jr$1,c5 as I1,aJ as ci$1,bY as ie,bX as V,bf as ig,aD as zC,c6 as Bg,cc as go$1,bi as H,cd as Ns$1,ce as Ss$1,cf as S,ao as $C,ar as Wp,aC as hg,ap as sT,bv as sb,cg as Nr$1,bx as N$1,a4 as aT,aa as Gl,h as bC,ag as zg,bt as uC,a_ as ZC,ch as KC,bu as Ig,aF as YC,E as nm,bz as TC,aB as rm}from'./main-TZVLLK67.js';import {f}from'./chunk-DWwNINBJ.js';import {C as C$1}from'./chunk-CUxvfCTH.js';import {O}from'./chunk-C4pJCbq-.js';import {d}from'./chunk-BjNuU0J_.js';import'./chunk-CU-RYihf.js';import {F as Fe,A as Ae$1}from'./chunk-Do6_xsGi.js';import {j as jn,m as me$1,G as Gn,T as Tn,Z as Ze$1,R as Rn,P as Pn,g as gn,h as hn,L,B as Bn,J as Jt$1,l as ln$1,f as ft,e as en$1,y as yt,b as m$4,D as D$1}from'./chunk-BOII3Fdm.js';import {a as at$1}from'./chunk-BffC_BAn.js';import {L as L$1,$,F as F$1}from'./chunk-M5tldLvJ.js';var Jt=class i{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return `${t}${e}`}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ee$1({token:i,factory:i.\u0275fac,providedIn:"root"})};function pt(i){if(Nr$1(i))return i();if(Array.isArray(i))return i.map(t=>pt(t));if(typeof i=="object"&&i!==null){let t={};for(let e in i)i.hasOwnProperty(e)&&(t[e]=pt(i[e]));return t}return i}var _i=i=>i;function ii(i,t){let e=go$1(i,_i,t?.equal),n=e[H],o=e;return o.set=a=>{let l=e();return Ns$1(n,a),()=>{Ns$1(n,l);}},o.update=a=>{let l=e();return Ss$1(n,a),()=>{Ns$1(n,l);}},e}var ot=class i{#e=T(E);isSaving=Ue(false);resourceDestinations=$({stream:()=>this.#e.getApiV2ConnectionStrings()});destinations=ii(()=>{let t=this.resourceDestinations.value()?.Data;return t||[]});save(t,e){return this.isSaving.set(true),e.Description="",(t==="new"?this.#e.postApiV2ConnectionStrings({requestBody:e}):this.#e.putApiV2ConnectionStringById({id:t.ID,requestBody:e})).pipe(Bu(()=>{this.isSaving.set(false);}))}getById(t){return this.#e.getApiV2ConnectionStringById({id:t})}delete(t){return this.#e.deleteApiV2ConnectionStringById({id:t})}reload(){this.resourceDestinations.reload();}updateBackups(t,e){return this.#e.postApiV2ConnectionStringByIdUpdateBackups({id:t,requestBody:{BackupIDs:e}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ee$1({token:i,factory:i.\u0275fac,providedIn:"root"})};var di=["daysRef"];function ci(i,t){if(i&1&&PC(0),i&2){let e=nC();Gl(" - ",e.getMonthName(e.getLastVisibleMonth())," ");}}function ui(i,t){if(i&1&&(Qi$1(0,"div"),PC(1),Hl()),i&2){let e=t.$implicit;DE(),nm(e);}}function pi(i,t){if(i&1){let e=gT();Qi$1(0,"button",9,1),Fg("keydown",function(o){let a=Sd(e).$implicit,l=nC(2);return xd(l.onKeydown(o,a))})("click",function(){let o=Sd(e).$implicit,a=uC(1),l=nC(2);return xd(l.setDate(o,a))}),PC(2),Hl();}if(i&2){let e=t.$implicit,n=nC().$implicit,o=nC();bC(o.isDateSelected(e)),Qg("out-of-scope",!o.isCurrentMonth(e,n)),hg("aria-label",o.getAriaLabel(e))("tabindex",o.getTabIndex(e))("aria-selected",o.isDateSelectedBool(e)),DE(2),Gl(" ",e.getDate()," ");}}function mi(i,t){if(i&1&&(Qi$1(0,"article",7),mg(1,"div",10),Hl()),i&2){let e=nC(2);DE(),TC(e.selectedDateStylePosition());}}function gi(i,t){if(i&1&&(Qi$1(0,"div",5)(1,"nav",6),cT(2,ui,2,1,"div",null,sT),Hl(),Qi$1(4,"div",7,0),cT(6,pi,3,8,"button",8,sT),oT(8,mi,2,2,"article",7),Hl()()),i&2){let e=t.$implicit,n=nC();DE(2),lT(n.weekdays()),DE(4),lT(n.getMonthDates(e)),DE(2),iT(n.asRange()?-1:8);}}var Ci=[[["label"]],[["","prefix",""]],[["","textPrefix",""]],[["input"]],[["","textSuffix",""]],[["","suffix",""]]],Ti=["label","[prefix]","[textPrefix]","input","[textSuffix]","[suffix]"],hi=["ngProjectAs","label",5,["label"]],fi=["ngProjectAs","[prefix]",5,["","prefix",""]],Si=["ngProjectAs","[textPrefix]",5,["","textPrefix",""]],Ei=["ngProjectAs","[textSuffix]",5,["","textSuffix",""]],yi=["ngProjectAs","[suffix]",5,["","suffix",""]];function Fi(i,t){if(i&1&&(Qi$1(0,"div",3),PC(1),Hl()),i&2){let e=nC();DE(),Gl(" ",e._maskedDate()," ");}}function Ni(i,t){if(i&1){let e=gT();Qi$1(0,"sh-datepicker",7),Fg("dateChange",function(o){Sd(e);let a=nC();return xd(a.onDateChange(o))})("tabbedOut",function(){Sd(e);let o=nC();return xd(o.isOpen.set(false))}),Hl();}if(i&2){let e=nC();bC(e.currentClass()),gg("date",e.internalDate());}}function Di(i,t){}var Ii=`sh-daterange-input sh-form-field-popover .input-wrap .input,sh-datepicker-input sh-form-field-popover .input-wrap .input{display:grid;grid-template-columns:1fr auto auto;align-items:center}sh-daterange-input sh-form-field-popover .input-wrap .input.active-start input:first-of-type,sh-datepicker-input sh-form-field-popover .input-wrap .input.active-start input:first-of-type{color:var(--primary-8)}sh-daterange-input sh-form-field-popover .input-wrap .input.active-end input:last-of-type,sh-datepicker-input sh-form-field-popover .input-wrap .input.active-end input:last-of-type{color:var(--primary-8)}sh-daterange-input sh-form-field-popover .input-wrap [suffix],sh-datepicker-input sh-form-field-popover .input-wrap [suffix]{margin-right:.75rem}sh-daterange-input sh-form-field-popover .masked-value,sh-datepicker-input sh-form-field-popover .masked-value{font:var(--paragraph-30B);color:var(--base-8);display:flex;gap:.25rem}sh-daterange-input sh-form-field-popover .masked-value.active-start .start-val,sh-datepicker-input sh-form-field-popover .masked-value.active-start .start-val{color:var(--primary-8)}sh-daterange-input sh-form-field-popover .masked-value.active-end .end-val,sh-datepicker-input sh-form-field-popover .masked-value.active-end .end-val{color:var(--primary-8)}sh-daterange-input sh-form-field-popover .masked-value+input+input,sh-daterange-input sh-form-field-popover .masked-value+input,sh-datepicker-input sh-form-field-popover .masked-value+input+input,sh-datepicker-input sh-form-field-popover .masked-value+input{opacity:0;height:0;width:0;margin:0}sh-daterange-input sh-form-field-popover [suffix]+[suffix].default-indicator,sh-datepicker-input sh-form-field-popover [suffix]+[suffix].default-indicator{display:none}sh-daterange-input sh-datepicker,sh-datepicker-input sh-datepicker{z-index:10000;position:relative;--dp-width: 15rem}sh-daterange-input sh-popover .popover-content{--dp-width: 18.75rem;min-width:var(--dp-width)}sh-daterange-input sh-form-field-popover.columns-1 sh-popover .popover-content{--dp-width: 18.75rem }sh-daterange-input sh-form-field-popover.columns-2 sh-popover .popover-content{--dp-width: 38.5rem }sh-daterange-input sh-form-field-popover.columns-3 sh-popover .popover-content{--dp-width: 58.25rem }sh-datepicker-input.sharp sh-datepicker,sh-daterange-input.sharp sh-datepicker,sh-datepicker.sharp{--dp-sel-s: var(--shape-1);--dp-ar: 1/.8;--dp-day-g: .5rem 0}sh-datepicker{--dp-sel-bg: var(--base-8);--dp-sel-bw: 0;--dp-sel-bc: transparent;--dp-sel-s: 50%;--dp-sel-c: #fff;--dp-day-c: var(--base-8);--dp-day-g: .25rem 0;--dp-day-f: var(--paragraph-20);--dp-width: 18.75rem;--dp-ar: 1/1;width:100%;padding:.5rem;max-width:var(--dp-width);display:flex;flex-direction:column}sh-datepicker.disabled{opacity:.5;pointer-events:none;-webkit-user-select:none;user-select:none;cursor:initial}sh-datepicker.columns-1{--dp-width: 18.75rem }sh-datepicker.columns-2{--dp-width: 38.5rem }sh-datepicker.columns-3{--dp-width: 58.25rem }sh-datepicker.columns-4{--dp-width: 78rem }sh-datepicker.columns-5{--dp-width: 97.75rem }sh-datepicker.columns-6{--dp-width: 117.5rem }sh-datepicker.columns-7{--dp-width: 137.25rem }sh-datepicker.columns-8{--dp-width: 157rem }sh-datepicker.columns-9{--dp-width: 176.75rem }sh-datepicker.columns-10{--dp-width: 196.5rem }sh-datepicker.columns-11{--dp-width: 216.25rem }sh-datepicker.columns-12{--dp-width: 236rem }sh-datepicker.as-range section .days>div.sel,sh-datepicker.as-range section .days>button.sel{background:var(--dp-sel-bg);opacity:.5;border-radius:0}sh-datepicker.as-range section .days>div.month-start,sh-datepicker.as-range section .days>div.week-start,sh-datepicker.as-range section .days>div.first,sh-datepicker.as-range section .days>button.month-start,sh-datepicker.as-range section .days>button.week-start,sh-datepicker.as-range section .days>button.first{border-top-left-radius:var(--dp-sel-s);border-bottom-left-radius:var(--dp-sel-s)}sh-datepicker.as-range section .days>div.month-end,sh-datepicker.as-range section .days>div.week-end,sh-datepicker.as-range section .days>div.last,sh-datepicker.as-range section .days>button.month-end,sh-datepicker.as-range section .days>button.week-end,sh-datepicker.as-range section .days>button.last{border-top-right-radius:var(--dp-sel-s);border-bottom-right-radius:var(--dp-sel-s)}sh-datepicker.as-range section .days>div.first,sh-datepicker.as-range section .days>div.last,sh-datepicker.as-range section .days>button.first,sh-datepicker.as-range section .days>button.last{opacity:1}sh-datepicker.as-range .month .days>div.out-of-scope,sh-datepicker.as-range .month .days>button.out-of-scope{opacity:0;pointer-events:none}sh-datepicker header{display:flex;align-items:center;justify-content:space-between;padding:.25rem 0;gap:0}sh-datepicker header .title{font:var(--paragraph-20)}sh-datepicker header button{appearance:none;background-color:transparent;border:0;cursor:pointer;height:2rem;color:var(--base-8)}sh-datepicker header button:focus{outline:none}sh-datepicker .months-container{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:1rem}sh-datepicker .month{display:grid;grid-template-columns:repeat(7,1fr);grid-template-rows:1fr 6fr;gap:var(--dp-day-g);align-items:flex-start}sh-datepicker .month .days,sh-datepicker .month .weekdays{display:grid;grid-column:1/-1;gap:var(--dp-day-g);grid-template-columns:subgrid;position:relative}sh-datepicker .month .days>.days,sh-datepicker .month .weekdays>.days{position:absolute;top:0;left:0;width:100%;height:100%;display:grid;grid-template-columns:repeat(7,1fr);grid-template-rows:repeat(7,1fr);gap:var(--dp-day-g);z-index:0}sh-datepicker .month .days>div,sh-datepicker .month .days>button,sh-datepicker .month .weekdays>div,sh-datepicker .month .weekdays>button{appearance:none;background:transparent;border:none;padding:0;margin:0;display:flex;align-items:center;justify-content:center;aspect-ratio:var(--dp-ar);cursor:pointer;position:relative;z-index:1;color:var(--dp-day-c);font:var(--dp-day-f);-webkit-user-select:none;user-select:none;border-radius:var(--dp-sel-s)}sh-datepicker .month .days>div:focus-visible,sh-datepicker .month .days>button:focus-visible,sh-datepicker .month .weekdays>div:focus-visible,sh-datepicker .month .weekdays>button:focus-visible{outline:2px solid var(--primary-10, #005fcc);outline-offset:-2px}sh-datepicker .month .days>div.sel,sh-datepicker .month .days>button.sel,sh-datepicker .month .weekdays>div.sel,sh-datepicker .month .weekdays>button.sel{color:var(--dp-sel-c);transition:color 75ms linear}sh-datepicker .month .days>div.out-of-scope,sh-datepicker .month .days>button.out-of-scope,sh-datepicker .month .weekdays>div.out-of-scope,sh-datepicker .month .weekdays>button.out-of-scope{opacity:.4}sh-datepicker .month .days>div.sel-el,sh-datepicker .month .days>button.sel-el,sh-datepicker .month .weekdays>div.sel-el,sh-datepicker .month .weekdays>button.sel-el{position:relative;top:0;left:0;transition:transform 75ms linear,opacity 75ms linear;background:var(--dp-sel-bg);border-radius:var(--dp-sel-s);border:var(--dp-sel-bw) solid var(--dp-sel-bc);opacity:0;box-sizing:border-box}sh-datepicker .month .weekdays>div{color:var(--base-12)}sh-datepicker.primary{--dp-sel-bg: var(--primary-8)}sh-datepicker.accent{--dp-sel-bg: var(--accent-8)}sh-datepicker.warn{--dp-sel-bg: var(--warn-8)}sh-datepicker.error{--dp-sel-bg: var(--error-8)}sh-datepicker.success{--dp-sel-bg: var(--success-8)}sh-datepicker.raised{--dp-sel-bg: var(--base-g2)}sh-datepicker.raised.primary{--dp-sel-bg: var(--primary-g2)}sh-datepicker.raised.accent{--dp-sel-bg: var(--accent-g2)}sh-datepicker.raised.warn{--dp-sel-bg: var(--warn-g2)}sh-datepicker.raised.error{--dp-sel-bg: var(--error-g2)}sh-datepicker.raised.success{--dp-sel-bg: var(--success-g2)}
|
|
2
|
+
`;var ln=(()=>{class i{constructor(){this.#e=new Date(new Date().setHours(0,0,0,0)),this.date=m1(null),this.endDate=m1(null),this.asRange=g1(false),this.activeRangeSelection=g1(null),this.monthsToShow=g1(1),this.disabled=g1(false),this.tabbedOut=h1(),this.startOfWeek=g1(1),this.weekdayLabels=g1(["Su","Mo","Tu","We","Th","Fr","Sa"]),this.daysRef=y1("daysRef"),this.currentDate=Ue(this.date()??this.#e),this.#t=T(N$1),this.prevMonthShortcut=Nt(()=>{let e="datepicker.prev-month",n=this.#t.getShortcut(e);return n?this.#t.getDisplayShortcut(e)||n:null}),this.nextMonthShortcut=Nt(()=>{let e="datepicker.next-month",n=this.#t.getShortcut(e);return n?this.#t.getDisplayShortcut(e)||n:null}),this.monthOffsets=Nt(()=>Array.from({length:this.monthsToShow()},(e,n)=>n)),this.selectedDateStylePosition=Ue(null),this.weekdays=Nt(()=>{let e=this.startOfWeek(),n=this.weekdayLabels();return n.slice(e).concat(n.slice(0,e))}),this.currentClasses=ie(),this.someEffect=Ga$1(()=>{this.currentClasses();this.#o();}),this.#n=Ga$1(()=>{this.monthsToShow()>1||this.#i();}),this.focusedDate=Ue(null),this.#a=T(Jr$1);}#e;#t;getLastVisibleMonth(){let e=this.monthsToShow()-1;return this.getOffsetDate(e)}getOffsetDate(e){let n=new Date(this.currentDate());return n.setMonth(n.getMonth()+e),n}getMonthDates(e){let n=this.getOffsetDate(e);return this.#r(n,this.startOfWeek())}#n;ngOnInit(){this.monthsToShow()!==1&&this.#i();}#i(){let e=this.date();e&&!isNaN(e.getTime())&&this.currentDate.set(e),this.#o();}#o(){setTimeout(()=>{let e=this.daysRef()?.nativeElement.querySelector(".sel");if(!e)return this.selectedDateStylePosition.update(n=>n?m$3(l({},n),{opacity:"0"}):null);this.setSelectedDateStylePosition(e);});}#r(e,n){let o=e.getFullYear(),a=e.getMonth(),l=new Date(o,a,1).getDay(),c=new Date(o,a+1,0).getDate(),u=[],T=l-n;T<0&&(T+=7);let N=new Date(o,a,0).getDate();for(let R=T-1;R>=0;R--)u.push(new Date(o,a-1,N-R,0,0,0,0));for(let R=1;R<=c;R++)u.push(new Date(o,a,R,0,0,0,0));let y=1;for(;u.length%7!==0;)u.push(new Date(o,a+1,y++,0,0,0,0));return u}nextMonth(){this.currentDate.update(e=>{let n=new Date(e);return n.setMonth(e.getMonth()+1),n}),this.#o();}previousMonth(){this.currentDate.update(e=>{let n=new Date(e);return n.setMonth(e.getMonth()-1),n}),this.#o();}setDate(e,n){this.focusedDate.set(e);let o=(a,l)=>{let c=0,u=0,T=0,N=0;return l&&((typeof l=="string"||typeof l=="number")&&(l=new Date(l)),l instanceof Date&&!isNaN(l.getTime())&&(c=l.getHours(),u=l.getMinutes(),T=l.getSeconds(),N=l.getMilliseconds())),new Date(a.getFullYear(),a.getMonth(),a.getDate(),c,u,T,N)};if(!this.asRange())this.date.set(o(e,this.date())),this.endDate.set(null);else {let a=this.date(),l=this.endDate(),c=this.activeRangeSelection();if(c==="start"){let u=o(e,a);this.date.set(u),l&&u>l&&this.endDate.set(null);}else if(c==="end")if(!a||e<a){let u=o(e,a);this.date.set(u),this.endDate.set(null);}else {let u=o(e,l);this.endDate.set(u);}else if(a)if(l){let u=o(e,a);this.date.set(u),this.endDate.set(null);}else if(e<a){let u=o(e,a);this.date.set(u),this.endDate.set(null);}else {let u=o(e,l);this.endDate.set(u);}else {let u=o(e,a);this.date.set(u);}}this.asRange()||this.setSelectedDateStylePosition(n);}isDateSelected(e){let n=this.date(),o=this.endDate();if((typeof n=="string"||typeof n=="number")&&(n=new Date(n)),(typeof o=="string"||typeof o=="number")&&(o=new Date(o)),!n||!(n instanceof Date)||isNaN(n.getTime()))return null;let a=y=>new Date(y.getFullYear(),y.getMonth(),y.getDate(),0,0,0,0),l=y=>new Date(y.getFullYear(),y.getMonth(),y.getDate(),23,59,59,999),c=a(e),u=a(n),T=o?l(o):null,N=[];if(this.asRange())if(T===null)c.getTime()===u.getTime()&&N.push("sel first last");else {if(c.getTime()===u.getTime()&&N.push("first"),c.getTime()===a(T).getTime()&&N.push("last"),c>=u&&c<=T){N.push("sel");let J=c.getDay(),X=this.startOfWeek();J===X&&N.push("week-start");let V=(X+6)%7;J===V&&N.push("week-end");}let y=new Date(c);y.setDate(c.getDate()+1),new Date(c).setDate(c.getDate()-1);let U=c.getDate()===1,A=y.getMonth()!==c.getMonth();U&&N.push("month-start"),A&&N.push("month-end");}else c.getTime()===u.getTime()&&N.push("sel");return N.join(" ")||null}setSelectedDateStylePosition(e){this.selectedDateStylePosition.set({transform:`translate(${e.offsetLeft}px, ${e.offsetTop}px)`,opacity:"1"});}getMonthName(e){return e.toLocaleString("default",{month:"long"})}getFullYear(e){return e.getFullYear()}isCurrentMonth(e,n){let o=this.getOffsetDate(n);return e.getMonth()===o.getMonth()}#a;isSameDay(e,n){return !e||!n?false:e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()}getAriaLabel(e){return e.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"})}getTabIndex(e){let n=this.focusedDate(),o=this.date(),a=new Date;return n?this.isSameDay(e,n)?0:-1:o?this.isSameDay(e,o)?0:-1:this.isSameDay(e,a)?0:-1}isDateSelectedBool(e){let n=this.isDateSelected(e);return n?n.includes("sel"):false}onKeydown(e,n){let o=new Date(n),a=false;this.#t.matches(e,"datepicker.prev-month")?(o.setMonth(n.getMonth()-1),a=true):this.#t.matches(e,"datepicker.next-month")?(o.setMonth(n.getMonth()+1),a=true):this.#t.matches(e,"datepicker.prev-year")?(o.setFullYear(n.getFullYear()-1),a=true):this.#t.matches(e,"datepicker.next-year")?(o.setFullYear(n.getFullYear()+1),a=true):this.#t.matches(e,"datepicker.month-start")?(o=new Date(n.getFullYear(),n.getMonth(),1,0,0,0,0),a=true):this.#t.matches(e,"datepicker.month-end")?(o=new Date(n.getFullYear(),n.getMonth()+1,0,0,0,0,0),a=true):this.#t.matches(e,"datepicker.day-next")?(o.setDate(n.getDate()+1),a=true):this.#t.matches(e,"datepicker.day-prev")?(o.setDate(n.getDate()-1),a=true):this.#t.matches(e,"datepicker.week-next")?(o.setDate(n.getDate()+7),a=true):this.#t.matches(e,"datepicker.week-prev")&&(o.setDate(n.getDate()-7),a=true),a&&(e.preventDefault(),this.ensureDateVisible(o),this.focusedDate.set(o),setTimeout(()=>{let l=this.#a.nativeElement.querySelectorAll("button");if(l){let c=this.getAriaLabel(o),u=null;for(let T=0;T<l.length&&!(l[T].getAttribute("aria-label")===c&&(u=l[T],!l[T].classList.contains("out-of-scope")));T++);u&&u.focus();}}));}ensureDateVisible(e){let n=this.currentDate(),o=this.getLastVisibleMonth();if(e<new Date(n.getFullYear(),n.getMonth(),1))this.currentDate.set(new Date(e.getFullYear(),e.getMonth(),1)),this.#o();else if(e>new Date(o.getFullYear(),o.getMonth()+1,0)){let a=new Date(e);a.setMonth(a.getMonth()-this.monthsToShow()+1),a.setDate(1),this.currentDate.set(a),this.#o();}}focusActiveDate(){setTimeout(()=>{let e=this.#a.nativeElement.querySelector('button[tabindex="0"]');e&&e.focus();},50);}onFocusOut(e){setTimeout(()=>{let n=document.activeElement;n&&n!==document.body&&!this.#a.nativeElement.contains(n)&&this.tabbedOut.emit();});}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=dw({type:i,selectors:[["sh-datepicker"]],viewQuery:function(n,o){n&1&&$g(o.daysRef,di,5),n&2&&lC();},hostVars:6,hostBindings:function(n,o){n&1&&Fg("focusout",function(l){return o.onFocusOut(l)}),n&2&&(bC("columns-"+o.monthsToShow()),Qg("as-range",o.asRange())("disabled",o.disabled()));},inputs:{date:[1,"date"],endDate:[1,"endDate"],asRange:[1,"asRange"],activeRangeSelection:[1,"activeRangeSelection"],monthsToShow:[1,"monthsToShow"],disabled:[1,"disabled"],startOfWeek:[1,"startOfWeek"],weekdayLabels:[1,"weekdayLabels"]},outputs:{date:"dateChange",endDate:"endDateChange",tabbedOut:"tabbedOut"},decls:14,vars:5,consts:[["daysRef",""],["elementRef",""],["tabindex","-1",3,"click"],[1,"title"],[1,"months-container"],[1,"month"],[1,"weekdays"],[1,"days"],["type","button",3,"out-of-scope","class"],["type","button",3,"keydown","click"],[1,"sel-el"]],template:function(n,o){n&1&&(Qi$1(0,"header")(1,"button",2),Fg("click",function(){return o.previousMonth()}),Qi$1(2,"sh-icon"),PC(3,"caret-left"),Hl()(),Qi$1(4,"div",3),PC(5),oT(6,ci,1,1),PC(7),Hl(),Qi$1(8,"button",2),Fg("click",function(){return o.nextMonth()}),Qi$1(9,"sh-icon"),PC(10,"caret-right"),Hl()()(),Qi$1(11,"section",4),cT(12,gi,9,1,"div",5,aT),Hl()),n&2&&(DE(),hg("aria-keyshortcuts",o.prevMonthShortcut()),DE(4),Gl(" ",o.getMonthName(o.currentDate())," "),DE(),iT(o.monthsToShow()>1?6:-1),DE(),Gl(" ",o.getFullYear(o.currentDate())," "),DE(),hg("aria-keyshortcuts",o.nextMonthShortcut()),DE(4),lT(o.monthOffsets()));},dependencies:[N],styles:[`sh-daterange-input sh-form-field-popover .input-wrap .input,sh-datepicker-input sh-form-field-popover .input-wrap .input{display:grid;grid-template-columns:1fr auto auto;align-items:center}sh-daterange-input sh-form-field-popover .input-wrap .input.active-start input:first-of-type,sh-datepicker-input sh-form-field-popover .input-wrap .input.active-start input:first-of-type{color:var(--primary-8)}sh-daterange-input sh-form-field-popover .input-wrap .input.active-end input:last-of-type,sh-datepicker-input sh-form-field-popover .input-wrap .input.active-end input:last-of-type{color:var(--primary-8)}sh-daterange-input sh-form-field-popover .input-wrap [suffix],sh-datepicker-input sh-form-field-popover .input-wrap [suffix]{margin-right:.75rem}sh-daterange-input sh-form-field-popover .masked-value,sh-datepicker-input sh-form-field-popover .masked-value{font:var(--paragraph-30B);color:var(--base-8);display:flex;gap:.25rem}sh-daterange-input sh-form-field-popover .masked-value.active-start .start-val,sh-datepicker-input sh-form-field-popover .masked-value.active-start .start-val{color:var(--primary-8)}sh-daterange-input sh-form-field-popover .masked-value.active-end .end-val,sh-datepicker-input sh-form-field-popover .masked-value.active-end .end-val{color:var(--primary-8)}sh-daterange-input sh-form-field-popover .masked-value+input+input,sh-daterange-input sh-form-field-popover .masked-value+input,sh-datepicker-input sh-form-field-popover .masked-value+input+input,sh-datepicker-input sh-form-field-popover .masked-value+input{opacity:0;height:0;width:0;margin:0}sh-daterange-input sh-form-field-popover [suffix]+[suffix].default-indicator,sh-datepicker-input sh-form-field-popover [suffix]+[suffix].default-indicator{display:none}sh-daterange-input sh-datepicker,sh-datepicker-input sh-datepicker{z-index:10000;position:relative;--dp-width: 15rem}sh-daterange-input sh-popover .popover-content{--dp-width: 18.75rem;min-width:var(--dp-width)}sh-daterange-input sh-form-field-popover.columns-1 sh-popover .popover-content{--dp-width: 18.75rem }sh-daterange-input sh-form-field-popover.columns-2 sh-popover .popover-content{--dp-width: 38.5rem }sh-daterange-input sh-form-field-popover.columns-3 sh-popover .popover-content{--dp-width: 58.25rem }sh-datepicker-input.sharp sh-datepicker,sh-daterange-input.sharp sh-datepicker,sh-datepicker.sharp{--dp-sel-s: var(--shape-1);--dp-ar: 1/.8;--dp-day-g: .5rem 0}sh-datepicker{--dp-sel-bg: var(--base-8);--dp-sel-bw: 0;--dp-sel-bc: transparent;--dp-sel-s: 50%;--dp-sel-c: #fff;--dp-day-c: var(--base-8);--dp-day-g: .25rem 0;--dp-day-f: var(--paragraph-20);--dp-width: 18.75rem;--dp-ar: 1/1;width:100%;padding:.5rem;max-width:var(--dp-width);display:flex;flex-direction:column}sh-datepicker.disabled{opacity:.5;pointer-events:none;-webkit-user-select:none;user-select:none;cursor:initial}sh-datepicker.columns-1{--dp-width: 18.75rem }sh-datepicker.columns-2{--dp-width: 38.5rem }sh-datepicker.columns-3{--dp-width: 58.25rem }sh-datepicker.columns-4{--dp-width: 78rem }sh-datepicker.columns-5{--dp-width: 97.75rem }sh-datepicker.columns-6{--dp-width: 117.5rem }sh-datepicker.columns-7{--dp-width: 137.25rem }sh-datepicker.columns-8{--dp-width: 157rem }sh-datepicker.columns-9{--dp-width: 176.75rem }sh-datepicker.columns-10{--dp-width: 196.5rem }sh-datepicker.columns-11{--dp-width: 216.25rem }sh-datepicker.columns-12{--dp-width: 236rem }sh-datepicker.as-range section .days>div.sel,sh-datepicker.as-range section .days>button.sel{background:var(--dp-sel-bg);opacity:.5;border-radius:0}sh-datepicker.as-range section .days>div.month-start,sh-datepicker.as-range section .days>div.week-start,sh-datepicker.as-range section .days>div.first,sh-datepicker.as-range section .days>button.month-start,sh-datepicker.as-range section .days>button.week-start,sh-datepicker.as-range section .days>button.first{border-top-left-radius:var(--dp-sel-s);border-bottom-left-radius:var(--dp-sel-s)}sh-datepicker.as-range section .days>div.month-end,sh-datepicker.as-range section .days>div.week-end,sh-datepicker.as-range section .days>div.last,sh-datepicker.as-range section .days>button.month-end,sh-datepicker.as-range section .days>button.week-end,sh-datepicker.as-range section .days>button.last{border-top-right-radius:var(--dp-sel-s);border-bottom-right-radius:var(--dp-sel-s)}sh-datepicker.as-range section .days>div.first,sh-datepicker.as-range section .days>div.last,sh-datepicker.as-range section .days>button.first,sh-datepicker.as-range section .days>button.last{opacity:1}sh-datepicker.as-range .month .days>div.out-of-scope,sh-datepicker.as-range .month .days>button.out-of-scope{opacity:0;pointer-events:none}sh-datepicker header{display:flex;align-items:center;justify-content:space-between;padding:.25rem 0;gap:0}sh-datepicker header .title{font:var(--paragraph-20)}sh-datepicker header button{appearance:none;background-color:transparent;border:0;cursor:pointer;height:2rem;color:var(--base-8)}sh-datepicker header button:focus{outline:none}sh-datepicker .months-container{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:1rem}sh-datepicker .month{display:grid;grid-template-columns:repeat(7,1fr);grid-template-rows:1fr 6fr;gap:var(--dp-day-g);align-items:flex-start}sh-datepicker .month .days,sh-datepicker .month .weekdays{display:grid;grid-column:1/-1;gap:var(--dp-day-g);grid-template-columns:subgrid;position:relative}sh-datepicker .month .days>.days,sh-datepicker .month .weekdays>.days{position:absolute;top:0;left:0;width:100%;height:100%;display:grid;grid-template-columns:repeat(7,1fr);grid-template-rows:repeat(7,1fr);gap:var(--dp-day-g);z-index:0}sh-datepicker .month .days>div,sh-datepicker .month .days>button,sh-datepicker .month .weekdays>div,sh-datepicker .month .weekdays>button{appearance:none;background:transparent;border:none;padding:0;margin:0;display:flex;align-items:center;justify-content:center;aspect-ratio:var(--dp-ar);cursor:pointer;position:relative;z-index:1;color:var(--dp-day-c);font:var(--dp-day-f);-webkit-user-select:none;user-select:none;border-radius:var(--dp-sel-s)}sh-datepicker .month .days>div:focus-visible,sh-datepicker .month .days>button:focus-visible,sh-datepicker .month .weekdays>div:focus-visible,sh-datepicker .month .weekdays>button:focus-visible{outline:2px solid var(--primary-10, #005fcc);outline-offset:-2px}sh-datepicker .month .days>div.sel,sh-datepicker .month .days>button.sel,sh-datepicker .month .weekdays>div.sel,sh-datepicker .month .weekdays>button.sel{color:var(--dp-sel-c);transition:color 75ms linear}sh-datepicker .month .days>div.out-of-scope,sh-datepicker .month .days>button.out-of-scope,sh-datepicker .month .weekdays>div.out-of-scope,sh-datepicker .month .weekdays>button.out-of-scope{opacity:.4}sh-datepicker .month .days>div.sel-el,sh-datepicker .month .days>button.sel-el,sh-datepicker .month .weekdays>div.sel-el,sh-datepicker .month .weekdays>button.sel-el{position:relative;top:0;left:0;transition:transform 75ms linear,opacity 75ms linear;background:var(--dp-sel-bg);border-radius:var(--dp-sel-s);border:var(--dp-sel-bw) solid var(--dp-sel-bc);opacity:0;box-sizing:border-box}sh-datepicker .month .weekdays>div{color:var(--base-12)}sh-datepicker.primary{--dp-sel-bg: var(--primary-8)}sh-datepicker.accent{--dp-sel-bg: var(--accent-8)}sh-datepicker.warn{--dp-sel-bg: var(--warn-8)}sh-datepicker.error{--dp-sel-bg: var(--error-8)}sh-datepicker.success{--dp-sel-bg: var(--success-8)}sh-datepicker.raised{--dp-sel-bg: var(--base-g2)}sh-datepicker.raised.primary{--dp-sel-bg: var(--primary-g2)}sh-datepicker.raised.accent{--dp-sel-bg: var(--accent-g2)}sh-datepicker.raised.warn{--dp-sel-bg: var(--warn-g2)}sh-datepicker.raised.error{--dp-sel-bg: var(--error-g2)}sh-datepicker.raised.success{--dp-sel-bg: var(--success-g2)}
|
|
3
|
+
`],encapsulation:2});}}return i})(),oi=(()=>{class i{constructor(){this.#e=T(Jr$1),this.ngControl=I1(m$4),this.#t=T(ci$1),this.#n=Ue(null),this.masking=g1("mediumDate"),this.closed=h1(),this._maskedDate=Nt(()=>{let e=this.internalDate(),n=this.masking();return n?e?this.#t.transform(e,n):null:e}),this.internalDate=Ue(null),this.isOpen=m1(false),this.currentClass=ie(),this.#i=V("#input-wrap input"),this.datepicker=y1(ln),this.#o=Ga$1(()=>{this.isOpen()&&setTimeout(()=>{this.datepicker()?.focusActiveDate();},50);}),this.#r=Ga$1(()=>{let e=this.#i();if(!e.length)return;let n=e[0];n&&(this.#a(n),n.addEventListener("inputValueChanged",o=>{let a=o.detail.value;if(!a){this.internalDate.set(null);return}let l=new Date(a);if(isNaN(l.getTime())&&typeof a=="string"&&/^(\d{2}):(\d{2})/.test(a)){let c=a.match(/^(\d{2}):(\d{2})(?::(\d{2}))?/);if(c){let u=this.internalDate()||new Date;l=new Date(u),l.setHours(parseInt(c[1],10),parseInt(c[2],10),c[3]?parseInt(c[3],10):0,0);}}isNaN(l.getTime())||this.internalDate.set(l);}),n.addEventListener("focus",()=>{this.isOpen.set(true);}),this.#n.set(n),n.autocomplete="off",typeof n.value=="string"&&this.internalDate.set(n.value?new Date(n.value):null));});}#e;#t;#n;#i;#o;onFocusOut(e){setTimeout(()=>{let n=document.activeElement;n&&n!==document.body&&!this.#e.nativeElement.contains(n)&&this.isOpen.set(false);});}onDateChange(e){this.internalDate.set(e);let n=this.ngControl()?.control;if(n)n.setValue(e);else {let o=this.#n();o&&(o.value=e?e.toString():"",o.dispatchEvent(new Event("input")));}}close(){this.closed.emit(this.internalDate());}#r;#a(e){return Object.defineProperty(e,"value",{configurable:true,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(n){Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,n);let a=new CustomEvent("inputValueChanged",{bubbles:true,cancelable:true,detail:{value:n}});return this.dispatchEvent(a),n}}),e}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=dw({type:i,selectors:[["sh-datepicker-input"]],contentQueries:function(n,o,a){n&1&&Bg(a,o.ngControl,m$4,5),n&2&&lC();},viewQuery:function(n,o){n&1&&$g(o.datepicker,ln,5),n&2&&lC();},hostBindings:function(n,o){n&1&&Fg("focusout",function(l){return o.onFocusOut(l)});},inputs:{masking:[1,"masking"],isOpen:[1,"isOpen"]},outputs:{closed:"closed",isOpen:"isOpenChange"},features:[zC([ci$1])],ngContentSelectors:Ti,decls:15,vars:3,consts:[["defaultIndicator",""],[3,"closed","isOpenChange","isOpen"],["id","input-wrap","ngProjectAs","input",5,["input"],1,"input"],[1,"masked-value"],["suffix","",1,"default-indicator"],["popoverContent",""],[3,"date","class"],[3,"dateChange","tabbedOut","date"]],template:function(n,o){if(n&1){let a=gT();oC(Ci),Qi$1(0,"sh-form-field-popover",1),Fg("closed",function(){return o.close()}),sm("isOpenChange",function(c){return Sd(a),HC(o.isOpen,c)||(o.isOpen=c),xd(c)}),iC(1,0,hi),iC(2,1,fi),iC(3,2,Si),Qi$1(4,"div",2),oT(5,Fi,2,1,"div",3),iC(6,3),Hl(),iC(7,4,Ei),iC(8,5,yi),Qi$1(9,"sh-icon",4),PC(10,"calendar"),Hl(),Qi$1(11,"div",5),oT(12,Ni,1,3,"sh-datepicker",6),Hl()(),ig(13,Di,0,0,"ng-template",null,0,sb);}n&2&&(im("isOpen",o.isOpen),DE(5),iT(o.masking()?5:-1),DE(7),iT(o.isOpen()?12:-1));},dependencies:[ln,Ae$1,N],styles:[Ii],encapsulation:2});}}return i})();function Ai(i,t){if(i&1){let e=gT();Qi$1(0,"div",26)(1,"sh-form-field")(2,"label",27),XT(3,7),Hl(),Qi$1(4,"input",28,0),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.nextTime.time,o)||(a.scheduleFields.nextTime.time=o),xd(o)}),Hl(),DD(),Qi$1(6,"sh-icon",29),PC(7,"clock"),Hl()(),Qi$1(8,"sh-datepicker-input",30)(9,"label",31),PC(10,"\xA0"),Hl(),Qi$1(11,"input",32,1),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.nextTime.date,o)||(a.scheduleFields.nextTime.date=o),xd(o)}),Hl(),DD(),Qi$1(13,"sh-icon",29),PC(14,"calendar"),Hl()()(),Qi$1(15,"div",26)(16,"sh-form-field")(17,"label",33),XT(18,8),Hl(),Qi$1(19,"input",34),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.repeatValue,o)||(a.scheduleFields.runAgain.repeatValue=o),xd(o)}),Hl(),DD(),Hl(),Qi$1(20,"sh-select",35)(21,"input",36),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.repeatUnit,o)||(a.scheduleFields.runAgain.repeatUnit=o),xd(o)}),Hl(),DD(),Hl()(),Qi$1(22,"sh-toggle-card",37),Ul(23,38),XT(24,9),Wl(),Qi$1(25,"div",39)(26,"sh-toggle",24),Og(27,10),Qi$1(28,"input",25),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.allowedDays.mon,o)||(a.scheduleFields.runAgain.allowedDays.mon=o),xd(o)}),Hl(),DD(),Pg(),Hl(),Qi$1(29,"sh-toggle",24),Og(30,11),Qi$1(31,"input",25),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.allowedDays.tue,o)||(a.scheduleFields.runAgain.allowedDays.tue=o),xd(o)}),Hl(),DD(),Pg(),Hl(),Qi$1(32,"sh-toggle",24),Og(33,12),Qi$1(34,"input",25),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.allowedDays.wed,o)||(a.scheduleFields.runAgain.allowedDays.wed=o),xd(o)}),Hl(),DD(),Pg(),Hl(),Qi$1(35,"sh-toggle",24),Og(36,13),Qi$1(37,"input",25),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.allowedDays.thu,o)||(a.scheduleFields.runAgain.allowedDays.thu=o),xd(o)}),Hl(),DD(),Pg(),Hl(),Qi$1(38,"sh-toggle",24),Og(39,14),Qi$1(40,"input",25),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.allowedDays.fri,o)||(a.scheduleFields.runAgain.allowedDays.fri=o),xd(o)}),Hl(),DD(),Pg(),Hl(),Qi$1(41,"sh-toggle",24),Og(42,15),Qi$1(43,"input",25),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.allowedDays.sat,o)||(a.scheduleFields.runAgain.allowedDays.sat=o),xd(o)}),Hl(),DD(),Pg(),Hl(),Qi$1(44,"sh-toggle",24),Og(45,16),Qi$1(46,"input",25),sm("ngModelChange",function(o){Sd(e);let a=nC(2);return HC(a.scheduleFields.runAgain.allowedDays.sun,o)||(a.scheduleFields.runAgain.allowedDays.sun=o),xd(o)}),Hl(),DD(),Pg(),Hl()()();}if(i&2){let e=nC(2);DE(4),im("ngModel",e.scheduleFields.nextTime.time),TD(),DE(7),im("ngModel",e.scheduleFields.nextTime.date),TD(),DE(8),im("ngModel",e.scheduleFields.runAgain.repeatValue),TD(),DE(),gg("options",e.unitOptions)("isClearable",false),DE(),im("ngModel",e.scheduleFields.runAgain.repeatUnit),TD(),DE(),gg("disableToggle",true),DE(6),im("ngModel",e.scheduleFields.runAgain.allowedDays.mon),TD(),DE(3),im("ngModel",e.scheduleFields.runAgain.allowedDays.tue),TD(),DE(3),im("ngModel",e.scheduleFields.runAgain.allowedDays.wed),TD(),DE(3),im("ngModel",e.scheduleFields.runAgain.allowedDays.thu),TD(),DE(3),im("ngModel",e.scheduleFields.runAgain.allowedDays.fri),TD(),DE(3),im("ngModel",e.scheduleFields.runAgain.allowedDays.sat),TD(),DE(3),im("ngModel",e.scheduleFields.runAgain.allowedDays.sun),TD();}}function Oi(i,t){if(i&1){let e=gT();Qi$1(0,"div",23)(1,"sh-toggle",24),Og(2,5),Qi$1(3,"input",25),sm("ngModelChange",function(o){Sd(e);let a=nC();return HC(a.scheduleFields.autoRun,o)||(a.scheduleFields.autoRun=o),xd(o)}),Hl(),DD(),Pg(),Hl(),Qi$1(4,"p"),XT(5,6),Hl()(),oT(6,Ai,47,14);}if(i&2){let e=nC();DE(3),im("ngModel",e.scheduleFields.autoRun),TD(),DE(3),iT(e.scheduleFields.autoRun()?6:-1);}}var Pi=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],Xt=[{key:$localize`Daily 13:00`,value:"daily",data:{autoRun:true,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:true,tue:true,wed:true,thu:true,fri:true,sat:true,sun:true}}}},{key:$localize`Weekdays 13:00`,value:"weekdays",data:{autoRun:true,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:true,tue:true,wed:true,thu:true,fri:true,sat:false,sun:false}}}},{key:$localize`Weekly monday 13:00`,value:"weekly",data:{autoRun:true,nextTime:{time:"13:00:00",date:Mi().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"W",allowedDays:{mon:true,tue:false,wed:false,thu:false,fri:false,sat:false,sun:false}}}},{key:$localize`Don't run automatically`,value:"disabled",data:{autoRun:false,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:true,tue:true,wed:true,thu:true,fri:true,sat:true,sun:true}}}},{key:$localize`Custom`,value:"custom",data:{autoRun:true,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:true,tue:true,wed:true,thu:true,fri:true,sat:true,sun:true}}}}];function ai(i){if(!i.autoRun)return null;let t=[i.runAgain.allowedDays.mon?"Monday":null,i.runAgain.allowedDays.tue?"Tuesday":null,i.runAgain.allowedDays.wed?"Wednesday":null,i.runAgain.allowedDays.thu?"Thursday":null,i.runAgain.allowedDays.fri?"Friday":null,i.runAgain.allowedDays.sat?"Saturday":null,i.runAgain.allowedDays.sun?"Sunday":null].filter(l=>l!==null),e=i.nextTime.time.split(":"),n=new Date(i.nextTime.date);n.setHours(parseInt(e[0])),n.setMinutes(parseInt(e[1]));let o=i.runAgain.repeatValue,a=i.runAgain.repeatUnit;return {Time:n.toISOString(),Repeat:`${o}${a}`,AllowedDays:t}}function Mi(){let i=new Date,t=i.getDay(),e=t===1?7:(8-t)%7;return i.setDate(i.getDate()+e),i.setHours(12,0,0,0),i}var dn=()=>({autoRun:Ue(true),nextTime:{time:Ue("13:00"),date:Ue(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:Ue(1),repeatUnit:Ue("D"),allowedDays:{mon:Ue(true),tue:Ue(true),wed:Ue(true),thu:Ue(true),fri:Ue(true),sat:Ue(true),sun:Ue(true)}}}),_n=class i{#e=T(we);#t=T(ee);#n=T(W);unitOptions=Pi;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=Xt;updateScheduleType(t){let e=Xt.find(n=>n.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let n=e.data;this.scheduleFields.autoRun.set(n.autoRun??false),this.scheduleFields.nextTime.time.set(n.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(n.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(n.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(n.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(n.runAgain?.allowedDays?.mon??true),this.scheduleFields.runAgain.allowedDays.tue.set(n.runAgain?.allowedDays?.tue??true),this.scheduleFields.runAgain.allowedDays.wed.set(n.runAgain?.allowedDays?.wed??true),this.scheduleFields.runAgain.allowedDays.thu.set(n.runAgain?.allowedDays?.thu??true),this.scheduleFields.runAgain.allowedDays.fri.set(n.runAgain?.allowedDays?.fri??true),this.scheduleFields.runAgain.allowedDays.sat.set(n.runAgain?.allowedDays?.sat??true),this.scheduleFields.runAgain.allowedDays.sun.set(n.runAgain?.allowedDays?.sun??true);}else this.scheduleType.set("custom");}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent});}next(){this.#e.shouldAutoSave()&&this.#e.submit(true),this.#t.navigate(["options"],{relativeTo:this.#n.parent});}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let n;n=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize` Automatically run backups ${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:TAG_INPUT:`;let l;l=$localize`If a date was missed, the job will run as soon as possible.`;let c;c=$localize`Next time`;let u;u=$localize`Run again every`;let T;T=$localize`Allowed days`;let N;N=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let y;y=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let R;R=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let A;A=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let X;return X=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,o,a,l,c,u,T,N,y,R,U,A,J,X,[1,"title-30"],["label","key","value","value",3,"isClearable","options"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","ngModel"],["suffix",""],[1,"primary","sharp"],["for","date"],["type","text","id","date",3,"ngModelChange","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disableToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(Qi$1(0,"h3",17),XT(1,2),Hl(),Qi$1(2,"sh-select",18)(3,"input",19),Fg("ngModelChange",function(a){return n.updateScheduleType(a)}),Hl(),DD(),Hl(),oT(4,Oi,7,2),Qi$1(5,"div",20)(6,"button",21),Fg("click",function(){return n.goBack()}),Og(7,3),mg(8,"sh-icon"),Pg(),Hl(),Qi$1(9,"button",22),Fg("click",function(){return n.next()}),Og(10,4),mg(11,"sh-icon"),Pg(),Hl()()),e&2&&(DE(2),gg("isClearable",false)("options",n.scheduleOptions),DE(),gg("ngModel",n.scheduleType()),TD(),DE(),iT(n.scheduleType()==="custom"?4:-1));},dependencies:[Bn,Ze$1,en$1,yt,Rn,Jt$1,Fe,J,N,v,Nt$1,I,oi],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"]})};var xi=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],bi=["[title]","[description]","[action]","*"];function Ri(i,t){i&1&&PC(0,"Title");}function vi(i,t){i&1&&(Qi$1(0,"sh-icon"),PC(1,"caret-down"),Hl());}var Qe=class i{isActive=m1(false);disableToggle=g1(false);ngOnInit(){this.disableToggle()&&this.isActive.set(true);}toggle(){this.isActive.set(!this.isActive());}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,n){e&2&&Qg("active",n.isActive());},inputs:{isActive:[1,"isActive"],disableToggle:[1,"disableToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:bi,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(e,n){e&1&&(oC(xi),Qi$1(0,"header")(1,"div",0)(2,"h3",1),Fg("click",function(){return n.disableToggle()||n.toggle()}),iC(3,0,null,Ri,1,0),oT(5,vi,2,0,"sh-icon"),Hl(),iC(6,1),Hl(),Qi$1(7,"div",2),iC(8,2),Hl()(),Qi$1(9,"div",3),iC(10,3),Hl()),e&2&&(DE(5),iT(n.disableToggle()?-1:5));},dependencies:[N],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-2)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.25rem;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1 0}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]:empty{display:none}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"]})};var Li=["textInput"];function wi(i,t){if(i&1){let e=gT();Qi$1(0,"sh-select",3)(1,"input",7),sm("ngModelChange",function(o){Sd(e);let a=nC();return HC(a.internalPath,o)||(a.internalPath=o),xd(o)}),Fg("ngModelChange",function(){Sd(e);let o=nC();return xd(o.updateFilter())}),Hl(),DD(),Hl();}if(i&2){let e=nC();gg("options",e.fileGroupOptions())("isClearable",false)("selectMultiple",true),DE(),im("ngModel",e.internalPath),TD();}}function ki(i,t){if(i&1&&(Qi$1(0,"div",8),PC(1),Hl()),i&2){let e=nC(2);DE(),nm(e.currentExpressionOption()?.startsWith);}}function Gi(i,t){if(i&1&&(Qi$1(0,"div",9),PC(1),Hl()),i&2){let e=nC(2);DE(),nm(e.currentExpressionOption()?.endsWith);}}function $i(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field",4)(1,"input",7,0),sm("ngModelChange",function(o){Sd(e);let a=nC();return HC(a.internalPath,o)||(a.internalPath=o),xd(o)}),Fg("ngModelChange",function(){Sd(e);let o=nC();return xd(o.updateFilter())}),Hl(),DD(),oT(3,ki,2,1,"div",8),oT(4,Gi,2,1,"div",9),Hl();}if(i&2){let e=nC();DE(),im("ngModel",e.internalPath),TD(),DE(2),iT(e.currentExpressionOption()?.startsWith?.length?3:-1),DE(),iT(e.currentExpressionOption()?.endsWith?.length?4:-1);}}var Ui=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],Vi=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Includes folders where name contains",value:"+FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Includes folder",value:"+Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Includes files where name contains",value:"+FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Include file extension",value:"+Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Include file groups",value:"+FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Wt=class i{#e=T(Te);path=g1.required();osType=g1();isNew=g1(false);pathChange=h1();remove=h1();internalPath=Ue("");pathType=Ue("-Expression");textInput=y1("textInput");currentExpressionOption=Nt(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=Ue(Ui);expressionOptions=Nt(()=>{let e=this.osType()==="Windows"?"\\":"/";return Vi.map(n=>n.value==="-Folder"||n.value==="+Folder"?m$3(l({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?m$3(l({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?m$3(l({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?m$3(l({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?m$3(l({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?m$3(l({},n),{startsWith:"*.",endsWith:""}):m$3(l({},n),{startsWith:"",endsWith:""}))});pathEffect=Ga$1(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",o=this.osType()==="Windows",a=o?"\\":"/";e.startsWith("%")&&e.endsWith(a)||o&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e)),this.isNew()&&eE(()=>{this.focusInput();},{injector:this.#e});});focusInput(){let t=this.textInput()?.nativeElement;t&&(t.focus(),t.select());}updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&(t==="*"&&(t=""),this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`));}removeFilter(){this.remove.emit();}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-new-filter"]],viewQuery:function(e,n){e&1&&$g(n.textInput,Li,5),e&2&&lC();},inputs:{path:[1,"path"],osType:[1,"osType"],isNew:[1,"isNew"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["textInput",""],["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["boxPrefix",""],["boxSuffix",""]]},template:function(e,n){e&1&&(Qi$1(0,"sh-select",1)(1,"input",2),sm("ngModelChange",function(a){return HC(n.pathType,a)||(n.pathType=a),a}),Fg("ngModelChange",function(){return n.updateFilter()}),Hl(),DD(),Hl(),oT(2,wi,2,4,"sh-select",3)(3,$i,5,3,"sh-form-field",4),Qi$1(4,"div",5),Fg("click",function(){return n.removeFilter()}),Qi$1(5,"sh-icon",6),PC(6,"x-circle"),Hl()()),e&2&&(gg("options",n.expressionOptions())("isClearable",false),DE(),im("ngModel",n.pathType),TD(),DE(),iT(n.currentExpressionOption()?.value=="-FileGroup"||n.currentExpressionOption()?.value=="+FileGroup"?2:3));},dependencies:[Bn,Ze$1,Rn,Jt$1,Nt$1,Fe,N],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"]})};var Bi=["filtersContainer"],Ki=()=>({updateOn:"blur",standalone:true});function zi(i,t){if(i&1){let e=gT();Qi$1(0,"button",15),Fg("click",function(){Sd(e);let o=nC();return xd(o.addFilter())}),Og(1,3),mg(2,"sh-icon"),Pg(),Hl();}}function Ji(i,t){i&1&&XT(0,2,1);}function Xi(i,t){i&1&&XT(0,2,2);}function Wi(i,t){i&1&&(Qi$1(0,"p",13),XT(1,4),Hl());}function Hi(i,t){i&1&&(Qi$1(0,"p",13),XT(1,5),Hl());}function ji(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field")(1,"textarea",16),sm("ngModelChange",function(o){Sd(e);let a=nC();return HC(a.bulkFilters,o)||(a.bulkFilters=o),xd(o)}),Fg("ngModelChange",function(){Sd(e);let o=nC();return xd(o.saveBulkFilterEdit())}),Hl(),DD(),Hl();}if(i&2){let e=nC();DE(),im("ngModel",e.bulkFilters),gg("ngModelOptions",QC(2,Ki)),TD();}}function qi(i,t){if(i&1){let e=gT();Qi$1(0,"app-new-filter",18),Fg("pathChange",function(o){let a=Sd(e).$index,l=nC(2);return xd(l.updateFilterAt(o,a))})("remove",function(){let o=Sd(e).$index,a=nC(2);return xd(a.removeFilterAt(o))}),Hl();}if(i&2){let e=t.$implicit,n=t.$index,o=nC(2);gg("path",e)("osType",o.osType())("isNew",o.lastAddedIndex()===n);}}function Yi(i,t){if(i&1&&(Qi$1(0,"div",14,0),cT(2,qi,1,3,"app-new-filter",17,sT),Hl()),i&2){let e=nC();DE(2),lT(e.filters());}}var Ht=class i{#e=T(Te);filters=m1.required();osType=g1("");disableToggle=g1(true);bulkFilterEditMode=Ue(false);bulkFilters=Ue("");lastAddedIndex=Ue(null);filtersContainer=y1.required("filtersContainer");hasFilters=Nt(()=>this.filters().length>0);toggleBulkFilterEdit(){this.bulkFilterEditMode()?this.bulkFilterEditMode.set(false):(this.bulkFilters.set(this.filters().join(`
|
|
4
|
+
`)),this.bulkFilterEditMode.set(true));}saveBulkFilterEdit(){let t=this.bulkFilters().split(`
|
|
5
|
+
`).map(n=>n.trim()).filter(n=>n!==""&&(n.startsWith("-")||n.startsWith("+"))),e=[...new Set(t)];this.filters.set(e),this.bulkFilterEditMode.set(false);}addFilter(){let t=this.filters(),e=t.length;this.filters.set([...t,"-*"]),this.lastAddedIndex.set(e),eE(()=>{this.scrollToFilter(e);},{injector:this.#e});}scrollToFilter(t){let e=this.filtersContainer()?.nativeElement;if(!e)return;let n=e.querySelectorAll("app-new-filter");n[t]&&n[t].scrollIntoView({behavior:"smooth",block:"nearest"});}updateFilterAt(t,e){let o=[...this.filters()];o[e]=t,this.filters.set(o),this.lastAddedIndex.set(null);}removeFilterAt(t){let n=this.filters().filter((o,a)=>a!==t);this.filters.set(n),this.lastAddedIndex.set(null);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-filters"]],viewQuery:function(e,n){e&1&&$g(n.filtersContainer,Bi,5),e&2&&lC();},inputs:{filters:[1,"filters"],osType:[1,"osType"],disableToggle:[1,"disableToggle"]},outputs:{filters:"filtersChange"},decls:20,vars:5,consts:()=>{let t;t=$localize`Filters`;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*15:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*15:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let n;n=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add filter `;let o;o=$localize`Customize your filters.`;let a;return a=$localize`Edit filters as text, one per line.`,[["filtersContainer",""],t,e,n,o,a,[3,"disableToggle"],["title",""],[1,"spacer"],["type","button","shButton","",1,"small"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],["description",""],[1,"filters"],["type","button","shButton","",1,"small",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[3,"path","osType","isNew"],[3,"pathChange","remove","path","osType","isNew"]]},template:function(e,n){e&1&&(Qi$1(0,"app-toggle-card",6),Ul(1,7),Qi$1(2,"span"),XT(3,1),Hl(),mg(4,"div",8),oT(5,zi,3,0,"button",9),Qi$1(6,"sh-menu")(7,"button",10)(8,"sh-icon"),PC(9,"dots-three-vertical"),Hl()(),Ul(10,11),Qi$1(11,"button",12),Fg("click",function(){return n.toggleBulkFilterEdit()}),Og(12,2),mg(13,"sh-icon"),oT(14,Ji,1,0)(15,Xi,1,0),Pg(),Hl(),Wl(),Hl(),Wl(),oT(16,Wi,2,0,"p",13)(17,Hi,2,0,"p",13),oT(18,ji,2,3,"sh-form-field")(19,Yi,4,0,"div",14),Hl()),e&2&&(gg("disableToggle",n.disableToggle()),DE(5),iT(n.bulkFilterEditMode()?-1:5),DE(9),iT(n.bulkFilterEditMode()?14:15),DE(2),iT(n.bulkFilterEditMode()?17:16),DE(2),iT(n.bulkFilterEditMode()?18:19));},dependencies:[Bn,Ze$1,Rn,Jt$1,v,N,ve,Fe,Qe,Wt],styles:["[_nghost-%COMP%]{display:block}.spacer[_ngcontent-%COMP%]{flex:1}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}.filters[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}"]})};var mt=class i{data=g1();closed=h1();path=Ue("");isValid=Nt(()=>this.path().length>0);dataEffect=Ga$1(()=>{let t=this.data();t?.initialPath&&this.path.set(t.initialPath);});submit(){this.closed.emit(this.path()||null);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-target-disk-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:11,vars:4,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Full disk source`;let n;n=$localize`Cancel`;let o;return o=$localize` Use this disk `,[e,n,o,[1,"title-30"],["content",""],[3,"customRemoteMode","destinationUrl"],["type","text","id","path","tabindex","4","placeholder",t,3,"ngModelChange","ngModel"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){e&1&&(Qi$1(0,"header")(1,"h3",3),XT(2,0),Hl()(),Qi$1(3,"section",4)(4,"app-file-tree",5)(5,"input",6),sm("ngModelChange",function(a){return HC(n.path,a)||(n.path=a),a}),Hl(),DD(),Hl()(),Qi$1(6,"footer",7)(7,"button",8),Fg("click",function(){return n.closed.emit(null)}),XT(8,1),Hl(),Qi$1(9,"button",9),Fg("click",function(){return n.submit()}),XT(10,2),Hl()()),e&2&&(DE(4),gg("customRemoteMode","diskimage")("destinationUrl","diskimage://"),DE(),im("ngModel",n.path),TD(),DE(4),gg("disabled",!n.isValid()));},dependencies:[v,Se,Bn,Ze$1,Rn,Jt$1],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"]})};var Qi=[[["","displayName",""]],[["","description",""]],"*"],Zi=["[displayName]","[description]","*"];function eo(i,t){if(i&1&&PC(0),i&2){nC(2);let e=$C(1);Gl(" ",e.Name," ");}}function to(i,t){if(i&1&&PC(0),i&2){nC(2);let e=$C(0);Gl(" ",e.displayName," ");}}function no(i,t){i&1&&(Qi$1(0,"sh-chip",6),PC(1,"Untested"),Hl());}function io(i,t){i&1&&(Qi$1(0,"sh-chip",6),PC(1,"Special"),Hl());}function oo(i,t){i&1&&(Qi$1(0,"sh-chip",7),PC(1,"Deprecated"),Hl());}function ao(i,t){if(i&1&&PC(0),i&2){nC();let e=$C(16);Gl(" ",e," ");}}function ro(i,t){if(i&1&&PC(0),i&2){nC(2);let e=$C(0);Gl(" ",e.description," ");}}function so(i,t){if(i&1&&(Qi$1(0,"sh-card",0)(1,"div",1),mg(2,"img",2),Hl(),Qi$1(3,"div",3)(4,"div",4),iC(5),Hl(),Qi$1(6,"div",5),oT(7,eo,1,1)(8,to,1,1),oT(9,no,2,0,"sh-chip",6)(10,io,2,0,"sh-chip",6)(11,oo,2,0,"sh-chip",7),Hl()(),Qi$1(12,"div",8)(13,"div",4),iC(14,1),Hl(),Qi$1(15,"div",5),cm(16),oT(17,ao,1,1)(18,ro,1,1),Hl()(),Qi$1(19,"div",9),iC(20,2),Hl()()),i&2){let e=nC(),n=$C(0),o=$C(1);gg("variant",e.variant()),DE(2),gg("src",n.icon,Wp),hg("alt",n.displayName),DE(5),iT(o&&o.Name?7:8),DE(2),iT((n.sortOrder??0)==-3?9:(n.sortOrder??0)==-2?10:(n.sortOrder??0)<0?11:-1),DE(7);let a=BC(e.getSimplePath(o?.BaseUrl));DE(),iT(a&&a.length>0?17:18);}}var at=class i{destination=g1();targetUrl=g1();variant=g1("type-b");connectionStringId=g1();#e=T(ot);connectionString=Nt(()=>{let t=this.connectionStringId();return t==null?null:this.#e.destinations().find(e=>e.ID===t)});selectedDestinationType=Nt(()=>{let t=this.targetUrl();return t?C(t)??null:null});destinationFromTargetUrl=Nt(()=>{let t=this.selectedDestinationType();return t?{key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description,icon:t.icon}:null});destinationItem=Nt(()=>{let t=this.destination(),e=this.destinationFromTargetUrl();return t||e||null});getSimplePath(t){return t?g(t):""}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"],targetUrl:[1,"targetUrl"],variant:[1,"variant"],connectionStringId:[1,"connectionStringId"]},ngContentSelectors:Zi,decls:3,vars:3,consts:[[3,"variant"],[1,"icon"],[3,"src"],[1,"name"],[1,"projected"],[1,"default"],[1,"small","simple","primary"],[1,"small","simple","warn"],[1,"description"],[1,"actions"]],template:function(e,n){if(e&1&&(oC(Qi),cm(0)(1),oT(2,so,21,7,"sh-card",0)),e&2){let o=BC(n.destinationItem());DE(),BC(n.connectionString()),DE(),iT(o?2:-1);}},dependencies:[f,D],styles:['[_nghost-%COMP%]{display:block;border-radius:var(--shape-3)}[_nghost-%COMP%]:focus-visible{outline:2px solid var(--primary-8);outline-offset:2px}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:empty{display:none}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:not(:empty) + .default[_ngcontent-%COMP%]{display:none}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:empty{display:none}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:not(:empty) + .default[_ngcontent-%COMP%]{display:none}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}']})};var rt=class i{#e=T(m$1);#t(t){return t.flatMap(e=>{if(!e?.Key)return null;let n=Me$1(e.Key);if(n.length<=1){let o=G(e.Key);return o.isDefaultEntry===true?[m$3(l({},o),{displayName:e.DisplayName||o.displayName||e.Key,description:e.Description||o.description||""})]:o}else return n}).filter(e=>e!==null)}#n(t){return t.map(e=>({key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon,searchTerms:[e.displayName,e.description,e.key,e.searchTerms??"",e.customKey??""].join(" "),sortOrder:e.sortOrder??0}))}backendDestinationOptions=Nt(()=>{let t=this.#e.backendModules(),e=this.#t(t);return this.#n(e)});sourceProviderOptions=Nt(()=>{let t=this.#e.sourceProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});restoreDestinationOptions=Nt(()=>{let t=this.#e.restoreDestinationProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});destinationTypeOptions=this.backendDestinationOptions;allModules=Nt(()=>[...this.#e.backendModules(),...this.#e.sourceProviderModules(),...this.#e.restoreDestinationProviderModules()].reduce((t,e)=>(t.find(n=>n.Key===e.Key)||t.push(e),t),[]));static \u0275fac=function(e){return new(e||i)};static \u0275prov=ee$1({token:i,factory:i.\u0275fac,providedIn:"root"})};function lo(i,t){if(i&1){let e=gT();Qi$1(0,"app-destination-list-item",7),Fg("click",function(){let o=Sd(e).$implicit,a=nC();return xd(a.setDestination.emit(o.customKey??o.key))})("keydown.enter",function(o){return o.target.click()})("keydown.space",function(o){return o.target.click()}),Qi$1(1,"button",8),Og(2,1),mg(3,"sh-icon"),Pg(),Hl()();}if(i&2){let e=t.$implicit;gg("destination",e);}}var jt=class i{#e=T(rt);#t=T(m$1);showAsSources=g1(false);moduleType=g1("Backend");setDestination=h1();destinationSearchTerm=Ue("");showAllDestinations=Ue(false);destinationTypeOptions=Nt(()=>{switch(this.moduleType()){case "SourceProvider":return this.#e.sourceProviderOptions();case "RestoreDestinationProvider":return this.#e.restoreDestinationOptions();default:return this.#e.backendDestinationOptions()}});destinationTypeOptionsFocused=Nt(()=>{let t=this.#t.backendModules(),e=this.destinationTypeOptions().map(l$1=>{let c=t.find(u=>u.Key==l$1.key);return c&&(l$1=m$3(l({},l$1),{sortOrder:c.IsDeprecated?-1:c.IsUntested?-3:l$1.sortOrder})),l$1}),n=this.destinationSearchTerm().toLowerCase(),o=this.showAllDestinations(),a=[...e].sort((l,c)=>{let u=l.sortOrder??0,T=c.sortOrder??0;return u!==T?T-u:l.displayName.localeCompare(c.displayName)}).filter(l=>{if(o)return true;let c=l.sortOrder??0;return c<0&&n?.length&&(l.key.toLocaleLowerCase()===n.toLocaleLowerCase()||l.customKey?.toLocaleLowerCase()===n.toLocaleLowerCase())?true:c>=0});return n?a.filter(l=>l.searchTerms.toLowerCase().includes(n)):a});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-destination-list"]],inputs:{showAsSources:[1,"showAsSources"],moduleType:[1,"moduleType"]},outputs:{setDestination:"setDestination"},decls:8,vars:2,consts:()=>{let t;t=$localize`Search for destination...`;let e;e=$localize`Show all`;let n;return n=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[e,n,[1,"search-area"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"raised","primary",3,"checkedChange","checked"],[1,"list"],["tabindex","0",3,"destination"],["tabindex","0",3,"click","keydown.enter","keydown.space","destination"],["shButton","","tabindex","-1","type","button"]]},template:function(e,n){e&1&&(Qi$1(0,"div",2)(1,"sh-form-field")(2,"input",3),sm("ngModelChange",function(a){return HC(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),Hl(),DD(),Hl(),Qi$1(3,"sh-toggle",4),sm("checkedChange",function(a){return HC(n.showAllDestinations,a)||(n.showAllDestinations=a),a}),XT(4,0),Hl()(),Qi$1(5,"div",5),cT(6,lo,4,1,"app-destination-list-item",6,sT),Hl()),e&2&&(DE(2),im("ngModel",n.destinationSearchTerm),TD(),DE(),im("checked",n.showAllDestinations),DE(3),lT(n.destinationTypeOptionsFocused()));},dependencies:[at,Bn,Ze$1,Rn,Jt$1,Fe,v,N,J],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden;padding:.25rem;min-height:250px}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding:.25rem .375rem 1rem;width:calc(100% + .5rem);margin-left:-.375rem;border-bottom:.0625rem solid var(--base-4)}.search-area[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:1rem}"]})};var _o=["fileInput"],co=[[["label"]]],uo=["label"],po=["ngProjectAs","label",5,["label"]],qt=class i{customId=g1();content=Ue("");readonly=Ue(false);placeholder=g1($localize`Drop a file here or use the browse button`);fileInputRef=y1("fileInput");onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0]);}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0]);}onDragOver(t){t.preventDefault();}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result);},e.readAsText(t);}triggerBrowse(){return this.fileInputRef()?.nativeElement.click(),false}onChange=()=>{};onTouched=()=>{};onChangeEffect=Ga$1(()=>{this.onChange(this.content());});writeValue(t){this.content.set(t??"");}registerOnChange(t){this.onChange=t;}registerOnTouched(t){this.onTouched=t;}setDisabledState(t){this.readonly.set(t);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,n){e&1&&$g(n.fileInputRef,_o,5),e&2&&lC();},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[zC([{provide:D$1,useExisting:i,multi:true}])],ngContentSelectors:uo,decls:9,vars:3,consts:[["fileInput",""],[1,"browse-btn"],["shButton","","type","button",1,"small","outlined",3,"click"],[1,"textarea-container","textarea-wrap",3,"drop","dragover"],["rows","10",3,"ngModelChange","placeholder","ngModel","disabled"],["type","file",1,"hidden",3,"change"]],template:function(e,n){if(e&1){let o=gT();oC(co),iC(0,0,po),Qi$1(1,"div",1)(2,"button",2),Fg("click",function(){return n.triggerBrowse()}),Qi$1(3,"sh-icon"),PC(4,"upload"),Hl()()(),Qi$1(5,"div",3),Fg("drop",function(l){return n.onFileDrop(l)})("dragover",function(l){return n.onDragOver(l)}),Qi$1(6,"textarea",4),sm("ngModelChange",function(l){return Sd(o),HC(n.content,l)||(n.content=l),xd(l)}),Hl(),DD(),Hl(),Qi$1(7,"input",5,0),Fg("change",function(l){return n.onFileSelected(l)}),Hl();}e&2&&(DE(6),gg("placeholder",n.placeholder()),im("ngModel",n.content),gg("disabled",n.readonly()),TD());},dependencies:[Bn,Ze$1,Rn,Jt$1,N,v],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}']})};var Yt=class i{data=g1();closed=h1();path=Ue("");destinationUrl=Ue("");backupId=Ue("");connectionStringId=Ue(null);isValid=Nt(()=>this.path().length>0);dataEffect=Ga$1(()=>{let t=this.data();t?.destinationUrl&&this.destinationUrl.set(t.destinationUrl),t?.backupId&&this.backupId.set(t.backupId),t?.connectionStringId&&this.connectionStringId.set(t.connectionStringId);});submit(){this.closed.emit(this.path()||null);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-browse-path-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:11,vars:8,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Select destination folder`;let n;n=$localize`Cancel`;let o;return o=$localize` Use this folder `,[e,n,o,[1,"title-30"],["content",""],[3,"customRemoteMode","backupId","destinationUrl","connectionStringId","onlySelectFolder","selectFiles"],["type","text","id","path","tabindex","4","placeholder",t,3,"ngModelChange","ngModel"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){e&1&&(Qi$1(0,"header")(1,"h3",3),XT(2,0),Hl()(),Qi$1(3,"section",4)(4,"app-file-tree",5)(5,"input",6),sm("ngModelChange",function(a){return HC(n.path,a)||(n.path=a),a}),Hl(),DD(),Hl()(),Qi$1(6,"footer",7)(7,"button",8),Fg("click",function(){return n.closed.emit(null)}),XT(8,1),Hl(),Qi$1(9,"button",9),Fg("click",function(){return n.submit()}),XT(10,2),Hl()()),e&2&&(DE(4),gg("customRemoteMode","backend")("backupId",n.backupId())("destinationUrl",n.destinationUrl())("connectionStringId",n.connectionStringId())("onlySelectFolder",true)("selectFiles",false),DE(),im("ngModel",n.path),TD(),DE(4),gg("disabled",!n.isValid()));},dependencies:[v,Se,Bn,Ze$1,Rn,Jt$1],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"]})};var mo=(i,t,e,n)=>({index:i,fieldGroup:"custom",formView:t,destinationType:e,oauthField:n}),me=i=>({$implicit:i}),go=(i,t,e,n)=>({index:i,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:n}),Co=()=>({updateOn:"blur"}),To=(i,t,e,n)=>({index:i,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:n}),Me=(i,t)=>({fieldGroup:i,formView:t}),ho=()=>["/connect/logon"];function fo(i,t){i&1&&Ig(0);}function So(i,t){if(i&1&&ig(0,fo,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;nC();let o=uC(15);nC();let a=$C(0),l=$C(1);gg("ngTemplateOutlet",o)("ngTemplateOutletContext",ZC(7,me,KC(2,mo,n,e,a,l.oauthField)));}}function Eo(i,t){i&1&&Ig(0);}function yo(i,t){if(i&1&&ig(0,Eo,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;nC();let o=uC(15);nC();let a=$C(0),l=$C(1);gg("ngTemplateOutlet",o)("ngTemplateOutletContext",ZC(7,me,KC(2,go,n,e,a,l.oauthField)));}}function Fo(i,t){if(i&1){let e=gT();Qi$1(0,"button",26),Fg("click",function(){Sd(e);let o=nC(2);return xd(o.showTextArea.set(false))}),Og(1,8),mg(2,"sh-icon"),Pg(),Hl();}}function No(i,t){if(i&1){let e=gT();Qi$1(0,"button",33,2),Fg("click",function(){let o=Sd(e).$implicit,a=nC(3);return xd(a.addAdvancedOption(o))}),PC(2),Hl();}if(i&2){let e=t.$implicit;DE(2),Gl(" ",e.name," ");}}function Do(i,t){if(i&1){let e=gT();Qi$1(0,"div",23)(1,"sh-menu",27)(2,"button",28),Og(3,9),mg(4,"sh-icon"),Pg(),Hl(),Ul(5,29),cT(6,No,3,1,"button",30,sT),Wl(),Hl(),Qi$1(8,"sh-menu")(9,"button",31)(10,"sh-icon"),PC(11,"dots-three-vertical"),Hl()(),Ul(12,29),Qi$1(13,"button",32),Fg("click",function(){Sd(e);let o=nC(2);return xd(o.showTextArea.set(true))}),Qi$1(14,"sh-icon"),PC(15,"link"),Hl(),PC(16," Edit contents as text "),Hl(),Wl(),Hl()();}if(i&2){nC();let e=$C(9);DE(),gg("searchable",true),DE(),gg("disabled",e.length===0),DE(4),lT(e);}}function Io(i,t){if(i&1){let e=gT();Qi$1(0,"textarea",34),Fg("ngModelChange",function(o){Sd(e);let a=nC(2);return xd(a.updateSettingsFromText(o))}),Hl(),DD();}if(i&2){let e=nC(2);gg("ngModel",e.settingsAsText())("ngModelOptions",QC(2,Co)),TD();}}function Ao(i,t){i&1&&Ig(0);}function Oo(i,t){if(i&1&&ig(0,Ao,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;nC(2);let o=uC(15),a=nC(),l=$C(0),c=$C(1),u=a.getFormView("advanced",e)??a.getDefaultFormView(e);gg("ngTemplateOutlet",o)("ngTemplateOutletContext",ZC(7,me,KC(2,To,n,u,l,c.oauthField)));}}function Po(i,t){if(i&1&&cT(0,Oo,1,9,"ng-container",null,sT),i&2){let e=nC(2);lT(e.advancedFormFieldNames());}}function Mo(i,t){i&1&&(Qi$1(0,"sup",43),PC(1,"*"),Hl());}function xo(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function bo(i,t){if(i&1){let e=gT();Qi$1(0,"app-file-tree",36)(1,"label",42),oT(2,Mo,2,0,"sup",43),PC(3),oT(4,xo,2,1,"sh-icon",44),Hl(),Qi$1(5,"input",45),Fg("ngModelChange",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Hl();}if(i&2){let e=nC().$implicit,n=$C(1),o=$C(2),a=$C(3),l=$C(4),c=$C(5);gg("startingPath",a)("accepts",e.formView.accepts)("showFiles",true)("hideShortcuts",false)("showHiddenNodes",true)("selectFiles",true)("resolvePaths",true),DE(),gg("for",c),DE(),iT(e.formView.isMandatory&&l?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("id",c)("ngModel",o),TD();}}function Ro(i,t){i&1&&(Qi$1(0,"sup",46),PC(1,"*"),Hl());}function vo(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function Lo(i,t){if(i&1){let e=gT();Qi$1(0,"app-file-tree",37)(1,"label",42),oT(2,Ro,2,0,"sup",46),PC(3),oT(4,vo,2,1,"sh-icon",44),Hl(),Qi$1(5,"input",45),Fg("ngModelChange",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Hl();}if(i&2){let e=nC().$implicit,n=$C(1),o=$C(2),a=$C(3),l=$C(4),c=$C(5);gg("hideShortcuts",false)("enableCreateFolder",true)("startingPath",a)("resolvePaths",true),DE(),gg("for",c),DE(),iT(e.formView.isMandatory&&l?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("id",c)("ngModel",o),TD();}}function wo(i,t){i&1&&(Qi$1(0,"sup",47),PC(1,"*"),Hl());}function ko(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function Go(i,t){i&1&&(Qi$1(0,"sh-icon",48),PC(1," warning "),Hl());}function $o(i,t){i&1&&Ig(0);}function Uo(i,t){if(i&1&&(Qi$1(0,"sh-icon",53),PC(1," link "),Hl()),i&2){nC();let e=$C(8),n=$C(9);Qg("error",e&&n==="error")("warn",e&&n==="warning"),gg("shTooltip",e);}}function Vo(i,t){i&1&&(Qi$1(0,"sh-icon",51),PC(1,"envelope"),Hl());}function Bo(i,t){i&1&&(Qi$1(0,"sh-icon",51),PC(1,"hard-drives"),Hl());}function Ko(i,t){i&1&&(Qi$1(0,"sh-icon",51),PC(1,"jar"),Hl());}function zo(i,t){i&1&&(Qi$1(0,"sh-icon",51),PC(1,"textbox"),Hl());}function Jo(i,t){if(i&1){let e=gT();Qi$1(0,"button",54),Fg("click",function(o){Sd(e);let a=nC(2).$implicit,l=nC(2);return xd(l.browse(a.fieldGroup,a.formView.name,o))}),PC(1," Browse ... "),Hl();}}function Xo(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field")(1,"label",42),oT(2,wo,2,0,"sup",47),PC(3),oT(4,ko,2,1,"sh-icon",44),oT(5,Go,2,0,"sh-icon",48),ig(6,$o,1,0,"ng-container",25),Hl(),Qi$1(7,"input",49),Fg("keydown",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),cm(8)(9),oT(10,Uo,2,5,"sh-icon",50)(11,Vo,2,0,"sh-icon",51)(12,Bo,2,0,"sh-icon",51)(13,Ko,2,0,"sh-icon",51)(14,zo,2,0,"sh-icon",51),oT(15,Jo,2,0,"button",52),Hl();}if(i&2){let e=nC().$implicit,n=$C(1),o=$C(2),a=$C(3),l=$C(4),c=$C(5);nC();let u=uC(17),T=nC();DE(),gg("for",c),DE(),iT(e.formView.isMandatory&&l?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),iT(l&&e.formView.type==="Path"?5:-1),DE(),gg("ngTemplateOutlet",u)("ngTemplateOutletContext",ZC(17,me,YC(14,Me,e.fieldGroup,e.formView))),DE(),gg("type",e.formView.type==="Email"?"email":"text")("id",c)("ngModel",o),TD();let N=a,y=T.hasLeadingSlash(N??"");DE(),BC(y&&e.formView.doubleSlash?.message),DE(),BC(e.formView.doubleSlash?.type),DE(),iT(e.formView.type==="Path"?10:e.formView.type==="Email"?11:e.formView.type==="Hostname"?12:e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?13:14),DE(5),iT(e.formView.type==="Path"&&T.hasV2ListBackendOperations()?15:-1);}}function Wo(i,t){i&1&&(Qi$1(0,"sup",55),PC(1,"*"),Hl());}function Ho(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function jo(i,t){i&1&&Ig(0);}function qo(i,t){if(i&1){let e=gT();Qi$1(0,"span",59),Fg("click",function(){Sd(e);let o=nC(2).$implicit,a=nC(2);return xd(a.oauthStartTokenCreation(o.destinationType,o.fieldGroup,o.formView.name,o.formView.oauthVersion))}),PC(1," AuthID "),Hl();}}function Yo(i,t){i&1&&(Qi$1(0,"sh-icon",51),PC(1,"password"),Hl());}function Qo(i,t){if(i&1){let e=gT();Qi$1(0,"sh-icon",60),Fg("click",function(){Sd(e);let o=nC(2).$implicit;return xd(o.formView.showPassword=!o.formView.showPassword)}),PC(1," eye "),Hl();}}function Zo(i,t){if(i&1){let e=gT();Qi$1(0,"sh-icon",60),Fg("click",function(){Sd(e);let o=nC(2).$implicit;return xd(o.formView.showPassword=!o.formView.showPassword)}),PC(1," eye-slash "),Hl();}}function ea(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field")(1,"label",42),oT(2,Wo,2,0,"sup",55),PC(3),oT(4,Ho,2,1,"sh-icon",44),ig(5,jo,1,0,"ng-container",25),Hl(),Qi$1(6,"input",56),Fg("ngModelChange",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),oT(7,qo,2,0,"span",57)(8,Yo,2,0,"sh-icon",51),oT(9,Qo,2,0,"sh-icon",58)(10,Zo,2,0,"sh-icon",58),Hl();}if(i&2){let e=nC().$implicit,n=$C(1),o=$C(2),a=$C(4),l=$C(5);nC();let c=uC(17);DE(),gg("for",l),DE(),iT(e.formView.isMandatory&&a?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",c)("ngTemplateOutletContext",ZC(14,me,YC(11,Me,e.fieldGroup,e.formView))),DE(),gg("type",e.formView.showPassword?"text":"password")("id",l)("ngModel",o),TD(),DE(),iT(e.oauthField===e.formView.name?7:8),DE(2),iT(e.formView.showPassword?9:10);}}function ta(i,t){i&1&&(Qi$1(0,"sup",62),PC(1,"*"),Hl());}function na(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(3).$implicit;gg("shTooltip",e.formView.longDescription);}}function ia(i,t){i&1&&Ig(0);}function oa(i,t){if(i&1&&PC(0),i&2){let e=t.$implicit;rm(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ");}}function aa(i,t){if(i&1){let e=gT();Qi$1(0,"sh-select",61)(1,"label",42),oT(2,ta,2,0,"sup",62),PC(3),oT(4,na,2,1,"sh-icon",44),ig(5,ia,1,0,"ng-container",25),Hl(),Qi$1(6,"input",45),Fg("ngModelChange",function(o){Sd(e);let a=nC(2).$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Hl(),ig(7,oa,1,2,"ng-template",null,3,sb);}if(i&2){let e=uC(8);nC();let n=$C(0),o=nC().$implicit,a=$C(1),l=$C(2),c=$C(4),u=$C(5);nC();let T=uC(17);gg("options",n)("isClearable",false)("optionTemplate",e),DE(),gg("for",u),DE(),iT(o.formView.isMandatory&&c?2:-1),DE(),Gl(" ",a," "),DE(),iT(o.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",T)("ngTemplateOutletContext",ZC(14,me,YC(11,Me,o.fieldGroup,o.formView))),DE(),gg("id",u)("ngModel",l),TD();}}function ra(i,t){if(i&1&&(cm(0),oT(1,aa,9,16)),i&2){let e=nC().$implicit,n=BC(nC(2).mapOptions(e.formView));DE(),iT(n?1:-1);}}function sa(i,t){i&1&&(Qi$1(0,"sup",65),PC(1,"*"),Hl());}function la(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(3).$implicit;gg("shTooltip",e.formView.longDescription);}}function _a(i,t){i&1&&Ig(0);}function da(i,t){if(i&1&&PC(0),i&2){let e=t.$implicit;rm(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ");}}function ca(i,t){if(i&1){let e=gT();Qi$1(0,"sh-select",64)(1,"label",42),oT(2,sa,2,0,"sup",65),PC(3),oT(4,la,2,1,"sh-icon",44),ig(5,_a,1,0,"ng-container",25),Hl(),Qi$1(6,"input",45),Fg("ngModelChange",function(o){Sd(e);let a=nC(2).$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Hl(),ig(7,da,1,2,"ng-template",null,4,sb);}if(i&2){let e=uC(8);nC();let n=$C(0),o=nC().$implicit,a=$C(1),l=$C(2),c=$C(4),u=$C(5);nC();let T=uC(17);gg("options",n)("asFreeText",true)("inlineSearch",true)("optionTemplate",e),DE(),gg("for",u),DE(),iT(o.formView.isMandatory&&c?2:-1),DE(),Gl(" ",a," "),DE(),iT(o.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",T)("ngTemplateOutletContext",ZC(15,me,YC(12,Me,o.fieldGroup,o.formView))),DE(),gg("id",u)("ngModel",l),TD();}}function ua(i,t){i&1&&mg(0,"sh-progress-bar",63);}function pa(i,t){if(i&1&&(cm(0),oT(1,ca,9,17)(2,ua,1,0,"sh-progress-bar",63)),i&2){let e=nC().$implicit,n=$C(2),o=BC(nC(2).mapOptionsWithFreeText(e.formView,n));DE(),iT(o?1:2);}}function ma(i,t){i&1&&(Qi$1(0,"sup",67),PC(1,"*"),Hl());}function ga(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function Ca(i,t){i&1&&Ig(0);}function Ta(i,t){if(i&1){let e=gT();Qi$1(0,"app-size",66),Fg("ngModelChange",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Qi$1(1,"label",42),oT(2,ma,2,0,"sup",67),PC(3),oT(4,ga,2,1,"sh-icon",44),ig(5,Ca,1,0,"ng-container",25),Hl()(),DD();}if(i&2){let e=nC().$implicit,n=$C(1),o=$C(2),a=$C(4),l=$C(5);nC();let c=uC(17);gg("inputType",e.Name)("ngModel",o)("customId",l),TD(),DE(),gg("for",l),DE(),iT(e.formView.isMandatory&&a?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",c)("ngTemplateOutletContext",ZC(12,me,YC(9,Me,e.fieldGroup,e.formView)));}}function ha(i,t){i&1&&(Qi$1(0,"sup",68),PC(1,"*"),Hl());}function fa(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function Sa(i,t){i&1&&Ig(0);}function Ea(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field")(1,"label",42),oT(2,ha,2,0,"sup",68),PC(3),oT(4,fa,2,1,"sh-icon",44),ig(5,Sa,1,0,"ng-container",25),Hl(),Qi$1(6,"input",69),Fg("ngModelChange",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Qi$1(7,"sh-icon",51),PC(8,"numpad"),Hl()();}if(i&2){let e=nC().$implicit,n=$C(1),o=$C(2),a=$C(4),l=$C(5);nC();let c=uC(17);DE(),gg("for",l),DE(),iT(e.formView.isMandatory&&a?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",c)("ngTemplateOutletContext",ZC(11,me,YC(8,Me,e.fieldGroup,e.formView))),DE(),gg("id",l)("ngModel",o),TD();}}function ya(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function Fa(i,t){i&1&&Ig(0);}function Na(i,t){if(i&1){let e=gT();Qi$1(0,"sh-toggle",39)(1,"label",42),PC(2),oT(3,ya,2,1,"sh-icon",44),ig(4,Fa,1,0,"ng-container",25),Hl(),Qi$1(5,"input",70),Fg("change",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o.target.checked?"true":"false"))}),Hl()();}if(i&2){let e=nC().$implicit,n=$C(1),o=$C(2),a=$C(5);nC();let l=uC(17),c=nC();DE(),gg("for",a),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?3:-1),DE(),gg("ngTemplateOutlet",l)("ngTemplateOutletContext",ZC(9,me,YC(6,Me,e.fieldGroup,e.formView))),DE(),gg("checked",c.isTrue(o));}}function Da(i,t){i&1&&(Qi$1(0,"sup",72),PC(1,"*"),Hl());}function Ia(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(3).$implicit;gg("shTooltip",e.formView.longDescription);}}function Aa(i,t){i&1&&Ig(0);}function Oa(i,t){if(i&1&&PC(0),i&2){let e=t.$implicit;rm(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ");}}function Pa(i,t){if(i&1){let e=gT();Qi$1(0,"sh-select",71)(1,"label",42),oT(2,Da,2,0,"sup",72),PC(3),oT(4,Ia,2,1,"sh-icon",44),ig(5,Aa,1,0,"ng-container",25),Hl(),Qi$1(6,"input",73),Fg("ngModelChange",function(o){Sd(e);let a=nC(2).$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Hl(),ig(7,Oa,1,2,"ng-template",null,5,sb);}if(i&2){let e=uC(8);nC();let n=$C(0),o=nC().$implicit,a=$C(1),l=$C(2),c=$C(4),u=$C(5);nC();let T=uC(17);gg("options",n)("selectMultiple",true)("optionTemplate",e),DE(),gg("for",u),DE(),iT(o.formView.isMandatory&&c?2:-1),DE(),Gl(" ",a," "),DE(),iT(o.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",T)("ngTemplateOutletContext",ZC(13,me,YC(10,Me,o.fieldGroup,o.formView))),DE(),gg("ngModel",l),TD();}}function Ma(i,t){if(i&1&&(cm(0),oT(1,Pa,9,15)),i&2){let e=nC().$implicit,n=BC(nC(2).mapOptions(e.formView));DE(),iT(n?1:-1);}}function xa(i,t){i&1&&(Qi$1(0,"sup",74),PC(1,"*"),Hl());}function ba(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function Ra(i,t){i&1&&Ig(0);}function va(i,t){if(i&1){let e=gT();Qi$1(0,"app-timespan",66),Fg("ngModelChange",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Qi$1(1,"label",42),oT(2,xa,2,0,"sup",74),PC(3),oT(4,ba,2,1,"sh-icon",44),ig(5,Ra,1,0,"ng-container",25),Hl()(),DD();}if(i&2){let e=nC().$implicit,n=$C(1),o=$C(2),a=$C(4),l=$C(5);nC();let c=uC(17);gg("inputType",e.formView.name)("ngModel",o)("customId",l),TD(),DE(),gg("for",l),DE(),iT(e.formView.isMandatory&&a?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",c)("ngTemplateOutletContext",ZC(12,me,YC(9,Me,e.fieldGroup,e.formView)));}}function La(i,t){i&1&&(Qi$1(0,"sup",76),PC(1,"*"),Hl());}function wa(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(2).$implicit;gg("shTooltip",e.formView.longDescription);}}function ka(i,t){i&1&&Ig(0);}function Ga(i,t){if(i&1){let e=gT();Qi$1(0,"app-file-drop-textarea",75),Fg("ngModelChange",function(o){Sd(e);let a=nC().$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Qi$1(1,"label"),oT(2,La,2,0,"sup",76),PC(3),oT(4,wa,2,1,"sh-icon",44),ig(5,ka,1,0,"ng-container",25),Hl()(),DD();}if(i&2){let e=nC().$implicit,n=$C(2),o=$C(4),a=$C(5);nC();let l=uC(17);gg("ngModel",n)("customId",a)("placeholder",e.formView.longDescription),TD(),DE(2),iT(e.formView.isMandatory&&o?2:-1),DE(),Gl(" ",e.formView.shortDescription??e.formView.name," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",l)("ngTemplateOutletContext",ZC(11,me,YC(8,Me,e.fieldGroup,e.formView)));}}function $a(i,t){i&1&&(mg(0,"sh-spinner"),Qi$1(1,"span"),XT(2,10),Hl()),i&2&&zg("--spinner-size","16px")("--spinner-thickness","2px");}function Ua(i,t){if(i&1){let e=gT();Qi$1(0,"div",79)(1,"span"),XT(2,11),Hl(),Qi$1(3,"button",32),Fg("click",function(){Sd(e);let o=nC(6);return xd(o.reloadTrigger.set(!o.reloadTrigger()))}),XT(4,12),Hl()();}}function Va(i,t){if(i&1&&PC(0),i&2){let e=t.$implicit;rm(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ");}}function Ba(i,t){if(i&1){let e=gT();Qi$1(0,"sh-select",80)(1,"label",42)(2,"sup",81),PC(3,"*"),Hl(),Qi$1(4,"span"),XT(5,13),Hl()(),Qi$1(6,"input",45),Fg("ngModelChange",function(o){Sd(e);let a=nC(4).$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Hl(),ig(7,Va,1,2,"ng-template",null,6,sb);}if(i&2){nC(4);let e=$C(2),n=$C(5),o=nC(2);gg("options",o.restoreBackupIdOptions())("isClearable",false),DE(),gg("for",n),DE(5),gg("id",n)("ngModel",e),TD();}}function Ka(i,t){if(i&1&&oT(0,$a,3,4)(1,Ua,5,0,"div",79)(2,Ba,9,5),i&2){let e=nC(5);iT(e.isLoadingRestoreBackupIdOptions()?0:e.restoreBackupIdOptions().length==0?1:2);}}function za(i,t){i&1&&(Qi$1(0,"sup",82),PC(1,"*"),Hl());}function Ja(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(4).$implicit;gg("shTooltip",e.formView.longDescription);}}function Xa(i,t){i&1&&Ig(0);}function Wa(i,t){if(i&1){let e=gT();Qi$1(0,"button",84),Fg("click",function(){Sd(e),nC(4);let o=$C(5),a=nC(2);return xd(a.toggleDisabled(o))}),Og(1,14),mg(2,"sh-icon"),Pg(),Hl();}}function Ha(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field")(1,"label",42),oT(2,za,2,0,"sup",82),PC(3),oT(4,Ja,2,1,"sh-icon",44),ig(5,Xa,1,0,"ng-container",25),Hl(),Qi$1(6,"input",83),Fg("ngModelChange",function(o){Sd(e);let a=nC(3).$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Qi$1(7,"sh-icon",51),PC(8,"textbox"),Hl()(),oT(9,Wa,3,0,"button",41);}if(i&2){let e=nC(3).$implicit,n=$C(1),o=$C(2),a=$C(4),l=$C(5);nC();let c=uC(17),u=nC();DE(),gg("for",l),DE(),iT(e.formView.isMandatory&&a?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",c)("ngTemplateOutletContext",ZC(15,me,YC(12,Me,e.fieldGroup,e.formView))),DE(),gg("type","text")("id",l)("ngModel",o)("placeholder",e.formView.longDescription)("disabled",true),TD(),DE(3),iT(u.getIsDisabled(l)?9:-1);}}function ja(i,t){if(i&1&&(Qi$1(0,"div",77),oT(1,Ka,3,1)(2,Ha,10,17),Hl()),i&2){let e=nC(4);DE(),iT(e.isRestoreFlow()?1:2);}}function qa(i,t){if(i&1){let e=gT();Qi$1(0,"div",85),Og(1,15),mg(2,"div")(3,"div"),Pg(),Hl(),Qi$1(4,"button",84),Fg("click",function(){Sd(e);let o=nC(5);return xd(o.openConsole())}),Og(5,16),mg(6,"sh-icon"),Pg(),Hl();}}function Ya(i,t){i&1&&(Qi$1(0,"div",85),XT(1,17),Hl(),Qi$1(2,"button",86),Og(3,18),mg(4,"sh-icon"),Pg(),Hl()),i&2&&(DE(2),gg("routerLink",QC(1,ho)));}function Qa(i,t){if(i&1&&(Qi$1(0,"div",78),oT(1,qa,7,0)(2,Ya,5,2),Hl()),i&2){let e=nC(4);DE(),iT(e.isConnectedToConsole()?1:2);}}function Za(i,t){if(i&1&&oT(0,ja,3,1,"div",77)(1,Qa,3,1,"div",78),i&2){let e=nC(3);iT(e.isConnectedToConsole()&&e.hasStorageApiKey()?0:1);}}function er(i,t){i&1&&(Qi$1(0,"sup",87),PC(1,"*"),Hl());}function tr(i,t){if(i&1&&(Qi$1(0,"sh-icon",44),PC(1,"question"),Hl()),i&2){let e=nC(3).$implicit;gg("shTooltip",e.formView.longDescription);}}function nr(i,t){i&1&&Ig(0);}function ir(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field")(1,"label",42),oT(2,er,2,0,"sup",87),PC(3),oT(4,tr,2,1,"sh-icon",44),ig(5,nr,1,0,"ng-container",25),Hl(),Qi$1(6,"input",88),Fg("ngModelChange",function(o){Sd(e);let a=nC(2).$implicit,l=nC(2);return xd(l.updateFieldValue(a.fieldGroup,a.formView.name,o))}),Hl(),DD(),Qi$1(7,"sh-icon",51),PC(8,"textbox"),Hl(),Qi$1(9,"button",89),Fg("click",function(){Sd(e);let o=nC(4);return xd(o.authenticateFilen())}),XT(10,19),Hl()();}if(i&2){let e=nC(2).$implicit,n=$C(1),o=$C(2),a=$C(4),l=$C(5);nC();let c=uC(17),u=nC();DE(),gg("for",l),DE(),iT(e.formView.isMandatory&&a?2:-1),DE(),Gl(" ",n," "),DE(),iT(e.formView.longDescription?4:-1),DE(),gg("ngTemplateOutlet",c)("ngTemplateOutletContext",ZC(12,me,YC(9,Me,e.fieldGroup,e.formView))),DE(),gg("id",l)("ngModel",o),TD(),DE(3),gg("disabled",u.isAuthenticatingFilen());}}function or(i,t){if(i&1&&oT(0,ir,11,14,"sh-form-field"),i&2){let e=nC(3);iT(e.hasFilenApiKey()?-1:0);}}function ar(i,t){if(i&1){let e=gT();Qi$1(0,"button",84),Fg("click",function(){Sd(e);let o=nC().$implicit,a=nC(2);return xd(a.removeAdvancedOption(o.formView.name))}),Qi$1(1,"sh-icon"),PC(2,"x-circle"),Hl()();}}function rr(i,t){if(i&1&&(Qi$1(0,"div",35),cm(1)(2)(3)(4)(5),oT(6,bo,6,13,"app-file-tree",36)(7,Lo,6,10,"app-file-tree",37)(8,Xo,16,19,"sh-form-field")(9,ea,11,16,"sh-form-field")(10,ra,2,2)(11,pa,3,2)(12,Ta,6,14,"app-size",38)(13,Ea,9,13,"sh-form-field")(14,Na,6,11,"sh-toggle",39)(15,Ma,2,2)(16,va,6,14,"app-timespan",38)(17,Ga,6,13,"app-file-drop-textarea",40)(18,Za,2,1)(19,or,1,1),oT(20,ar,3,0,"button",41),Hl()),i&2){let e=t.$implicit;nC();let n=$C(0),o=nC();Qg("single-field",e.fieldGroup!=="advanced"),DE(),BC(e.formView.shortDescription??e.formView.name),DE(),BC(o.getFieldGroup(n,e.fieldGroup)[e.formView.name]),DE();let a=BC(o.getFieldValue(e.fieldGroup,e.formView.name));DE(),BC((a??"").toString().trim()===""),DE(),BC("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),DE(),iT(e.formView.type==="FileTree"?6:e.formView.type==="FolderTree"?7:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"||e.formView.type==="Hostname"||e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?8:e.formView.type==="Password"?9:e.formView.type==="Enumeration"?10:e.formView.type==="NonValidatedSelectableString"?11:e.formView.type==="Size"?12:e.formView.type==="Integer"?13:e.formView.type==="Boolean"?14:e.formView.type==="Flags"?15:e.formView.type==="Timespan"||e.formView.type==="DateTime"?16:e.formView.type==="FreeText"?17:e.formView.type==="DuplicatiBackupId"?18:e.formView.type==="Filen2FACode"?19:-1),DE(14),iT(e.fieldGroup==="advanced"?20:-1);}}function sr(i,t){if(i&1&&(Qi$1(0,"sh-icon",90),PC(1,"x-circle"),Hl()),i&2){nC();let e=$C(0);gg("shTooltip",e?.message??"Invalid value");}}function lr(i,t){if(i&1&&(Qi$1(0,"sh-icon",91),PC(1,"warning"),Hl()),i&2){nC();let e=$C(0);gg("shTooltip",e?.message??"Invalid value");}}function _r(i,t){if(i&1&&(cm(0),oT(1,sr,2,1,"sh-icon",90)(2,lr,2,1,"sh-icon",91)),i&2){let e=nC().$implicit,n=$C(0),o=BC(e.formView.validate(n));DE(),iT(o?.type==="error"?1:o?.type==="warning"?2:-1);}}function dr(i,t){if(i&1&&(cm(0),oT(1,_r,3,2)),i&2){let e=t.$implicit,o=(BC(nC(2).getFieldValue(e.fieldGroup,e.formView.name))??"").toString().trim()==="";DE(),iT(!o&&e.formView.validate?1:-1);}}function cr(i,t){if(i&1&&(cm(0),cT(1,So,1,9,"ng-container",null,sT),cT(3,yo,1,9,"ng-container",null,sT),Qi$1(5,"sh-toggle-card",20),Ul(6,21)(7),XT(8,7),Wl(),cm(9),oT(10,Fo,3,0,"button",22)(11,Do,17,2,"div",23),Wl(),oT(12,Io,1,3,"textarea",24)(13,Po,2,0),Hl(),ig(14,rr,21,9,"ng-template",null,0,sb)(16,dr,2,2,"ng-template",null,1,sb)),i&2){let e=nC(),n=$C(1);BC(e.destinationForm()),DE(),lT(n.custom),DE(2),lT(n.dynamic),DE(2),gg("disableToggle",true),DE(4),BC(e.nonSelectedAdvancedFormViews()),DE(),iT(e.showTextArea()?10:11),DE(2),iT(e.showTextArea()?12:13);}}var Qt=class i{#e=T(we);#t=T(m$1);#n=T(O);#i=T(rt);#o=T(C$1);#r=T(d$1);#a=T(be);injector=T(Te);targetUrl=m1.required();useBackupState=g1(false);#s=null;destinationType=Nt(()=>{let t=this.targetUrl();if(!t)return null;let e=C(t);return this.#s=e?.customKey??e?.key,this.#s});refreshView=Ue(false);destinationForm=Ue({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=Nt(()=>Object.keys(this.destinationForm().advanced??{}));destinationFormConfig=Ue(null);showTextArea=Ue(false);hasV2ListBackendOperations=this.#t.hasV2ListBackendOperations;isLoadingRestoreBackupIdOptions=Ue(false);isRestoreFlow=Nt(()=>!this.useBackupState());reloadTrigger=Ue(false);hasLoadedBackupIdOptions=Ue(false);restoreBackupIdOptions=L$1(Iy(F$1(this.targetUrl).pipe(ry(),pt$1(t=>({url:t,isReload:false}))),F$1(this.reloadTrigger).pipe(pt$1(()=>({url:this.targetUrl(),isReload:true})))).pipe($u(({url:t,isReload:e})=>t&&t.startsWith("duplicati://")&&this.hasStorageApiKey()&&this.isRestoreFlow()&&(e||!this.hasLoadedBackupIdOptions())?(this.hasLoadedBackupIdOptions.set(true),this.isLoadingRestoreBackupIdOptions.set(true),this.#r.getDuplicatiStorageBackups(t).pipe(Vs(a=>(console.error("Error loading Duplicati storage backups",a),ty([]))),Bu(()=>this.isLoadingRestoreBackupIdOptions.set(false)))):ty([]))),{initialValue:[]});isConnectedToConsole=Nt(()=>this.#o.state()==="connected");hasStorageApiKey=Nt(()=>{let t=this.destinationForm();return (this.#n.serverSettings()?.["remote-control-storage-api-id"]??"").length>0||t.advanced["duplicati-auth-apiid"]});isAuthenticatingFilen=Ue(false);hasFilenApiKey=Nt(()=>{let e=this.destinationForm().advanced["api-key"];return e&&e.length>0});nonSelectedAdvancedFormViews=Nt(()=>{let t=this.destinationFormConfig();if(!t)return [];let e=this.advancedFormFieldNames();return t.advanced.filter(n=>e.findIndex(o=>o===n.name)===-1)});destinationTypeEffect=Ga$1(()=>{let t=this.targetUrl(),e=C(t??""),n=e.key,o=e.customKey??n,a=this.#i.allModules().find(U=>U.Key===n)??{DisplayName:e.displayName,Description:e.description,Options:[]};if(!a||!a.Options||!n)return;let l$1=e&&e.oauthField?e.oauthField:null,c=e&&e.customFields?e.customFields:{},u=e&&e.dynamicFields?e.dynamicFields:[],T=e&&e.advancedFields?e.advancedFields:[],N=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],y={destinationType:o,oauthField:l$1,custom:[],dynamic:[],advanced:[]};c&&Object.entries(c).forEach(([U,A],J)=>{let X=A.order??J,V=A.validate;!V&&A.type==="Bucketname"&&(V=B=>we$1(B)?null:{type:"error",message:$localize`Invalid bucket name.`}),V&&A.type==="Hostname"&&(V=B=>Ee(B)?null:{type:"error",message:$localize`Invalid hostname.`}),y.custom.push(l({order:900+X,validate:V},A));});for(let U=0;U<a.Options.length;U++){let A=a.Options[U];if(A.Deprecated)continue;let J=u.find(X=>X===A.Name||A.Aliases?.includes(X.name)||X.name===A.Name);if(J){let X=A.Aliases?.indexOf(J.name)??-1,V=A.Aliases&&X>-1?A.Aliases[X]:A.Name,B=J&&typeof J!="string";B?J?.defaultValue??A.DefaultValue:A.DefaultValue;let ke=B&&J?.order!==void 0?J.order:U,be={name:V,type:A.Type,shortDescription:A.ShortDescription??void 0,longDescription:A.LongDescription??void 0,options:A.ValidValues,order:900+ke},Re=B?l(l({},be),J):be;y.dynamic.push(Re);}else {let X=A.Name;if(N.find(Pe=>Pe===X))continue;let B=T.find(Pe=>Pe===X||Pe.name===X),xe=B&&typeof B!="string",ke=xe&&B?.order!==void 0?B.order:U,be={name:X,type:A.Type,shortDescription:A.ShortDescription??void 0,longDescription:A.LongDescription??void 0,options:A.ValidValues,defaultValue:A.DefaultValue,order:900+ke},Re=xe?l(l({},be),B):be;y.advanced.push(Re);}}if(y.custom.sort((U,A)=>U.order-A.order),y.dynamic.sort((U,A)=>U.order-A.order),y.advanced.sort((U,A)=>U.order-A.order),this.destinationFormConfig.set(y),!t)return;let R=Ce(t);R&&this.destinationForm.set({custom:R.custom,dynamic:R.dynamic,advanced:R.advanced});});destinationFormEffect=Ga$1(()=>{let t=this.#s,e=this.destinationForm();this.refreshView();if(!e||!t)return;let o=Ve({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});o&&this.targetUrl.set(o);});getFieldValue(t,e){let o=this.destinationForm()[t][e];return o||null}getFormView(t,e){let o=this.destinationFormConfig()?.[t].find(a=>a.name===e);return o||null}getDefaultFormView(t){return {name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??false}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(l({},e));}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return false}onKeyDown(t,e,n,o){if(n==="Hostname"||n==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(o.key))return;if(o.key=="/"||o.key=="\\"||o.key==":"){o.preventDefault();return}}}updateFieldValue(t,e,n){let o=this.destinationForm();o[t][e]=n,this.destinationForm.set(l({},o));}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(l({},e));}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let n=t.options;return n?n.map(o=>({key:o,value:o})):null}mapOptionsWithFreeText(t,e){let n=this.mapOptions(t);return n?(e&&e.length>0&&(n.find(a=>a.value===e)||n.push({key:e,value:e})),n):null}#l=Ue(false);browse(t,e,n){let o=this.useBackupState()?this.#e.backupId():null,a=this.useBackupState()?this.#e.connectionStringId():null;this.#a.open(Yt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:false,data:{backupId:o,destinationUrl:this.targetUrl(),connectionStringId:a}}).closed.subscribe(c=>{c&&(c=c.replace(/^\/+/,""),this.destinationForm.update(u=>(u[t][e]=c,l({},u))));});}oauthStartTokenCreation(t,e,n,o){this.#l.set(true);let a=(o??1)==2?this.#t.defaultOAuthUrlV2():this.#t.defaultOAuthUrl(),l$1=this.#n.serverSettings()?.["--oauth-url"];if(l$1&&l$1.length>0&&(a=l$1),this.useBackupState()){let A=this.#e.mapFormsToSettings().find(J=>J.Name==="--oauth-url")?.Value;A&&A.length>0&&(a=A);}let c=this.destinationForm().advanced["oauth-url"];c&&c.length>0&&(a=c);let u=`${a}?type=${t}`,T=450,N=600,y=screen.width/2-T/2,R=screen.height/2-N/2,U=window.open(u,"_blank","height="+N+",width="+T+",menubar=0,status=0,titlebar=0,toolbar=0,left="+y+",top="+R);return window.addEventListener("message",A=>{let J=A.data.startsWith("authid:"),X=J?A.data.replace("authid:",""):null;J&&(this.destinationForm.update(V=>(V[e][n]=X,l({},V))),this.#l.set(false),this.refreshView.set(!this.refreshView()),U?.close());}),false}settingsAsText=Nt(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,n])=>{let o=e??"",a="";return typeof n=="boolean"?a=this.isTrue(n)?"True":"False":(typeof n=="number"||n!=null)&&(a=n.toString()),`${o}=${a}`}).join(`
|
|
6
|
+
`)});updateSettingsFromText(t){if(typeof t!="string")return;let e=Ae(t);this.destinationForm.update(n=>m$3(l({},n),{advanced:e}));}getIsDisabled(t){return document.getElementById(t)?.disabled??true}toggleDisabled(t){let e=document.getElementById(t);e&&(e.disabled=!e.disabled);}openConsole(){this.#o.openConsole();}#_(t){var e=this.useBackupState()?this.#e.backupId():null;this.isAuthenticatingFilen.set(true),this.#r.getFilenApiKey(t,e).pipe(Bu(()=>this.isAuthenticatingFilen.set(false))).subscribe({next:n=>{if(n.length===0){this.#a.open(h,{data:{title:$localize`Authentication failed`,message:$localize`No API key was returned from the Filen server.`,confirmText:$localize`OK`}});return}this.destinationForm.update(o=>(o.advanced["api-key"]=n,o.dynamic["two-factor-code"]=null,l({},o))),this.refreshView.set(!this.refreshView());},error:n=>{console.error("Error authenticating Filen",n),this.#a.open(h,{data:{title:$localize`Authentication failed`,message:$localize`An error occurred while requesting the Filen API key: ${n.message}`,confirmText:$localize`OK`}});}});}authenticateFilen(){let t=this.targetUrl();if(!t)return;let n=this.destinationForm().advanced["api-key"];if(n&&n.length>0){this.#a.open(h,{data:{title:$localize`Confirm re-authenticate?`,message:$localize`You already have an API key. Are you sure you want to re-authenticate?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{if(o){var a=new URL(t);a.searchParams.delete("api-key"),this.#_(a.toString());}}});return}this.#_(t);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let l;l=$localize`This field is mandatory`;let c;c=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let u;u=$localize`This field is mandatory`;let T;T=$localize`This field is mandatory`;let N;N=$localize`This field is mandatory`;let y;y=$localize`This field is mandatory`;let R;R=$localize`This field is mandatory`;let U;U=$localize`This field is mandatory`;let A;A=$localize`This field is mandatory`;let J;J=$localize`This field is mandatory`;let X;X=$localize`Loading available backups...`;let V;V=$localize`No backups found from this machine, contact support`;let B;B=$localize` Try again `;let xe;xe=$localize`This field is mandatory`;let ke;ke=$localize`Pick the backup to restore from`;let be;be=$localize`This field is mandatory`;let Re;Re=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:pencil${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Pe;Pe=$localize`${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:An API key with storage access is required to use Duplicati storage.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:Visit the console and assign an API key to this machine.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:`,Pe=tC(Pe);let lt;lt=$localize` Visit console ${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON:`;let _t;_t=$localize`Connect to the console to use Duplicati storage.`;let j;j=$localize` Connect now ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let gn;gn=$localize`This field is mandatory`;let Cn;return Cn=$localize` Authenticate now `,[["fieldTemplate",""],["validateTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],["backupIdOptionTemplate",""],t,e,n,X,V,B,ke,Re,Pe,lt,_t,j,Cn,[1,"advanced-options",3,"disableToggle"],["title",""],["shButton","","type","button",1,"outlined","small"],[1,"actions"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["shButton","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["type","button",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"field-row"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles","resolvePaths"],[3,"hideShortcuts","enableCreateFolder","startingPath","resolvePaths"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],[3,"ngModel","customId","placeholder"],["shButton","","type","button",1,"outlined"],[3,"for"],["shTooltip",o],[1,"primary",3,"shTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["shTooltip",a],["shTooltip",l],["shTooltip",c,1,"warn"],["autocomplete","off",3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["suffix","","shButton","","type","button",1,"outlined","small","browse"],["prefix","",3,"shTooltip"],["suffix","","shButton","","type","button",1,"outlined","small","browse",3,"click"],["shTooltip",u],["autocomplete","new-password",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["shTooltip",T],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",N],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",y],["shTooltip",R],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"change","checked"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",U],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",A],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",J],[1,"duplicati-backup-id"],[1,"duplicati-backup-id-console"],[1,"no-backups-found"],[3,"options","isClearable"],["shTooltip",xe],["shTooltip",be],["autocomplete","off",3,"ngModelChange","type","id","ngModel","placeholder","disabled"],["shButton","","type","button",1,"outlined",3,"click"],[1,"info"],["shButton","","type","button",1,"outlined",3,"routerLink"],["shTooltip",gn],["type","text","autocomplete","off",3,"ngModelChange","id","ngModel"],["suffix","","shButton","","type","button",1,"outlined","small",3,"click","disabled"],[1,"error",3,"shTooltip"],[1,"warn",3,"shTooltip"]]},template:function(e,n){if(e&1&&(cm(0)(1),oT(2,cr,18,5)),e&2){let o=BC(n.destinationType());DE();let a=BC(n.destinationFormConfig());DE(),iT(o&&a?2:-1);}},dependencies:[Gn,Ze$1,en$1,Rn,Bn,Jt$1,ei,_t,Se,mt$1,_t$1,qt,Fe,v,N,I,ve,Nt$1,at$1,J,d,m$2],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.advanced-options[_ngcontent-%COMP%]{position:relative;z-index:1}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}.duplicati-backup-id[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:flex-end}.duplicati-backup-id[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{width:100%}.duplicati-backup-id-console[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:center}.duplicati-backup-id-console[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:4px}.no-backups-found[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:4px;margin-right:4px}.browse[_ngcontent-%COMP%]{padding:.25rem}"]})};var Zt=class i{#e=T(C$2);#t=T(be);#n=T(m$1);testDestination(t,e,n,o,a,l,c,u,T){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,n,o,a,l,c,u,T):this.testDestinationv1(t,e,n,o,a,l,c,u,T)}testDestinationv2(t,e,n,o,a,l,c,u,T){return new S(N=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,ConnectionStringId:n??null,BackupId:e=="new"?null:e,AutoCreate:u==="create",ReadOnlyTest:T,Options:null,DestinationType:l,SourcePrefix:e=="new"?null:o}}).subscribe({next:y=>{if(y.Success){this.emitSuccessV2(N,t,a,y);return}this.handleGenericError(N,t,a,y.Error??"Unknown error",c);},error:y=>{let R=y?.error?.body??y?.error?.requestBody;if(R?.Data?.FolderExists===false||R?.StatusCode==="missing-folder"){this.handleMissingFolder(N,t,e,n,a,c,u,T);return}if(R?.Data?.HostCertificate){this.handleMissingCertificate(N,t,a,R.Data?.HostCertificate,c);return}if(R?.Data?.ReportedHostKey){this.handleIncorrectKey(N,t,a,R.Data.ReportedHostKey,R.Data.AcceptedHostKey??null,c);return}this.handleGenericError(N,t,a,y?.message??"Unknown error",c);}});})}testDestinationv1(t,e,n,o,a,l,c,u,T){return new S(N=>{this.#e.postApiV1RemoteoperationTest({readOnlyTest:T,requestBody:{path:t,backupId:e=="new"?null:e,connectionStringId:n??null,sourcePrefix:e=="new"?null:o},type:l}).subscribe({next:y=>{N.next({action:"success",targetUrl:t,testAgain:false,destinationIndex:a}),N.complete();},error:y=>{this.handleDestinationErrorv1(y.message,t,e,n,a,c,u,T).subscribe(R=>{N.next(R);});}});})}handleMissingFolder(t,e,n,o,a,l,c,u){function T(){t.next({action:"missing-folder",targetUrl:e,testAgain:false,destinationIndex:a,errorMessage:$localize`The remote destination folder does not exist.`}),t.complete();}if(l||c==="error"){T();return}this.#t.open(h,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:N=>{if(!N){this.reportNoAction(t,e,a,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,ConnectionStringId:o,AutoCreate:true,ReadOnlyTest:u,Options:null,BackupId:n=="new"?null:n}}).subscribe({next:y=>{if(y.Success){this.emitSuccessV2(t,e,a,y);return}else this.handleFolderCreateFailure(t,e,a,y.Error??$localize`Unknown error`);},error:y=>{this.handleFolderCreateFailure(t,e,a,y.message??$localize`Unknown error`);}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e,backupId:n=="new"?null:n}}).subscribe({next:()=>{this.handleFolderCreated(t,e,a);},error:y=>{this.handleFolderCreateFailure(t,e,a,y.message??$localize`Unknown error`);}});}});}handleFolderCreateFailure(t,e,n,o){this.#t.open(h,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:false,destinationIndex:n}),t.complete();}});}emitSuccessV2(t,e,n,o){t.next({action:"success",targetUrl:e,testAgain:false,destinationIndex:n,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete();}handleFolderCreated(t,e,n){this.#t.open(h,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:true,destinationIndex:n}),t.complete();}});}reportNoAction(t,e,n,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:false,destinationIndex:n}),t.complete();}handleMissingCertificate(t,e,n,o,a){let l=$localize`The server is using a certificate that is not trusted.
|
|
7
|
+
If this is a self-signed certificate, you can choose to trust this certificate.
|
|
8
|
+
The server reported the certificate hash: ${o}`,c=e.includes("?");function u(){t.next({action:"trust-cert",targetUrl:e,suggestedUrl:e+`${c?"&":"?"}accept-specified-ssl-hash=${o}`,testAgain:true,certData:o,errorMessage:l,destinationIndex:n}),t.complete();}if(a){u();return}this.#t.open(h,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:l,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:T=>{if(!T){this.reportNoAction(t,e,n,$localize`The server certificate is not trusted.`);return}u();}});}handleIncorrectKey(t,e,n,o,a,l){if(a){let N=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:T,testAgain:true,reportedHostKey:o,errorMessage:u,destinationIndex:n}),t.complete();};let u=$localize`The host key has changed, please check with the server administrator if this is correct,
|
|
9
|
+
otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
|
|
10
|
+
Do you want to REPLACE your CURRENT host key ${a}
|
|
11
|
+
with the REPORTED host key: ${o}?`,T=e;try{let R=new URL(e);R.searchParams.set("ssh-fingerprint",o),T=R.toString();}catch{let R=e.replace(/([?&])ssh-fingerprint=[^&]*/,""),U=R.includes("?");T=R+`${U?"&":"?"}ssh-fingerprint=${o}`;}if(l){N();return}this.#t.open(h,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:u,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:R=>{if(!R){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}N();}});}else {let N=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:e+`${T?"&":"?"}ssh-fingerprint=${o}`,testAgain:true,reportedHostKey:o,errorMessage:u,destinationIndex:n}),t.complete();};let u=$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,T=e.includes("?");if(l){N();return}this.#t.open(h,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:u,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:y=>{if(!y){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}N();}});}}handleGenericError(t,e,n,o,a){function l(){t.next({action:"generic-error",targetUrl:e,testAgain:false,destinationIndex:n,errorMessage:o}),t.complete();}if(a){l();return}this.#t.open(h,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:c=>l()});}handleDestinationErrorv1(t,e,n,o,a,l,c,u){return new S(T=>{if(t==="missing-folder"){this.handleMissingFolder(T,e,n,o,a,l,c,u);return}if(t.startsWith("incorrect-cert:")){let N=t.split("incorrect-cert:")[1];this.handleMissingCertificate(T,e,a,N,l);return}if(t.startsWith("incorrect-host-key:")){let N=t.split('incorrect-host-key:"')[1].split('",')[0],y=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(T,e,a,N,y,l);return}this.handleGenericError(T,e,a,t,l);})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ee$1({token:i,factory:i.\u0275fac,providedIn:"root"})};function ur(i,t){if(i&1){let e=gT();Qi$1(0,"sh-alert",13),Og(1,0),Qi$1(2,"button",14),Fg("click",function(){Sd(e);let o=nC(2);return xd(o.testDestinationClick())}),Hl(),Pg(),Hl();}}function pr(i,t){i&1&&(Qi$1(0,"sh-alert",13),Og(1,1),mg(2,"sh-icon"),Qi$1(3,"div",15),mg(4,"sh-spinner"),Hl(),Pg(),Hl()),i&2&&(DE(4),zg("--spinner-size","16px")("--spinner-thickness","2px"));}function mr(i,t){i&1&&(Qi$1(0,"sh-alert",17),XT(1,2),Hl());}function gr(i,t){i&1&&(Qi$1(0,"sh-alert",16),XT(1,3),Hl());}function Cr(i,t){if(i&1&&oT(0,mr,2,0,"sh-alert",17)(1,gr,2,0,"sh-alert",16),i&2){let e=nC(4);iT(e.testResponse()?.containsBackup?0:1);}}function Tr(i,t){i&1&&(Qi$1(0,"sh-alert",18),XT(1,4),Hl());}function hr(i,t){i&1&&(Qi$1(0,"sh-alert",16),XT(1,5),Hl());}function fr(i,t){i&1&&(Qi$1(0,"sh-alert",17),XT(1,6),Hl());}function Sr(i,t){if(i&1&&oT(0,Tr,2,0,"sh-alert",18)(1,hr,2,0,"sh-alert",16)(2,fr,2,0,"sh-alert",17),i&2){let e=nC(4);iT(e.testResponse()?.containsBackup?0:e.testResponse()?.anyFilesFound?1:2);}}function Er(i,t){i&1&&(Qi$1(0,"sh-alert",17),XT(1,7),Hl());}function yr(i,t){i&1&&(Qi$1(0,"sh-alert",16),XT(1,8),Hl());}function Fr(i,t){if(i&1&&oT(0,Er,2,0,"sh-alert",17)(1,yr,2,0,"sh-alert",16),i&2){let e=nC(4);iT(e.testResponse()?.anyFilesFound?0:1);}}function Nr(i,t){i&1&&(Qi$1(0,"sh-alert",17),XT(1,9),Hl());}function Dr(i,t){i&1&&(Qi$1(0,"sh-alert",17),XT(1,10),Hl());}function Ir(i,t){i&1&&(Qi$1(0,"sh-alert",17),XT(1,11),Hl());}function Ar(i,t){if(i&1&&oT(0,Nr,2,0,"sh-alert",17)(1,Dr,2,0,"sh-alert",17)(2,Ir,2,0,"sh-alert",17),i&2){let e=nC(4);iT(e.testResponse()?.containsBackup?0:e.testResponse()?.anyFilesFound?1:2);}}function Or(i,t){if(i&1&&oT(0,Cr,2,1)(1,Sr,3,1)(2,Fr,2,1)(3,Ar,3,1),i&2){let e=nC(3);iT(e.testExpectation()==="containsBackup"?0:e.testExpectation()==="destinationEmpty"?1:e.testExpectation()==="destinationNotEmpty"?2:3);}}function Pr(i,t){if(i&1){let e=gT();Og(0,12,1),Qi$1(1,"button",14),Fg("click",function(){Sd(e);let o=nC(4);return xd(o.createFolder())}),Hl(),Pg();}}function Mr(i,t){if(i&1&&(Qi$1(0,"sh-alert",16),Og(1,12),oT(2,Pr,2,0,"button",19),Pg(),Hl()),i&2){let e=nC(3);DE(2),iT(e.askToCreate()?2:-1);}}function xr(i,t){if(i&1){let e=gT();Qi$1(0,"sh-alert",16),PC(1),Qi$1(2,"button",14),Fg("click",function(){Sd(e);let o=nC(3);return xd(o.useSuggestedUrl())}),PC(3,"Approve"),Hl()();}if(i&2){let e=nC(3);DE(),Gl(" ",e.testResponse()?.errorMessage," ");}}function br(i,t){if(i&1){let e=gT();Qi$1(0,"sh-alert",16),PC(1),Qi$1(2,"button",14),Fg("click",function(){Sd(e);let o=nC(3);return xd(o.useSuggestedUrl())}),PC(3,"Approve"),Hl()();}if(i&2){let e=nC(3);DE(),Gl(" ",e.testResponse()?.errorMessage," ");}}function Rr(i,t){if(i&1){let e=gT();Qi$1(0,"sh-alert",16),PC(1),Qi$1(2,"button",14),Fg("click",function(){Sd(e);let o=nC(3);return xd(o.testDestinationClick())}),PC(3,"Test again"),Hl()();}if(i&2){let e=nC(3);DE(),Gl(" ",e.testResponse()?.errorMessage," ");}}function vr(i,t){if(i&1&&oT(0,Or,4,1)(1,Mr,3,1,"sh-alert",16)(2,xr,4,1,"sh-alert",16)(3,br,4,1,"sh-alert",16)(4,Rr,4,1,"sh-alert",16),i&2){let e=nC(2);iT(e.testResponse()?.action==="success"?0:e.testResponse()?.action==="missing-folder"?1:e.testResponse()?.action==="trust-cert"?2:e.testResponse()?.action==="approve-host-key"?3:e.testResponse()?.action==="generic-error"?4:-1);}}function Lr(i,t){if(i&1&&oT(0,ur,3,0,"sh-alert",13)(1,pr,5,4,"sh-alert",13)(2,vr,5,1),i&2){let e=nC();iT(e.testSignal()===null?0:e.testSignal()==="testing"?1:2);}}var en=class i{#e=T(Zt);targetUrl=m1.required();testSignal=m1.required();connectionStringId=g1(null);backupId=g1.required();sourcePrefix=g1.required();suppressErrorDialogs=g1.required();askToCreate=g1.required();readOnlyTest=g1.required();testExpectation=g1.required();moduleType=g1.required();testResponse=Nt(()=>{let t=this.testSignal();return t&&typeof t!="string"?t:null});isExpectedValidTargetUrl=Nt(()=>{let t=this.targetUrl();return !(!t||!Ce(t))});prevTargetUrl=null;targetUrlEffect=Ga$1(()=>{let t=this.targetUrl(),e=this.prevTargetUrl;t!==e&&(this.prevTargetUrl=t,this.testSignal()!=="testing"&&e!==null&&this.testSignal.set(null));});useSuggestedUrl(){let t=this.targetUrl(),e=this.testSignal(),n=e&&typeof e!="string"?e?.targetUrl:null,o=e&&typeof e!="string"?e?.suggestedUrl:null;return !t||!o||n!==t||(this.targetUrl.set(o),this.testDestinationClick()),false}createFolder(){return this.testDestination(true),false}testDestinationClick(){return this.testDestination(false),false}testDestination(t){let e=this.targetUrl();if(!e)return;this.testSignal.set("testing");let n=t?"create":this.askToCreate()?"prompt":"error";return new Promise(o=>{this.#e.testDestination(e,this.backupId(),this.connectionStringId(),this.sourcePrefix(),0,this.moduleType(),this.suppressErrorDialogs(),n,this.readOnlyTest())?.subscribe({next:a=>{if(!this.suppressErrorDialogs()&&a.testAgain){let l=a.suggestedUrl;l&&this.targetUrl.set(l),this.testSignal.set("testing"),this.#e.testDestination(l??e,this.backupId(),this.connectionStringId(),this.sourcePrefix(),0,this.moduleType(),this.suppressErrorDialogs(),n,this.readOnlyTest())?.subscribe({next:c=>{this.testSignal.set(c),o(c);}});}else this.testSignal.set(a),o(a);}});})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-test-url"]],inputs:{targetUrl:[1,"targetUrl"],testSignal:[1,"testSignal"],connectionStringId:[1,"connectionStringId"],backupId:[1,"backupId"],sourcePrefix:[1,"sourcePrefix"],suppressErrorDialogs:[1,"suppressErrorDialogs"],askToCreate:[1,"askToCreate"],readOnlyTest:[1,"readOnlyTest"],testExpectation:[1,"testExpectation"],moduleType:[1,"moduleType"]},outputs:{targetUrl:"targetUrlChange",testSignal:"testSignalChange"},decls:1,vars:1,consts:()=>{let t;t=$localize` Make sure to test the configuration ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON:Test now${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV: Testing connection... ${"\uFFFD#4\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`;let n;n=$localize`Success! Test completed, backup found.`;let o;o=$localize`No backup found at the specified destination.`;let a;a=$localize` The remote destination already contains a backup. Please use a different folder for each backup. `;let l;l=$localize` The remote destination is not empty. It is recommended to use an empty folder for the backup. `;let c;c=$localize`Success! Test completed, destination is empty.`;let u;u=$localize`Success! Test completed, destination contains files.`;let T;T=$localize`The remote destination is empty.`;let N;N=$localize`Success! Test completed, backup found.`;let y;y=$localize`Success! Test completed, destination contains files.`;let R;R=$localize`Success! Test completed, destination is empty.`;let U;return U=$localize` The specified folder does not exist. ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:Create now${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_BUTTON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:`,[t,e,n,o,a,l,c,u,T,N,y,R,U,[1,"simple","primary"],["shButton","",1,"primary","small",3,"click"],[1,"testing"],[1,"simple","warn"],[1,"simple","success"],[1,"simple","error"],["shButton","",1,"primary","small"]]},template:function(e,n){e&1&&oT(0,Lr,3,1),e&2&&iT(n.isExpectedValidTargetUrl()?0:-1);},dependencies:[ue,v,N,m$2],styles:["[_nghost-%COMP%]{display:block}.testing[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:8px;justify-content:space-between}"]})};function wr(i,t){if(i&1){let e=gT();Qi$1(0,"app-destination-list",10),Fg("setDestination",function(o){Sd(e);let a=nC();return xd(a.setDestination(o))}),Hl();}if(i&2){let e=nC();gg("showAsSources",true)("moduleType",e.moduleType());}}function kr(i,t){if(i&1){let e=gT();Qi$1(0,"app-destination-list-item",11)(1,"button",8),Fg("click",function(){Sd(e);let o=nC();return xd(o.removeDestination())}),XT(2,3),Hl()(),Qi$1(3,"app-test-url",12),sm("targetUrlChange",function(o){Sd(e);let a=nC();return HC(a.targetUrlModel,o)||(a.targetUrlModel=o),xd(o)})("testSignalChange",function(o){Sd(e);let a=nC();return HC(a.testSignal,o)||(a.testSignal=o),xd(o)}),Hl(),Qi$1(4,"app-single-destination",13),sm("targetUrlChange",function(o){Sd(e);let a=nC();return HC(a.targetUrlModel,o)||(a.targetUrlModel=o),xd(o)}),Hl();}if(i&2){let e=nC();gg("targetUrl",e.targetUrlModel()),DE(3),im("targetUrl",e.targetUrlModel)("testSignal",e.testSignal),gg("backupId",e.backupId())("sourcePrefix",e.sourcePrefix())("suppressErrorDialogs",e.suppressErrorDialogs())("askToCreate",e.askToCreate())("testExpectation",e.expectedResult())("readOnlyTest",true)("moduleType",e.moduleType()),DE(),im("targetUrl",e.targetUrlModel);}}function Gr(i,t){i&1&&XT(0,2,1);}function $r(i,t){i&1&&XT(0,2,2);}function Ur(i,t){i&1&&XT(0,2,3);}function Vr(i,t){i&1&&XT(0,2,4);}var gt=class i{data=g1();closed=h1();targetUrlModel=Ue(null);moduleType=Ue("Backend");askToCreate=Ue(false);expectedResult=Ue("any");suppressErrorDialogs=Ue(false);backupId=Ue(null);sourcePrefix=Ue(null);dataEffect=Ga$1(()=>{let t=this.data();t?.targetUrlModel&&this.targetUrlModel.set(t.targetUrlModel),t?.moduleType&&this.moduleType.set(t.moduleType),t?.askToCreate!==null&&t?.askToCreate!==void 0&&this.askToCreate.set(t.askToCreate),t?.expectedResult&&this.expectedResult.set(t.expectedResult),t?.suppressErrorDialogs!==null&&t?.suppressErrorDialogs!==void 0&&this.suppressErrorDialogs.set(t.suppressErrorDialogs),t?.backupId&&this.backupId.set(t.backupId),t?.sourcePrefix&&this.sourcePrefix.set(t.sourcePrefix);});testSignal=Ue(null);setTargetUrl(t,e=false){this.targetUrlModel.set(t);}setDestination(t){let e=G(t??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.setTargetUrl(n,true);return}this.setTargetUrl(`${t}://`,true);}}submit(){this.closed.emit(this.targetUrlModel());}removeDestination(){this.setTargetUrl(null,true);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-target-url-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:15,vars:6,consts:()=>{let t;t=$localize`Remote source`;let e;e=$localize`Cancel`;let n;n=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Use storage destination ${"\uFFFD/*11:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_ELSE_IF: Use remote source ${"[\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_ELSE_IF_1: Use remote destination ${"[\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_ELSE: Use remote URL ${"\uFFFD/*14:4\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=tC(n);let o;return o=$localize`Change`,[t,e,n,o,[1,"title-30"],["content",""],[3,"showAsSources","moduleType"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"],[3,"setDestination","showAsSources","moduleType"],[1,"current-destination",3,"targetUrl"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","readOnlyTest","moduleType"],[3,"targetUrlChange","targetUrl"]]},template:function(e,n){if(e&1&&(Qi$1(0,"header")(1,"h3",4),XT(2,0),Hl()(),Qi$1(3,"section",5),oT(4,wr,1,2,"app-destination-list",6),oT(5,kr,5,11),Hl(),Qi$1(6,"footer",7)(7,"button",8),Fg("click",function(){return n.closed.emit(null)}),XT(8,1),Hl(),Qi$1(9,"button",9),Fg("click",function(){return n.submit()}),Og(10,2),oT(11,Gr,1,0)(12,$r,1,0)(13,Ur,1,0)(14,Vr,1,0),Pg(),Hl()()),e&2){let o=!!n.targetUrlModel();DE(4),iT(o?-1:4),DE(),iT(o?5:-1),DE(4),Qg("loading",n.testSignal()==="testing"),gg("disabled",!o||n.testSignal()===null||n.testSignal()==="testing"),DE(2),iT(n.moduleType()==="Backend"?11:n.moduleType()==="SourceProvider"?12:n.moduleType()==="RestoreDestinationProvider"?13:14);}},dependencies:[Qt,jt,at,v,en],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"]})};var Br=["formRef"],Kr=()=>({updateOn:"blur",standalone:true}),un=()=>({standalone:true});function zr(i,t){if(i&1){let e=gT();Qi$1(0,"button",41),Fg("click",function(){Sd(e);let o=nC(2);return xd(o.openLocalDiskDialog())}),Og(1,12),mg(2,"sh-icon"),Pg(),Hl();}}function Jr(i,t){if(i&1){let e=gT();oT(0,zr,3,0,"button",40),Qi$1(1,"button",41),Fg("click",function(){Sd(e);let o=nC();return xd(o.openRemoteDestinationDialog())}),Og(2,11),mg(3,"sh-icon"),Pg(),Hl();}if(i&2){let e=nC();iT(e.isLocalDiskSupported()?0:-1);}}function Xr(i,t){i&1&&XT(0,7,1);}function Wr(i,t){i&1&&XT(0,7,2);}function Hr(i,t){i&1&&(Qi$1(0,"p",34),XT(1,13),Hl());}function jr(i,t){i&1&&(Qi$1(0,"p",34),XT(1,14),Hl());}function qr(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field")(1,"textarea",42),sm("ngModelChange",function(o){Sd(e);let a=nC();return HC(a.bulkPaths,o)||(a.bulkPaths=o),xd(o)}),Fg("ngModelChange",function(){Sd(e);let o=nC();return xd(o.savePathBulkEdit())}),Hl(),DD(),Hl();}if(i&2){let e=nC();DE(),im("ngModel",e.bulkPaths),gg("ngModelOptions",QC(2,Kr)),TD();}}function Yr(i,t){if(i&1){let e=gT();Qi$1(0,"sh-form-field",46)(1,"input",47),sm("ngModelChange",function(o){Sd(e);let a=nC(3);return HC(a.editingPath,o)||(a.editingPath=o),xd(o)}),Hl(),DD(),Hl(),Qi$1(2,"button",24),Fg("click",function(){Sd(e);let o=nC(3);return xd(o.updatePath())}),Qi$1(3,"sh-icon"),PC(4,"floppy-disk"),Hl()(),Qi$1(5,"button",24),Fg("click",function(){Sd(e);let o=nC(3);return xd(o.cancelEditPath())}),Qi$1(6,"sh-icon"),PC(7,"x-bold"),Hl()();}if(i&2){let e=nC(3);DE(),im("ngModel",e.editingPath),gg("ngModelOptions",QC(2,un)),TD();}}function Qr(i,t){if(i&1&&(Qi$1(0,"sh-chip"),mg(1,"img",48),PC(2),Hl()),i&2){let e=nC(2).$implicit,n=nC(2);DE(),gg("src",n.getBackendIcon(e),Wp),DE(),Gl(" ",n.getRemotePathDisplayName(e)," ");}}function Zr(i,t){if(i&1&&(Qi$1(0,"sh-form-field",46),mg(1,"input",49),DD(),Hl()),i&2){let e=nC(2).$implicit;hg("readonly",true),DE(),gg("ngModel",e)("ngModelOptions",QC(3,un)),TD();}}function es(i,t){if(i&1){let e=gT();oT(0,Qr,3,2,"sh-chip")(1,Zr,2,4,"sh-form-field",46),Qi$1(2,"button",24),Fg("click",function(){Sd(e);let o=nC().$implicit,a=nC(2);return xd(a.editPath(o))}),Qi$1(3,"sh-icon"),PC(4,"pen"),Hl()(),Qi$1(5,"button",24),Fg("click",function(){Sd(e);let o=nC().$implicit,a=nC(2);return xd(a.removePath(o))}),Qi$1(6,"sh-icon"),PC(7,"trash-simple"),Hl()();}if(i&2){let e=nC().$implicit;iT(e.startsWith("@")?0:1);}}function ts(i,t){if(i&1&&(Qi$1(0,"div",43),oT(1,Yr,8,3)(2,es,8,1),Hl()),i&2){let e=t.$implicit,n=nC(2);DE(),iT(n.oldPath()===e?1:2);}}function ns(i,t){if(i&1){let e=gT();cT(0,ts,3,1,"div",43,sT),Qi$1(2,"div",39)(3,"sh-form-field"),mg(4,"input",44),DD(),Hl(),Qi$1(5,"button",45),Fg("click",function(){Sd(e);let o=nC();return xd(o.addNewPath())}),Qi$1(6,"sh-icon"),PC(7,"plus"),Hl()()();}if(i&2){let e=nC();lT(e.nonFilterPaths()),DE(4),gg("formControl",e.newPathCtrl),TD();}}function is(i,t){if(i&1){let e=gT();Qi$1(0,"div",39)(1,"app-size",50),Fg("ngModelChange",function(o){Sd(e);let a=nC();return xd(a.updateFilesLargerThan(o))}),Hl(),DD(),Hl();}if(i&2){let e=nC();DE(),gg("ngModel",e.filesLargerThan())("ngModelOptions",QC(2,un)),TD();}}var st=new jn,ri=(i={path:"",filters:[],excludes:{filesLargerThan:null}})=>st.group({path:st.control(i.path),excludes:st.group({filesLargerThan:st.group({size:st.control(null),unit:st.control(null)})})}),cn=class i{#e=T(we);#t=T(be);#n=T(ee);#i=T(W);#o=T(m$1);formRef=y1.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new L("");filesLargerThan=Nt(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=L$1(this.sourceDataForm.controls.path.valueChanges);pathArray=Nt(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=Nt(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=Ue(null);editingPath=Ue(null);addingNewPath=Ue(false);bulkPathEditMode=Ue(false);bulkPaths=Ue("");mobileMenuOpen=Ue(false);backupId=this.#e.backupId();isLocalDiskSupported=Nt(()=>this.#o.systemInfo()?.SourceProviderModules?.find(t=>t.Key=="diskimage"));filters=Ue([]);#r=Ga$1(()=>{let e=this.pathSignal()?.split("\0").filter(n=>n!=="___none___"&&(n.startsWith("-")||n.startsWith("+")))??[];this.filters.set(e);});openRemoteDestinationDialog(){this.#t.open(gt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:false,data:{targetUrlModel:null,moduleType:"SourceProvider",askToCreate:false,expectedResult:"destinationNotEmpty",suppressErrorDialogs:true,backupId:null,sourcePrefix:null}}).component.closed.subscribe(e=>{if(!e)return;let n=Math.random().toString(36).substring(2,10),o=e.split("://")[0],l=`@${this.#o.systemInfo()?.DirectorySeparator==="\\"?"X:\\":"/"}dupl-${o}-${n}|${e}`;this.addPath(l);});}openLocalDiskDialog(){this.#t.open(mt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:false,data:{initialPath:null}}).closed.subscribe(e=>{if(!e)return;let n=Math.random().toString(36).substring(2,10),a=`@${this.#o.systemInfo()?.DirectorySeparator==="\\"?"X:\\":"/"}dupl-disk-${n}|diskimage://${e}`;this.addPath(a);});}togglePathBulkEdit(){if(this.bulkPathEditMode())this.bulkPathEditMode.set(false);else {let t=this.nonFilterPaths()?.join(`
|
|
12
|
+
`)??"";this.bulkPaths.set(t),this.bulkPathEditMode.set(true);}}savePathBulkEdit(){let t=this.bulkPaths().split(`
|
|
13
|
+
`).filter(a=>a.trim()!=="")??[],e=this.pathArray(),n=[...t,...e],o=[...new Set(n)].join("\0");this.sourceDataForm.controls.path.setValue(o);}editPath(t){if(t&&t.startsWith("@")){let e=t.split("|");if(e.length!==2)return;e[1].startsWith("diskimage://")?this.editLocalDiskSource(t,e[0],e[1].substring(12)):this.editTargetUrlPath(t,e[0],e[1]);return}this.oldPath.set(t),this.editingPath.set(t);}editLocalDiskSource(t,e,n){this.#t.open(mt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:false,data:{initialPath:n}}).closed.subscribe(a=>{if(!a)return;let l=`${e}|diskimage://${a}`,c=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(c?.replace(t,l)??"");});}editTargetUrlPath(t,e,n){this.#t.open(gt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:false,data:{targetUrlModel:n,moduleType:"SourceProvider",askToCreate:false,expectedResult:"destinationNotEmpty",suppressErrorDialogs:true,backupId:this.#e.backupId(),sourcePrefix:e}}).closed.subscribe(a=>{if(!a)return;let l=`${e}|${a}`,c=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(c?.replace(t,l)??"");});}updateFilesLargerThan(t){let{size:e,unit:n}=rn(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n});}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null);}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null);}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),o=n.indexOf(t);if(o===-1)return;n.splice(o,1);let a=n.filter(l=>l&&l!=="").join("\0");this.sourceDataForm.controls.path.setValue(a);}addPath(t){let n=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(n);}updateFilters(t){let n=[...this.nonFilterPaths()??[],...t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(n);}getPath(){return this.sourceDataForm.value.path??null}getBackendIcon(t){if(!t)return "";let e=t.split("|")[1];return Fe$1(e)}getRemotePathDisplayName(t){if(!t)return "";let e=t.split("|")[1];return Pe(e)}toggleFilesLargerThan(t){t?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null});}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let o=n.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(o),this.newPathCtrl.setValue("");}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent});}next(){this.#e.shouldAutoSave()&&this.#e.submit(true),this.#n.navigate(["schedule"],{relativeTo:this.#i.parent});}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&$g(n.formRef,Br,5),e&2&&lC();},decls:57,vars:18,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Source Data`;let n;n=$localize`Folder path`;let o;o=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let l;l=$localize`Options`;let c;c=$localize`Paths`;let u;u=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*41:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*41:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*42:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*42:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let T;T=$localize`Exclude`;let N;N=$localize`Choose if there’s any files you want to exclude.`;let y;y=$localize` Files larger than `;let R;R=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:hard-drive${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add local disk `;let A;A=$localize`Manually add a path.`;let J;J=$localize`Edit paths as text, one per line.`;let X;X=$localize`Add a direct path`;let V;return V=$localize`Edit path`,[["formRef",""],e,n,o,a,l,c,u,T,N,y,R,U,A,J,[3,"submit","formGroup"],[1,"left"],[1,"header-row"],[1,"title-30"],["shButton","","type","button",1,"small","ghost","mobile-menu-toggle",3,"click"],[1,"fill",3,"multiSelect","startingPath","showFiles","showUnrootedSources","backupId"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","submit",1,"raised","primary","small"],[1,"right"],[1,"mobile-header"],["shButton","","type","button",1,"small","ghost",3,"click"],[3,"disableToggle"],["title",""],[1,"spacer"],["shButton","","type","button",1,"small"],["menu",""],["description",""],[1,"paths"],[3,"filtersChange","filters","osType"],["formGroupName","excludes",3,"disableToggle"],[1,"raised","primary",3,"checkedChange","checked"],[1,"row-inputs"],["shButton","","type","button",1,"small","rowbutton"],["shButton","","type","button",1,"small","rowbutton",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[1,"path"],["type","text","placeholder",X,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",V,3,"ngModelChange","ngModel","ngModelOptions"],["alt","Provider icon",1,"provider-icon",3,"src"],["type","text",3,"ngModel","ngModelOptions"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let o=gT();Qi$1(0,"form",15,0),Fg("submit",function(){return n.next()}),Qi$1(2,"div",16)(3,"div",17)(4,"h3",18),XT(5,1),Hl(),Qi$1(6,"button",19),Fg("click",function(){return n.mobileMenuOpen.set(true)}),Qi$1(7,"sh-icon"),PC(8,"sliders"),Hl()()(),Qi$1(9,"app-file-tree",20)(10,"label",21),XT(11,2),Hl(),mg(12,"input",22),DD(),Hl(),Qi$1(13,"div",23)(14,"button",24),Fg("click",function(){return n.goBack()}),Og(15,3),mg(16,"sh-icon"),Pg(),Hl(),Qi$1(17,"button",25),Og(18,4),mg(19,"sh-icon"),Pg(),Hl()()(),Qi$1(20,"div",26)(21,"div",27)(22,"span",18),XT(23,5),Hl(),Qi$1(24,"button",28),Fg("click",function(){return n.mobileMenuOpen.set(false)}),Qi$1(25,"sh-icon"),PC(26,"x-bold"),Hl()()(),Qi$1(27,"app-toggle-card",29),Ul(28,30),Qi$1(29,"span"),XT(30,6),Hl(),mg(31,"div",31),oT(32,Jr,4,1),Qi$1(33,"sh-menu")(34,"button",32)(35,"sh-icon"),PC(36,"dots-three-vertical"),Hl()(),Ul(37,33),Qi$1(38,"button",24),Fg("click",function(){return n.togglePathBulkEdit()}),Og(39,7),mg(40,"sh-icon"),oT(41,Xr,1,0)(42,Wr,1,0),Pg(),Hl(),Wl(),Hl(),Wl(),oT(43,Hr,2,0,"p",34)(44,jr,2,0,"p",34),Qi$1(45,"div",35),oT(46,qr,2,3,"sh-form-field")(47,ns,8,1),Hl()(),Qi$1(48,"app-filters",36),sm("filtersChange",function(l){return Sd(o),HC(n.filters,l)||(n.filters=l),xd(l)}),Fg("filtersChange",function(l){return n.updateFilters(l)}),Hl(),Qi$1(49,"app-toggle-card",37),Ul(50,30),XT(51,8),Wl(),Qi$1(52,"p",34),XT(53,9),Hl(),Qi$1(54,"sh-toggle",38),Fg("checkedChange",function(l){return n.toggleFilesLargerThan(l)}),XT(55,10),Hl(),oT(56,is,2,3,"div",39),Hl()()();}e&2&&(gg("formGroup",n.sourceDataForm),DE(9),gg("multiSelect",true)("startingPath",n.getPath())("showFiles",true)("showUnrootedSources",true)("backupId",n.backupId),DE(3),TD(),DE(8),Qg("open",n.mobileMenuOpen()),DE(7),gg("disableToggle",true),DE(5),iT(n.bulkPathEditMode()?-1:32),DE(9),iT(n.bulkPathEditMode()?41:42),DE(2),iT(n.bulkPathEditMode()?44:43),DE(3),iT(n.bulkPathEditMode()?46:47),DE(2),im("filters",n.filters),gg("osType",n.osType()??""),DE(),gg("disableToggle",true),DE(5),gg("checked",n.filesLargerThan()!==null),DE(2),iT(n.filesLargerThan()?56:-1));},dependencies:[Bn,Tn,Ze$1,Rn,Pn,Jt$1,Gn,ln$1,gn,hn,ft,Fe,N,v,J,ve,Ht,Se,Qe,mt$1,D],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}@media only screen and (max-width:768px){form[_ngcontent-%COMP%]{display:block;position:relative}}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.header-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.mobile-header[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}}.mobile-menu-toggle[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-menu-toggle[_ngcontent-%COMP%]{display:inline-flex}}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}@media only screen and (max-width:768px){.left[_ngcontent-%COMP%]{border-right:none;padding:1.5rem 1.5rem 4.5rem;height:100%;width:100%}}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}@media only screen and (max-width:768px){.right[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:10;background:var(--base-1);padding:1.5rem;transform:translate(100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.right.open[_ngcontent-%COMP%]{transform:translate(0)}}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.path[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content min-content;gap:.25rem;align-items:center}.path[_ngcontent-%COMP%] sh-chip[_ngcontent-%COMP%]{width:100%}.path[_ngcontent-%COMP%] .provider-icon[_ngcontent-%COMP%]{width:1rem;height:1rem;margin-right:.5rem}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}.paths[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}"]})};var si="1W:1D,4W:1W,12M:1M",pn=false,we=class i{#e=T(ee);#t=T(m$1);#n=T(be);#i=T(C$2);#o=T(O);#r=T(Jt);#a=T(ot);generalForm=li();sourceDataForm=ri();scheduleFields=dn();scheduleType=Ue("daily");settings=Ue([]);optionsFields={backupRetention:Ue("all"),backupRetentionTime:Ue(""),backupRetentionVersions:Ue(0),backupRetentionCustom:Ue("")};targetUrls=Ue([]);targetUrlModel=Nt(()=>this.targetUrls()[0]?.url??null);connectionStringId=Nt(()=>this.targetUrls()[0]?.connectionStringId??null);targetUrlTestSignal=Ue(null);backupMetadata=Ue(null);isDraft=Ue(false);backupId=Ue(null);backupName=Nt(()=>this.generalFormSignal()?.name??"");isSubmitting=Ue(false);finishedLoading=Ue(false);backupDefaults=Ue(null);applicationOptions=Ue(null);isNew=Nt(()=>this.backupId()==="new");shouldAutoSave=Nt(()=>!this.isDraft()&&!this.isNew());osType=Nt(()=>this.#t.systemInfo()?.OSType);isSyncMode=Nt(()=>this.generalForm.controls.operationType.value==="Sync");isConnectionStringSaved=Nt(()=>{let t=this.targetUrlModel();return t?this.#a.destinations().some(e=>e.BaseUrl===t):false});selectedOptions=Ue([]);sourceDataFormSignal=L$1(this.sourceDataForm.valueChanges);generalFormSignal=L$1(this.generalForm.valueChanges);encryptionFieldSignal=L$1(this.generalForm.controls.encryption.valueChanges);operationTypeFieldSignal=L$1(this.generalForm.controls.operationType.valueChanges);advancedOptions=Nt(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#s=Ue(null);#l=null;testSignal=this.#s.asReadonly();#_=Ga$1(()=>{let t=this.targetUrlModel(),e=this.#s(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&this.#s.set(null);});#g=Ga$1(()=>{this.targetUrlModel();let e=this.connectionStringId();if(e){let n=this.#a.destinations();if(n.length===0)return;let o=n.find(a=>a.ID===e);!o||o.BaseUrl;}});setTestState(t){this.#s.set(t);}#u(t){return {name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=Nt(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return [Ct,...t]});nonSelectedOptions=Nt(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=false){this.isSubmitting.set(true),this.#p().pipe($u(e=>{let n=this.#d(),o=this.backupId(),a=n;if(a.Backup){e.length>0&&e[0]!==null?n.Backup.ConnectionStringID=e[0]:e.length>0&&e[0]===null&&(n.Backup.ConnectionStringID=void 0);let c=this.targetUrls().slice(1).map((u,T)=>{let N=e[T+1];return {TargetUrl:u.url,ConnectionStringID:N??void 0,UrlKey:u.urlKey}});c.length>0&&(a.Backup.AdditionalTargetURLs=c);}return this.isDraft()&&n.Backup&&(n.Backup.Metadata=this.backupMetadata()),o==="new"||!o||this.isDraft()?this.#i.postApiV1Backups({requestBody:n}):this.#i.putApiV1BackupById({id:o,requestBody:n})}),Bu(()=>this.isSubmitting.set(false))).subscribe({next:()=>{t||this.exit(false);},error:()=>{}});}validateBeforeSubmit(){this.generalForm.markAllAsTouched(),this.sourceDataForm.markAllAsTouched();let t=this.#d(),e=(t.Backup.Name??"").trim()!=="",a=(!(this.generalForm.controls.operationType.value==="Sync")&&this.generalForm.controls.encryption.value!==""&&this.generalForm.controls.encryption.value!=="-")===false||this.generalForm.controls.password.value===this.generalForm.controls.repeatPassword.value&&this.generalForm.controls.password.value!=="";if(!e||!a)return this.#n.open(h,{data:{title:$localize`Validation Error`,message:this.isNew()?$localize`Please fix the errors indicated before creating the backup.`:$localize`Please fix the errors indicated before saving.`,confirmText:$localize`OK`}}),"general";let l=this.targetUrls();if(!(l.length>0&&l.some(T=>T.url.trim()!=="")))return this.#n.open(h,{data:{title:$localize`Destination required`,message:this.isNew()?$localize`You must setup a destination before creating the backup.`:$localize`Please setup a destination before saving.`,confirmText:$localize`OK`}}),"destination";var u=(t.Backup.Sources??[]).filter(T=>T.trim()!=="").length>0;return !u||!this.sourceDataForm.valid?(this.#n.open(h,{data:{title:$localize`Source data required`,message:this.isNew()?$localize`You must setup source data before creating the backup.`:$localize`Please add at least one source path before saving.`,confirmText:$localize`OK`}}),"source"):""}exit(t){if(!t){this.#c(),this.#e.navigate(["/"]);return}this.#n.open(h,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#c(),this.#e.navigate(["/"]));}});}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(l=>`${l.Include?"+":"-"}${l.Expression}`)??[],o=t.Settings?.find(l=>l.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,a={path:[...e,...n].join("\0"),excludes:{filesLargerThan:o===null?void 0:rn(o)}};this.sourceDataForm.patchValue(a);}mapDestinationToForm(t){let e=t,n=t.TargetURL??"",o=(t.ConnectionStringID===-1?null:t.ConnectionStringID)??null,a=n?[{url:n,connectionStringId:o,urlKey:null,save:!!o}]:[],l=e.AdditionalTargetURLs?.map(c=>({url:c.TargetUrl,urlKey:c.UrlKey,connectionStringId:c.ConnectionStringID??null,save:!!c.ConnectionStringID}))??[];this.targetUrls.set([...a,...l]);}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",o=t.Settings?.find(T=>T.Name==="encryption-module"),a=t.Settings?.find(T=>T.Name==="passphrase")?.Value??"",l=o?.Value&&o.Value.length?o.Value:"",c=t.OperationType??"Backup",u={name:t.Name??"",description:t.Description??"",operationType:c};e&&e!==""&&(u.name=e),n&&n!==""&&(u.description=n),l&&l!==""&&(u.encryption=l),a&&a!==""&&(u.password=a,u.repeatPassword=a),this.generalForm.patchValue(u);}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(false);return}let e=this.#r.fromString(t.Repeat)??null,n=this.#m(t.Time);this.scheduleFields.autoRun.set(true),n.date&&this.scheduleFields.nextTime.date.set(n.date),this.scheduleFields.nextTime.time.set(n.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??false),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??false),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??false),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??false),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??false),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??false),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??false);let o=pt(this.scheduleFields),a=Xt.find(l=>JSON.stringify(l.data)===JSON.stringify(o));a?this.scheduleType.set(a.value):this.scheduleType.set("custom");}mapOptionsToForms(t,e=false){let n=["--no-encryption","--skip-files-larger-than","passphrase","keep-time","keep-versions","retention-policy"],o=(t.Settings??[]).map(u=>u);if(e){let u=this.#o.serverSettings()??{};Object.keys(u).filter(T=>T.startsWith("--")).forEach(T=>{o.find(y=>y.Name===T)||o.push({Name:T,Value:u[T],Filter:null});});}let a=o.filter(u=>!n.includes(u.Name)),l=o.filter(u=>n.includes(u.Name));this.settings.set(a??[]),a?.forEach(u=>{if(u.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(u.Value??"")});var c="all";l?.forEach(u=>{if(u.Name==="keep-time"&&(u.Value??"")!=="")return c="time",this.optionsFields.backupRetentionTime.set(u.Value??"");if(u.Name==="keep-versions"&&(u.Value??"")!=="")return c="versions",this.optionsFields.backupRetentionVersions.set(u.Value?parseInt(u.Value):null);if(u.Name==="retention-policy"&&(u.Value??"")!=="")if(u.Value===si)c="smart";else return c="custom",this.optionsFields.backupRetentionCustom.set(u.Value??"")}),this.optionsFields.backupRetention.set(c);}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null);}getScheduleFormValue(){let t=pt(this.scheduleFields);return ai(t)}#d(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,a=this.targetUrls()[0],l=a?.url??null,c=n.path?.split("\0")??[],u=this.mapFormsToSettings(),T=n.excludes?.filesLargerThan;return T&&T.size!==null&&T.unit!==null&&u.push({Name:"--skip-files-larger-than",Value:`${T.size}${T.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:l??null,ConnectionStringID:a?.connectionStringId??null,OperationType:t.operationType??"Backup",Sources:c.filter(N=>!(N.startsWith("-")||N.startsWith("+"))),Settings:u,Filters:c.filter(N=>N.startsWith("-")||N.startsWith("+")).map((N,y)=>({Order:y,Include:N.startsWith("+"),Expression:N.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["dblock-size","compression-module"],o=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy",...n,...n.map(y=>`--${y}`)],a=[{Name:"--no-encryption",Value:"True"}];!(e.operationType==="Sync")&&e.encryption!==""&&e.encryption!==Ct.Key&&(a=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let c=n.map(y=>{let R=this.settings().find(U=>U.Name===y||U.Name==="--"+y);return R?{Name:y,Value:R.Value}:null}).filter(y=>y!==null),u=[];if(!this.isSyncMode())switch(this.optionsFields.backupRetention()){case "time":u.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case "versions":u.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case "custom":u.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case "smart":u.push({Name:"retention-policy",Value:si});break}let T=[...t,...o],N=this.settings().filter(y=>!T.includes(y.Name)).map(y=>{let R=y.Value;return typeof y.Value=="number"&&(R=y.Value.toString()),typeof y.Value=="boolean"&&(R=y.Value?"True":"False"),{Name:y.Name?.startsWith("--")?y.Name:`--${y.Name}`,Value:R}});return [...a,...c,...u,...N]}#p(){let t=this.targetUrls();if(t.length===0)return ty([]);let e=t.map(n=>{if(n.connectionStringId)return ty(n.connectionStringId);if(!n.save)return ty(null);let o=n.url,l=C(o)?.displayName??"Destination";this.#a.destinations().filter(y=>y.Name?.startsWith(l)).length;let N={Name:`${l} ${new Date().toISOString()}`,Description:null,BaseUrl:o};return this.#a.save("new",N).pipe(pt$1(y=>y.Data?.ID??null))});return vy(e).pipe(Ju(n=>{let o=this.targetUrls();n.forEach((a,l)=>{if(a&&l<o.length&&(this.#a.reload(),o[l].connectionStringId!==a)){let c=o[l].urlKey;this.updateTargetUrl(l,o[l].url,a,c);}});}))}#m(t){if(!t||t?.indexOf("T")===-1)return {time:t??"13:00"};let e=new Date(t);return {time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:`${(""+e.getFullYear()).padStart(4,"0")}-${(""+(e.getMonth()+1)).padStart(2,"0")}-${(""+e.getDate()).padStart(2,"0")}`}}setTargetUrl(t,e=false,n=null,o=null){if(e&&(this.#l=null),t===null){this.targetUrls.set([]);return}this.targetUrls.update(a=>{let l=[...a];return l.length===0?l.push({url:t,urlKey:o,connectionStringId:n,save:n?true:pn}):l[0]={url:t,urlKey:o,connectionStringId:n,save:n?true:pn},l});}addTargetUrl(t,e,n){this.targetUrls.update(o=>[...o,{url:t,connectionStringId:e,urlKey:n,save:e?true:pn}]);}updateTargetUrl(t,e,n,o){this.targetUrls.update(a=>{if(t<0||t>=a.length)return a;let l=[...a],c=l[t].save;return l[t]={url:e,connectionStringId:n,urlKey:o,save:n?true:c},l});}toggleSaveConnectionString(t){this.targetUrls.update(e=>{if(t<0||t>=e.length)return e;let n=[...e];return n[t]=m$3(l({},n[t]),{save:!n[t].save}),n});}removeTargetUrl(t){this.targetUrls.update(e=>e.filter((n,o)=>o!==t));}#c(){this.generalForm.reset({operationType:"Backup"}),this.sourceDataForm.reset(),this.scheduleFields=dn(),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrls.set([]);}static \u0275fac=function(e){return new(e||i)};static \u0275prov=ee$1({token:i,factory:i.\u0275fac,providedIn:"root"})};var os=["formRef"];function as(i,t){i&1&&(Qi$1(0,"sh-alert",31),Og(1,5),mg(2,"sh-icon",33),Pg(),Hl());}function rs(i,t){i&1&&(Qi$1(0,"sh-alert",32),Og(1,6),mg(2,"sh-icon",33),Pg(),Hl());}function ss(i,t){if(i&1&&oT(0,as,3,0,"sh-alert",31)(1,rs,3,0,"sh-alert",32),i&2){let e=nC();iT(e.generalFormSignal()?.operationType==="Sync"?0:e.generalFormSignal()?.encryption!==""?1:-1);}}function ls(i,t){if(i&1){let e=gT();Qi$1(0,"div",26)(1,"label"),XT(2,7),Hl(),Qi$1(3,"sh-button-group",34),sm("valueChange",function(o){Sd(e);let a=nC();return HC(a.operationTypeFieldSignal,o)||(a.operationTypeFieldSignal=o),xd(o)}),Qi$1(4,"button",35),Og(5,8),mg(6,"sh-icon",36),Pg(),Hl(),Qi$1(7,"button",37),Og(8,9),mg(9,"sh-icon",36),Pg(),Hl()()();}if(i&2){let e=nC();DE(3),im("value",e.operationTypeFieldSignal),DE(3),gg("shTooltip","Store backups with version history, deduplication, compression and encryption"),DE(3),gg("shTooltip","Copy files from the source to the destination without compression or encryption");}}function _s(i,t){i&1&&(Qi$1(0,"sh-alert",38),Og(1,10),mg(2,"sh-icon",33),Pg(),Hl());}function ds(i,t){if(i&1&&oT(0,_s,3,0,"sh-alert",38),i&2){let e=nC();iT(e.isNew()?0:-1);}}function cs(i,t){if(i&1&&PC(0),i&2){let e=t.$implicit;Gl(" ",e.DisplayName," ");}}function us(i,t){if(i&1&&mg(0,"sh-progress-bar",52),i&2){let e=nC(4);Qg("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),gg("value",e.calculatePasswordStrength()*(100/5));}}function ps(i,t){i&1&&(Qi$1(0,"span",47),XT(1,15),Hl());}function ms(i,t){i&1&&(Og(0,13,1),mg(1,"sh-icon"),Pg());}function gs(i,t){i&1&&(Og(0,13,2),mg(1,"sh-icon"),Pg());}function Cs(i,t){i&1&&(Og(0,16,1),mg(1,"sh-icon",54),Pg());}function Ts(i,t){i&1&&(Og(0,16,2),mg(1,"sh-icon"),Pg());}function hs(i,t){if(i&1){let e=gT();Qi$1(0,"button",53),Fg("click",function(){Sd(e);let o=nC(4);return xd(o.copyPassword())}),Og(1,16),oT(2,Cs,2,0)(3,Ts,2,0),Pg(),Hl();}if(i&2){let e=nC(4);DE(2),iT(e.copiedPassword()?2:3);}}function fs(i,t){i&1&&(Qi$1(0,"sh-alert",51),XT(1,17),Hl());}function Ss(i,t){if(i&1){let e=gT();Qi$1(0,"div",42)(1,"sh-form-field")(2,"label",43),Og(3,12),mg(4,"sup"),Pg(),Hl(),mg(5,"input",44),DD(),Hl(),oT(6,us,1,9,"sh-progress-bar",45),Qi$1(7,"sh-form-field"),mg(8,"input",46),DD(),oT(9,ps,2,0,"span",47),Hl(),Qi$1(10,"div",48)(11,"button",49),Fg("click",function(){Sd(e);let o=nC(3);return xd(o.showPassword.set(!o.showPassword()))}),Og(12,13),oT(13,ms,2,0)(14,gs,2,0),Pg(),Hl(),Qi$1(15,"button",49),Fg("click",function(){Sd(e);let o=nC(3);return xd(o.generatePassword())}),Og(16,14),mg(17,"sh-icon"),Pg(),Hl(),oT(18,hs,4,1,"button",50),Hl(),oT(19,fs,2,0,"sh-alert",51),Hl();}if(i&2){let e=nC(3);DE(5),gg("type",e.showPassword()?"text":"password"),TD(),DE(),iT(e.generalForm.value.password?6:-1),DE(2),gg("type",e.showPassword()?"text":"password"),TD(),DE(),iT(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),DE(4),iT(e.showPassword()?13:14),DE(5),iT(e.showCopyPassword()?18:-1),DE(),iT(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1);}}function Es(i,t){if(i&1&&(Qi$1(0,"sh-select",39)(1,"label",40),XT(2,11),Hl(),mg(3,"input",41),DD(),ig(4,cs,1,1,"ng-template"),Hl(),oT(5,Ss,20,7,"div",42)),i&2){let e=nC(2);gg("options",e.encryptionOptions())("isClearable",false),DE(3),TD(),DE(2),iT(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1);}}function ys(i,t){if(i&1&&oT(0,Es,6,3),i&2){let e=nC();iT(e.isNew()?0:-1);}}function Fs(i,t){if(i&1&&(Qi$1(0,"button",29),Og(1,18),mg(2,"sh-icon"),Pg(),Hl()),i&2){let e=nC();gg("disabled",e.nameAndDescriptionValid()===false);}}function Ns(i,t){if(i&1&&(Qi$1(0,"button",30),Og(1,19),mg(2,"sh-icon"),Pg(),Hl()),i&2){let e=nC();gg("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword());}}var Ze=new jn,li=(i={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:"",operationType:"Backup"})=>Ze.group({name:Ze.control(i.name,[me$1.required]),description:Ze.control(i.description),encryption:Ze.control(i.encryption,[F()]),password:Ze.control(i.password,[y(t=>t?.value.encryption!=="-",[me$1.required])]),repeatPassword:Ze.control(i.repeatPassword,[y(t=>t?.value.encryption!=="-",[me$1.required])]),operationType:Ze.control(i.operationType)}),Ct={Key:"-",DisplayName:"None"},mn=class i{#e=T(ee);#t=T(W);#n=T(m);#i=T(we);#o=T(m$1);formRef=y1.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;operationTypeFieldSignal=Ue("Backup");encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;syncModeSupported=this.#o.hasSyncMode;showPassword=Ue(false);copiedPassword=Ue(false);showCopyPassword=Ue(false);noneOptionKey=Ct.Key;encryptionEffect=Ga$1(()=>{this.encryptionFieldSignal()===Ct.Key&&(this.copiedPassword.set(false),this.showCopyPassword.set(false));});#r=Ga$1(()=>{let t=this.#i.operationTypeFieldSignal();this.operationTypeFieldSignal.set(t??"Backup");});#a=Ga$1(()=>{let t=this.operationTypeFieldSignal();this.generalForm.controls.operationType.setValue(t);});nameAndDescriptionValid=Nt(()=>{this.generalFormSignal();let e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=Nt(()=>{let e=this.generalFormSignal()?.password??"";return this.#n.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus();}exit(){this.#i.exit(true);}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#s(t??""),this.copiedPassword.set(true);}async#s(t){try{await navigator.clipboard.writeText(t);}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n);}catch(n){console.error("Failed to copy text: ",n);}}}generatePassword(){this.copiedPassword.set(false);let t=this.#n.generate(41);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(true);}next(){this.#i.shouldAutoSave()&&this.#i.submit(true),this.#e.navigate(["destination"],{relativeTo:this.#t.parent});}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=dw({type:i,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&$g(n.formRef,os,5),e&2&&lC();},decls:23,vars:5,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let o;o=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let l;l=$localize`Backup description`;let c;c=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let u;u=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrows-left-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Synchronization job - files are not encrypted `;let T;T=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let N;N=$localize`Operation mode`;let y;y=$localize` Backup ${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON: info ${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON:`;let R;R=$localize` Sync ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON: info ${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: This is a synchronization job. Files are copied without encryption. `;let A;A=$localize`Encryption`;let J;J=$localize`Encryption`;let X;X=$localize`Password`;let V;V=$localize`Repeat password`;let B;B=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let xe;xe=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,xe=tC(xe);let ke;ke=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let be;be=$localize`Passwords do not match`;let Re;Re=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Re=tC(Re);let Pe;Pe=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let lt;lt=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let _t;return _t=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,l,c,u,T,N,y,R,U,J,B,xe,ke,be,Re,Pe,lt,_t,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"mode-toggle"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],[1,"primary","accent"],[1,"primary"],["icon",""],[3,"valueChange","value"],["value","Backup","type","button"],[3,"shTooltip"],["value","Sync","type","button"],[1,"accent"],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",A,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",X,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",V,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){e&1&&(Qi$1(0,"form",20,0),Fg("submit",function(){return n.next()}),Qi$1(2,"h3",21),XT(3,1),Hl(),oT(4,ss,2,1),Qi$1(5,"sh-form-field")(6,"label",22),Og(7,2),mg(8,"sup"),Pg(),Hl(),mg(9,"input",23),DD(),Hl(),Qi$1(10,"sh-form-field")(11,"label",24),XT(12,3),Hl(),mg(13,"textarea",25),DD(),Hl(),oT(14,ls,10,3,"div",26),oT(15,ds,1,1)(16,ys,1,1),Qi$1(17,"div",27)(18,"button",28),Fg("click",function(){return n.exit()}),Og(19,4),mg(20,"sh-icon"),Pg(),Hl(),oT(21,Fs,3,1,"button",29)(22,Ns,3,1,"button",30),Hl()()),e&2&&(gg("formGroup",n.generalForm),DE(4),iT(n.isNew()?-1:4),DE(5),TD(),DE(4),TD(),DE(),iT(n.isNew()&&n.syncModeSupported()?14:-1),DE(),iT(n.generalFormSignal()?.operationType==="Sync"?15:16),DE(6),iT(n.generalFormSignal()?.operationType==="Sync"||n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?21:22));},dependencies:[Gn,Tn,Ze$1,Rn,Pn,gn,hn,Fe,Nt$1,v,N,d,ue,at$1,x],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}.mode-toggle[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;width:100%;transition:transform 125ms linear;transform:scale(1);gap:.25rem}.mode-toggle[_ngcontent-%COMP%] sh-button-group[_ngcontent-%COMP%]{width:100%}"]})};
|
|
14
|
+
var chunkJD5JT5QX=/*#__PURE__*/Object.freeze({__proto__:null,NONE_OPTION:Ct,createGeneralForm:li,default:mn});var chunkTEZCH65O=/*#__PURE__*/Object.freeze({__proto__:null,createSourceDataForm:ri,default:cn});var chunkB3SBCILA=/*#__PURE__*/Object.freeze({__proto__:null,SCHEDULE_DEFAULT_OPTIONS:Xt,SCHEDULE_FIELD_DEFAULTS:dn,default:_n,scheduleOptionToSchedule:ai});export{Ht as H,Qt as Q,at as a,Qe as b,chunkJD5JT5QX as c,chunkTEZCH65O as d,en as e,chunkB3SBCILA as f,gt as g,jt as j,ot as o,we as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {G}from'./chunk-CuU6b3lp.js';import {w as w$1}from'./chunk-ySdaWJYB.js';import {w as we}from'./chunk-BUF3tczf.js';import'./chunk-IEVZ0UN6.js';import'./chunk-BNf0YAwH.js';import'./chunk-BAbAUjHY.js';import'./chunk-BPpheyQK.js';import'./chunk-birClroL.js';import'./chunk-bx0aDvCZ.js';import {e as ee$1}from'./chunk-BMGXb3gX.js';import'./chunk-BqjWEFHw.js';import'./chunk-BS8yAz3P.js';import'./chunk-CtLFpDTP.js';import'./chunk-CxPG-KgI.js';import'./chunk-B-ryE8KW.js';import'./chunk-CDRHCSvU.js';import'./chunk-5zEiKCqR.js';import'./chunk-CMs999gl.js';import'./chunk-CdZVal1F.js';import {T,aw as W,e as ee,U as Ue,G as Ga,b5 as k$1,d as dw,Z as lr,_ as _t,a8 as To,j as mg,o as oT,Q as Qi,H as Hl,D as DE,i as iT,aD as zC,I as Qg,n as nC,X as XT,z as gg,a3 as QC,a_ as ZC}from'./main-TZVLLK67.js';import'./chunk-DWwNINBJ.js';import'./chunk-CUxvfCTH.js';import'./chunk-C4pJCbq-.js';import {L}from'./chunk-M5tldLvJ.js';import'./chunk-BjNuU0J_.js';import'./chunk-CU-RYihf.js';import'./chunk-Do6_xsGi.js';import'./chunk-BOII3Fdm.js';import'./chunk-BffC_BAn.js';var w=()=>["/restore-from-files/destination"],k=()=>["/restore-from-files/encryption"],x=()=>["/restore-from-files/select-files"],J=()=>["/restore-from-files/options"],X=t=>["/restore",t,"select-files"],D=t=>["/restore",t,"options"];function z(t,n){t&1&&(Qi(0,"div",7),XT(1,0),Hl(),Qi(2,"div",7),XT(3,1),Hl(),Qi(4,"div",8),XT(5,2),Hl(),Qi(6,"div",8),XT(7,3),Hl()),t&2&&(gg("routerLink",QC(4,w)),DE(2),gg("routerLink",QC(5,k)),DE(2),gg("routerLink",QC(6,x)),DE(2),gg("routerLink",QC(7,J)));}function B(t,n){if(t&1&&(Qi(0,"div",7),XT(1,4),Hl(),Qi(2,"div",7),XT(3,5),Hl()),t&2){let e=nC(2);gg("routerLink",ZC(2,X,e.backupId())),DE(2),gg("routerLink",ZC(4,D,e.backupId()));}}function U(t,n){if(t&1&&(Qi(0,"sh-stepper",6),oT(1,z,8,8)(2,B,4,6),Hl()),t&2){let e=nC();DE(),iT(e.isFileRestore()?1:2);}}var f=class t{#e=T(W);#n=T(ee);#t=T(G);#i=L(this.#e.params);#o=L(this.#e.url);#r=L(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isFullWidthPage=Ue(false);paramsChanged=Ga(()=>{let n=this.#r(),e=this.#i()?.id,r=!!this.#o()?.find(s=>s.path==="restore-from-files"),d=!!n?.find(s=>s.path==="select-files"),R=!!n?.find(s=>s.path==="progress");this.isFullWidthPage.set(R||d),this.#t.init(e,r);});ngOnInit(){this.#n.events.subscribe(n=>{if(n instanceof k$1){let e=n.urlAfterRedirects;this.isFullWidthPage.set(e.includes("progress")||e.includes("select-files"));}});}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=dw({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,r){e&2&&Qg("full-width",r.isFullWidthPage());},features:[zC([G,we])],decls:4,vars:1,consts:()=>{let n;n=$localize` Destination `;let e;e=$localize` Encryption `;let r;r=$localize` Select files `;let d;d=$localize` Options `;let R;R=$localize` Select files `;let s;return s=$localize`Options`,[n,e,r,d,R,s,[1,"primary"],["tabindex","-1","routerLinkActive","active",3,"routerLink"],["tabindex","-1","routerLinkActive","active",1,"inactive",3,"routerLink"]]},template:function(e,r){e&1&&(mg(0,"app-status-bar"),oT(1,U,3,1,"sh-stepper",6),Qi(2,"section"),mg(3,"router-outlet"),Hl()),e&2&&(DE(),iT(r.isFullWidthPage()?-1:1));},dependencies:[w$1,ee$1,lr,_t,To],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{margin:2.5rem 2rem;width:calc(100% - 4rem)}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}@media only screen and (max-width:768px){section[_ngcontent-%COMP%]{padding:0 2rem}}.inactive[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}"]})};export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {d}from'./chunk-DofVJ9gn.js';import'./chunk-BNf0YAwH.js';import'./chunk-BAbAUjHY.js';import'./chunk-BPpheyQK.js';import {J}from'./chunk-birClroL.js';import'./chunk-bx0aDvCZ.js';import {O as Oe$1,F as Fe$1}from'./chunk-CtLFpDTP.js';import'./chunk-CxPG-KgI.js';import'./chunk-B-ryE8KW.js';import'./chunk-CDRHCSvU.js';import'./chunk-CMs999gl.js';import {D}from'./chunk-CdZVal1F.js';import {T,ab as C,e as ee,ah as fe,a5 as g,U as Ue,N as Nt,ai as m,aj as l,C as Bu,d as dw,v,f as N,aH as m$1,be as m$2,Q as Qi,X as XT,H as Hl,o as oT,F as Fg,j as mg,O as Og,P as Pg,D as DE,i as iT,z as gg,k as gT,a1 as cT,s as sm,S as Sd,n as nC,l as HC,x as xd,a2 as lT,w as im,p as DD,q as PC,y as TD,I as Qg,aa as Gl,ar as Wp,aM as tb,au as Lg,aR as rb,av as eC,aN as ob}from'./main-TZVLLK67.js';import {f}from'./chunk-DWwNINBJ.js';import {d as d$1}from'./chunk-BjNuU0J_.js';import {U}from'./chunk-CU-RYihf.js';import {F as Fe$2}from'./chunk-Do6_xsGi.js';import {B as Bn,Z as Ze,R as Rn,J as Jt}from'./chunk-BOII3Fdm.js';import {a as at}from'./chunk-BffC_BAn.js';import'./chunk-M5tldLvJ.js';var Oe=(n,t)=>t.BackupId;function Fe(n,t){n&1&&(Qi(0,"div",14),mg(1,"sh-progress-bar",20),Qi(2,"p"),XT(3,3),Hl()());}function Pe(n,t){n&1&&(Qi(0,"div",15)(1,"p"),XT(2,4),Hl()());}function Me(n,t){if(n&1){let e=gT();Qi(0,"sh-icon",33),Fg("click",function(){Sd(e);let o=nC(3);return xd(o.searchTerm.set(""))}),PC(1,"x-circle"),Hl();}}function he(n,t){if(n&1){let e=gT();Qi(0,"div",27)(1,"sh-form-field")(2,"input",28),sm("ngModelChange",function(o){Sd(e);let c=nC(2);return HC(c.searchTerm,o)||(c.searchTerm=o),xd(o)}),Hl(),DD(),Qi(3,"sh-icon",29),PC(4,"magnifying-glass"),Hl(),oT(5,Me,2,0,"sh-icon",30),Hl()(),Qi(6,"div",31)(7,"button",32),Fg("click",function(){Sd(e);let o=nC(2);return xd(o.selectAll())}),XT(8,6),Hl(),Qi(9,"button",32),Fg("click",function(){Sd(e);let o=nC(2);return xd(o.selectNone())}),XT(10,7),Hl()();}if(n&2){let e=nC(2);DE(2),im("ngModel",e.searchTerm),TD(),DE(3),iT(e.searchTerm()?5:-1),DE(2),gg("disabled",e.allSelected()),DE(2),gg("disabled",e.noneSelected());}}function Le(n,t){if(n&1&&(Qi(0,"div"),XT(1,8),tb(2,"bytes"),Hl()),n&2){let e=nC().$implicit;DE(2),Lg(rb(2,1,e.Metadata?.SourceFilesSize)),eC(1);}}function ye(n,t){if(n&1&&(Qi(0,"div"),XT(1,9),tb(2,"bytes"),Hl()),n&2){let e=nC().$implicit;DE(2),Lg(rb(2,1,e.Metadata?.TargetFilesSize)),eC(1);}}function Ae(n,t){if(n&1&&(Qi(0,"div"),XT(1,10),tb(2,"relativeTime"),Hl()),n&2){let e=nC().$implicit;DE(2),Lg(ob(2,1,e.Metadata?.LastBackupFinished,false)),eC(1);}}function Re(n,t){if(n&1){let e=gT();Qi(0,"sh-card",34),Fg("click",function(){let o=Sd(e).$implicit,c=nC(2);return xd(c.toggleSelected(o.BackupId))}),Qi(1,"sh-checkbox",35),sm("checkedChange",function(o){let c=Sd(e).$implicit;return HC(c.Selected,o)||(c.Selected=o),xd(o)}),Qi(2,"h3"),PC(3),Qi(4,"sh-chip",36),mg(5,"img",37),PC(6),Hl()()(),Qi(7,"div",38),oT(8,Le,3,3,"div"),oT(9,ye,3,3,"div"),oT(10,Ae,3,4,"div"),Hl()();}if(n&2){let e=t.$implicit,i=nC(2);Qg("unmatched",e.Match===false),DE(),im("checked",e.Selected),DE(2),Gl(" ",e.Name," "),DE(2),gg("src",i.getBackendIcon(e.TargetURLDisplay),Wp),DE(),Gl(" ",i.getBackendType(e.TargetURLDisplay)," "),DE(2),iT(e.Metadata?.SourceFilesSize?8:-1),DE(),iT(e.Metadata?.TargetFilesSize?9:-1),DE(),iT(e.Metadata?.LastBackupFinished?10:-1);}}function Ge(n,t){if(n&1){let e=gT();Qi(0,"sh-toggle",26),sm("checkedChange",function(o){Sd(e);let c=nC(2);return HC(c.saveNow,o)||(c.saveNow=o),xd(o)}),Og(1,11),mg(2,"sh-icon",39),Pg(),Hl();}if(n&2){let e=nC(2);gg("color","primary"),im("checked",e.saveNow),DE(2),gg("shTooltip","Save backups without editing the configuration");}}function De(n,t){n&1&&(Qi(0,"sh-toggle",25),Og(1,12),mg(2,"sh-icon",39),Pg(),Hl()),n&2&&(gg("color","primary")("checked",true)("disabled",true),DE(2),gg("shTooltip","Save now can only be disabled when importing a single backup"));}function ke(n,t){if(n&1){let e=gT();oT(0,he,11,4),Qi(1,"div",21),cT(2,Re,11,9,"sh-card",22,Oe),Hl(),Qi(4,"div",23),oT(5,Ge,3,3,"sh-toggle",24)(6,De,3,4,"sh-toggle",25),Qi(7,"sh-toggle",26),sm("checkedChange",function(o){Sd(e);let c=nC();return HC(c.importMetadata,o)||(c.importMetadata=o),xd(o)}),XT(8,5),Hl()();}if(n&2){let e=nC();iT(e.configs().length>1?0:-1),DE(2),lT(e.configsSorted()),DE(3),iT(e.selectedItems().length<=1?5:6),DE(2),gg("color","primary"),im("checked",e.importMetadata);}}function $e(n,t){n&1&&XT(0,2,1);}function be(n,t){n&1&&XT(0,2,2);}var w=class n{#t=T(d);#n=T(C);#e=T(ee);#i=T(fe);#o=T(g);getBackendType=Oe$1;getBackendIcon=Fe$1;isLoading=Ue(true);isImporting=Ue(false);configs=Ue([]);saveNow=Ue(false);importMetadata=Ue(false);searchTerm=Ue("");allSelected=Nt(()=>this.selectedItems().length===this.configs().length);noneSelected=Nt(()=>this.selectedItems().length===0);configsSorted=Nt(()=>{let t=this.searchTerm().toLowerCase();return this.configs().map(e=>m(l({},e),{Match:t?e.Name?.toLowerCase().includes(t):null})).sort((e,i)=>(e.Name??"").localeCompare(i.Name??"")).sort((e,i)=>e.Match===i.Match?0:e.Match?-1:1)});ngOnInit(){let t=this.#t.temporaryBackupId();if(!t){this.#e.navigate(["/backup/import-destination/destination"]);return}this.#n.postApiV1BackupByIdRestoreTaskConfig({id:t}).pipe(Bu(()=>this.isLoading.set(false))).subscribe({next:e=>{let i=e.sort((o,c)=>(o.Name??"").localeCompare(c.Name??"")).map(o=>m(l({},o),{Selected:e.length===1}));this.configs.set(i);},error:e=>{this.#t.showErrorDialog(e.message||"Failed to fetch configurations");}});}toggleSelected(t){this.configs.update(e=>e.map(i=>i.BackupId===t?m(l({},i),{Selected:!i.Selected}):i));}selectAll(){this.configs.update(t=>t.map(e=>m(l({},e),{Selected:true})));}selectNone(){this.configs.update(t=>t.map(e=>m(l({},e),{Selected:false})));}selectedItems=Nt(()=>this.configs().filter(t=>t.Selected));import(){let t=this.selectedItems();if(t.length===0)return;let e=this.importMetadata(),i=this.saveNow()||t.length!==1;this.isImporting.set(true);let o=c=>{if(c>=t.length){this.isImporting.set(false),this.#i.success($localize`Successfully imported ${t.length} backup(s)`),this.#e.navigate(["/"]);return}let N=t[c];this.#n.postApiV1BackupByIdImportfromtemp({requestBody:{BackupId:N.BackupId,ImportMetadata:e,Direct:i}}).subscribe({next:u=>{if(i)this.configs.update(I=>I.filter(G=>G.BackupId!==N.BackupId)),o(c+1);else {this.isImporting.set(false);let I=this.#o.addDraftBackup(u.data);this.#e.navigate(["/backup-draft",I]);}},error:u=>{this.isImporting.set(false),this.#t.showErrorDialog(`Failed to import ${N.Name}: ${u.message}`);}});};o(0);}back(){this.#e.navigate(["/backup/import-destination/encryption"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=dw({type:n,selectors:[["app-import-destination-select-config"]],decls:14,vars:4,consts:()=>{let t;t=$localize`Select configurations to import`;let e;e=$localize`Back`;let i;i=$localize`${"\uFFFD*12:1\uFFFD"}:START_BLOCK_IF: Importing... ${"\uFFFD/*12:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*13:2\uFFFD"}:START_BLOCK_ELSE: Import selected ${"\uFFFD/*13:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let o;o=$localize`Fetching backup configurations from destination...`;let c;c=$localize`No backup configurations found at this destination.`;let N;N=$localize`Import metadata`;let u;u=$localize`Search for destination...`;let I;I=$localize`Select all`;let G;G=$localize`Select none`;let K;K=$localize` Source size: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize` Target size: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let J;J=$localize` Last backup: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let X;X=$localize` Save now ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let z;return z=$localize` Save now ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON: info ${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,e,i,o,c,N,I,G,K,U,J,X,z,[1,"content-wrapper"],[1,"loading-state"],[1,"empty-state"],[1,"actions"],["shButton","",3,"click","disabled"],[1,"spacer"],["shButton","",1,"primary","raised",3,"click","disabled"],[1,"primary","indeterminate"],[1,"config-list"],[1,"type-a","actionable","full-width",3,"unmatched"],[1,"options"],[3,"color","checked"],[3,"color","checked","disabled"],[3,"checkedChange","color","checked"],[1,"search-area"],["type","text","placeholder",u,3,"ngModelChange","ngModel"],["prefix",""],["suffix","",1,"clear-search"],[1,"list-actions"],["shButton","",1,"small",3,"click","disabled"],["suffix","",1,"clear-search",3,"click"],[1,"type-a","actionable","full-width",3,"click"],[1,"primary","raised",3,"checkedChange","checked"],[1,"small","provider"],["alt","",1,"provider-icon",3,"src"],[1,"metadata"],[1,"small",3,"shTooltip"]]},template:function(e,i){e&1&&(Qi(0,"div",13)(1,"h2"),XT(2,0),Hl(),oT(3,Fe,4,0,"div",14)(4,Pe,3,0,"div",15)(5,ke,9,4),Qi(6,"div",16)(7,"button",17),Fg("click",function(){return i.back()}),XT(8,1),Hl(),mg(9,"div",18),Qi(10,"button",19),Fg("click",function(){return i.import()}),Og(11,2),oT(12,$e,1,0)(13,be,1,0),Pg(),Hl()()()),e&2&&(DE(3),iT(i.isLoading()?3:i.configs().length===0?4:5),DE(4),gg("disabled",i.isImporting()),DE(3),gg("disabled",i.isImporting()||i.selectedItems().length===0||i.isLoading()),DE(2),iT(i.isImporting()?12:13));},dependencies:[v,f,J,U,Bn,Ze,Rn,Jt,d$1,at,N,D,Fe$2,m$1,m$2],styles:["[_nghost-%COMP%]{display:block;padding:2rem;max-width:50rem;margin:0 auto}.loading-state[_ngcontent-%COMP%], .empty-state[_ngcontent-%COMP%]{text-align:center;padding:4rem 2rem}.loading-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-top:1rem;color:var(--color-on-surface-variant)}h2[_ngcontent-%COMP%]{margin-bottom:2rem}.search-area[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:1rem;margin-bottom:2rem}.list-actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:.5rem;margin-bottom:.5rem;justify-content:flex-end}.clear-search[_ngcontent-%COMP%]{opacity:.6;cursor:pointer}.config-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;margin-bottom:2rem}.config-list[_ngcontent-%COMP%] sh-card[_ngcontent-%COMP%]{padding:1rem;cursor:pointer;display:flex;flex-direction:column;gap:.5rem}.config-list[_ngcontent-%COMP%] sh-card.unmatched[_ngcontent-%COMP%]{opacity:.4}.config-list[_ngcontent-%COMP%] sh-card[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem;flex-grow:1}.config-list[_ngcontent-%COMP%] sh-card[_ngcontent-%COMP%] .provider[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.config-list[_ngcontent-%COMP%] sh-card[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;margin-left:1.75rem}.provider-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem}.options[_ngcontent-%COMP%]{margin-bottom:2rem;display:flex;flex-direction:column;gap:1rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:2rem}.actions[_ngcontent-%COMP%] .spacer[_ngcontent-%COMP%]{flex:1}"]})};export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {m,C as C$1,F}from'./chunk-IEVZ0UN6.js';import {J}from'./chunk-birClroL.js';import {x}from'./chunk-CDRHCSvU.js';import {T,a6 as be$1,ab as C,aw as W,e as ee,ax as De,a5 as g,U as Ue$1,N as Nt,G as Ga,at as h,ay as $u,az as t,aA as y,aj as l,C as Bu,d as dw,_ as _t,f as N,v,u as ue,Q as Qi,q as PC,O as Og,j as mg,P as Pg,H as Hl,F as Fg,s as sm,p as DD,o as oT,D as DE,z as gg,a3 as QC,I as Qg,aB as rm,w as im,y as TD,i as iT,t as tC,l as HC,k as gT,S as Sd,n as nC,x as xd,E as nm,X as XT,au as Lg,av as eC}from'./main-TZVLLK67.js';import {L}from'./chunk-M5tldLvJ.js';import {d}from'./chunk-BjNuU0J_.js';import {F as Fe}from'./chunk-Do6_xsGi.js';import {j as jn,m as me,G as Gn,T as Tn,Z as Ze,y as yt,R as Rn,P as Pn,g as gn,h as hn}from'./chunk-BOII3Fdm.js';import {a as at}from'./chunk-BffC_BAn.js';var Xe=()=>["/"];function be(t,o){t&1&&(Qi(0,"sh-toggle",25),Og(1,5),mg(2,"input",28),DD(),Pg(),Hl()),t&2&&(DE(2),TD());}function Ge(t,o){t&1&&(Qi(0,"span",31),XT(1,9),Hl());}function Be(t,o){if(t&1&&(Qi(0,"span",31),XT(1,10),Hl()),t&2){let e=nC(2);DE(),Lg(e.exportForm.controls.password.errors?.minlength.requiredLength),eC(1);}}function ve(t,o){if(t&1&&mg(0,"sh-progress-bar",38),t&2){let e=nC(2);Qg("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),gg("value",e.calculatePasswordStrength()*(100/5));}}function ke(t,o){t&1&&(Qi(0,"span",31),XT(1,11),Hl());}function Ue(t,o){t&1&&(Qi(0,"span",31),XT(1,12),Hl());}function Ke(t,o){if(t&1&&(Qi(0,"span",31),XT(1,13),Hl()),t&2){let e=nC(2);DE(),Lg(e.exportForm.controls.repeatPassword.errors?.minlength.requiredLength),eC(1);}}function Je(t,o){t&1&&(Og(0,7,1),mg(1,"sh-icon"),Pg());}function He(t,o){t&1&&(Og(0,7,2),mg(1,"sh-icon"),Pg());}function ze(t,o){t&1&&(Og(0,14,1),mg(1,"sh-icon",40),Pg());}function Ve(t,o){t&1&&(Og(0,14,2),mg(1,"sh-icon"),Pg());}function qe(t,o){if(t&1){let e=gT();Qi(0,"button",39),Fg("click",function(){Sd(e);let a=nC(2);return xd(a.copyPassword())}),Og(1,14),oT(2,ze,2,0)(3,Ve,2,0),Pg(),Hl();}if(t&2){let e=nC(2);DE(2),iT(e.copiedPassword()?2:3);}}function je(t,o){t&1&&(Qi(0,"sh-alert",37),XT(1,15),Hl());}function We(t,o){if(t&1){let e=gT();Qi(0,"div",26)(1,"sh-form-field")(2,"label",29),Og(3,6),mg(4,"sup"),Pg(),Hl(),mg(5,"input",30),DD(),oT(6,Ge,2,0,"span",31)(7,Be,2,1,"span",31),Hl(),oT(8,ve,1,9,"sh-progress-bar",32),Qi(9,"sh-form-field"),mg(10,"input",33),DD(),oT(11,ke,2,0,"span",31)(12,Ue,2,0,"span",31)(13,Ke,2,1,"span",31),Hl(),Qi(14,"div",34)(15,"button",35),Fg("click",function(){Sd(e);let a=nC();return xd(a.showPassword.set(!a.showPassword()))}),Og(16,7),oT(17,Je,2,0)(18,He,2,0),Pg(),Hl(),Qi(19,"button",35),Fg("click",function(){Sd(e);let a=nC();return xd(a.generatePassword())}),Og(20,8),mg(21,"sh-icon"),Pg(),Hl(),oT(22,qe,4,1,"button",36),Hl(),oT(23,je,2,0,"sh-alert",37),Hl();}if(t&2){let e=nC();DE(5),gg("type",e.showPassword()?"text":"password"),TD(),DE(),iT(e.exportForm.controls.password.errors?.required?6:e.exportForm.controls.password.errors?.minlength?7:-1),DE(2),iT(e.exportForm.value.password?8:-1),DE(2),gg("type",e.showPassword()?"text":"password"),TD(),DE(),iT(e.exportForm.value.repeatPassword&&e.exportForm.value.repeatPassword!==e.exportForm.value.password?11:e.exportForm.controls.repeatPassword.errors?.required?12:e.exportForm.controls.repeatPassword.errors?.minlength?13:-1),DE(6),iT(e.showPassword()?17:18),DE(5),iT(e.showCopyPassword()?22:-1),DE(),iT(e.exportForm.value.password&&e.exportForm.value.password===e.exportForm.value.repeatPassword?23:-1);}}function Qe(t,o){if(t&1&&(Qi(0,"div",27)(1,"code"),PC(2),Hl()()),t&2){let e=nC();DE(2),nm(e.exportedCmd());}}var I=new jn,K=class t$1{#o=T(m);#n=T(be$1);#t=T(C);#e=T(W);#i=T(ee);#r=T(De);#s=T(g);isExporting=Ue$1(false);exportType=Ue$1("file");exportedCmd=Ue$1(null);exportForm=I.group({exportPasswords:I.control(true),encryption:I.control(false,[me.required,F()]),password:I.control("",[C$1("encryption",true,[me.required,me.minLength(3)])]),repeatPassword:I.control("",[C$1("encryption",true,[me.required,me.minLength(3)])])});exportFormSignal=L(this.exportForm.valueChanges);encryptionFieldSignal=Nt(()=>(this.exportFormSignal()?.encryption??false)&&this.exportType()==="file");activeBackup=Nt(()=>this.#s.backups().find(o=>o.Backup?.ID===this.#e.snapshot.params.id));showPassword=Ue$1(false);copiedPassword=Ue$1(false);showCopyPassword=Ue$1(false);calculatePasswordStrength=Nt(()=>{let e=this.exportFormSignal()?.password??"";return this.#o.calculatePasswordStrength(e)});showPasswordEffect=Ga(()=>{this.showPassword()&&this.exportForm.updateValueAndValidity();});disablePasswordForCommandLine=Ga(()=>{this.exportType()==="cmd"&&this.exportForm.controls.encryption.setValue(false);});submit(){if(this.exportType()==="file"&&this.exportFormSignal()?.exportPasswords===true&&!this.exportFormSignal()?.encryption){this.#n.open(h,{data:{title:$localize`Export without encryption?`,message:$localize`Are you sure you want to export your backup without encryption?`,confirmText:$localize`Yes, write plain-text passwords`,cancelText:$localize`Cancel`},closed:o=>{o&&this.submitApproved();}});return}this.submitApproved();}submitApproved(){this.isExporting.set(true),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe($u(o=>{let e=T=>{let O=Object.entries(T);return O?"?"+O.filter(([h,E])=>E!=null).map(([h,E])=>`${encodeURIComponent(h)}=${encodeURIComponent(E)}`).join("&"):""},n=this.exportFormSignal()?.password?.length?this.exportFormSignal()?.password:void 0,a=t.BASE||"";return this.#r.get(`${a}/api/v1/backup/${this.#e.snapshot.params.id}/export${e({"export-passwords":this.exportFormSignal()?.exportPasswords??void 0,passphrase:n,token:o.Token})}`,{responseType:"blob",headers:new y(l({},t.HEADERS??{}))})}),Bu(()=>this.isExporting.set(false))).subscribe({next:o=>{let n=this.activeBackup()?.Backup?.Name??"Backup",a=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(o,`${n}-duplicati-config.${a}`),this.#i.navigate(["/"]);},error:o=>{}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe(Bu(()=>this.isExporting.set(false))).subscribe({next:o=>{this.exportedCmd.set(o.Command??null);},error:o=>{}});}downloadFile(o,e){let n=window.URL.createObjectURL(o),a=document.createElement("a");a.href=n,a.download=e,a.click(),window.URL.revokeObjectURL(n);}async copyPassword(){let o=this.exportForm.controls.password.value;await this.#a(o??""),this.copiedPassword.set(true);}async#a(o){try{await navigator.clipboard.writeText(o);}catch{try{let n=document.createElement("textarea");n.value=o,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n);}catch(n){console.error("Failed to copy text: ",n);}}}generatePassword(){this.copiedPassword.set(false);let o=this.#o.generate(16);this.exportForm.controls.password.setValue(o),this.exportForm.controls.repeatPassword.setValue(o),this.showCopyPassword.set(true);}static \u0275fac=function(e){return new(e||t$1)};static \u0275cmp=dw({type:t$1,selectors:[["app-export"]],decls:26,vars:13,consts:()=>{let o;o=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let n;n=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: As command line `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:file${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: To file `;let T;T=$localize` Export passwords ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Encrypt file ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let h;h=$localize`Password`;let E;E=$localize`Repeat password`;let J;J=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let w;w=$localize`${"\uFFFD*17:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*17:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*18:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*18:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=tC(w);let H;H=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let z;z=$localize`Passwords are required`;let V;V=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let q;q=$localize`Passwords do not match`;let j;j=$localize`Passwords are required`;let W;W=$localize` Passwords must be at least ${"\uFFFD0\uFFFD"}:INTERPOLATION: characters long `;let D;D=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,D=tC(D);let Q;return Q=$localize` Tip: Be sure to save your password. If you lose it, you will not be able to import the configuration. `,[o,e,n,a,T,O,J,w,H,z,V,q,j,W,D,Q,[1,"actions"],["shButton","",1,"outlined",3,"routerLink"],["shButton","",1,"raised","primary",3,"click","shTooltip","disabled"],["autocomplete","off",3,"formGroup"],[1,"type-b",3,"valueChange","value"],["value","cmd"],["value","file"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],[1,"passwords"],[1,"cmd-output"],["type","checkbox","formControlName","encryption"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],["error",""],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",E,"formControlName","repeatPassword",3,"type"],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],[1,"primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){e&1&&(Qi(0,"header")(1,"h3"),PC(2," Export backup configuration "),Qi(3,"div",16)(4,"button",17),Og(5,0),mg(6,"sh-icon"),Pg(),Hl(),Qi(7,"button",18),Fg("click",function(){return n.submit()}),Og(8,1),mg(9,"sh-icon"),Pg(),Hl()()(),Qi(10,"p"),PC(11),Hl()(),Qi(12,"form",19)(13,"sh-button-group",20),sm("valueChange",function(T){return HC(n.exportType,T)||(n.exportType=T),T}),Qi(14,"button",21),Og(15,2),mg(16,"sh-icon"),Pg(),Hl(),Qi(17,"button",22),Og(18,3),mg(19,"sh-icon"),Pg(),Hl()(),Qi(20,"sh-toggle",23),Og(21,4),mg(22,"input",24),DD(),Pg(),Hl(),oT(23,be,3,0,"sh-toggle",25),oT(24,We,24,8,"div",26),oT(25,Qe,3,1,"div",27),Hl()),e&2&&(DE(4),gg("routerLink",QC(12,Xe)),DE(3),Qg("loading",n.isExporting()),gg("shTooltip",n.encryptionFieldSignal()?"Remember to copy the password":"")("disabled",n.exportForm.invalid||n.showCopyPassword()&&!n.copiedPassword()||n.encryptionFieldSignal()&&n.exportForm.value.repeatPassword!==n.exportForm.value.password),DE(4),rm("#",n.activeBackup()?.Backup?.ID,": ",n.activeBackup()?.Backup?.Name),DE(),gg("formGroup",n.exportForm),DE(),im("value",n.exportType),DE(9),TD(),DE(),iT(n.exportType()==="file"?23:-1),DE(),iT(n.encryptionFieldSignal()?24:-1),DE(),iT(n.exportedCmd()?25:-1));},dependencies:[Gn,Tn,Ze,yt,Rn,Pn,gn,hn,_t,x,J,N,Fe,v,ue,d,at],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}.hide[_ngcontent-%COMP%]{display:none}"]})};export{K as default};
|