@duplicati/ngclient 0.0.141 → 0.0.143
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/backgrounds/base-bg.svg +1 -1
- package/assets/duplicati-logo.svg +1 -1
- package/assets/sh-bold.woff2 +0 -0
- package/assets/sh.woff2 +0 -0
- package/assets/ship.css +81 -0
- package/assets/spk.woff2 +0 -0
- package/chunk-2NU5Y4V7.js +1 -0
- package/chunk-2RB5RKNM.js +1 -0
- package/chunk-36RDZAZ4.js +1 -0
- package/{chunk-ULLALJQ2.js → chunk-3UN32GIC.js} +1 -1
- package/chunk-4YL5DZVH.js +1 -0
- package/chunk-5AENPWCF.js +1 -0
- package/chunk-5PSLWJTF.js +1 -0
- package/chunk-66BSPEOQ.js +1 -0
- package/chunk-6BCYG4Y6.js +1 -0
- package/chunk-6GC5VKTI.js +1 -0
- package/chunk-6WWCFRZ5.js +1 -0
- package/chunk-6XBSQDXR.js +2 -0
- package/{chunk-B6OIHB5W.js → chunk-73RDJP55.js} +1 -1
- package/{chunk-ELFZD53L.js → chunk-7AMBMWZP.js} +1 -1
- package/chunk-7WD3AN66.js +1 -0
- package/{chunk-DBD6FOQL.js → chunk-7X7K5IXS.js} +2 -2
- package/chunk-AB2L3URR.js +1 -0
- package/chunk-ACH476VA.js +1 -0
- package/chunk-AO4O42CM.js +1 -0
- package/chunk-ARXKB7WH.js +1 -0
- package/{chunk-UZK7ABRM.js → chunk-B5FUQFEQ.js} +1 -1
- package/chunk-BGUKMOKY.js +1 -0
- package/chunk-BIETD4DI.js +1 -0
- package/chunk-BSP6AKSZ.js +1 -0
- package/chunk-BXRW2LGW.js +1 -0
- package/chunk-CFNP4FBG.js +2 -0
- package/chunk-CTEFMU6N.js +1 -0
- package/{chunk-WXARH2SG.js → chunk-CWBEE627.js} +1 -1
- package/chunk-CZLLEVMJ.js +1 -0
- package/chunk-ETCRT3EV.js +1 -0
- package/chunk-FFY3NRCC.js +1 -0
- package/chunk-FPPZ4BUR.js +1 -0
- package/chunk-GDWLKG6V.js +3 -0
- package/chunk-GHFYBZHQ.js +1 -0
- package/{chunk-32366MQR.js → chunk-GO22DJ44.js} +1 -1
- package/chunk-GUH5TMOS.js +1 -0
- package/chunk-HBTRQAXQ.js +1 -0
- package/chunk-HDQRG3ZZ.js +1 -0
- package/chunk-HKZX6OB5.js +1 -0
- package/chunk-IGOZJJE3.js +1 -0
- package/{chunk-AM7RYTIO.js → chunk-IHNX6WZQ.js} +1 -1
- package/chunk-J2MHNGNQ.js +1 -0
- package/chunk-J3BBLPAD.js +2 -0
- package/chunk-J5PSMGKZ.js +2 -0
- package/{chunk-DG7SFNGT.js → chunk-JA7OQSO3.js} +1 -1
- package/chunk-JIHMT35A.js +1 -0
- package/chunk-K3ZQ67VT.js +3 -0
- package/chunk-KGJAK6OP.js +1 -0
- package/chunk-KUPXKQHP.js +1 -0
- package/{chunk-2W6BEUGU.js → chunk-L2EO4M4B.js} +1 -1
- package/chunk-LSVMEMXJ.js +1 -0
- package/{chunk-V5YSQG4X.js → chunk-LZUM5XKC.js} +1 -1
- package/chunk-M2RYJ73O.js +1 -0
- package/chunk-MBBEXLIJ.js +1 -0
- package/chunk-NTA2CULM.js +1 -0
- package/chunk-ODVCGM2O.js +1 -0
- package/chunk-OTMW34HV.js +1 -0
- package/chunk-OXOOR7I4.js +1 -0
- package/chunk-PT7UQJD4.js +1 -0
- package/chunk-QDFCX6XE.js +4 -0
- package/chunk-QFU6VJXV.js +1 -0
- package/chunk-QGFC5ZUR.js +1 -0
- package/chunk-QNOIURSX.js +1 -0
- package/chunk-QY6E755W.js +1 -0
- package/chunk-SCOG2I64.js +2 -0
- package/chunk-TJOWPBPB.js +1 -0
- package/chunk-UACX27D3.js +1 -0
- package/{chunk-NSIELNIY.js → chunk-USU2EHJV.js} +1 -1
- package/chunk-UT6XGEMV.js +1 -0
- package/chunk-UUODEERG.js +1 -0
- package/chunk-UW4GBMEP.js +1 -0
- package/{chunk-B26UYXA3.js → chunk-VC72SWC4.js} +1 -1
- package/chunk-WJPLJKPQ.js +1 -0
- package/chunk-WRNQOX5R.js +1 -0
- package/chunk-WWFNG47J.js +1 -0
- package/chunk-WZ23D2R7.js +1 -0
- package/chunk-X3IA226Q.js +1 -0
- package/chunk-XHUUCB2W.js +1 -0
- package/{chunk-AH5TLYN4.js → chunk-XLE2TW65.js} +1 -1
- package/chunk-XNVRJH42.js +1 -0
- package/chunk-XQ4CAUD4.js +1 -0
- package/chunk-YHNIGBHB.js +8 -0
- package/{chunk-7QJG4IIT.js → chunk-ZGAC2JKG.js} +1 -1
- package/index.html +4 -4
- package/locale/messages.cs.json +1 -0
- package/locale/messages.da.json +3 -20
- package/locale/messages.de.json +126 -104
- package/locale/messages.en_GB.json +1 -0
- package/locale/messages.es.json +1 -0
- package/locale/messages.fi.json +1 -0
- package/locale/messages.fr.json +1 -0
- package/locale/messages.hu.json +1 -0
- package/locale/messages.it.json +144 -112
- package/locale/messages.ja_JP.json +1 -0
- package/locale/messages.nl_NL.json +7 -106
- package/locale/messages.pl.json +29 -0
- package/locale/messages.pt.json +1 -0
- package/locale/messages.pt_BR.json +1 -0
- package/locale/messages.ru.json +1 -0
- package/locale/messages.sr_RS.json +1 -0
- package/locale/messages.sv_SE.json +1 -0
- package/locale/messages.zh-Hans.json +3 -97
- package/locale/messages.zh_CN.json +1 -88
- package/locale/messages.zh_TW.json +2 -0
- package/main-SFGPSKNZ.js +1 -0
- package/package.json +1 -1
- package/styles-EZGVWHZF.css +1 -0
- package/chunk-23ODVSFI.js +0 -1
- package/chunk-2BX65XJQ.js +0 -1
- package/chunk-2D26BDYB.js +0 -1
- package/chunk-2G6TVFPZ.js +0 -1
- package/chunk-2ULYPLGO.js +0 -1
- package/chunk-3JKXOOME.js +0 -1
- package/chunk-3WCZIRMO.js +0 -1
- package/chunk-3ZVSHKLD.js +0 -1
- package/chunk-52KRFMSD.js +0 -1
- package/chunk-64ZU74CD.js +0 -1
- package/chunk-6DSLFJ4T.js +0 -1
- package/chunk-6JQM2X3B.js +0 -1
- package/chunk-AC7QC7PU.js +0 -1
- package/chunk-AFLQOHXV.js +0 -1
- package/chunk-BCHZRC5K.js +0 -1
- package/chunk-BTMXQPBB.js +0 -7
- package/chunk-C26ZMSTR.js +0 -1
- package/chunk-CCA5ZCEA.js +0 -1
- package/chunk-CDXBWYCI.js +0 -8
- package/chunk-CWLTHXVS.js +0 -1
- package/chunk-DNJOKPEL.js +0 -2
- package/chunk-E4GCCYDQ.js +0 -1
- package/chunk-EBXKOOS2.js +0 -1
- package/chunk-EJZXEK6Z.js +0 -1
- package/chunk-EKP3ML6M.js +0 -1
- package/chunk-EQAVG2TR.js +0 -1
- package/chunk-F3LCHCDX.js +0 -1
- package/chunk-FJ62TYXT.js +0 -1
- package/chunk-FTFVEVRT.js +0 -1
- package/chunk-H2PTENA3.js +0 -1
- package/chunk-HLYFP2CB.js +0 -1
- package/chunk-IBG5YOFG.js +0 -1
- package/chunk-IVBTBJGC.js +0 -1
- package/chunk-IZXB2EWT.js +0 -1
- package/chunk-J6BHRR34.js +0 -1
- package/chunk-JA3Y722G.js +0 -1
- package/chunk-JFOXV66M.js +0 -1
- package/chunk-JOUBVX7V.js +0 -1
- package/chunk-JPMOGXHN.js +0 -1
- package/chunk-KSQIUDEA.js +0 -1
- package/chunk-LDIZ5E5Z.js +0 -1
- package/chunk-MMPTX6PS.js +0 -1
- package/chunk-MQI6JU7H.js +0 -1
- package/chunk-N57J64DN.js +0 -3
- package/chunk-N7RSCHJF.js +0 -3
- package/chunk-NHAGSIVX.js +0 -1
- package/chunk-NS4PAVKI.js +0 -1
- package/chunk-NZ2KKCDC.js +0 -1
- package/chunk-Q6W2U6VI.js +0 -2
- package/chunk-QBJGIKPM.js +0 -1
- package/chunk-QRRKPBY6.js +0 -1
- package/chunk-QU24HTBS.js +0 -2
- package/chunk-QVEGV6V6.js +0 -1
- package/chunk-RCKA5DTC.js +0 -1
- package/chunk-UKPX2XRO.js +0 -1
- package/chunk-V77N2OUE.js +0 -1
- package/chunk-VLBSM6YW.js +0 -1
- package/chunk-WIDMAJIO.js +0 -1
- package/chunk-WPGKMLVU.js +0 -1
- package/chunk-WRWIBPXL.js +0 -2
- package/chunk-WZNH4JPF.js +0 -1
- package/chunk-WZRDKVOR.js +0 -1
- package/chunk-X7SFNRJF.js +0 -1
- package/chunk-XBJRRUMO.js +0 -2
- package/chunk-XIOHRQ3X.js +0 -1
- package/chunk-Y5IRBMLB.js +0 -1
- package/chunk-ZAFFTZSE.js +0 -1
- package/chunk-ZI2XNFAW.js +0 -1
- package/main-A5QFJ7CT.js +0 -1
- package/styles-IH5IS4WG.css +0 -1
- /package/{polyfills-COBLRUJG.js → polyfills-DNO7R5SL.js} +0 -0
- /package/{sparkle-ui-assets → ship-ui-assets}/fonts/InterTight-VariableFont_wght.woff2 +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ea as gt}from"./chunk-WJPLJKPQ.js";import{Ab as O,Ac as Me,Bb as M,Cb as me,Db as j,Eb as W,Fb as ge,Ib as ye,Jb as ie,Mc as Qe,Oc as L,Pc as U,Qa as lt,Ra as b,Ta as De,Tc as ue,Uc as T,V as Ae,Va as _e,Vc as se,Wb as Y,Wc as mt,Xa as ct,Xb as ce,Xc as G,Y as st,Yb as w,Zb as B,_ as P,_b as y,a as nt,ba as ot,bb as A,ca as rt,da as at,db as Oe,dc as ht,dd as Ye,ea as F,ec as ne,fa as H,fc as ae,gb as Se,gc as pt,hc as ee,ia as Le,ic as $,jc as ut,ka as we,kc as de,lb as He,lc as R,mc as qe,na as Fe,nc as he,oa as k,oc as Te,qb as dt,qc as ze,rc as $e,sc as Ne,tb as be,tc as ft,ua as Q,ub as q,uc as pe,vb as z,vc as te,wb as je,xb as Be,yb as We,zb as le,zc as Ue}from"./chunk-QDFCX6XE.js";import{a as re,b as fe,c as it,d as u,e as x,f as D,g as E}from"./chunk-EUDKD2JW.js";var Z=["*"],It=[[["","icon",""]],[["","title",""]],"*",[["","content",""]]],kt=["[icon]","[title]","*","[content]"];function Rt(t,e){t&1&&(O(0,"sh-icon",3),R(1,"info"),M())}function Vt(t,e){t&1&&(O(0,"sh-icon",3),R(1,"info"),M())}function Pt(t,e){t&1&&(O(0,"sh-icon",3),R(1,"warning"),M())}function At(t,e){t&1&&(O(0,"sh-icon",3),R(1,"warning-octagon"),M())}function Lt(t,e){t&1&&(O(0,"sh-icon",3),R(1,"check-circle"),M())}function Ft(t,e){t&1&&(O(0,"sh-icon",3),R(1,"question"),M())}function Ht(t,e){if(t&1){let s=ie();O(0,"sh-icon",7),Y("click",function(){F(s);let i=w();return H(i.removeAlert())}),R(1,"plus"),M()}}var jt=["dialogRef"];function Bt(t,e){if(t&1){let s=ie();j(0,"div",4),ce("click",function(){F(s);let i=w();return H(i.isOpen.set(!1))}),W()}}var Wt=["shButton",""];var qt=["triggerRef"],zt=["popoverRef"],$t=[[["","trigger",""]],[["button"]],[["","shButton",""]],"*"],Nt=["[trigger]","button","[shButton]","*"];var Ut=()=>({closeOnButton:!1,closeOnEsc:!0});var Qt=[[["label"]],[["","prefix",""]],[["","textPrefix",""]],[["input"]],[["textarea"]],[["","textSuffix",""]],[["","suffix",""]],[["","error",""]],[["","hint",""]]],Yt=["label","[prefix]","[textPrefix]","input","textarea","[textSuffix]","[suffix]","[error]","[hint]"],vt=["input"],Xt=[[["label"]]],Gt=["label"];function Kt(t,e){if(t&1&&(O(0,"div",3),R(1),M()),t&2){let s=w();b(),qe(s.files()[0].name)}}function Zt(t,e){if(t&1&&(O(0,"div",3),R(1),M()),t&2){let s=w();b(),he("",s.files().length," files selected")}}function Jt(t,e){if(t&1&&(O(0,"div",4),R(1),M()),t&2){let s=w();b(),qe(s.filesOver()?s.overlayText():s.placeholder())}}var ei=["optionsRef"],ti=["*",[["","menu",""]]],ii=["*","[menu]"];function ni(t,e){t&1&&(O(0,"sh-icon",5),R(1,"caret-down"),M())}var si=[[["label"]],[["input","type","range"]]],oi=["label","input[type=range]"],ri=["optionsWrap"],ai=[[["label"]],[["input"]],[["textarea"]]],li=["label","input","textarea"],ci=()=>({closeOnButton:!1,closeOnEsc:!1}),Je=t=>({$implicit:t});function di(t,e){if(t&1&&R(0),t&2){let s=w();he(" ",s.inputValue()," ")}}function hi(t,e){t&1&&ye(0)}function pi(t,e){if(t&1&&Se(0,hi,1,0,"ng-container",12),t&2){let s=w(3).$implicit;w(2);let n=te(2);le("ngTemplateOutlet",n)("ngTemplateOutletContext",Me(2,Je,s))}}function ui(t,e){if(t&1&&R(0),t&2){let s=w(3).$implicit,n=w(2);he(" ",n.getLabel(s)," ")}}function fi(t,e){if(t&1){let s=ie();O(0,"sh-chip",11),Y("click",function(i){F(s);let o=w(2).$index,m=w(2);return H(m.removeSelectedOptionByIndex(i,o))}),q(1,pi,1,4,"ng-container")(2,ui,1,1),O(3,"sh-icon"),R(4,"x-bold"),M()()}if(t&2){let s=w(4),n=te(2);de(s.selectClasses()),b(),z(n?1:2)}}function mi(t,e){t&1&&ye(0)}function gi(t,e){if(t&1&&Se(0,mi,1,0,"ng-container",12),t&2){let s=w(4).$implicit;w(2);let n=te(2);le("ngTemplateOutlet",n)("ngTemplateOutletContext",Me(2,Je,s))}}function vi(t,e){if(t&1&&R(0),t&2){let s=w(4),n=s.$implicit,i=s.$index,o=s.$count,m=w(2);he(" ",i===o-1?m.getLabel(n):m.getLabel(n)+","," ")}}function Ci(t,e){if(t&1&&q(0,gi,1,4,"ng-container")(1,vi,1,1),t&2){w(5);let s=te(2);z(s?0:1)}}function _i(t,e){if(t&1&&q(0,Ci,2,1),t&2){w(4);let s=te(5);z(s?-1:0)}}function Si(t,e){if(t&1&&q(0,fi,5,3,"sh-chip",10)(1,_i,1,1),t&2){w(3);let s=te(4);z(s?0:1)}}function yi(t,e){if(t&1&&q(0,Si,2,1),t&2){let s=e.$implicit;z(s?0:-1)}}function xi(t,e){if(t&1&&Be(0,yi,1,1,null,null,je),t&2){w();let s=te(1);We(s)}}function Ei(t,e){t&1&&ye(0)}function wi(t,e){if(t&1&&Se(0,Ei,1,0,"ng-container",13),t&2){w(2);let s=te(0);le("ngTemplateOutlet",s)}}function Di(t,e){if(t&1&&R(0),t&2){let s=w(2);he(" ",s.placeholderText()??""," ")}}function Oi(t,e){if(t&1&&q(0,wi,1,1,"ng-container")(1,Di,1,1),t&2){w();let s=te(0);z(s?0:1)}}function bi(t,e){t&1&&(O(0,"sh-icon",6),R(1,"caret-down"),M())}function Ti(t,e){t&1&&me(0,"sh-spinner",7)}function Mi(t,e){t&1&&(O(0,"sh-icon",6),R(1,"list-magnifying-glass"),M())}function Ii(t,e){t&1&&(O(0,"sh-icon",6),R(1,"magnifying-glass"),M())}function ki(t,e){if(t&1){let s=ie();O(0,"sh-icon",14),Y("click",function(i){F(s);let o=w();return H(o.clear(i))}),R(1,"x-bold"),M()}}function Ri(t,e){t&1&&(O(0,"sh-icon",6),R(1,"caret-down"),M())}function Vi(t,e){t&1&&(O(0,"sh-icon",6),R(1,"caret-up"),M())}function Pi(t,e){if(t&1&&me(0,"sh-checkbox"),t&2){let s=w().$index,n=w();de(n.selectClasses()),$("active",n.isSelected(s))}}function Ai(t,e){t&1&&ye(0)}function Li(t,e){if(t&1&&Se(0,Ai,1,0,"ng-container",12),t&2){let s=w().$implicit;w();let n=te(3);le("ngTemplateOutlet",n)("ngTemplateOutletContext",Me(2,Je,s))}}function Fi(t,e){if(t&1&&R(0),t&2){let s=w().$implicit,n=w();he(" ",n.getLabel(s)," ")}}function Hi(t,e){if(t&1){let s=ie();O(0,"li",15),Y("click",function(){let i=F(s).$index,o=w();return H(o.toggleOptionByIndex(i))}),q(1,Pi,1,4,"sh-checkbox",16),q(2,Li,1,4,"ng-container")(3,Fi,1,1),M()}if(t&2){let s=e.$implicit,n=e.$index,i=w(),o=te(3);$("selected",i.isSelected(n))("focused",n===i.focusedOptionIndex()),le("id",i.getLabelAsSlug(s)),be("aria-selected",i.isSelected(n)),b(),z(i.selectMultiple()?1:-1),b(),z(o?2:3)}}var ji=["dragImageElement"],Bi=[[["","sidenav",""]],[["","sidenav-closed-topbar",""]],"*"],Wi=["[sidenav]","[sidenav-closed-topbar]","*"];function qi(t,e){t&1&&ge(0,"div",1,0)}function zi(t,e){if(t&1){let s=ie();j(0,"div",7),ce("drop",function(i){F(s);let o=w();return H(o.drop(i))})("dragenter",function(){F(s);let i=w();return H(i.dragEnter())})("dragleave",function(){F(s);let i=w();return H(i.dragLeave())}),W()}}function $i(t,e){if(t&1){let s=ie();j(0,"div",8),ce("dragstart",function(i){F(s);let o=w();return H(o.dragStart(i))})("dragend",function(i){F(s);let o=w();return H(o.dragEnd(i))})("drag",function(i){F(s);let o=w();return H(o.drag(i))})("touchstart",function(i){F(s);let o=w();return H(o.touchStart(i))})("touchmove",function(i){F(s);let o=w();return H(o.touchMove(i))})("touchend",function(i){F(s);let o=w();return H(o.touchEnd(i))})("touchcancel",function(i){F(s);let o=w();return H(o.touchCancel(i))}),W()}}var Ni=["tbody"],Ui=["*",[["","table-no-rows",""]]],Qi=["*","[table-no-rows]"];function Yi(t,e){t&1&&me(0,"sh-progress-bar",1)}function Xi(t,e){t&1&&(O(0,"div",2),y(1,1),M())}var Gi=[[["","title",""]],"*"],Ki=["[title]","*"];function Zi(t,e){t&1&&R(0,"Title")}function Ji(t,e){t&1&&(O(0,"sh-icon",1),R(1,"caret-down"),M())}var en=["bold","thin","light","fill"],Ce=(()=>{var e,s;let n=class n{constructor(){x(this,e,P(Q));x(this,s,P(_e))}ngAfterContentInit(){let o=u(this,e).nativeElement.textContent?.trim();if(!o)return;let m=o.split("-").at(-1);m&&en.includes(m)&&u(this,s).addClass(u(this,e).nativeElement,m)}};e=new WeakMap,s=new WeakMap,n.\u0275fac=function(m){return new(m||n)},n.\u0275cmp=A({type:n,selectors:[["sh-icon"]],ngContentSelectors:Z,decls:1,vars:0,template:function(m,p){m&1&&(B(),y(0))},encapsulation:2,changeDetection:0});let t=n;return t})(),Pn=(()=>{let e=class e{constructor(){this._el=P(Q),this.alertService=T(null),this.id=T(null),this.alertClasses=L(()=>this._el.nativeElement.classList.toString())}removeAlert(){this.id()&&this.alertService()&&this.alertService()?.removeAlert(this.id())}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-alert"]],inputs:{alertService:[1,"alertService"],id:[1,"id"]},ngContentSelectors:kt,decls:17,vars:4,consts:[["ref",""],[1,"alert"],[1,"icon"],[1,"state-icon"],[1,"title"],[1,"close-icon"],[1,"content"],[1,"close-icon",3,"click"]],template:function(i,o){if(i&1&&(B(It),O(0,"div",1)(1,"div",2,0),y(3),M(),O(4,"div",2),q(5,Rt,2,0,"sh-icon",3)(6,Vt,2,0,"sh-icon",3)(7,Pt,2,0,"sh-icon",3)(8,At,2,0,"sh-icon",3)(9,Lt,2,0,"sh-icon",3)(10,Ft,2,0,"sh-icon",3),M(),O(11,"div",4),y(12,1),y(13,2),M(),q(14,Ht,2,0,"sh-icon",5),O(15,"div",6),y(16,3),M()()),i&2){let m=pt(2);b(),ee("display",m.children.length?"block":"none");let p=o.alertClasses();b(4),z(p.includes("primary")?5:p.includes("accent")?6:p.includes("warn")?7:p.includes("error")?8:p.includes("success")?9:10),b(9),z(o.id()?14:-1)}},dependencies:[Ce],encapsulation:2,changeDetection:0});let t=e;return t})();function Re(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}var An=(()=>{let e=class e{constructor(){this.alertHistory=k([]),this.alertHistoryIsOpen=k(!1),this.alertHistoryIsHidden=k(!0)}error(n){this.addAlert({type:"error",title:n??"An error occured"})}success(n){this.addAlert({type:"success",title:n})}question(n){this.addAlert({type:"question",title:n})}warning(n){this.addAlert({type:"warn",title:n})}info(n){this.addAlert({type:"primary",title:n})}addAlert(n){let i=Re();this.alertHistory.update(o=>[fe(re({},n),{isOpen:!0,animateIn:!0,animateOut:!1,id:i}),...o]),setTimeout(()=>{this.alertHistory.update(o=>o.map(m=>fe(re({},m),{animateIn:m.id===i?!1:m.animateIn})))},40),setTimeout(()=>{this.hideAlert(i)},2500)}removeAlert(n){this.alertHistory.update(i=>i.map(o=>fe(re({},o),{animateOut:o.id===n?!1:o.animateOut}))),setTimeout(()=>{this.alertHistory.update(i=>i.filter(o=>o.id!==n))},300)}hideAlert(n){this.alertHistory.update(i=>i.map(o=>fe(re({},o),{isOpen:o.id===n?!1:o.isOpen})))}setHidden(n){this.alertHistoryIsHidden.set(n)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=Ae({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),et=new st("Ship UI Config"),tn={class:"default",width:void 0,maxWidth:void 0,height:void 0,maxHeight:void 0,closeOnButton:!0,closeOnEsc:!0,closeOnOutsideClick:!0},nn=(()=>{var e;let s=class s{constructor(){x(this,e);D(this,e,P(et,{optional:!0})),this.dialogRef=se("dialogRef"),this.isOpen=G(!1),this.options=T(),this.closed=ue(),this.defaultOptionMerge=L(()=>re(fe(re({},tn),{class:u(this,e)?.dialogType??"default"}),this.options())),this.abortController=null,this.isOpenEffect=U(()=>{let i=this.dialogRef()?.nativeElement;this.abortController&&this.abortController.abort(),this.abortController=new AbortController,this.isOpen()?(i?.showModal(),i?.addEventListener("close",()=>{this.isOpen.set(!1),this.closed.emit()},{signal:this.abortController?.signal}),document.addEventListener("keydown",o=>{o.key==="Escape"&&!this.defaultOptionMerge().closeOnEsc&&o.preventDefault(),o.key==="Escape"&&this.defaultOptionMerge().closeOnEsc&&this.isOpen.set(!1)},{signal:this.abortController?.signal})):(this.closed.emit(),i?.close())})}ngOnDestroy(){this.abortController?.abort()}};e=new WeakMap,s.\u0275fac=function(o){return new(o||s)},s.\u0275cmp=A({type:s,selectors:[["sh-dialog"]],viewQuery:function(o,m){o&1&&ne(m.dialogRef,jt,5),o&2&&ae()},inputs:{isOpen:[1,"isOpen"],options:[1,"options"]},outputs:{isOpen:"isOpenChange",closed:"closed"},ngContentSelectors:Z,decls:5,vars:11,consts:[["dialogRef",""],["shDialog",""],[1,"content"],[1,"closeable-overlay"],[1,"closeable-overlay",3,"click"]],template:function(o,m){if(o&1&&(B(),j(0,"dialog",1,0)(2,"div",2),y(3),W(),q(4,Bt,1,0,"div",3),W()),o&2){let p=m.defaultOptionMerge();de(p.class),ee("width",p.width??"")("max-width",p.maxWidth??"")("max-height",p.maxHeight??"")("height",p.height??""),b(4),z(m.defaultOptionMerge().closeOnOutsideClick?4:-1)}},encapsulation:2,changeDetection:0});let t=s;return t})(),Ln=(()=>{var e,s,n,Ct,xe;let m=class m{constructor(){x(this,n);x(this,e);x(this,s);D(this,e,typeof document<"u"?document.querySelector("body"):null),D(this,s,P(dt)),this.compRef=null,this.insertedCompRef=null,this.closedFieldSub=null,this.compClosedSub=null}open(a,r){let d=u(this,s).injector,C=E(this,n,Ct).call(this),_=r||{},{data:v,closed:g}=_,S=it(_,["data","closed"]);this.compRef&&E(this,n,xe).call(this),this.insertedCompRef=Ye(a,{environmentInjector:d}),this.compRef=Ye(nn,{hostElement:C,environmentInjector:d,projectableNodes:[[this.insertedCompRef.location.nativeElement]]});let c=this.insertedCompRef.instance?.data,l=this.insertedCompRef.instance?.closed;if(v){if(Fe(c))this.insertedCompRef.setInput("data",v);else if(!Fe(c))throw new Error("data is not an input signal on the passed component")}l instanceof Qe&&(this.closedFieldSub=l.subscribe((...I)=>{g?.(...I),E(this,n,xe).call(this)})),u(this,s).attachView(this.insertedCompRef.hostView),u(this,s).attachView(this.compRef.hostView),this.insertedCompRef.changeDetectorRef.detectChanges(),this.compRef.changeDetectorRef.detectChanges(),this.compRef.instance.isOpen.set(!0),this.compRef.setInput("options",S),this.compRef.instance.closed.subscribe(()=>f());let h=this;function f(){var I;l&&l instanceof Qe?l.emit(!1):g?.(void 0),E(I=h,n,xe).call(I)}return{component:this.insertedCompRef.instance,close:f}}ngOnDestroy(){E(this,n,xe).call(this)}};e=new WeakMap,s=new WeakMap,n=new WeakSet,Ct=function(){let a=document.createElement("sh-dialog-ref");return a.id="sh-dialog-ref",document.getElementById("sh-dialog-ref")||u(this,e)?.append(a),document.getElementById("sh-dialog-ref")},xe=function(){this.insertedCompRef&&(u(this,s).detachView(this.insertedCompRef.hostView),this.closedFieldSub?.unsubscribe(),this.insertedCompRef.destroy()),this.compRef&&(u(this,s).detachView(this.compRef.hostView),this.compClosedSub?.unsubscribe(),this.compRef.destroy())},m.\u0275fac=function(r){return new(r||m)},m.\u0275prov=Ae({token:m,factory:m.\u0275fac,providedIn:"root"});let t=m;return t})(),Fn=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-button-group"]],ngContentSelectors:Z,decls:1,vars:0,template:function(i,o){i&1&&(B(),y(0))},encapsulation:2,changeDetection:0});let t=e;return t})(),Hn=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["","shButton",""]],attrs:Wt,ngContentSelectors:Z,decls:1,vars:0,template:function(i,o){i&1&&(B(),y(0))},encapsulation:2,changeDetection:0});let t=e;return t})(),jn=(()=>{var e;let s=class s{constructor(){x(this,e);D(this,e,P(et,{optional:!0})),this.class=k(u(this,e)?.cardType??"default")}};e=new WeakMap,s.\u0275fac=function(o){return new(o||s)},s.\u0275cmp=A({type:s,selectors:[["sh-card"]],hostVars:2,hostBindings:function(o,m){o&2&&de(m.class())},ngContentSelectors:Z,decls:1,vars:0,template:function(o,m){o&1&&(B(),y(0))},encapsulation:2,changeDetection:0});let t=s;return t})(),sn=(()=>{var e;let s=class s{constructor(){x(this,e,P(Q))}};e=new WeakMap,s.\u0275fac=function(o){return new(o||s)},s.\u0275cmp=A({type:s,selectors:[["sh-checkbox"]],ngContentSelectors:Z,decls:6,vars:0,consts:[[1,"box"],[1,"inherit","default-indicator"],[1,"inherit","indeterminate-indicator"]],template:function(o,m){o&1&&(B(),O(0,"div",0)(1,"sh-icon",1),R(2,"check-bold"),M(),O(3,"sh-icon",2),R(4,"minus-bold"),M()(),y(5))},dependencies:[Ce],encapsulation:2,changeDetection:0});let t=s;return t})(),on=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-chip"]],ngContentSelectors:Z,decls:2,vars:0,template:function(i,o){i&1&&(B(),j(0,"div"),y(1),W())},encapsulation:2,changeDetection:0});let t=e;return t})();var rn=["scroll","auto"],an={width:void 0,height:void 0,closeOnButton:!0,closeOnEsc:!0},_t=(()=>{var e,s,St,Ie;let o=class o{constructor(){x(this,s);x(this,e);D(this,e,4),this.SUPPORTS_ANCHOR=typeof CSS<"u"&&CSS.supports("position-anchor","--abc")&&CSS.supports("anchor-name","--abc"),this.asMultiLayer=T(!1),this.disableOpenByClick=T(!1),this.isOpen=G(!1),this.options=T(),this.closed=ue(),this.defaultOptionMerge=L(()=>re(re({},an),this.options())),this.triggerRef=se.required("triggerRef"),this.popoverRef=se.required("popoverRef"),this.id=k("--"+Re()),this.menuStyle=k(null),this.openAbort=null,this.openEffect=U(()=>{let p=this.popoverRef()?.nativeElement;if(this.isOpen()){this.openAbort&&this.openAbort.abort(),this.openAbort=new AbortController;let r={signal:this.openAbort?.signal};p?.showPopover(),document.addEventListener("keydown",d=>{d.key==="Escape"&&!this.defaultOptionMerge().closeOnEsc&&d.preventDefault(),d.key==="Escape"&&this.defaultOptionMerge().closeOnEsc&&this.isOpen.set(!1)},r),setTimeout(()=>{E(this,s,St).call(this,this.popoverRef()?.nativeElement).addEventListener("scroll",()=>E(this,s,Ie).call(this),r),window?.addEventListener("resize",()=>E(this,s,Ie).call(this),r),E(this,s,Ie).call(this)})}else p.hidePopover&&p.hidePopover(),this.openAbort?.abort(),this.closed.emit()})}toggleIsOpen(p){p.preventDefault(),p.stopPropagation(),this.disableOpenByClick()||this.isOpen.set(!this.isOpen())}eventClose(p){p.stopPropagation(),p.preventDefault(),this.isOpen.set(!1)}};e=new WeakMap,s=new WeakSet,St=function(p){let a=p.parentElement;for(;a;){if(rn.indexOf(window?.getComputedStyle(a).overflowY)>-1&&a.scrollHeight>a.clientHeight)return a;a=a.parentElement}return document.documentElement},Ie=function(){let p=this.triggerRef()?.nativeElement.getBoundingClientRect(),a=this.popoverRef()?.nativeElement.getBoundingClientRect(),r=p.left,d=p.bottom,C=r,v=d+u(this,e),g=C+a.width>window?.innerWidth,S=v+a.height>window?.innerHeight;if(!this.SUPPORTS_ANCHOR){if(C=r,v=d+u(this,e),S){let l=p.top-a.height-u(this,e);l<0||(v=l)}g&&(C=p.right-a.width,C<0&&(C=0));let c={left:C+"px",top:v+"px"};this.menuStyle.set(c)}},o.\u0275fac=function(a){return new(a||o)},o.\u0275cmp=A({type:o,selectors:[["sh-popover"]],viewQuery:function(a,r){a&1&&(ne(r.triggerRef,qt,5),ne(r.popoverRef,zt,5)),a&2&&ae(2)},hostVars:2,hostBindings:function(a,r){a&2&&$("multi-layer",r.asMultiLayer())},inputs:{asMultiLayer:[1,"asMultiLayer"],disableOpenByClick:[1,"disableOpenByClick"],isOpen:[1,"isOpen"],options:[1,"options"]},outputs:{isOpen:"isOpenChange",closed:"closed"},ngContentSelectors:Nt,decls:10,vars:6,consts:[["triggerRef",""],["popoverRef",""],[1,"trigger",3,"click"],[1,"trigger-wrapper"],["popover","",1,"popover"],[1,"overlay",3,"click"]],template:function(a,r){if(a&1){let d=ie();B($t),j(0,"div",2,0),ce("click",function(v){return F(d),H(r.toggleIsOpen(v))}),j(2,"div",3),y(3),y(4,1),y(5,2),W()(),j(6,"div",4,1)(8,"div",5),ce("click",function(v){return F(d),H(r.isOpen()&&r.eventClose(v))}),W(),y(9,3),W()}a&2&&(ee("anchor-name",r.id()),b(6),ut(r.menuStyle()),ee("position-anchor",r.id()))},encapsulation:2,changeDetection:0});let t=o;return t})();var Bn=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-divider"]],ngContentSelectors:Z,decls:1,vars:0,template:function(i,o){i&1&&(B(),y(0))},encapsulation:2,changeDetection:0});let t=e;return t})(),tt=(()=>{var e;let s=class s{constructor(){x(this,e,P(Q));He(()=>{let i=typeof CSS<"u"&&CSS.supports("field-sizing","content"),o=u(this,e).nativeElement.querySelector("textarea");if(!i&&o!==null){let a=function(){o.style.height="auto",o.style.height=o.scrollHeight+"px"},r=function(){setTimeout(a,0)};var m=a,p=r;o.addEventListener("change",a),o.addEventListener("cut",r),o.addEventListener("paste",r),o.addEventListener("drop",r),o.addEventListener("keydown",r),o.focus(),o.select(),a()}})}onClick(){u(this,e).nativeElement.querySelector("input")&&u(this,e).nativeElement.querySelector("input").focus(),u(this,e).nativeElement.querySelector("textarea")&&u(this,e).nativeElement.querySelector("textarea").focus()}};e=new WeakMap,s.\u0275fac=function(o){return new(o||s)},s.\u0275cmp=A({type:s,selectors:[["sh-form-field"]],hostBindings:function(o,m){o&1&&Y("click",function(){return m.onClick()})},ngContentSelectors:Yt,decls:15,vars:0,consts:[[1,"input-wrap"],[1,"prefix"],[1,"suffix"],[1,"helpers"],[1,"error-wrap"],[1,"hint"]],template:function(o,m){o&1&&(B(Qt),y(0),j(1,"div",0)(2,"div",1),y(3,1),y(4,2),W(),y(5,3),y(6,4),j(7,"div",2),y(8,5),y(9,6),W()(),j(10,"div",3)(11,"div",4),y(12,7),W(),j(13,"div",5),y(14,8),W()())},encapsulation:2,changeDetection:0});let t=s;return t})(),Wn=(()=>{let e=class e{constructor(){this._el=P(Q),this.inputRef=se.required("input"),this.filesOver=k(!1),this.multiple=T(),this.accept=T(null),this.placeholder=G("Click or drag files here"),this.overlayText=T("Drop files here"),this.files=G([]),this.fileUploadClasses=L(()=>this._el.nativeElement.classList.toString()),this.inputEffect=U(()=>{let n=this.inputRef().nativeElement;n&&(n.placeholder&&this.placeholder.set(n.placeholder),n.addEventListener("dragover",i=>{i.preventDefault(),this.filesOver.set(!0)}),n.addEventListener("dragleave",i=>{i.preventDefault(),this.filesOver.set(!1)}),n.addEventListener("drop",i=>{i.preventDefault(),this.filesOver.set(!1);let o=i.dataTransfer?.files;o&&o.length>0&&(this.handleFileUpload(Array.from(o)),n.files=o)}),n.addEventListener("change",i=>{i.preventDefault(),this.handleFileUpload(Array.from(i.target.files))}))})}handleFileUpload(n){this.multiple()?this.files.update(i=>[...i,...n]):this.files.set(n)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-file-upload"]],viewQuery:function(i,o){i&1&&ne(o.inputRef,vt,5),i&2&&ae()},inputs:{multiple:[1,"multiple"],accept:[1,"accept"],placeholder:[1,"placeholder"],overlayText:[1,"overlayText"],files:[1,"files"]},outputs:{placeholder:"placeholderChange",files:"filesChange"},ngContentSelectors:Gt,decls:12,vars:7,consts:[["inputWrap",""],["input",""],["ngProjectAs","input",5,["input"],1,"input"],[1,"files-text"],[1,"placeholder"],["type","file"],[1,"bg-overlay"],["suffix",""]],template:function(i,o){i&1&&(B(Xt),O(0,"sh-form-field"),y(1,0,["ngProjectAs","label",5,["label"]]),O(2,"div",2,0),q(4,Kt,2,1,"div",3)(5,Zt,2,1,"div",3)(6,Jt,2,1,"div",4),me(7,"input",5,1)(9,"div",6),M(),O(10,"sh-icon",7),R(11,"upload-simple"),M()()),i&2&&(de(o.fileUploadClasses()),b(4),z(o.files().length===1?4:o.files().length>1?5:6),b(3),be("multiple",o.multiple())("accept",o.accept()),b(2),$("files-over",o.filesOver()))},dependencies:[tt,Ce],encapsulation:2,changeDetection:0});let t=e;return t})(),qn=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-list"]],ngContentSelectors:Z,decls:1,vars:0,template:function(i,o){i&1&&(B(),y(0))},encapsulation:2,changeDetection:0});let t=e;return t})();function yt(t,e){let s=e?.injector||(at(yt),P(Le)),{debounce:n=0,initialValue:i=void 0,transform:o=f=>f,compare:m=(f,_)=>f===_,forceType:p=void 0,returnPreviousValue:a=!0}=e||{},r=k(i),d=s.get(we),C=L(()=>{let f=t()?.nativeElement;if(f instanceof HTMLInputElement||f instanceof HTMLTextAreaElement)return l(f)}),v=!1,g,S=null;return U(()=>{let f=C();if(!f)return r.set(a&&g?o(g):void 0);i!==void 0&&f.value===""?r.set(i):f.value!==""&&c();let _=I=>{S!==null&&clearTimeout(S),S=setTimeout(()=>{S=null,c()},n)};f.addEventListener("input",_),f.addEventListener("inputValueChanged",_),d.onDestroy(()=>{f.removeEventListener("input",_),f.removeEventListener("inputValueChanged",_),S!==null&&clearTimeout(S)})},{injector:s}),U(()=>{let f=C();if(!f)return;let _=r()??"",I=_==null?"":String(_);f.value!==I&&(g=I,f.value=I,f.dispatchEvent(new Event("input")))},{injector:s}),r;function c(){if(!v){v=!0;try{let f=C();if(!f)return;let _=f.value,I=p?h(_,p):o(_);g=_,m(r(),I)||r.set(I)}finally{v=!1}}}function l(f){return Object.defineProperty(f,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(f),"value").get.call(this)},set(_){Object.getOwnPropertyDescriptor(Object.getPrototypeOf(f),"value").set.call(this,_);let X=new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:_}});return this.dispatchEvent(X),_}}),f}function h(f,_){switch(_){case"string":return f.toString();case"number":let I=Number(f);return isNaN(I)?void 0:I;case"boolean":return f.toLowerCase()==="true"?!0:f.toLowerCase()==="false"?!1:void 0;default:return f}}}function xt(t,e){let s=P(Le),n=s.get(we),i=k([]),o=null,m=null,p=(r,d)=>{m&&m.disconnect();let C=Array.from(r.nativeElement.querySelectorAll(d.join(",")));i.set(C),typeof MutationObserver<"u"&&(m=new MutationObserver(v=>{queueMicrotask(()=>{let g=Array.from(r.nativeElement.querySelectorAll(d.join(",")));i.set(g)})}),m.observe(r.nativeElement,{childList:!0,subtree:!0})),n.onDestroy(()=>a())};o=U(()=>{let r=typeof t=="function"&&t[nt]?t():t,d=typeof e=="function"?e():e;r&&d?.length>0?p(r,d):(i.set([]),m&&(m.disconnect(),m=null))},{injector:s});function a(){o&&o.destroy(),m&&m.disconnect()}return{signal:i.asReadonly(),destroy:a}}var zn=(()=>{var e,s,Et,Xe;let o=class o{constructor(){x(this,s);x(this,e);D(this,e,P(_e)),this.asMultiLayer=T(!1),this.openIndicator=T(!1),this.disabled=T(!1),this.customOptionElementSelectors=T(["button"]),this.keepClickedOptionActive=T(!1),this.closeOnClick=T(!0),this.isOpen=G(!1),this.closed=ue(),this.searchable=T(!1),this.activeOptionIndex=k(-1),this.inputRef=se("input"),this.optionsRef=se("optionsRef"),this.options=xt(this.optionsRef,this.customOptionElementSelectors),this.optionsEl=L(()=>this.options.signal().filter(p=>!p.disabled)),this.inputValue=yt(this.inputRef),this.abortController=null,this.optionsEffect=U(()=>{if(!this.isOpen())return;this.abortController&&(this.abortController.abort(),this.abortController=null),this.abortController=new AbortController;let p=this.inputRef()?.nativeElement;p&&(queueMicrotask(()=>p.focus()),this.closeOnClick()||this.optionsRef()?.nativeElement?.addEventListener("click",r=>{let d=r.target,C=this.activeElements();if(!C.length){let g=this.optionsEl();this.activeElements.set(g),C=g}let v=C.findIndex(g=>g===d);v>-1&&(this.activeOptionIndex.set(v),p.focus())}),p.addEventListener("keydown",a=>{let r=this.activeOptionIndex();a.key==="ArrowDown"?(a.preventDefault(),this.activeOptionIndex.set(this.nextActiveIndex(r))):a.key==="ArrowUp"?(a.preventDefault(),this.activeOptionIndex.set(this.prevActiveIndex(r))):a.key==="Enter"?(a.preventDefault(),r>-1&&(this.activeElements()[r].click(),queueMicrotask(()=>this.close("active")))):a.key==="Tab"&&(a.preventDefault(),this.close("closed"))},{signal:this.abortController.signal}))}),this._lastElementList=[],this.activeElements=k([]),this.lastInputValue="",this.inputValueEffect=U(()=>{if(!this.searchable())return;let a=(this.inputValue()??"").toLowerCase();if(E(this,s,Xe).call(this),!a||a==="")return;let r=this._lastElementList.length&&a.length>this.lastInputValue.length?this._lastElementList:this.optionsEl();this.lastInputValue=a;for(let d=0;d<r.length;d++){let C=r[d],v=C.textContent?.toLowerCase()||"",g=E(this,s,Et).call(this,v,a);C.value=g}r=r.filter(d=>d.value>0).sort((d,C)=>C.value-d.value);for(let d=0;d<r.length;d++)u(this,e).setStyle(r[d],"order",d);this.activeElements.set(r),this._lastElementList=r}),this.activeOptionIndexEffect=U(()=>{let p=this.activeElements(),a=this.activeOptionIndex();for(let r=0;r<p.length;r++)p[r].classList.remove("active");a>-1&&(p[a].scrollIntoView({block:"center"}),p[a].classList.add("active"))})}nextActiveIndex(p){let a=this.activeElements();if(!a.length){let d=this.optionsEl();this.activeElements.set(d),a=d}if(p===-1||p===a.length-1)return 0;let r=p+1;return a[r].disabled?this.nextActiveIndex(r):r}prevActiveIndex(p){let a=this.activeElements();if(!a.length){let d=this.optionsEl();this.activeElements.set(d),a=d}if(p===0||p===-1)return a.length-1;let r=p-1;return a[r].disabled?this.prevActiveIndex(r):r}close(p="closed",a){this.inputValue.set(""),this.closeOnClick()&&((!this.keepClickedOptionActive()||p==="closed")&&E(this,s,Xe).call(this),this.isOpen.set(!1),this.closed.emit(p==="active"))}ngOnDestroy(){this.abortController&&(this.abortController.abort(),this.abortController=null)}};e=new WeakMap,s=new WeakSet,Et=function(p,a){if(!a)return 0;let r=0,d=-1,C=0,v=!0;for(let g=0;g<a.length;g++){let S=a[g];if(p.length>d+1&&p[d+1]===S)r+=g===0?100:150,d++,C++;else{let c=p.indexOf(S,d+1);if(g>0&&(v=!1),c===-1)return 0;r+=100,d=c,C++}}return v&&a.length===C&&(r+=1e3),r+=C*20,r},Xe=function(){this.activeOptionIndex.set(-1);let p=this.optionsEl();for(let a=0;a<p.length;a++)p[a].classList.remove("active")},o.\u0275fac=function(a){return new(a||o)},o.\u0275cmp=A({type:o,selectors:[["sh-menu"]],viewQuery:function(a,r){a&1&&(ne(r.inputRef,vt,5),ne(r.optionsRef,ei,5)),a&2&&ae(2)},hostVars:6,hostBindings:function(a,r){a&2&&$("disabled",r.disabled())("has-search",r.searchable())("multi-layer",r.asMultiLayer())},inputs:{asMultiLayer:[1,"asMultiLayer"],openIndicator:[1,"openIndicator"],disabled:[1,"disabled"],customOptionElementSelectors:[1,"customOptionElementSelectors"],keepClickedOptionActive:[1,"keepClickedOptionActive"],closeOnClick:[1,"closeOnClick"],isOpen:[1,"isOpen"],searchable:[1,"searchable"]},outputs:{isOpen:"isOpenChange",closed:"closed"},ngContentSelectors:ii,decls:12,vars:12,consts:[["formFieldWrapper",""],["input",""],["optionsRef",""],[3,"isOpenChange","closed","isOpen","disableOpenByClick","asMultiLayer","options"],["trigger","",3,"click"],[1,"open-indicator"],[1,"form-field-wrap"],[1,"small","stretch"],["type","text","placeholder","Search"],[1,"options",3,"click"]],template:function(a,r){if(a&1){let d=ie();B(ti),O(0,"sh-popover",3,0),Ne("isOpenChange",function(v){return F(d),$e(r.isOpen,v)||(r.isOpen=v),H(v)}),Y("closed",function(){return F(d),H(r.close("fromPopover"))}),O(2,"div",4),Y("click",function(){return F(d),H(!r.disabled()&&r.isOpen.set(!0))}),y(3),q(4,ni,2,0,"sh-icon",5),M(),O(5,"div",6)(6,"sh-form-field",7),me(7,"input",8,1),M()(),O(9,"div",9,2),Y("click",function(){return F(d),H(r.close("active"))}),y(11,1),M()()}a&2&&(ze("isOpen",r.isOpen),le("disableOpenByClick",!0)("asMultiLayer",r.asMultiLayer())("options",Ue(11,Ut)),b(2),$("is-open",r.isOpen()),b(2),z(r.openIndicator()?4:-1),b(2),$("hidden",r.searchable()===!1),b(3),$("searching",r.searchable()&&r.inputValue()!==""))},dependencies:[_t,tt,Ce],encapsulation:2,changeDetection:0});let t=o;return t})(),ln=(()=>{let e=class e{constructor(){this.value=T(void 0)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-progress-bar"]],inputs:{value:[1,"value"]},decls:1,vars:2,consts:[[1,"progress-bar"]],template:function(i,o){i&1&&ge(0,"div",0),i&2&&ee("width",o.value(),"%")},encapsulation:2,changeDetection:0});let t=e;return t})(),$n=(()=>{var e;let s=class s{constructor(){x(this,e,P(Q))}onClick(){u(this,e).nativeElement.querySelector("input")&&u(this,e).nativeElement.querySelector("input").focus()}};e=new WeakMap,s.\u0275fac=function(o){return new(o||s)},s.\u0275cmp=A({type:s,selectors:[["sh-radio"]],hostBindings:function(o,m){o&1&&Y("click",function(){return m.onClick()})},ngContentSelectors:Z,decls:2,vars:0,consts:[[1,"radio"]],template:function(o,m){o&1&&(B(),ge(0,"div",0),y(1))},encapsulation:2,changeDetection:0});let t=s;return t})(),Nn=(()=>{var e,s,n,i,o,Ge,wt,Dt,Ot;let d=class d{constructor(){x(this,o);x(this,e);x(this,s);x(this,n);x(this,i);D(this,e,P(Q)),D(this,s,null),D(this,n,null),D(this,i,0),this.unit=T(""),this.value=G(u(this,i)),this.inputState=k({min:0,max:100,step:1}),this.valuePercentage=L(()=>{let{min:v,max:g}=this.inputState(),S=this.value()??v;if(isNaN(S))return 0;let c=g-v;if(c===0)return 0;let l=(S-v)/c*100;return Math.max(0,Math.min(100,l))}),this.trackFilledPercentage=L(()=>this.valuePercentage()),this.thumbPositionPercentage=L(()=>this.valuePercentage()),this.syncModelToInputEffect=U(()=>{let v=this.value();if(u(this,n)){let g=parseFloat(u(this,n).value);(isNaN(g)||String(g)!==String(v))&&(u(this,n).value=String(v))}})}get hasInputElement(){return!!u(this,n)}ngAfterViewInit(){D(this,n,u(this,e).nativeElement.querySelector('input[type="range"]')),u(this,n)?(E(this,o,Ot).call(this,u(this,n)),u(this,n).oninput=()=>{this.setNewInputValue(u(this,n).value)},u(this,n).addEventListener("inputValueChanged",v=>{this.setNewInputValue(v.detail.value)}),queueMicrotask(()=>E(this,o,Ge).call(this,!0)),E(this,o,wt).call(this)):console.error('ShipRangeSliderComponent: No <input type="range"> element found projected inside.')}setNewInputValue(v){let g=parseFloat(v??"0");if(!isNaN(g)){let{min:S,max:c}=this.inputState();this.value.set(Math.max(S,Math.min(c,g)))}}trackEvent(v){if(!u(this,n)||u(this,n).readOnly||u(this,n).disabled){v.preventDefault(),v.stopPropagation();return}if(v.target===u(this,n)||v.target?.closest(".thumb, .min-indicator, .max-indicator"))return;let S=v.currentTarget.getBoundingClientRect(),c=v.clientX-S.left,l=S.width,{min:h,max:f,step:_}=this.inputState(),I=f-h;if(l>0&&I!==0&&_>0){let N=(c/l*I+h-h)/_,V=h+Math.round(N)*_,K=E(this,o,Dt).call(this,_);V=parseFloat(V.toFixed(K));let oe=Math.max(h,Math.min(f,V));this.value.set(oe)}}ngOnDestroy(){u(this,s)&&u(this,s).disconnect(),u(this,n)&&(u(this,n).oninput=null)}};e=new WeakMap,s=new WeakMap,n=new WeakMap,i=new WeakMap,o=new WeakSet,Ge=function(v=!1){if(!u(this,n))return;let g=parseFloat(u(this,n).min??"0")??0,S=parseFloat(u(this,n).max??"100")??100,c=u(this,n).step,l=1;if(c&&c.toLowerCase()!=="any"){let f=parseFloat(c);!isNaN(f)&&f>0&&(l=f)}this.inputState.set({min:g,max:S,step:l});let h=parseFloat(u(this,n).value??String(g))??g;if(v&&this.value()!==u(this,i)){let f=this.value(),_=Math.max(g,Math.min(S,f));h!==_&&(u(this,n).value=String(_)),f!==_&&this.value.set(_)}else{let f=Math.max(g,Math.min(S,h));this.value()!==f&&this.value.set(f)}},wt=function(){if(!u(this,n)||typeof MutationObserver>"u")return;let v=["min","max","step","value","readonly","disabled"];D(this,s,new MutationObserver(g=>{let S=!1;for(let c of g)if(c.type==="attributes"&&v.includes(c.attributeName??"")){S=!0;break}S&&E(this,o,Ge).call(this,!1)})),u(this,s).observe(u(this,n),{attributes:!0})},Dt=function(v){if(isNaN(v)||Math.floor(v)===v)return 0;let S=v.toString().split(".")[1];return S?S.length:0},Ot=function(v){Object.defineProperty(v,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(v),"value").get.call(this)},set(g){Object.getOwnPropertyDescriptor(Object.getPrototypeOf(v),"value").set.call(this,g);let c=new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:g}});return this.dispatchEvent(c),g}})},d.\u0275fac=function(g){return new(g||d)},d.\u0275cmp=A({type:d,selectors:[["sh-range-slider"]],hostVars:2,hostBindings:function(g,S){g&2&&$("has-input",S.hasInputElement)},inputs:{unit:[1,"unit"],value:[1,"value"]},outputs:{value:"valueChange"},ngContentSelectors:oi,decls:15,vars:10,consts:[[1,"label"],[1,"input-wrap"],[1,"min-indicator"],[1,"track-wrap",3,"click"],[1,"track"],[1,"track-filled"],[1,"thumb-wrap"],[1,"thumb"],[1,"value-indicator"],[1,"max-indicator"]],template:function(g,S){g&1&&(B(si),j(0,"div",0),y(1),W(),j(2,"div",1)(3,"div",2),R(4),W(),j(5,"div",3),ce("click",function(l){return S.trackEvent(l)}),y(6,1),j(7,"div",4),ge(8,"div",5),W(),j(9,"div",6)(10,"div",7)(11,"div",8),R(12),W()()()(),j(13,"div",9),R(14),W()()),g&2&&(b(4),Te("",S.inputState().min,"",S.unit()),b(4),ee("width",S.trackFilledPercentage(),"%"),b(),ee("left",S.thumbPositionPercentage(),"%"),b(3),Te("",S.value(),"",S.unit()),b(2),Te("",S.inputState().max,"",S.unit()))},encapsulation:2,changeDetection:0});let t=d;return t})(),cn=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-spinner"]],decls:0,vars:0,template:function(i,o){},encapsulation:2,changeDetection:0});let t=e;return t})(),Un=(()=>{var e,s,n,i,Ke,m,p,Ze,J,bt,Tt,Mt;let g=class g{constructor(){x(this,i);x(this,e);x(this,s);x(this,n);x(this,m);x(this,p);D(this,e,P(Q)),this.value=T(),this.label=T(),this.asFreeText=T(!1),this.placeholder=T(),this.readonly=G(!1),this.disabled=G(!1),this.lazySearch=T(!1),this.inlineSearch=T(!1),this.asText=T(!1),this.isClearable=T(!0),this.selectMultiple=T(!1),this.optionTemplate=T(null),this.selectedOptionTemplate=T(null),this.placeholderTemplate=T(null),this.isOpen=G(!1),this.isLoading=G(!1),this.options=G([]),this.selectedOptions=G([]),this.cleared=ue(),D(this,s,k(null)),this.inlineTemplate=mt(De),this.optionsWrapRef=se.required("optionsWrap"),this.inputRefInput=k(null),D(this,n,typeof MutationObserver<"u"&&new MutationObserver(c=>{for(var l of c)l&&(l.target.nodeName==="INPUT"||l.target.nodeName==="TEXTAREA")&&(this.inputRefInput.set(new Q(l.target)),u(this,n).disconnect())})),this.inputValue=k(""),this.prevInputValue=k(null),this.focusedOptionIndex=k(-1),this._isClearable=L(()=>this.selectMultiple()||this.isClearable()),this.selectClasses=L(()=>u(this,e).nativeElement.classList.toString()),this.stretch=L(()=>this.selectClasses().includes("stretch")),this.small=L(()=>this.selectClasses().includes("small")),this.placeholderText=L(()=>{let c=this.placeholder(),l=this.inputRefEl();return c||l?.placeholder||null}),this.selectedOptionValues=L(()=>{let c=this.selectedOptions(),l=this.value();return l?c.map(h=>E(this,i,J).call(this,h,l)):c}),this.filteredOptions=L(()=>{let c=this.options()||[],l=this.label(),h=this.value(),f=this.inlineSearch(),_=this.inputValue().toLowerCase(),I=E(this,i,Tt).call(this,_);if(c.length<=0)return[];if(!f||_==="")return c;let N=c.filter(V=>{let K=l?(E(this,i,J).call(this,V,l)??"").toString().toLowerCase():(V??"").toString().toLowerCase(),oe=((h?E(this,i,J).call(this,V,h):V)??"").toString().toLowerCase(),Ve=I.test(K),Pe=I.test(oe);return Ve||Pe}).map(V=>{let K=l?(E(this,i,J).call(this,V,l)??"").toString().toLowerCase():(V??"").toString().toLowerCase(),oe=((h?E(this,i,J).call(this,V,h):V)??"").toString().toLowerCase(),Ve=E(this,i,Ke).call(this,K,_),Pe=E(this,i,Ke).call(this,oe,_);return{item:V,score:Math.max(Ve,Pe)}});return N.sort((V,K)=>K.score-V.score),N.map(V=>V.item)}),D(this,m,Re()),this.inputRefEl=L(()=>{let c=this.inputRefInput();if(c===null)return;let l=c?c.nativeElement:null;return l?(l.autocomplete="off",l.setAttribute("role","combobox"),l.setAttribute("id",`combobox-${u(this,m)}`),l.setAttribute("aria-haspopup","listbox"),l.setAttribute("aria-owns","optionsWrapId"),E(this,i,bt).call(this,l),l.addEventListener("focus",()=>{this.readonly()||this.open()}),this.hasSearch()&&l.addEventListener("input",h=>{let f=h.target.value,_=this.inputValue();f!==_&&(this.focusedOptionIndex.set(this.asFreeText()?-1:0),this.inputValue.set(f),this.updateInputElValue())}),l.addEventListener("inputValueChanged",h=>{let f=h.detail.value,_=this.inputValue();if(f!==_){if(f===""){this.clear();return}this.setSelectedOptionsFromValue(f),this.setInputValueFromOptions(this.selectedOptions()),E(this,i,Ze).call(this)}}),l):(console.warn("<sh-select> input element not found are you missing to pass an <input> or <textarea> element to select component?"),null)}),this.focusEffect=U(()=>{let c=this.inputRefEl();if(!c)return;let l=this.getLabelAsSlug(this.filteredOptions()[this.focusedOptionIndex()]);l?c.setAttribute("aria-activedescendant",l):c.removeAttribute("aria-activedescendant")}),this.openAbortController=null,this.isOpenEffect=U(()=>{if(this.isOpen()){this.openAbortController||(this.openAbortController=new AbortController);let l=this.inputRefEl();if(!l)return;l.setAttribute("aria-expanded",this.isOpen().toString()),l.addEventListener("keydown",h=>{if((h.key==="Escape"||h.key==="Tab")&&(h.preventDefault(),this.close()),(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),this.toggleOptionByIndex(this.focusedOptionIndex())),h.key==="ArrowDown"){h.preventDefault();let f=this.focusedOptionIndex()+1;this.focusedOptionIndex.set(f>this.filteredOptions().length-1?0:f)}if(h.key==="ArrowUp"){h.preventDefault();let f=this.focusedOptionIndex()-1;this.focusedOptionIndex.set(f<0?this.filteredOptions().length-1:f)}},{signal:this.openAbortController?.signal})}else{let l=this.inputRefEl();if(!l)return;l.setAttribute("aria-expanded",this.isOpen().toString()),this.openAbortController&&(this.openAbortController.abort(),this.openAbortController=null)}}),this._inputValue="",this.inputValueEffect=U(()=>{let c=this.inputValue();this._inputValue=c}),this.inputRefElEffect=U(()=>{let c=this.inputRefEl();c&&c.value!==this._inputValue&&(this.disabled.set(c.disabled),this.setSelectedOptionsFromValue(c.value),this.setInputValueFromOptions(this.selectedOptions()))}),this.selectedLabels=L(()=>{let c=this.selectedOptions();return this.label()?c.map(h=>this.getLabel(h)).join(", "):c.join(", ")}),this.inputState=L(()=>(this.selectedOptions().length>0||this.asFreeText()&&this.inputValue().length>0)&&!this.isOpen()?"selected":this.isLoading()?"loading":this.isOpen()&&(this.lazySearch()||this.inlineSearch())?"open-searching":this.isOpen()?"open":this.inlineSearch()||this.lazySearch()?"searching":"closed"),this.hasSearch=L(()=>this.inlineSearch()||this.lazySearch()),D(this,p,U(()=>{if(this.selectMultiple()&&this.hasSearch())return;let c=this.selectedOptions(),l=this.value(),h=c.map(f=>l?E(this,i,J).call(this,f,l):f).join(",");this.inputValue.set(h)}))}ngOnInit(){this.setInitInput()}setInitInput(){let c=u(this,e).nativeElement.querySelector("input");if(c){this.inputRefInput.set(new Q(c));return}let l=u(this,e).nativeElement.querySelector("textarea");if(l){this.inputRefInput.set(new Q(l));return}typeof MutationObserver<"u"&&u(this,n).observe(u(this,e).nativeElement,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}setSelectedOptionsFromValue(c){let l=this.options()||[],h=this.value(),f=this.selectMultiple(),_=c.toString().split(",");if(_.length===0){this.selectedOptions.set([]);return}let I=f?_:[_[0]],X=l.filter(N=>{let V=h?E(this,i,J).call(this,N,h)?.toString():N?.toString();return V&&I.includes(V)});this.selectedOptions.set(f?X:[X[0]])}setInputValueFromOptions(c){let l=this.value();if(c.length===0){this.inputValue.set(""),this.updateInputElValue();return}let h=c.map(f=>l?E(this,i,J).call(this,f,l):f).join(",");h!==this.inputValue()&&(this.inputValue.set(h),this.updateInputElValue())}getLabel(c){let l=this.label();return l?E(this,i,J).call(this,c,l):c}getLabelAsSlug(c){let l=this.getLabel(c);return!l||typeof l!="string"?"":l.replaceAll(" ","-")}toggleOptionByIndex(c,l){let h=this.filteredOptions()[c];if(this.asFreeText()&&c===-1||!h){this.close();return}l&&l.stopPropagation();let f=this.selectMultiple(),_=this._isClearable(),I=this.value(),X=this.selectedOptionValues(),N=I?E(this,i,J).call(this,h,I):h;this.prevInputValue.set(null),u(this,s).set(null),this.selectedOptions.update(V=>{let K=X.indexOf(N);if(K>-1){let oe=[...V.slice(0,K),...V.slice(K+1)];return _||oe.length>0?oe:V}else return this.focusedOptionIndex.set(c),f?[...V,h]:[h]}),f?this.inputRefEl()?.focus():this.isOpen.set(!1),this.setInputValueFromOptions(this.selectedOptions()),f&&this.hasSearch()&&(this.inputValue.set(""),this.updateInputElValue())}removeSelectedOptionByIndex(c,l){c.stopPropagation(),this.selectedOptions.update(h=>[...h.slice(0,l),...h.slice(l+1)]),this.setInputValueFromOptions(this.selectedOptions())}isSelected(c){let l=this.value(),h=this.filteredOptions()[c],f=l?E(this,i,J).call(this,h,l):h;return this.selectedOptionValues().indexOf(f)>-1}open(){this.isOpen()||(this.isOpen.set(!0),this.hasSearch()?(this.prevInputValue.set(this.inputValue()??""),this.inputValue.set(""),this.updateInputElValue()):u(this,s).set(this.selectedOptions()),this.selectMultiple()||E(this,i,Ze).call(this))}close(){this.isOpen.set(!1);let c=this.prevInputValue(),l=u(this,s).call(this);if(this.asFreeText()){this.updateInputElValue();return}this.hasSearch()&&c&&(this.inputValue.set(c),this.setInputValueFromOptions(this.selectedOptions())),!this.hasSearch()&&l!==null&&this.setInputValueFromOptions(l),this.selectMultiple()&&this.setInputValueFromOptions(this.selectedOptions())}clear(c){c?.stopPropagation(),this.inputValue.set(""),this.selectedOptions.set([]),this.isOpen.set(!1),this.prevInputValue.set(null),this.cleared.emit(),this.updateInputElValue()}updateInputElValue(){let c=this.inputRefEl(),l=this.inputValue();c&&(c.value=l,c.dispatchEvent(new Event("input")))}ngOnDestroy(){this.openAbortController&&(this.openAbortController.abort(),this.openAbortController=null),typeof MutationObserver<"u"&&u(this,n).disconnect()}};e=new WeakMap,s=new WeakMap,n=new WeakMap,i=new WeakSet,Ke=function(c,l){if(!l)return 0;let h=0,f=-1,_=0,I=!0;for(let X=0;X<l.length;X++){let N=l[X];if(c.length>f+1&&c[f+1]===N)h+=X===0?100:150,f++,_++;else{let V=c.indexOf(N,f+1);if(X>0&&(I=!1),V===-1)return 0;h+=100,f=V,_++}}return I&&l.length===_&&(h+=1e3),h+=_*20,h},m=new WeakMap,p=new WeakMap,Ze=function(){let c=this.selectedOptionValues()[0],l=this.value();if(c){let h=this.filteredOptions().findIndex(f=>l?E(this,i,J).call(this,f,l)===c:f===c);this.focusedOptionIndex.set(h)}else this.focusedOptionIndex.set(-1)},J=function(c,l){return l.split(".").reduce((h,f)=>h?.[f],c)},bt=function(c){Object.defineProperty(c,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(c),"value").get.call(this)},set(l){Object.getOwnPropertyDescriptor(Object.getPrototypeOf(c),"value").set.call(this,l);let f=new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:l}});return this.dispatchEvent(f),l}})},Tt=function(c){let l=(c??"").toLowerCase(),h="^";for(let f of l)h+=".*"+E(this,i,Mt).call(this,f);return h+=".*$",new RegExp(h,"i")},Mt=function(c){return c.replace(/[-\/\\^$+?.()|[\]{}]/g,"\\$&")},g.\u0275fac=function(l){return new(l||g)},g.\u0275cmp=A({type:g,selectors:[["sh-select"]],contentQueries:function(l,h,f){l&1&&ht(f,h.inlineTemplate,De,5),l&2&&ae()},viewQuery:function(l,h){l&1&&ne(h.optionsWrapRef,ri,5),l&2&&ae()},hostVars:2,hostBindings:function(l,h){l&2&&$("multiple",h.selectMultiple())},inputs:{value:[1,"value"],label:[1,"label"],asFreeText:[1,"asFreeText"],placeholder:[1,"placeholder"],readonly:[1,"readonly"],disabled:[1,"disabled"],lazySearch:[1,"lazySearch"],inlineSearch:[1,"inlineSearch"],asText:[1,"asText"],isClearable:[1,"isClearable"],selectMultiple:[1,"selectMultiple"],optionTemplate:[1,"optionTemplate"],selectedOptionTemplate:[1,"selectedOptionTemplate"],placeholderTemplate:[1,"placeholderTemplate"],isOpen:[1,"isOpen"],isLoading:[1,"isLoading"],options:[1,"options"],selectedOptions:[1,"selectedOptions"]},outputs:{readonly:"readonlyChange",disabled:"disabledChange",isOpen:"isOpenChange",isLoading:"isLoadingChange",options:"optionsChange",selectedOptions:"selectedOptionsChange",cleared:"cleared"},ngContentSelectors:li,decls:28,vars:22,consts:[["formFieldWrapper",""],["optionsWrap",""],[3,"isOpenChange","closed","isOpen","disableOpenByClick","options"],["trigger","",3,"click"],["ngProjectAs","input",5,["input"],1,"input"],[1,"selected-value"],["suffix",""],["suffix","",1,"primary"],["id","optionsWrapId","role","listbox",1,"ship-options"],[1,"option",3,"id","selected","focused"],[1,"small",3,"class"],[1,"small",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngTemplateOutlet"],["suffix","",3,"click"],[1,"option",3,"click","id"],[3,"class","active"]],template:function(l,h){if(l&1){let f=ie();B(ai),ft(0)(1)(2)(3)(4)(5),O(6,"sh-popover",2,0),Ne("isOpenChange",function(I){return F(f),$e(h.isOpen,I)||(h.isOpen=I),H(I)}),Y("closed",function(){return F(f),H(h.close())}),O(8,"sh-form-field",3),Y("click",function(){return F(f),H(h.open())}),y(9,0,["ngProjectAs","label",5,["label"]]),O(10,"div",4)(11,"div",5),q(12,di,1,1)(13,xi,2,0)(14,Oi,2,1),y(15,1),y(16,2),M()(),q(17,bi,2,0,"sh-icon",6)(18,Ti,1,0,"sh-spinner",7)(19,Mi,2,0,"sh-icon",6)(20,Ii,2,0,"sh-icon",6)(21,ki,2,0,"sh-icon",6)(22,Ri,2,0,"sh-icon",6)(23,Vi,2,0,"sh-icon",6),M(),O(24,"div",8,1),Be(26,Hi,4,8,"li",9,je),M()()}if(l&2){pe(h.placeholderTemplate());let f=h.optionTemplate(),_=h.selectedOptionTemplate(),I=h.inlineTemplate();b();let X=pe(h.selectedOptions()),N=h.inputState();b(),pe(_||f||I),b(),pe(f||I),b();let V=pe(!h.asText()&&h.selectMultiple());b();let K=pe(h.isOpen()&&h.hasSearch()&&(V||h.inputValue().length>0));b(),ze("isOpen",h.isOpen),le("disableOpenByClick",!0)("options",Ue(21,ci)),b(2),$("stretch",h.stretch())("small",h.small())("readonly",h.readonly()||h.disabled()),b(2),$("show-search-text",K),b(),$("is-selected",N==="selected"),b(),z(h.asFreeText()&&h.inputValue().length>0&&!h.isOpen()?12:X.length>0?13:K?-1:14),b(5),z(N==="closed"?17:N==="loading"?18:N==="open-searching"?19:N==="searching"?20:N==="selected"&&h._isClearable()?21:N==="selected"&&!h._isClearable()?22:23),b(9),We(h.filteredOptions())}},dependencies:[gt,_t,tt,Ce,sn,cn,on],encapsulation:2,changeDetection:0});let t=g;return t})();function dn(t){let e=P(Q),s=P(we),n=k(!1),i=typeof MutationObserver<"u"&&new MutationObserver(o=>{o.forEach(m=>{m.type==="attributes"&&m.attributeName==="class"&&n.set(e.nativeElement.classList.contains(t))})});return rt(e.nativeElement,()=>{i&&i.observe(e.nativeElement,{attributes:!0}),n.set(e.nativeElement.classList.contains(t))}),s.onDestroy(()=>{i&&i.disconnect()}),n}var Qn=(()=>{var e,s,n,i,Ee;let m=class m{constructor(){x(this,i);x(this,e);x(this,s);x(this,n);D(this,e,P(Q)),this.openWidth=280,this.openWidthTreshold=this.openWidth*.5,this.disableDrag=T(!1),this.isOpen=G(!1),this.isOverlay=dn("overlay"),D(this,s,u(this,e).nativeElement.parentElement),D(this,n,u(this,s).getBoundingClientRect&&u(this,s).getBoundingClientRect()),this.dragImageElement=se.required("dragImageElement"),this.dragIsEnding=k(!1),this.dragIsOnScreen=k(!0),this.isDragging=k(!1),this.dragPositionX=k(0),this.dragActualPositionX=L(()=>{let a=this.dragPositionX(),r=280,d=100,C=.008,v=r/2,g=v-d/2,S=v+d/2;if(a>S){let c=a-S,h=(r-S)*(1-Math.exp(-C*c));return S+h}else if(a<g){let c=g-a,h=g*(1-Math.exp(-C*c));return g-h}return a}),this.draggingStyle=L(()=>this.isOverlay()?this.isDragging()?`translateX(${this.dragActualPositionX()}px)`:this.isOpen()?`translateX(${this.openWidth}px)`:"translateX(0px)":null),this.draggingEffect=U(()=>{typeof document>"u"||(this.isDragging()?document.body.classList.add("dragging"):document.body.classList.remove("dragging"))})}drop(a){a.stopPropagation(),E(this,i,Ee).call(this,a.clientX-u(this,n).left)}dragEnd(a){a.clientX-u(this,n).left<0&&E(this,i,Ee).call(this,0),a.clientX-u(this,n).left>this.openWidthTreshold&&E(this,i,Ee).call(this,this.openWidthTreshold)}dragEnter(){this.dragIsOnScreen.set(!0)}dragLeave(){this.dragIsOnScreen.set(!1)}dragStart(a){a.stopPropagation(),D(this,n,u(this,s).getBoundingClientRect()),this.isDragging.set(!0)}drag(a){a.stopPropagation(),this.isDragging()&&(a.clientX!==0||a.clientY!==0)&&this.dragPositionX.set(a.clientX-u(this,n).left)}touchStart(a){a.stopPropagation(),this.isDragging.set(!0),D(this,n,u(this,s).getBoundingClientRect()),this.dragPositionX.set(0)}touchMove(a){a.stopPropagation(),this.isDragging()&&this.dragPositionX.set(a.touches[0].clientX-u(this,n).left)}touchEnd(a){a.stopPropagation(),E(this,i,Ee).call(this,a.changedTouches[0].clientX-u(this,n).left)}touchCancel(a){a.stopPropagation(),this.isDragging.set(!1)}};e=new WeakMap,s=new WeakMap,n=new WeakMap,i=new WeakSet,Ee=function(a){this.isDragging.set(!1),a>=this.openWidthTreshold?this.isOpen.set(!0):this.isOpen.set(!1)},m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=A({type:m,selectors:[["sh-sidenav"]],viewQuery:function(r,d){r&1&&ne(d.dragImageElement,ji,5),r&2&&ae()},hostVars:6,hostBindings:function(r,d){r&2&&$("open",d.isOpen())("closed",!d.isOpen())("is-dragging",d.isDragging())},inputs:{disableDrag:[1,"disableDrag"],isOpen:[1,"isOpen"]},outputs:{isOpen:"isOpenChange"},ngContentSelectors:Wi,decls:10,vars:5,consts:[["dragImageElement",""],[1,"drag-image"],[1,"dropping-surface"],[1,"sidenav"],[1,"main-wrap"],["draggable","true",1,"dragable"],[1,"closed-topbar"],[1,"dropping-surface",3,"drop","dragenter","dragleave"],["draggable","true",1,"dragable",3,"dragstart","dragend","drag","touchstart","touchmove","touchend","touchcancel"]],template:function(r,d){r&1&&(B(Bi),q(0,qi,2,0,"div",1),q(1,zi,1,0,"div",2),j(2,"div",3),y(3),W(),j(4,"div",4),q(5,$i,1,0,"div",5),j(6,"div",6),y(7,1),W(),j(8,"main"),y(9,2),W()()),r&2&&(z(d.isOverlay()?0:-1),b(),z(d.isOverlay()&&d.isDragging()?1:-1),b(3),ee("transform",d.draggingStyle()),b(),z(d.isOverlay()&&!d.disableDrag()?5:-1))},encapsulation:2,changeDetection:0});let t=m;return t})();var Yn=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-stepper"]],ngContentSelectors:Z,decls:1,vars:0,template:function(i,o){i&1&&(B(),y(0))},encapsulation:2,changeDetection:0});let t=e;return t})();var Xn=(()=>{var e;let s=class s{constructor(){x(this,e);D(this,e,P(hn)),this.shSort=T(),this.sortAsc=L(()=>{let i=u(this,e).sortByColumn(),o=this.shSort();return!i||!o?!1:i===o}),this.sortDesc=L(()=>{let i=u(this,e).sortByColumn(),o=this.shSort();return!i||!o?!1:i===`-${o}`})}toggleSort(){let i=this.shSort();i&&u(this,e).toggleSort(i)}};e=new WeakMap,s.\u0275fac=function(o){return new(o||s)},s.\u0275dir=Oe({type:s,selectors:[["","shSort",""]],hostAttrs:[1,"sortable"],hostVars:4,hostBindings:function(o,m){o&1&&Y("mousedown",function(){return m.toggleSort()}),o&2&&$("sort-asc",m.sortAsc())("sort-desc",m.sortDesc())},inputs:{shSort:[1,"shSort"]}});let t=s;return t})();var ve=1.5,hn=(()=>{var e,s,n,i,o,ke;let p=class p{constructor(){x(this,o);x(this,e);x(this,s);x(this,n);x(this,i);D(this,e,P(Q)),D(this,s,P(et,{optional:!0})),this.loading=T(!1),this.data=T([]),this.dataChange=ue(),this.sortByColumn=G(null),this.tbody=se("tbody"),this.columns=xt(this.tbody,["tr:first-child th"]),this.class=k(u(this,s)?.tableType??"default"),this.resizing=k(!1),this.sizeTrigger=k(!0),D(this,n,null),D(this,i,k(!1)),this.scrollXState=k(-1),this.scrollYState=k(-1),this.canScrollX=k(!1),this.canScrollY=k(!1),this.columnSizes=L(()=>{this.sizeTrigger();let r=this.columns.signal();return r.reduce((d,C,v)=>{let g=C,S=g.getAttribute("size"),c=v===r.length-1;return S?`${d} ${S}`:g.classList.contains("sticky")||g.classList.contains("sticky-end")?`${d} min-content`:c?`${d} 1fr`:`${d} 1fr`},"")}),this.e=U(()=>{let r=this.sortByColumn();if(r===null)return u(this,i).call(this)||(D(this,n,this.data()),u(this,i).set(!0)),this.dataChange.emit(structuredClone(u(this,n)));let d=r.startsWith("-")?r.slice(1):r,C=r.startsWith("-"),v=this.data().sort((g,S)=>{let c=g[d],l=S[d],h=0;return typeof c=="number"&&typeof l=="number"&&(h=c-l),c instanceof Date&&l instanceof Date&&(h=c.getTime()-l.getTime()),typeof c=="string"&&typeof l=="string"&&(h=c.localeCompare(l,void 0,{sensitivity:"base"})),C?-h:h});this.dataChange.emit(v)})}updateColumnSizes(){this.sizeTrigger.set(!this.sizeTrigger())}onScroll(){E(this,o,ke).call(this)}onResize(r){E(this,o,ke).call(this)}ngAfterViewInit(){queueMicrotask(()=>E(this,o,ke).call(this))}toggleSort(r){let d=this.sortByColumn(),C=d===r?`-${r}`:d===`-${r}`?null:r;this.sortByColumn.set(C)}};e=new WeakMap,s=new WeakMap,n=new WeakMap,i=new WeakMap,o=new WeakSet,ke=function(){let r=u(this,e).nativeElement,d=-1,C=-1,v=r.scrollWidth>r.clientWidth+ve;if(v){let S=r.scrollLeft<=ve;r.scrollWidth-(r.scrollLeft+r.clientWidth)<ve?d=1:S||(d=0)}this.scrollXState.set(d),this.canScrollX.set(v);let g=r.scrollHeight>r.clientHeight+ve;if(g){let S=r.scrollTop<=ve;r.scrollHeight-(r.scrollTop+r.clientHeight)<ve?C=1:S||(C=0)}this.scrollYState.set(C),this.canScrollY.set(g)},p.\u0275fac=function(d){return new(d||p)},p.\u0275cmp=A({type:p,selectors:[["sh-table"]],viewQuery:function(d,C){d&1&&ne(C.tbody,Ni,5),d&2&&ae()},hostVars:18,hostBindings:function(d,C){d&1&&Y("scroll",function(){return C.onScroll()})("resize",function(g){return C.onResize(g)},lt),d&2&&(de(C.class()),ee("grid-template-columns",C.columnSizes()),$("resizing",C.resizing())("can-scroll-x",C.canScrollX())("can-scroll-y",C.canScrollY())("scrolled-x",C.scrollXState()>=0)("scrolled-x-end",C.scrollXState()===1)("scrolled-y",C.scrollYState()>=0)("scrolled-y-end",C.scrollYState()===1))},inputs:{loading:[1,"loading"],data:[1,"data"],sortByColumn:[1,"sortByColumn"]},outputs:{dataChange:"dataChange",sortByColumn:"sortByColumnChange"},ngContentSelectors:Qi,decls:5,vars:2,consts:[["tbody",""],[1,"indeterminate","primary"],[1,"no-rows"]],template:function(d,C){d&1&&(B(Ui),q(0,Yi,1,0,"sh-progress-bar",1),O(1,"tbody",null,0),y(3),M(),q(4,Xi,2,0,"div",2)),d&2&&(z(C.loading()?0:-1),b(4),z(C.loading()?-1:4))},dependencies:[ln],encapsulation:2,changeDetection:0});let t=p;return t})(),Gn=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-tabs"]],ngContentSelectors:Z,decls:1,vars:0,template:function(i,o){i&1&&(B(),y(0))},encapsulation:2,changeDetection:0});let t=e;return t})(),Kn=(()=>{let e=class e{constructor(){this.isActive=G(!1),this.disallowToggle=T(!1)}ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-toggle-card"]],hostVars:2,hostBindings:function(i,o){i&2&&$("active",o.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:Ki,decls:7,vars:1,consts:[[3,"click"],[1,"toggle-icon"],[1,"collapsable"],[1,"content"]],template:function(i,o){i&1&&(B(Gi),O(0,"h3",0),Y("click",function(){return o.disallowToggle()||o.toggle()}),y(1,0,null,Zi,1,0),q(3,Ji,2,0,"sh-icon",1),M(),O(4,"div",2)(5,"div",3),y(6,1),M()()),i&2&&(b(3),z(o.disallowToggle()?-1:3))},dependencies:[Ce],encapsulation:2,changeDetection:0});let t=e;return t})(),Zn=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=A({type:e,selectors:[["sh-toggle"]],ngContentSelectors:Z,decls:3,vars:0,consts:[[1,"box"],[1,"knob"]],template:function(i,o){i&1&&(B(),j(0,"div",0),ge(1,"div",1),W(),y(2))},encapsulation:2,changeDetection:0});let t=e;return t})();var Jn=(()=>{let e=class e{constructor(){this.filesOver=k(!1),this.filesDropped=ue()}onDragOver(n){n.preventDefault(),n.stopPropagation(),this.filesOver.set(!0)}onDragLeave(n){n.preventDefault(),n.stopPropagation(),this.filesOver.set(!1)}ondrop(n){n.preventDefault(),n.stopPropagation(),this.filesOver.set(!1);let i=n.dataTransfer?.files;i&&i.length>0&&this.filesDropped.emit(i)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275dir=Oe({type:e,selectors:[["","shDragDrop",""]],hostVars:2,hostBindings:function(i,o){i&1&&Y("dragover",function(p){return o.onDragOver(p)})("dragleave",function(p){return o.onDragLeave(p)})("drop",function(p){return o.ondrop(p)}),i&2&&$("filesover",o.filesOver())},outputs:{filesDropped:"filesDropped"}});let t=e;return t})();var pn=(()=>{var e,s,n;let i=class i{constructor(){x(this,e);x(this,s);x(this,n);this.positionAnchorName=T.required(),this.anchorEl=T.required(),this.isOpen=T(!1),D(this,e,P(Q)),D(this,s,P(_e)),D(this,n,null),this.SUPPORTS_ANCHOR=typeof CSS<"u"&&CSS.supports("position-anchor","--abc"),this.isBelow=k(!1),this.openEffect=U(()=>{this.isOpen()?setTimeout(()=>{u(this,e).nativeElement.showPopover(),this.calculateTooltipPosition()}):u(this,e).nativeElement.hidePopover()}),this.calculateTooltipPosition=()=>{if(!this.anchorEl())return;let m=this.anchorEl().nativeElement.getBoundingClientRect(),p=u(this,e).nativeElement,a=p.getBoundingClientRect();if(a.width===0&&a.height===0)return;let r=m.top-a.height<0;if(this.isBelow.set(r),!this.SUPPORTS_ANCHOR){let d=m.top-a.height,C=m.left+m.width/2-a.width/2;r&&(d=m.top+m.height),C+a.width>window?.innerWidth&&(C=m.right-a.width/2),C<0&&(C=-(a.width/2)),u(this,s).setStyle(p,"left",`${C}px`),u(this,s).setStyle(p,"top",`${d}px`),u(this,s).setStyle(p,"position","fixed")}},He(()=>{D(this,n,new AbortController);let m={signal:u(this,n).signal,capture:!0};window?.addEventListener("scroll",this.calculateTooltipPosition,m),window?.addEventListener("resize",this.calculateTooltipPosition,{signal:u(this,n).signal}),setTimeout(()=>this.calculateTooltipPosition())})}ngOnDestroy(){u(this,n)?.abort()}};e=new WeakMap,s=new WeakMap,n=new WeakMap,i.\u0275fac=function(p){return new(p||i)},i.\u0275cmp=A({type:i,selectors:[["ship-tooltip-wrapper"]],hostAttrs:["role","tooltip"],hostVars:5,hostBindings:function(p,a){p&2&&(be("popover","auto"),ee("position-anchor",a.positionAnchorName()),$("below",a.isBelow()))},inputs:{positionAnchorName:[1,"positionAnchorName"],anchorEl:[1,"anchorEl"],isOpen:[1,"isOpen"]},ngContentSelectors:Z,decls:2,vars:0,consts:[[1,"tooltip-content"]],template:function(p,a){p&1&&(B(),j(0,"div",0),y(1),W())},encapsulation:2});let t=i;return t})(),es=(()=>{var e,s,n,i,o,m;let p=class p{constructor(){x(this,e);x(this,s);x(this,n);x(this,i);x(this,o);x(this,m);this.shTooltip=T.required(),D(this,e,P(Q)),D(this,s,P(ct)),D(this,n,P(ot)),D(this,i,P(_e)),D(this,o,null),D(this,m,null),this.anchorName=`--${Re()}`,this.isOpen=k(!1)}onMouseEnter(){this.cleanupTooltip(),queueMicrotask(()=>this.showTooltip())}ngOnDestroy(){this.cleanupTooltip()}showTooltip(){if(u(this,o)||!this.shTooltip())return;this.isOpen.set(!0);let r,d=this.shTooltip();if(typeof d=="string")r=[[u(this,i).createText(d)]];else if(d instanceof De)D(this,m,d.createEmbeddedView({})),u(this,m).detectChanges(),r=[u(this,m).rootNodes];else return;D(this,o,u(this,s).createComponent(pn,{environmentInjector:u(this,n),projectableNodes:r})),u(this,o).setInput("positionAnchorName",this.anchorName),u(this,o).setInput("anchorEl",u(this,e)),u(this,o).setInput("isOpen",this.isOpen),u(this,o).changeDetectorRef.detectChanges()}cleanupTooltip(){this.isOpen.set(!1),u(this,o)&&(u(this,o).destroy(),D(this,o,null)),u(this,m)&&(u(this,m).destroy(),D(this,m,null))}};e=new WeakMap,s=new WeakMap,n=new WeakMap,i=new WeakMap,o=new WeakMap,m=new WeakMap,p.\u0275fac=function(d){return new(d||p)},p.\u0275dir=Oe({type:p,selectors:[["","shTooltip",""]],hostAttrs:[1,"tooltip"],hostVars:4,hostBindings:function(d,C){d&1&&Y("mouseenter",function(){return C.onMouseEnter()}),d&2&&(ee("anchor-name",C.anchorName),$("active",C.isOpen()))},inputs:{shTooltip:[1,"shTooltip"]}});let t=p;return t})();export{Ce as a,Pn as b,An as c,nn as d,Ln as e,Fn as f,Hn as g,jn as h,sn as i,on as j,Bn as k,tt as l,Wn as m,qn as n,zn as o,ln as p,$n as q,Nn as r,cn as s,Un as t,Qn as u,Yn as v,Xn as w,hn as x,Gn as y,Kn as z,Zn as A,Jn as B,es as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ce}from"./chunk-XNVRJH42.js";import{a as ge}from"./chunk-3UN32GIC.js";import{a as me}from"./chunk-OXOOR7I4.js";import{a as Te}from"./chunk-66BSPEOQ.js";import{c as Ee,e as Oe,i as fe,k as Ae,s as G}from"./chunk-USU2EHJV.js";import{b as oe}from"./chunk-ETCRT3EV.js";import{a as ae,b as se,e as le,g as re,i as _e,l as ue,p as pe,q as Se,s as ce,t as de}from"./chunk-WRNQOX5R.js";import{h as A}from"./chunk-J3BBLPAD.js";import{a as Pe}from"./chunk-B5FUQFEQ.js";import{la as ie}from"./chunk-WJPLJKPQ.js";import{Ab as s,Bb as l,Cb as C,Dc as H,Ec as te,Fc as ne,H as k,Jb as R,Oc as U,Qb as E,Ra as r,Rb as O,Sb as p,Tc as x,Vb as Q,Wb as S,Yb as T,_ as d,bb as f,ea as N,fa as M,hc as ee,ic as m,lc as g,nc as L,oa as c,oc as z,qc as b,rc as B,sc as y,ub as F,vb as D,wb as Z,xb as q,yb as J,zb as I}from"./chunk-QDFCX6XE.js";function Re(a,n){if(a&1){let i=R();s(0,"sh-radio",10),S("click",function(){let t=N(i).$implicit,o=T();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=T();m("active",e.pauseOption()===i.value),r(),L(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=d(A);pauseOptions=c(be);closed=x();isSubmitting=c(!1);pauseTransfers=c(!1);pauseOption=c(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(k(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),p(2,0),l()(),s(3,"div",6)(4,"div",7),q(5,Re,2,3,"sh-radio",8,Z),l(),s(7,"div",9)(8,"sh-checkbox",10),S("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),p(9,1),l(),s(10,"sh-alert",11),p(11,2),l()()(),s(12,"footer",12)(13,"button",13),S("click",function(){return e.closed.emit()}),p(14,3),l(),s(15,"button",14),S("click",function(){return e.submit()}),p(16,4),l()()),i&2&&(r(5),J(e.pauseOptions()),r(3),m("active",e.pauseTransfers()),r(7),m("loader",e.isSubmitting()))},dependencies:[G,Se,_e,se],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Fe=8,W=1024,w=W*1024,K=w*1024,Y=K*1024,De=Y*1024,ye={B:1,KB:W,MB:w,GB:K,TB:Y,PB:De},Ue=1e3,V=Ue*1e3,X=V*1e3,ve=[{threshold:De,unitPrefix:"PByte"},{threshold:Y,unitPrefix:"TByte"},{threshold:K,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:W,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],v=class a{#e=d(A);closed=x();isSubmitting=c(!1);sizeOptions=c([...Be]);maxUpload=c(0);maxDownload=c(0);maxUploadUnit=c("mbps");maxDownloadUnit=c("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(ye[i.toUpperCase()]||w)*Fe;return t===0?{value:0,unit:"mbps"}:t>=X?{value:parseFloat((t/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/V).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*X;break;case"mbps":e=n*V;break}let t=e/Fe;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:_}of ve)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:_};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],u=this.convertToBitsPerSecondUnits(o,_);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],u=this.convertToBitsPerSecondUnits(o,_);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,_=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(e,t),h=Me[P];h?n=`${u}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${P}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(o,_),h=Me[P];h?i=`${u}${h}`:console.error(`Invalid unit prefix for API submission (download): ${P}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(k(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let _;return _=$localize` Update settings `,[n,i,e,t,o,_,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),p(2,0),l(),s(3,"p"),p(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),p(9,2),l(),s(10,"sh-form-field")(11,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),y("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),y("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),p(16,3),l(),s(17,"sh-form-field")(18,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),y("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),y("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),S("click",function(){return e.closed.emit(!1)}),p(23,4),l(),s(24,"button",14),S("click",function(){return e.submit()}),p(25,5),l()()),i&2&&(r(11),b("ngModel",e.maxUpload),r(),I("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxUploadUnit),r(5),b("ngModel",e.maxDownload),r(),I("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxDownloadUnit),r(4),m("loader",e.isSubmitting()))},dependencies:[G,Ee,Ae,Oe,fe,ue,de],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function ke(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=T();r(),z("",i.statusData().actionText," - ",i.statusData().statusText),r(),I("value",i.statusData().progress*100)}}function Le(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=T();r(),L(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),r(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function xe(a,n){a&1&&(s(0,"div",7),p(1,1),l())}function Ge(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(r(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=R();s(0,"button",10),S("click",function(){N(i);let t=T(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=R();s(0,"button",10),S("click",function(){N(i);let t=T(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&F(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=T();D(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Xe(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Ie=new Date,j=class a{#e=d(A);#t=d(Ce);#n=d(le);#a=d(ge);#s=d(oe);#l=d(Te);#i=d(me);minsAgo=Ie.setMinutes(Ie.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=U(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=U(()=>this.runningTask()==this.#o());#o=c(-1);pgState=U(()=>this.#i.serverState());nextBackup=U(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(v,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),F(2,ke,3,3)(3,Le,7,8,"div",7)(4,xe,2,0,"div",7)(5,Ge,3,4,"div",8),l(),s(6,"div",9),F(7,ze,2,1),s(8,"button",10),S("click",function(){return e.pauseResume()}),E(9,0),F(10,He,2,0)(11,Xe,2,0),O(),l(),s(12,"button",10),S("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;r(2),D((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),r(5),D(e.runningTask()?7:-1),r(),m("loader",e.isResuming()),r(2),D(e.clientIsRunning()?10:11)}},dependencies:[pe,ae,re,ce,Pe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as h}from"./chunk-TJOWPBPB.js";import"./chunk-K3ZQ67VT.js";import"./chunk-CZLLEVMJ.js";import{a as w}from"./chunk-WWFNG47J.js";import{h as k}from"./chunk-36RDZAZ4.js";import"./chunk-QY6E755W.js";import"./chunk-UACX27D3.js";import"./chunk-VC72SWC4.js";import{b as T}from"./chunk-QGFC5ZUR.js";import"./chunk-XNVRJH42.js";import"./chunk-3UN32GIC.js";import"./chunk-OXOOR7I4.js";import"./chunk-GUH5TMOS.js";import"./chunk-RHW5QVAY.js";import"./chunk-66BSPEOQ.js";import"./chunk-CWBEE627.js";import"./chunk-USU2EHJV.js";import"./chunk-ZGAC2JKG.js";import"./chunk-ETCRT3EV.js";import{a as L,b as M,c as N,d as I,e as G,f as W}from"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import{q as v,v as y}from"./chunk-WRNQOX5R.js";import"./chunk-J3BBLPAD.js";import"./chunk-B5FUQFEQ.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-73RDJP55.js";import{Ab as i,Ac as p,Bb as n,Cb as s,Pc as $,Qb as F,Ra as r,Rb as l,Yb as O,_ as u,bb as D,ic as P,oa as C,ub as g,vb as E,yc as A,zb as _,zc as R}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],X=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"sh-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"sh-radio"),l(),n(),i(9,"div",6),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,X)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,z,e.backupId())),r(3),_("routerLink",p(4,B,e.backupId()))}}function V(t,o){if(t&1&&(i(0,"sh-stepper"),g(1,U,12,8)(2,j,6,6),n()),t&2){let e=O();r(),E(e.isFileRestore()?1:2)}}var m=class t{#e=u(M);#o=u(I);#t=u(h);#i=T(this.#e.params);#n=T(this.#e.url);#s=T(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),c=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(c),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&P("full-width",a.isProgressPage())},features:[A([h,k])],decls:4,vars:1,consts:()=>{let o;o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let c;c=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[o,e,a,c,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),g(1,V,3,1,"sh-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),E(a.isProgressPage()?-1:1))},dependencies:[y,v,w,N,G,W],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as z}from"./chunk-GO22DJ44.js";import{a as x,c as B,d as w,e as U,f as k}from"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import{a as X,f as H,o as V}from"./chunk-WRNQOX5R.js";import"./chunk-J3BBLPAD.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as t,Cb as _,Gb as f,Hb as P,Jb as R,Qb as l,Ra as O,Rb as s,Sb as b,Tb as v,Ub as y,Wb as u,Yb as c,_ as T,bb as D,ea as a,fa as S,oa as $,ub as N,vb as G,zb as M}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";function W(g,F){if(g&1){let n=R();i(0,"sh-menu",15)(1,"button",16),b(2,2),t(),f(3,17),i(4,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"sh-icon"),s(),t(),i(7,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"sh-icon"),s(),t(),i(10,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"sh-icon"),s(),t(),i(13,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"sh-icon"),s(),t(),i(16,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Retry"))}),l(17,7),_(18,"sh-icon"),s(),t(),i(19,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Information"))}),l(20,8),_(21,"sh-icon"),s(),t(),i(22,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"sh-icon"),s(),t(),i(25,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Warning"))}),l(26,10),_(27,"sh-icon"),s(),t(),i(28,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Error"))}),l(29,11),_(30,"sh-icon"),s(),t(),P(),t()}if(g&2){let n=c();M("openIndicator",!0),O(2),v(n.logLevelByLabel()),y(2)}}var C=class g{#n=T(w);#e=T(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=$(this.#n.url);constructor(){this.#n.events.subscribe(F=>{F instanceof x&&this.currentUrl.set(F.urlAfterRedirects)})}updateLogLevel(F){this.#e.isPolling.set(!0),this.#e.updateLogLevel(F)}static \u0275fac=function(n){return new(n||g)};static \u0275cmp=D({type:g,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let F;F=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Disabled `;let L;L=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Verbose `;let d;d=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Explicit only `;let h;h=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Profiling `;let I;I=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Retry `;let E;E=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Information `;let A;A=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Dry run `;let m;m=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON: Warning `;let p;return p=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: Error `,[F,n,o,e,L,d,h,I,E,A,m,p,[1,"filters"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"sh-button-group")(2,"button",13),l(3,0),_(4,"sh-icon"),s(),t(),i(5,"button",14),l(6,1),_(7,"sh-icon"),s(),t()(),N(8,W,31,2,"sh-menu",15),t(),_(9,"router-outlet")),n&2&&(O(8),G(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[H,X,V,B,k,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:0 2rem;margin-bottom:1.25rem}"],changeDetection:0})};export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _}from"./chunk-6GC5VKTI.js";import"./chunk-QGFC5ZUR.js";import"./chunk-J3BBLPAD.js";import{oa as l}from"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import{Db as n,Dc as g,Eb as i,Ec as d,Ra as a,Sb as p,_ as s,bb as S,lc as c,mc as m}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";var o=class r{#e=s(_);serverSettings=this.#e.serverSettings;static \u0275fac=function(e){return new(e||r)};static \u0275cmp=S({type:r,selectors:[["app-server-settings"]],decls:6,vars:3,consts:()=>{let t;return t=$localize`System settings`,[t]},template:function(e,f){e&1&&(n(0,"h3"),p(1,0),i(),n(2,"code")(3,"pre"),c(4),g(5,"json"),i()()),e&2&&(a(4),m(d(5,1,f.serverSettings())))},dependencies:[l],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30)}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:1rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as k,r as L}from"./chunk-NSIELNIY.js";import{h as U}from"./chunk-DNJOKPEL.js";import{H as C,Hc as A,U as E,Z as R,na as z,r as S}from"./chunk-BTMXQPBB.js";import{a,b as D}from"./chunk-EUDKD2JW.js";var h=class{constructor(t){this.loader=t}_data=z(void 0);_isLoading=!1;_loaded=!1;load(){return!this._loaded&&!this._isLoading&&(this._isLoading=!0,this.loader().pipe(C(()=>this._isLoading=!1)).subscribe(t=>{this._data.set(t),this._loaded=!0})),this._data.asReadonly()}value(){return this._data.asReadonly()}isLoading(){return this._isLoading}isLoaded(){return this._loaded}reset(){this._data.set(void 0),this._loaded=!1}};var g=class e{#e=R(U);#o=new h(()=>this.getS3Config("Providers"));#n=new h(()=>this.getS3Config("Regions"));#r=new h(()=>this.getS3Config("RegionHosts"));#i=new h(()=>this.getS3Config("StorageClasses"));#a=A(()=>{let t=this.#o.value()(),o=this.#r.value()(),r=[...t??[],...o?.map(n=>({key:`Amazon ${n.key}`,value:n.value}))??[]];return Array.from(new Map(r.map(n=>[n.value,n])).values())});#s=new h(()=>this.getStorjConfig("Satellites"));#l=new h(()=>this.getStorjConfig("AuthenticationMethods"));#c=new h(()=>this.getOpenstackConfig("Providers"));#p=new h(()=>this.getOpenstackConfig("Versions"));#u=new h(()=>this.getGcsConfig("Locations"));#m=new h(()=>this.getGcsConfig("StorageClasses"));getS3AllProviders(){return this.#o.load(),this.#r.load(),this.#a}getS3Providers(){return this.#o.load()}getS3Regions(){return this.#n.load()}getS3RegionHosts(){return this.#r.load()}getS3StorageClasses(){return this.#i.load()}getStorjSatellites(){return this.#s.load()}getStorjAuthenticationMethods(){return this.#l.load()}getOpenstackProviders(){return this.#c.load()}getOpenstackVersions(){return this.#p.load()}getGcsLocations(){return this.#u.load()}getGcsStorageClasses(){return this.#m.load()}getS3Config(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":t}}).pipe(S(o=>this.#t(o)))}createS3IamUser(t,o){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":t,"s3-password":o}})}createS3PolicyIAM(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:t}})}getStorjConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":t}}).pipe(S(o=>this.#t(o)))}getOpenstackConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":t}}).pipe(S(o=>this.#t(o)))}getGcsConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":t}}).pipe(S(o=>this.#t(o)))}#t(t){return(t.Result&&typeof t.Result=="object"&&Object.entries(t.Result).map(([o,r])=>({key:o,value:r})))??[]}static \u0275fac=function(o){return new(o||e)};static \u0275prov=E({token:e,factory:e.\u0275fac,providedIn:"root"})};var i=new L,p={type:"error",message:$localize`Using a leading slash is most likely wrong, and will result in objects being created with a leading slash in the name.`},w={description:$localize`Unknown destination type`,isDefaultEntry:!0,customFields:{path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path`,formElement:e=>i.control(e??"")}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let n=o.startsWith(`${e}:///`)?o.split(`${e}:///`)[1]:o.split(`${e}://`)[1];return a({destinationType:e,custom:{path:n.split("?")[0]}},s(e,t))}}},V=[{key:"file",displayName:$localize`File system`,description:$localize`Store backups on your local file system.`,customFields:{path:{type:"FolderTree",name:"path",doubleSlash:p,shortDescription:$localize`File path`,longDescription:$localize`The path to store the backup`,formElement:e=>i.control(e??""),isMandatory:!0}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let r=o.startsWith("file:///"),n=decodeURIComponent(r?o.split("file:///")[1]:o.split("file://")[1]),u=n.slice(1).startsWith(":\\")?n:"/"+n;return a({destinationType:e,custom:{path:u.split("?")[0]}},s(e,t))}}},{key:"ssh",displayName:$localize`SSH`,description:$localize`Store backups with SSH.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`The server to connect to`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`The port to connect to`,formElement:e=>i.control(e??"",[k.required,k.max(65535)])},path:{type:"Path",name:"path",shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0}],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:$localize`This is a path to a private key file locally on the machine`,longDescription:$localize`This is a path to a private key file locally on the machine`},{type:"FreeText",name:"ssh-key",shortDescription:$localize`SSH private key`,longDescription:$localize`An SSH private key. Supported formats are OpenSSL, OpenSSH, PuTTY, and PEM.`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"s3",displayName:$localize`S3 Compatible`,description:$localize`Store backups in any S3 compatible bucket.`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the S3 compatible server to connect to`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3AllProviders(),isMandatory:!0,formElement:e=>i.control(e??"")},{name:"use-ssl",order:2},{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],advancedFields:[{name:"s3-client",type:"Enumeration",loadOptions:()=>z([{key:"AWS Library",value:"aws"},{key:"MinIO Library",value:"minio"}])},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3StorageClasses()},{name:"s3-location-constraint",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3Regions()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"gcs",displayName:$localize`Google Cloud Storage`,description:$localize`Store backups in Google Cloud Storage.`,oauthField:"authid",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],advancedFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsLocations()},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsStorageClasses()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"googledrive",displayName:$localize`Google Drive`,description:$localize`Store backups in Google Drive.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"pcloud",displayName:$localize`pCloud`,description:$localize`Store backups in pCloud.`,oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>z([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",oauthVersion:2,isMandatory:!0}],mapper:{to:e=>{let{server:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{server:r,path:n}},s(e,t))}}},{key:"azure",displayName:$localize`Azure Blob Storage`,description:$localize`Store backups in Azure Blob Storage.`,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Container name`,longDescription:$localize`Container name`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"onedrivev2",displayName:$localize`OneDrive`,description:$localize`Store backups in OneDrive.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"od4b",displayName:$localize`OneDrive Business`,description:$localize`Store backups in OneDrive Business.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"mssp",displayName:$localize`Microsoft SharePoint`,description:$localize`Store backups in Microsoft SharePoint.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"sharepoint",displayName:$localize`Microsoft SharePoint v2`,description:$localize`Store backups in Microsoft SharePoint.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"site-id",isMandatory:!0},{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"dropbox",displayName:$localize`Dropbox`,description:$localize`Store backups in Dropbox.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"box",displayName:$localize`Box.com`,description:$localize`Store backups in Box.com.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"jottacloud",displayName:$localize`Jottacloud`,description:$localize`Store backups in Jottacloud.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"b2",displayName:$localize`B2 Cloud Storage`,description:$localize`Store backups in B2 Cloud Storage.`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Application ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Application Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"e2",displayName:$localize`IDrive e2`,description:$localize`Store backups in IDrive e2.`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Access ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access Secret`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{bucket:r,path:n}},s(e,t))}}},{key:"mega",displayName:$localize`Mega.nz`,description:$localize`Store backups in Mega.nz.`,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let t=e.custom.path;return c(e,null,null,t)},from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"msgroup",displayName:$localize`Microsoft Office 365 Group`,description:$localize`Store backups in Microsoft Office 365 Group.`,oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:$localize`Group email`,longDescription:$localize`Group email`,formElement:e=>i.control(e??"",[k.email]),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"cloudfiles",displayName:$localize`Rackspace CloudFiles`,description:$localize`Store backups in Rackspace CloudFiles.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"rclone",displayName:$localize`Rclone`,description:$localize`Store backups in Rclone.`,dynamicFields:[{name:"rclone-local-repository",shortDescription:$localize`Local repository`,defaultValue:""},{name:"rclone-remote-repository",shortDescription:$localize`Remote repository`,defaultValue:""},{name:"rclone-remote-path",type:"Path",shortDescription:$localize`Path on remote repository`,defaultValue:""}],mapper:{to:e=>{let t=e.dynamic["rclone-remote-repository"],o=e.dynamic["rclone-remote-path"],r=Object.entries(e.dynamic).filter(([n])=>!["rclone-remote-repository","rclone-remote-path"].includes(n));return v(e.destinationType??"rclone",t,null,o,[...Object.entries(e.advanced),...r])},from:(e,t,o)=>{let{advanced:r,dynamic:n}=s(e,t),{server:l,path:u}=m(t);return a({destinationType:e,dynamic:a({"rclone-remote-repository":l,"rclone-remote-path":u},n)},r)}}},{key:"openstack",displayName:$localize`OpenStack Object Storage`,description:$localize`Store backups in OpenStack Object Storage.`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket`,longDescription:$localize`Bucket`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:[{name:"openstack-authuri",shortDescription:$localize`Auth URI`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackProviders(),isMandatory:!0},{name:"openstack-version",shortDescription:$localize`Version`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackVersions()},{name:"openstack-domain-name",type:"Hostname",shortDescription:$localize`Domain name`},{name:"openstack-tenant-name",shortDescription:$localize`Tenant name`},{name:"openstack-region",shortDescription:$localize`Region`}],mapper:{to:e=>{let{bucket:t}=e.custom;return c(e,t,null,null)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"webdav",displayName:$localize`WebDAV`,description:$localize`Store backups in WebDAV.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`},{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"aftp",displayName:$localize`Alternative FTP`,description:$localize`Store backups in FTP.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"ftp",displayName:$localize`FTP`,description:$localize`Store backups in FTP.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"sia",displayName:$localize`Sia Decentrilized Cloud`,description:$localize`Store backups in Sia Decentrilized Cloud.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let t=e.custom.server,o=e.dynamic["sia-targetpath"],r=[...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([n])=>n!=="sia-targetpath")];return v(e.destinationType??"sia",t,null,o,r)},from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"cos",displayName:$localize`Tencent COS`,description:$localize`Store backups in Tencent COS.`,customFields:{bucket:{name:"bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"cos-region",shortDescription:$localize`Region`},{name:"cos-app-id",shortDescription:$localize`COS App Id`,isMandatory:!0},{name:"cos-secret-id",shortDescription:$localize`COS Secret Id`,isMandatory:!0},{name:"cos-secret-key",shortDescription:$localize`COS Secret Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(a({},e),{advanced:D(a({},e.advanced),{"cos-bucket":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=s(e,t),n=r.advanced["cos-bucket"];return delete r.advanced["cos-bucket"],a({destinationType:e,custom:{path:d(t),bucket:n}},r)}}},{key:"tahoe",displayName:$localize`Tahoe LAFS`,description:$localize`Store backups in Tahoe LAFS.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"smb",displayName:$localize`Windows Share (SMB)`,description:$localize`Store backups on SMB storage.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},share:{type:"Hostname",name:"share",shortDescription:$localize`Share Name`,longDescription:$localize`Share Name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:["transport",{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0},"auth-domain"],mapper:{to:e=>{let{share:t,server:o,path:r}=e.custom;return c(e,o,null,M(t,r))},from:(e,t,o)=>{let{server:r,path:n}=m(t),l=n.split("/")[0],u=n.split("/").slice(1).join("/");return a({destinationType:e,custom:{server:r,share:l,path:u}},s(e,t))}}},{key:"filen",displayName:$localize`Filen.io`,description:$localize`Store backups in Filen.io.`,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filen`,longDescription:$localize`Path on Filen`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"filejump",displayName:$localize`Filejump`,description:$localize`Store backups in Filejump.`,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filejump`,longDescription:$localize`Path on Filejump`,formElement:e=>i.control(e??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:$localize`API Token`,longDescription:$localize`Filejump API Token`,formElement:e=>i.control(e??""),isMandatory:!0}],mapper:{to:e=>{let{path:t}=e.custom;return console.log(t),c(e,null,null,t)},from:(e,t,o)=>(console.log(t),a({destinationType:e,custom:{path:d(t)}},s(e,t)))}},{key:"storj",customKey:"storjAccessGrant",displayName:$localize`Storj Access Grant`,description:$localize`Store backups in Storj Access Grant.`,dynamicFields:[{name:"storj-shared-access",shortDescription:$localize`Access Grant`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p},{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0}],mapper:{to:e=>{let t={"storj-auth-method":"Acccess grant"};return`storj://storj.io/config${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=s(e,t);return delete r.advanced["storj-auth-method"],a({destinationType:e},r)}}},{key:"storj",customKey:"storjApiKey",displayName:$localize`Storj API Key`,description:$localize`Store backups in Storj API Key.`,dynamicFields:[{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0},{name:"storj-api-key",shortDescription:$localize`API Key`,isMandatory:!0},{name:"storj-secret",shortDescription:$localize`Secret`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p}],mapper:{to:e=>{let t={"storj-auth-method":"API key"};return`storj://storj.io/config${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=s(e,t);return delete r.advanced["storj-auth-method"],a({destinationType:e},r)}}},{key:"aliyunoss",displayName:$localize`Aliyun OSS`,description:$localize`Store backups in Aliyun OSS`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in bucket`,longDescription:$localize`Path in bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"oss-endpoint",isMandatory:!0},{name:"oss-access-key-id",isMandatory:!0},{name:"oss-access-key-secret",isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(a({},e),{advanced:D(a({},e.advanced),{"oss-bucket-name":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=s(e,t),n=r.advanced["oss-bucket-name"];return delete r.advanced["oss-bucket-name"],a({destinationType:e,custom:{path:d(t),bucket:n}},r)}}}],le={".amazonaws.com":"Amazon S3",".mycloudyplace.com":"MyCloudyPlace S3",".impossibleapi.net":"Impossible Cloud S3",".scw.cloud":"Scaleway S3",".hosteurope.de":"Hosteurope S3",".dunkel.de":"Dunkel S3",".dreamhost.com":"DreamHost S3",".dincloud.com":"dinCloud S3",".polisystems.ch":"Poli Systems S3",".softlayer.net":"IBM COS (S3)",".storadera.com":"Storadera S3",".wasabisys.com":"Wasabi S3",".infomaniak.com":"Infomaniak S3",".infomaniak.cloud":"Infomaniak S3",".sakurastorage.jp":"\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 S3",".lyvecloud.seagate.com":"Seagate Lyve S3",".digitaloceanspaces.com":"DigitalOcean S3",".backblazeb2.com":"Backblaze B2 S3",".cloudian.com":"Cloudian S3",".min.io":"MinIO S3",".linodeobjects.com":"Linode S3",".bunnycdn.com":"BunnyCDN S3",".azure.com":"Microsoft Azure S3",".googleapis.com":"Google Cloud Storage S3",".ibm.com":"IBM Cloud S3",".oracle.com":"Oracle Cloud S3",".cloudflare.com":"Cloudflare S3",".alibaba.com":"Alibaba Cloud S3",".huawei.com":"Huawei Cloud S3",".tencent.com":"Tencent Cloud S3",".baidu.com":"Baidu Cloud S3",".jd.com":"JD Cloud S3",".ucloud.cn":"UCloud S3",".qiniu.com":"Qiniu Cloud S3",".aliyuncs.com":"Aliyun S3",".tcloud.com":"TCloud S3",".tencentcloudapi.com":"Tencent Cloud S3"};function c(e,t,o,r){return v(e.destinationType??"file",t,o,r,[...Object.entries(e.advanced),...Object.entries(e.dynamic)])}function v(e,t,o,r,n){let l=b(n),u=encodeURIComponent(B(t)),y=u==""?"":u+j(o),f=r??"",$=f.slice(1).startsWith(":\\")&&e=="file"?"file:///":`${e}://`,O=M(y,N(f));return`${$}${O}${l}`}function I(e){return e==null||e===""?"":e.startsWith("/")?e.substring(1):e}function M(...e){if(e.length===0)return"";if(e.length===1)return e[0]??"";let t="";for(let o of e)o==null||o===""||(t+=t.endsWith("/")||t==""?o:"/"+o);return t}function N(e){return e.split("/").map(encodeURIComponent).join("/")}function d(e){if(e==null||e==="")return"";if(typeof e=="string")try{e=new URL(e)}catch{return""}return decodeURIComponent(e.hostname??"")+decodeURIComponent(e.pathname=="/"?"":e.pathname??"")}function B(e){return e==null||e===""?"":e.endsWith("/")?e.substring(0,e.length-1):e}function j(e){return e==null||e===""?"":":"+e.toString()}function P(e){return V.find(o=>o.key===e||o.customKey===e)??V.find(o=>`${o.key}s`===e)??null??a({key:e,displayName:e},w)}function m(e){return{server:decodeURIComponent(e.hostname),port:e.port,path:I(decodeURIComponent(e.pathname))}}function s(e,t){let o={},r={},n=P(e);return t.searchParams.forEach((l,u)=>{n?.dynamicFields?.some(f=>f===u||f?.name===u)?r[u]=decodeURIComponent(l):o[u]=decodeURIComponent(l)}),{advanced:o,dynamic:r}}function b(e,t=!1){let o=e.map(([n,l])=>`${n}=${l?encodeURIComponent(l.toString()):""}`).join("&");return o?(t?"":"?")+o:""}function me(e){let t=e.destinationType??"";return P(t)?.mapper.to(e)??""}function de(e){let t=URL.canParse(e),o=e.split("://")[0],r=e.split("://")[1],n=o==="file"?"http://dummy":"http://"+r;if(!r)return null;if(r.startsWith("%")&&o==="file")return P(o).mapper.from(o,new URL("http://localhost"),e);let l=P(o),u="";`${l.key}s`===o&&(u+=n.indexOf("?")===-1?"?":"&",u+="use-ssl=true",e=l.key+e.substring(o.length));try{let y=new URL(n+u);if(y.host==="undefined")return null;let f=r.split("?")[0].split("/")[0],G=!isNaN(Number(y.host.replaceAll(".",""))),$=f.split("."),O=$.length===4&&$.every(F=>F.length&&F.length<=3&&!isNaN(Number(F))&&parseInt(F)<=255);return G&&!O?null:l.mapper.from(l.key,y,e)}catch(y){return console.error("Error while parsing target path",y),null}}export{P as a,me as b,de as c,le as d};
|
|
1
|
+
import{d as k,r as L}from"./chunk-USU2EHJV.js";import{h as U}from"./chunk-J3BBLPAD.js";import{H as C,Oc as R,V as E,_ as A,oa as z,r as S}from"./chunk-QDFCX6XE.js";import{a,b as D}from"./chunk-EUDKD2JW.js";var h=class{constructor(t){this.loader=t}_data=z(void 0);_isLoading=!1;_loaded=!1;load(){return!this._loaded&&!this._isLoading&&(this._isLoading=!0,this.loader().pipe(C(()=>this._isLoading=!1)).subscribe(t=>{this._data.set(t),this._loaded=!0})),this._data.asReadonly()}value(){return this._data.asReadonly()}isLoading(){return this._isLoading}isLoaded(){return this._loaded}reset(){this._data.set(void 0),this._loaded=!1}};var g=class e{#e=A(U);#o=new h(()=>this.getS3Config("Providers"));#n=new h(()=>this.getS3Config("Regions"));#r=new h(()=>this.getS3Config("RegionHosts"));#i=new h(()=>this.getS3Config("StorageClasses"));#a=R(()=>{let t=this.#o.value()(),o=this.#r.value()(),r=[...t??[],...o?.map(n=>({key:`Amazon ${n.key}`,value:n.value}))??[]];return Array.from(new Map(r.map(n=>[n.value,n])).values())});#s=new h(()=>this.getStorjConfig("Satellites"));#l=new h(()=>this.getStorjConfig("AuthenticationMethods"));#c=new h(()=>this.getOpenstackConfig("Providers"));#p=new h(()=>this.getOpenstackConfig("Versions"));#u=new h(()=>this.getGcsConfig("Locations"));#m=new h(()=>this.getGcsConfig("StorageClasses"));getS3AllProviders(){return this.#o.load(),this.#r.load(),this.#a}getS3Providers(){return this.#o.load()}getS3Regions(){return this.#n.load()}getS3RegionHosts(){return this.#r.load()}getS3StorageClasses(){return this.#i.load()}getStorjSatellites(){return this.#s.load()}getStorjAuthenticationMethods(){return this.#l.load()}getOpenstackProviders(){return this.#c.load()}getOpenstackVersions(){return this.#p.load()}getGcsLocations(){return this.#u.load()}getGcsStorageClasses(){return this.#m.load()}getS3Config(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":t}}).pipe(S(o=>this.#t(o)))}createS3IamUser(t,o){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":t,"s3-password":o}})}createS3PolicyIAM(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:t}})}getStorjConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":t}}).pipe(S(o=>this.#t(o)))}getOpenstackConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":t}}).pipe(S(o=>this.#t(o)))}getGcsConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":t}}).pipe(S(o=>this.#t(o)))}#t(t){return(t.Result&&typeof t.Result=="object"&&Object.entries(t.Result).map(([o,r])=>({key:o,value:r})))??[]}static \u0275fac=function(o){return new(o||e)};static \u0275prov=E({token:e,factory:e.\u0275fac,providedIn:"root"})};var i=new L,p={type:"error",message:$localize`Using a leading slash is most likely wrong, and will result in objects being created with a leading slash in the name.`},w={description:$localize`Unknown destination type`,isDefaultEntry:!0,customFields:{path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path`,formElement:e=>i.control(e??"")}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let n=o.startsWith(`${e}:///`)?o.split(`${e}:///`)[1]:o.split(`${e}://`)[1];return a({destinationType:e,custom:{path:n.split("?")[0]}},s(e,t))}}},V=[{key:"file",displayName:$localize`File system`,description:$localize`Store backups on your local file system.`,customFields:{path:{type:"FolderTree",name:"path",doubleSlash:p,shortDescription:$localize`File path`,longDescription:$localize`The path to store the backup`,formElement:e=>i.control(e??""),isMandatory:!0}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let r=o.startsWith("file:///"),n=decodeURIComponent(r?o.split("file:///")[1]:o.split("file://")[1]),u=n.slice(1).startsWith(":\\")?n:"/"+n;return a({destinationType:e,custom:{path:u.split("?")[0]}},s(e,t))}}},{key:"ssh",displayName:$localize`SSH`,description:$localize`Store backups with SSH.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`The server to connect to`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`The port to connect to`,formElement:e=>i.control(e??"",[k.required,k.max(65535)])},path:{type:"Path",name:"path",shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0}],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:$localize`This is a path to a private key file locally on the machine`,longDescription:$localize`This is a path to a private key file locally on the machine`},{type:"FreeText",name:"ssh-key",shortDescription:$localize`SSH private key`,longDescription:$localize`An SSH private key. Supported formats are OpenSSL, OpenSSH, PuTTY, and PEM.`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"s3",displayName:$localize`S3 Compatible`,description:$localize`Store backups in any S3 compatible bucket.`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the S3 compatible server to connect to`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3AllProviders(),isMandatory:!0,formElement:e=>i.control(e??"")},{name:"use-ssl",order:2},{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],advancedFields:[{name:"s3-client",type:"Enumeration",loadOptions:()=>z([{key:"AWS Library",value:"aws"},{key:"MinIO Library",value:"minio"}])},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3StorageClasses()},{name:"s3-location-constraint",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3Regions()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"gcs",displayName:$localize`Google Cloud Storage`,description:$localize`Store backups in Google Cloud Storage.`,oauthField:"authid",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],advancedFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsLocations()},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsStorageClasses()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"googledrive",displayName:$localize`Google Drive`,description:$localize`Store backups in Google Drive.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"pcloud",displayName:$localize`pCloud`,description:$localize`Store backups in pCloud.`,oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>z([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",oauthVersion:2,isMandatory:!0}],mapper:{to:e=>{let{server:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{server:r,path:n}},s(e,t))}}},{key:"azure",displayName:$localize`Azure Blob Storage`,description:$localize`Store backups in Azure Blob Storage.`,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Container name`,longDescription:$localize`Container name`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"onedrivev2",displayName:$localize`OneDrive`,description:$localize`Store backups in OneDrive.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"od4b",displayName:$localize`OneDrive Business`,description:$localize`Store backups in OneDrive Business.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"mssp",displayName:$localize`Microsoft SharePoint`,description:$localize`Store backups in Microsoft SharePoint.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"sharepoint",displayName:$localize`Microsoft SharePoint v2`,description:$localize`Store backups in Microsoft SharePoint.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"site-id",isMandatory:!0},{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"dropbox",displayName:$localize`Dropbox`,description:$localize`Store backups in Dropbox.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"box",displayName:$localize`Box.com`,description:$localize`Store backups in Box.com.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"jottacloud",displayName:$localize`Jottacloud`,description:$localize`Store backups in Jottacloud.`,oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"b2",displayName:$localize`B2 Cloud Storage`,description:$localize`Store backups in B2 Cloud Storage.`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Application ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Application Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"e2",displayName:$localize`IDrive e2`,description:$localize`Store backups in IDrive e2.`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Access ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access Secret`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{bucket:r,path:n}},s(e,t))}}},{key:"mega",displayName:$localize`Mega.nz`,description:$localize`Store backups in Mega.nz.`,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let t=e.custom.path;return c(e,null,null,t)},from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"msgroup",displayName:$localize`Microsoft Office 365 Group`,description:$localize`Store backups in Microsoft Office 365 Group.`,oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:$localize`Group email`,longDescription:$localize`Group email`,formElement:e=>i.control(e??"",[k.email]),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"cloudfiles",displayName:$localize`Rackspace CloudFiles`,description:$localize`Store backups in Rackspace CloudFiles.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"rclone",displayName:$localize`Rclone`,description:$localize`Store backups in Rclone.`,dynamicFields:[{name:"rclone-local-repository",shortDescription:$localize`Local repository`,defaultValue:""},{name:"rclone-remote-repository",shortDescription:$localize`Remote repository`,defaultValue:""},{name:"rclone-remote-path",type:"Path",shortDescription:$localize`Path on remote repository`,defaultValue:""}],mapper:{to:e=>{let t=e.dynamic["rclone-remote-repository"],o=e.dynamic["rclone-remote-path"],r=Object.entries(e.dynamic).filter(([n])=>!["rclone-remote-repository","rclone-remote-path"].includes(n));return v(e.destinationType??"rclone",t,null,o,[...Object.entries(e.advanced),...r])},from:(e,t,o)=>{let{advanced:r,dynamic:n}=s(e,t),{server:l,path:u}=m(t);return a({destinationType:e,dynamic:a({"rclone-remote-repository":l,"rclone-remote-path":u},n)},r)}}},{key:"openstack",displayName:$localize`OpenStack Object Storage`,description:$localize`Store backups in OpenStack Object Storage.`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket`,longDescription:$localize`Bucket`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:[{name:"openstack-authuri",shortDescription:$localize`Auth URI`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackProviders(),isMandatory:!0},{name:"openstack-version",shortDescription:$localize`Version`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackVersions()},{name:"openstack-domain-name",type:"Hostname",shortDescription:$localize`Domain name`},{name:"openstack-tenant-name",shortDescription:$localize`Tenant name`},{name:"openstack-region",shortDescription:$localize`Region`}],mapper:{to:e=>{let{bucket:t}=e.custom;return c(e,t,null,null)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return a({destinationType:e,custom:{path:n,bucket:r}},s(e,t))}}},{key:"webdav",displayName:$localize`WebDAV`,description:$localize`Store backups in WebDAV.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`},{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"aftp",displayName:$localize`Alternative FTP`,description:$localize`Store backups in FTP.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"ftp",displayName:$localize`FTP`,description:$localize`Store backups in FTP.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"sia",displayName:$localize`Sia Decentrilized Cloud`,description:$localize`Store backups in Sia Decentrilized Cloud.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let t=e.custom.server,o=e.dynamic["sia-targetpath"],r=[...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([n])=>n!=="sia-targetpath")];return v(e.destinationType??"sia",t,null,o,r)},from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"cos",displayName:$localize`Tencent COS`,description:$localize`Store backups in Tencent COS.`,customFields:{bucket:{name:"bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"cos-region",shortDescription:$localize`Region`},{name:"cos-app-id",shortDescription:$localize`COS App Id`,isMandatory:!0},{name:"cos-secret-id",shortDescription:$localize`COS Secret Id`,isMandatory:!0},{name:"cos-secret-key",shortDescription:$localize`COS Secret Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(a({},e),{advanced:D(a({},e.advanced),{"cos-bucket":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=s(e,t),n=r.advanced["cos-bucket"];return delete r.advanced["cos-bucket"],a({destinationType:e,custom:{path:d(t),bucket:n}},r)}}},{key:"tahoe",displayName:$localize`Tahoe LAFS`,description:$localize`Store backups in Tahoe LAFS.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return a({destinationType:e,custom:{server:r,port:n,path:l}},s(e,t))}}},{key:"smb",displayName:$localize`Windows Share (SMB)`,description:$localize`Store backups on SMB storage.`,customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},share:{type:"Hostname",name:"share",shortDescription:$localize`Share Name`,longDescription:$localize`Share Name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:["transport",{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0},"auth-domain"],mapper:{to:e=>{let{share:t,server:o,path:r}=e.custom;return c(e,o,null,M(t,r))},from:(e,t,o)=>{let{server:r,path:n}=m(t),l=n.split("/")[0],u=n.split("/").slice(1).join("/");return a({destinationType:e,custom:{server:r,share:l,path:u}},s(e,t))}}},{key:"filen",displayName:$localize`Filen.io`,description:$localize`Store backups in Filen.io.`,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filen`,longDescription:$localize`Path on Filen`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>a({destinationType:e,custom:{path:d(t)}},s(e,t))}},{key:"filejump",displayName:$localize`Filejump`,description:$localize`Store backups in Filejump.`,customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filejump`,longDescription:$localize`Path on Filejump`,formElement:e=>i.control(e??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:$localize`API Token`,longDescription:$localize`Filejump API Token`,formElement:e=>i.control(e??""),isMandatory:!0}],mapper:{to:e=>{let{path:t}=e.custom;return console.log(t),c(e,null,null,t)},from:(e,t,o)=>(console.log(t),a({destinationType:e,custom:{path:d(t)}},s(e,t)))}},{key:"storj",customKey:"storjAccessGrant",displayName:$localize`Storj Access Grant`,description:$localize`Store backups in Storj Access Grant.`,dynamicFields:[{name:"storj-shared-access",shortDescription:$localize`Access Grant`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p},{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0}],mapper:{to:e=>{let t={"storj-auth-method":"Acccess grant"};return`storj://storj.io/config${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=s(e,t);return delete r.advanced["storj-auth-method"],a({destinationType:e},r)}}},{key:"storj",customKey:"storjApiKey",displayName:$localize`Storj API Key`,description:$localize`Store backups in Storj API Key.`,dynamicFields:[{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0},{name:"storj-api-key",shortDescription:$localize`API Key`,isMandatory:!0},{name:"storj-secret",shortDescription:$localize`Secret`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p}],mapper:{to:e=>{let t={"storj-auth-method":"API key"};return`storj://storj.io/config${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=s(e,t);return delete r.advanced["storj-auth-method"],a({destinationType:e},r)}}},{key:"aliyunoss",displayName:$localize`Aliyun OSS`,description:$localize`Store backups in Aliyun OSS`,customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in bucket`,longDescription:$localize`Path in bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"oss-endpoint",isMandatory:!0},{name:"oss-access-key-id",isMandatory:!0},{name:"oss-access-key-secret",isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(a({},e),{advanced:D(a({},e.advanced),{"oss-bucket-name":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=s(e,t),n=r.advanced["oss-bucket-name"];return delete r.advanced["oss-bucket-name"],a({destinationType:e,custom:{path:d(t),bucket:n}},r)}}}],le={".amazonaws.com":"Amazon S3",".mycloudyplace.com":"MyCloudyPlace S3",".impossibleapi.net":"Impossible Cloud S3",".scw.cloud":"Scaleway S3",".hosteurope.de":"Hosteurope S3",".dunkel.de":"Dunkel S3",".dreamhost.com":"DreamHost S3",".dincloud.com":"dinCloud S3",".polisystems.ch":"Poli Systems S3",".softlayer.net":"IBM COS (S3)",".storadera.com":"Storadera S3",".wasabisys.com":"Wasabi S3",".infomaniak.com":"Infomaniak S3",".infomaniak.cloud":"Infomaniak S3",".sakurastorage.jp":"\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 S3",".lyvecloud.seagate.com":"Seagate Lyve S3",".digitaloceanspaces.com":"DigitalOcean S3",".backblazeb2.com":"Backblaze B2 S3",".cloudian.com":"Cloudian S3",".min.io":"MinIO S3",".linodeobjects.com":"Linode S3",".bunnycdn.com":"BunnyCDN S3",".azure.com":"Microsoft Azure S3",".googleapis.com":"Google Cloud Storage S3",".ibm.com":"IBM Cloud S3",".oracle.com":"Oracle Cloud S3",".cloudflare.com":"Cloudflare S3",".alibaba.com":"Alibaba Cloud S3",".huawei.com":"Huawei Cloud S3",".tencent.com":"Tencent Cloud S3",".baidu.com":"Baidu Cloud S3",".jd.com":"JD Cloud S3",".ucloud.cn":"UCloud S3",".qiniu.com":"Qiniu Cloud S3",".aliyuncs.com":"Aliyun S3",".tcloud.com":"TCloud S3",".tencentcloudapi.com":"Tencent Cloud S3"};function c(e,t,o,r){return v(e.destinationType??"file",t,o,r,[...Object.entries(e.advanced),...Object.entries(e.dynamic)])}function v(e,t,o,r,n){let l=b(n),u=encodeURIComponent(B(t)),y=u==""?"":u+j(o),f=r??"",$=f.slice(1).startsWith(":\\")&&e=="file"?"file:///":`${e}://`,O=M(y,I(f));return`${$}${O}${l}`}function N(e){return e==null||e===""?"":e.startsWith("/")?e.substring(1):e}function M(...e){if(e.length===0)return"";if(e.length===1)return e[0]??"";let t="";for(let o of e)o==null||o===""||(t+=t.endsWith("/")||t==""?o:"/"+o);return t}function I(e){return e.split("/").map(encodeURIComponent).join("/")}function d(e){if(e==null||e==="")return"";if(typeof e=="string")try{e=new URL(e)}catch{return""}return decodeURIComponent(e.hostname??"")+decodeURIComponent(e.pathname=="/"?"":e.pathname??"")}function B(e){return e==null||e===""?"":e.endsWith("/")?e.substring(0,e.length-1):e}function j(e){return e==null||e===""?"":":"+e.toString()}function P(e){return V.find(o=>o.key===e||o.customKey===e)??V.find(o=>`${o.key}s`===e)??null??a({key:e,displayName:e},w)}function m(e){return{server:decodeURIComponent(e.hostname),port:e.port,path:N(decodeURIComponent(e.pathname))}}function s(e,t){let o={},r={},n=P(e);return t.searchParams.forEach((l,u)=>{n?.dynamicFields?.some(f=>f===u||f?.name===u)?r[u]=decodeURIComponent(l):o[u]=decodeURIComponent(l)}),{advanced:o,dynamic:r}}function b(e,t=!1){let o=e.map(([n,l])=>`${n}=${l?encodeURIComponent(l.toString()):""}`).join("&");return o?(t?"":"?")+o:""}function me(e){let t=e.destinationType??"";return P(t)?.mapper.to(e)??""}function de(e){let t=URL.canParse(e),o=e.split("://")[0],r=e.split("://")[1],n=o==="file"?"http://dummy":"http://"+r;if(!r)return null;if(r.startsWith("%")&&o==="file")return P(o).mapper.from(o,new URL("http://localhost"),e);let l=P(o),u="";`${l.key}s`===o&&(u+=n.indexOf("?")===-1?"?":"&",u+="use-ssl=true",e=l.key+e.substring(o.length));try{let y=new URL(n+u);if(y.host==="undefined")return null;let f=r.split("?")[0].split("/")[0],G=!isNaN(Number(y.host.replaceAll(".",""))),$=f.split("."),O=$.length===4&&$.every(F=>F.length&&F.length<=3&&!isNaN(Number(F))&&parseInt(F)<=255);return G&&!O?null:l.mapper.from(l.key,y,e)}catch(y){return console.error("Error while parsing target path",y),null}}export{P as a,me as b,de as c,le as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as B}from"./chunk-3UN32GIC.js";import{a as z}from"./chunk-OXOOR7I4.js";import{a as $}from"./chunk-GUH5TMOS.js";import{a as b}from"./chunk-66BSPEOQ.js";import{a as R}from"./chunk-CWBEE627.js";import{e as S}from"./chunk-WRNQOX5R.js";import{h as P}from"./chunk-J3BBLPAD.js";import{H as u,Oc as c,P as k,Pc as f,V as m,_ as s,n as d,oa as n,r as h}from"./chunk-QDFCX6XE.js";import{a,b as r}from"./chunk-EUDKD2JW.js";var F={Starting_Operation:$localize`Starting operation …`,Backup_Begin:$localize`Starting backup …`,Backup_PreBackupVerify:$localize`Verifying backend data …`,Backup_PostBackupTest:$localize`Verifying remote data …`,Backup_PreviousBackupFinalize:$localize`Completing previous backup …`,Backup_ProcessingFiles:$localize`Processing files to backup …`,Backup_Finalize:$localize`Completing backup …`,Backup_WaitForUpload:$localize`Waiting for upload to finish …`,Backup_Delete:$localize`Deleting unwanted files …`,Backup_Compact:$localize`Compacting remote data …`,Backup_VerificationUpload:$localize`Uploading verification file …`,Backup_PostBackupVerify:$localize`Verifying backend data …`,Backup_Complete:$localize`Backup complete!`,Restore_Begin:$localize`Starting restore …`,Restore_RecreateDatabase:$localize`Rebuilding local database …`,Restore_PreRestoreVerify:$localize`Verifying remote data …`,Restore_CreateFileList:$localize`Building list of files to restore …`,Restore_CreateTargetFolders:$localize`Creating target folders …`,Restore_ScanForExistingFiles:$localize`Scanning existing files …`,Restore_ScanForLocalBlocks:$localize`Scanning for local blocks …`,Restore_PatchWithLocalBlocks:$localize`Patching files with local blocks …`,Restore_DownloadingRemoteFiles:$localize`Downloading files …`,Restore_PostRestoreVerify:$localize`Verifying restored files …`,Restore_Complete:$localize`Restore complete!`,Recreate_Running:$localize`Recreating database …`,Vacuum_Running:$localize`Vacuuming database …`,Repair_Running:$localize`Repairing database …`,Verify_Running:$localize`Verifying files …`,BugReport_Running:$localize`Creating bug report …`,Delete_Listing:$localize`Listing remote files …`,Delete_Deleting:$localize`Deleting remote files …`,PurgeFiles_Begin:$localize`Listing remote files for purge …`,PurgeFiles_Process:$localize`Purging files …`,PurgeFiles_Compact:$localize`Compacting remote data …`,PurgeFiles_Complete:$localize`Purging files complete!`,Error:$localize`Error!`},v=class g{#i=s(R);#t=s(P);#o=s(B);#e=s(z);#c=s(S);#g=s(b);#s=n(!1);#a=n(null);statusData=this.#a.asReadonly();lastState=null;serverState=c(()=>{let e=this.#e.serverState();return e?(e.ProposedSchedule=e.ProposedSchedule?.map(i=>r(a({},i),{backup:i.Item1?this.#o.getBackupById(i.Item1):null})),this.lastState=e,e):this.lastState});hasProgressOnWebsocket=c(()=>this.#g.hasProgressSubscribeOption()&&this.#e.getConnectionMethod()==="websocket");clientIsRunning=c(()=>this.serverState()?.ProgramState==="Running");isResuming=n(!1);isFetching=this.#s.asReadonly();connectionStatus=this.#e.connectionStatus;pollingInterval;#f=f(()=>{let e=this.#e.serverState();e?.ActiveTask||this.#o.getBackups(!0),this.hasProgressOnWebsocket()&&(this.#e.subscribe("progress"),this.#e.subscribe("taskqueue")),e?.ActiveTask&&this.pollingInterval===void 0?this.startPollingProgress():e?.ActiveTask||this.stopPollingProgress()});#d=f(()=>{let e=this.#e.progressState(),i=this.#e.taskQueueState();if(e){let t=i?.find(o=>o.ID===e.TaskID)??null;this.#l(r(a({},e),{task:t}))}});setConnectionMethod(e){this.#e.setConnectionMethod(e)}startPollingProgress(){this.hasProgressOnWebsocket()?this.#e.subscribe("progress"):this.pollingInterval=setInterval(()=>{this.#r()},1e3)}stopPollingProgress(){clearInterval(this.pollingInterval)}fetchProgressState(){this.#r()}pauseResume(){return this.isResuming.set(!0),this.#t.postApiV1ServerstateResume().pipe(u(()=>this.isResuming.set(!1)))}resumeDialogCheck(e){if(!this.clientIsRunning()){this.#c.open($,{data:{title:$localize`Server paused`,message:$localize`Server is currently paused. Do you want to resume now?`,confirmText:$localize`Resume`,cancelText:$localize`No, I'll resume later`},closed:i=>{i&&this.pauseResume().subscribe({next:()=>{e()}})}});return}e()}#r(){this.#s.set(!0),this.#t.getApiV1Progressstate().pipe(k(e=>{let i=e.TaskID??null;return i===null?d(e):this.#t.getApiV1TaskByTaskid({taskid:i}).pipe(h(t=>r(a({},e),{task:t??null})))}),u(()=>this.#s.set(!1))).subscribe({next:e=>{this.#l(e),this.serverState()?.ActiveTask==null&&this.stopPollingProgress()},error:e=>{e.status===404&&this.stopPollingProgress()}})}#l(e){let i=e.TaskID??null,t=e.BackupID??null;i!==null&&t!==null&&(e.backup=this.#o.getBackupById(t)),this.#a.set(r(a({},e),{progress:this.#p(e),statusText:this.#u(e),actionText:e.backup?.Backup?.Name??$localize`Running task`}))}#p(e){let i=-1;if(e.task&&e)if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=0;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,l=e.TotalFileSize-e.ProcessedFileSize-t;i=(e.ProcessedFileSize+t)/e.TotalFileSize,e.ProcessedFileCount===0?i=0:i>=.9&&(i=.9)}else e.Phase==="Backup_Finalize"||e.Phase==="Backup_WaitForUpload"?i=.9:e.Phase==="Backup_Delete"||e.Phase==="Backup_Compact"?i=.95:e.Phase==="Backup_VerificationUpload"||e.Phase==="Backup_PostBackupVerify"?i=.98:e.Phase==="Backup_Complete"?i=1:e.OverallProgress>0&&(i=e.OverallProgress);return i}#n(e){let i=(e.ActiveTransfers??[]).map(o=>o.BackendSpeed).reduce((o,l)=>(o??0)+(l??0),0)??-1,t=i<=0?e.BackendSpeed:i;return(t??-1)<0?"":` at ${this.#i.transform(t)}/s`}#u(e){let i="Running \u2026";if(e.task&&e){if(i=e.Phase?F[e.Phase]:"Running \u2026",e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=`Counting (${e.TotalFileCount} files found, ${this.#i.transform(e.TotalFileSize)})`;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,l=e.TotalFileSize-e.ProcessedFileSize-t,_=e.Phase==="Restore_DownloadingRemoteFiles"?"Restoring: ":"",p=this.#n(e);e.Phase==="Backup_ProcessingFiles"&&o===0?i=`Completing upload ${p}`:e.BackendIsBlocking??!1?i=`Waiting for transfers ${p}`:i=`${_}${o} files (${this.#i.transform(l)}) to go ${p}`}else if(e.Phase==="Backup_WaitForUpload"){let t=this.#n(e);t!==""&&(i=`Waiting for upload to finish ${t}`)}}return i}static \u0275fac=function(i){return new(i||g)};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk-3UN32GIC.js";import"./chunk-OXOOR7I4.js";import"./chunk-RHW5QVAY.js";import"./chunk-66BSPEOQ.js";import{b as k,c as G,e as L,f as w,j as U,o as x,q as j,r as K,t as X}from"./chunk-USU2EHJV.js";import"./chunk-ZGAC2JKG.js";import"./chunk-ETCRT3EV.js";import{d as A,e as O}from"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import{A as E,a as y,c as N,g as b,l as B,m as R}from"./chunk-WRNQOX5R.js";import{h as $}from"./chunk-J3BBLPAD.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import{Ab as a,Bb as n,Cb as l,H as g,Qb as C,Ra as s,Rb as h,Sb as _,Vb as I,Wb as d,_ as F,bb as T,ic as P,oa as m,ub as S,vb as D,zb as c,zc as M}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";var V=()=>["/"];function z(p,o){p&1&&(a(0,"sh-form-field")(1,"label",14),_(2,3),n(),l(3,"input",15),n())}var u=new K,f=class p{#e=F(N);#o=F($);#n=F(v);#t=F(A);isImporting=m(!1);isSecureFile=m(!1);importForm=u.group({config:u.control(""),cmdline:u.control(!1),import_metadata:u.control(!1),direct:u.control(!1),passphrase:u.control("")});selectedFile=m([]);onFileDropped(o){let e=o[0];if(e){let t=new FileReader;this.isSecureFile.set(e.type!=="application/json"),t.onload=this.#i.bind(this),t.readAsArrayBuffer(e)}}#i(o){let e=o.target?.result;this.isSecureFile.set(this.#r(e)!=="json"),this.importForm.patchValue({config:this.#a(e)})}#r(o){let e=new Uint8Array(o);if(e.length>=5&&e[0]===65&&e[1]===69&&e[2]===83&&e[4]===0)return"aes";try{let t=new TextDecoder().decode(o),i=JSON.parse(t);if(typeof i=="object"&&i!==null)return"json"}catch{}return"unknown"}#a(o){let e=new Uint8Array(o),t=e.byteLength,i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return btoa(i)}submit(){this.isImporting.set(!0);let o=this.importForm.value.direct??!1;this.#o.postApiV1BackupsImport({requestBody:this.importForm.value}).pipe(g(()=>this.isImporting.set(!1))).subscribe({next:e=>{if(o){this.#e.success("Backup imported successfully."),this.#t.navigate(["/"]);return}let t=this.#n.addDraftBackup(e.data);this.#t.navigate(["/backup-draft",t])},error:e=>{this.#e.error(e.message)}})}static \u0275fac=function(e){return new(e||p)};static \u0275cmp=T({type:p,selectors:[["app-import"]],decls:19,vars:8,consts:()=>{let o;o=$localize` Import backup configuration ${"\uFFFD#3\uFFFD"}:START_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:arrow-left${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Back ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#6\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#5\uFFFD|\uFFFD#7\uFFFD]"}:START_TAG_SH_ICON:download-simple${"[\uFFFD/#5\uFFFD|\uFFFD/#7\uFFFD]"}:CLOSE_TAG_SH_ICON: Import ${"[\uFFFD/#4\uFFFD|\uFFFD/#6\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`,o=I(o);let e;e=$localize`Import Metadata`;let t;t=$localize`Save now`;let i;return i=$localize`Passphrase`,[o,e,t,i,[1,"actions"],["shButton","","type","button",1,"outlined",3,"routerLink"],["shButton","","type","submit",1,"raised","primary",3,"click","disabled"],["autocomplete","off",3,"formGroup"],["accept",".json,.aes",3,"filesChange","files"],[1,"primary","raised"],["for","importMetadata"],["type","checkbox","formControlName","import_metadata"],["for","direct"],["type","checkbox","formControlName","direct"],["for","passphrase"],["type","password","formControlName","passphrase"]]},template:function(e,t){e&1&&(a(0,"header")(1,"h3"),C(2,0),a(3,"div",4)(4,"button",5),l(5,"sh-icon"),n(),a(6,"button",6),d("click",function(){return t.submit()}),l(7,"sh-icon"),n()(),h(),n()(),a(8,"form",7)(9,"sh-file-upload",8),d("filesChange",function(r){return t.onFileDropped(r)}),n(),S(10,z,4,0,"sh-form-field"),a(11,"sh-toggle",9)(12,"label",10),_(13,1),n(),l(14,"input",11),n(),a(15,"sh-toggle",9)(16,"label",12),_(17,2),n(),l(18,"input",13),n()()),e&2&&(s(4),c("routerLink",M(7,V)),s(2),P("loader",t.isImporting()),c("disabled",t.isImporting()),s(2),c("formGroup",t.importForm),s(),c("files",t.selectedFile()),s(),D(t.isSecureFile()?10:-1))},dependencies:[X,U,G,k,L,w,x,j,O,B,y,b,E,R],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}sh-file-upload[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})};export{f as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as it}from"./chunk-6GC5VKTI.js";import{a as tt,b as nt}from"./chunk-CZLLEVMJ.js";import{a as X,b as Ze,c as Je}from"./chunk-XLE2TW65.js";import{h as et}from"./chunk-36RDZAZ4.js";import{a as Ye}from"./chunk-QY6E755W.js";import{a as k}from"./chunk-GUH5TMOS.js";import{a as K}from"./chunk-66BSPEOQ.js";import{a as qe,c as ue,e as Ce,i as ge,k as We,s as fe,t as Qe}from"./chunk-USU2EHJV.js";import{A as Ue,C as He,a as pe,e as ke,g as me,l as Re,o as Be,p as ze,t as Ke,z as Xe}from"./chunk-WRNQOX5R.js";import{h as je}from"./chunk-J3BBLPAD.js";import{ea as Ge}from"./chunk-WJPLJKPQ.js";import{Ab as _,Ac as de,Bb as d,Cb as z,Cc as ce,Gb as re,Hb as W,Hc as J,Ib as le,Jb as N,Oc as P,Pc as Y,Qb as Q,Ra as l,Rb as Z,Sb as De,Uc as ee,V as oe,Wb as x,Xc as be,Yb as s,Zb as we,_ as M,_b as Ae,ac as Fe,bb as ae,bc as Oe,cc as Me,ea as T,f as ie,fa as S,gb as G,gc as B,ia as ye,ic as se,lc as p,nc as F,oa as b,oc as _e,qc as Ve,rc as ve,sc as Le,tc as L,ub as g,uc as A,vb as f,vc as c,wb as H,xb as j,yb as q,yc as Pe,zb as m,zc as $e}from"./chunk-QDFCX6XE.js";import{a as O,b as ne}from"./chunk-EUDKD2JW.js";var ot=class n{#t=M(je);#e=M(ke);#n=M(K);testDestination(t,e,o,i){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i):this.testDestinationv1(t,e,o,i)}testDestinationv2(t,e,o,i){return new ie(a=>{this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:t,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){this.emitSuccessV2(a,t,e,r);return}this.handleGenericError(a,t,e,r.Error??"Unknown error",i)},error:r=>{let u=r?.error?.body;if(u?.Data?.FolderExists===!1||u?.StatusCode==="missing-folder"){o?this.handleMissingFolder(a,t,e):this.handleGenericError(a,t,e,$localize`The remote destination folder does not exist.`,i);return}if(u?.Data?.HostCertificate){this.handleMissingCertificate(a,t,e,u.Data?.HostCertificate);return}if(u?.Data?.ReportedHostKey){this.handleIncorrectKey(a,t,e,u.Data.ReportedHostKey,u.Data.AcceptedHostKey??null);return}this.handleGenericError(a,t,e,r?.message??"Unknown error",i)}})})}testDestinationv1(t,e,o,i){return new ie(a=>{this.#t.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:r=>{a.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:e}),a.complete()},error:r=>{this.handleDestinationErrorv1(r.message,t,e,o,i).subscribe(u=>{a.next(u)})}})})}handleMissingFolder(t,e,o){this.#e.open(k,{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:i=>{if(!i){this.reportNoAction(t,e,o,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#t.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#e.open(k,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#e.open(k,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#e.open(k,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
|
|
2
|
+
If this is a self-signed certificate, you can choose to trust this certificate.
|
|
3
|
+
The server reported the certificate hash: ${i}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,o,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:i,destinationIndex:o}),t.complete()}})}handleIncorrectKey(t,e,o,i,a){a?this.#e.open(k,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
|
|
4
|
+
otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
|
|
5
|
+
Do you want to REPLACE your CURRENT host key ${a}
|
|
6
|
+
with the REPORTED host key: ${i}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,o,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:i,destinationIndex:o}),t.complete()}}):this.#e.open(k,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${i}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,o,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:i,destinationIndex:o}),t.complete()}})}handleGenericError(t,e,o,i,a){function r(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o,errorMessage:i}),t.complete()}if(a){r();return}this.#e.open(k,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:i,cancelText:$localize`OK`},closed:u=>r()})}handleDestinationErrorv1(t,e,o,i,a){return new ie(r=>{if(t==="missing-folder"){i?this.handleMissingFolder(r,e,o):this.handleGenericError(r,e,o,$localize`The remote destination folder does not exist.`,a);return}if(t.startsWith("incorrect-cert:")){let u=t.split("incorrect-cert:")[1];this.handleMissingCertificate(r,e,o,u);return}if(t.startsWith("incorrect-host-key:")){let u=t.split('incorrect-host-key:"')[1].split('",')[0],E=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(r,e,o,u,E);return}this.handleGenericError(r,e,o,t,a)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Te=class n{#t=M(K);supportedDestinationTypes=P(()=>this.#t.backendModules().map(t=>{if(!t?.Key)return null;let e=X(t.Key);return e.isDefaultEntry===!0?ne(O({},e),{displayName:t.DisplayName||e.displayName||t.Key,description:t.Description||e.description||""}):e}).filter(t=>t!==null));destinationTypeOptions=P(()=>this.supportedDestinationTypes().map(t=>({key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description})));backendModules=P(()=>this.#t.backendModules()??[]);static \u0275fac=function(e){return new(e||n)};static \u0275prov=oe({token:n,factory:n.\u0275fac,providedIn:"root"})};var st=["fileInput"],_t=[[["label"]]],dt=["label"],Se=class n{customId=ee();content=b("");readonly=b(!1);placeholder=ee("Drop a file here or use the browse button");fileInputRef;onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0])}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0])}onDragOver(t){t.preventDefault()}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result)},e.readAsText(t)}triggerBrowse(){return this.fileInputRef.nativeElement.click(),!1}onChange=()=>{};onTouched=()=>{};onChangeEffect=Y(()=>{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||n)};static \u0275cmp=ae({type:n,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,o){if(e&1&&Fe(st,5),e&2){let i;Oe(i=Me())&&(o.fileInputRef=i.first)}},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Pe([{provide:qe,useExisting:n,multi:!0}])],ngContentSelectors:dt,decls:9,vars:3,consts:()=>{let t;return t=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:upload${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["fileInput",""],t,[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,o){if(e&1){let i=N();we(_t),Ae(0,0,["ngProjectAs","label",5,["label"]]),_(1,"div",2)(2,"button",3),x("click",function(){return T(i),S(o.triggerBrowse())}),Q(3,1),z(4,"sh-icon"),Z(),d()(),_(5,"div",4),x("drop",function(r){return T(i),S(o.onFileDrop(r))})("dragover",function(r){return T(i),S(o.onDragOver(r))}),_(6,"textarea",5),Le("ngModelChange",function(r){return T(i),ve(o.content,r)||(o.content=r),S(r)}),d()(),_(7,"input",6,0),x("change",function(r){return T(i),S(o.onFileSelected(r))}),d()}e&2&&(l(6),m("placeholder",o.placeholder()),Ve("ngModel",o.content),m("disabled",o.readonly()))},dependencies:[fe,ue,Ce,ge,pe,me],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var ct=(n,t,e,o)=>({index:n,fieldGroup:"custom",formView:t,destinationType:e,oauthField:o}),Ie=n=>({$implicit:n}),pt=(n,t,e,o)=>({index:n,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:o}),mt=()=>({updateOn:"blur"}),ut=(n,t,e,o)=>({index:n,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:o});function Ct(n,t){n&1&&le(0)}function gt(n,t){if(n&1&&G(0,Ct,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s();let i=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,Ie,ce(2,ct,o,e,a,r.oauthField)))}}function ft(n,t){n&1&&le(0)}function Tt(n,t){if(n&1&&G(0,ft,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s();let i=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,Ie,ce(2,pt,o,e,a,r.oauthField)))}}function St(n,t){if(n&1){let e=N();_(0,"button",14),x("click",function(){T(e);let i=s(2);return S(i.showTextArea.set(!1))}),Q(1,6),z(2,"sh-icon"),Z(),d()}}function ht(n,t){if(n&1){let e=N();_(0,"button",21,1),x("click",function(){let i=T(e).$implicit,a=s(3);return S(a.addAdvancedOption(i))}),p(2),d()}if(n&2){let e=t.$implicit;l(2),F(" ",e.name," ")}}function xt(n,t){if(n&1){let e=N();_(0,"div",11)(1,"sh-menu",15)(2,"button",16),Q(3,7),z(4,"sh-icon"),Z(),d(),re(5,17),j(6,ht,3,1,"button",18,H),W(),d(),_(8,"sh-menu")(9,"button",19)(10,"sh-icon"),p(11,"dots-three-vertical"),d()(),re(12,17),_(13,"button",20),x("click",function(){T(e);let i=s(2);return S(i.showTextArea.set(!0))}),_(14,"sh-icon"),p(15,"link"),d(),p(16," Edit contents as text "),d(),W(),d()()}if(n&2){s();let e=c(9);l(),m("searchable",!0),l(),m("disabled",e.length===0),l(4),q(e)}}function Nt(n,t){if(n&1){let e=N();_(0,"textarea",22),x("ngModelChange",function(i){T(e);let a=s(2);return S(a.updateSettingsFromText(i))}),d()}if(n&2){let e=s(2);m("ngModel",e.settingsAsText())("ngModelOptions",$e(2,mt))}}function Et(n,t){n&1&&le(0)}function It(n,t){if(n&1&&G(0,Et,1,0,"ng-container",13),n&2){let e=t.$implicit,o=t.$index;s(2);let i=B(15),a=s(),r=c(0),u=c(1),E=a.getFormView("advanced",e)??a.getDefaultFormView(e);m("ngTemplateOutlet",i)("ngTemplateOutletContext",de(7,Ie,ce(2,ut,o,E,r,u.oauthField)))}}function yt(n,t){if(n&1&&j(0,It,1,9,"ng-container",null,H),n&2){let e=s(2);q(e.advancedFormFieldNames())}}function Dt(n,t){n&1&&(_(0,"sup",31),p(1,"*"),d())}function wt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function At(n,t){if(n&1){let e=N();_(0,"app-file-tree",24)(1,"label",30),g(2,Dt,2,0,"sup",31),p(3),g(4,wt,2,1,"sh-icon",32),d(),_(5,"input",33),x("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5);m("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),m("for",u),l(),f(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",u)("ngModel",i)}}function Ft(n,t){n&1&&(_(0,"sup",34),p(1,"*"),d())}function Ot(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Mt(n,t){if(n&1){let e=N();_(0,"app-file-tree",25)(1,"label",30),g(2,Ft,2,0,"sup",34),p(3),g(4,Ot,2,1,"sh-icon",32),d(),_(5,"input",33),x("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5);m("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a),l(),m("for",u),l(),f(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",u)("ngModel",i)}}function Vt(n,t){n&1&&(_(0,"sup",35),p(1,"*"),d())}function vt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Lt(n,t){n&1&&(_(0,"sh-icon",36),p(1," warning "),d())}function Pt(n,t){n&1&&(_(0,"sh-icon",37),p(1,"x-circle"),d())}function $t(n,t){n&1&&(_(0,"sh-icon",38),p(1,"warning"),d())}function bt(n,t){if(n&1&&(_(0,"sh-icon",42),p(1," link "),d()),n&2){s();let e=c(9),o=c(10);se("error",e&&o==="error")("warn",e&&o==="warning"),m("shTooltip",e)}}function Gt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"envelope"),d())}function kt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"hard-drives"),d())}function Rt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"jar"),d())}function Bt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"textbox"),d())}function zt(n,t){if(n&1){let e=N();_(0,"sh-form-field")(1,"label",30),g(2,Vt,2,0,"sup",35),p(3),g(4,vt,2,1,"sh-icon",32),g(5,Lt,2,0,"sh-icon",36),g(6,Pt,2,0,"sh-icon",37),g(7,$t,2,0,"sh-icon",38),d(),_(8,"input",39),x("keydown",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,i))})("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),L(9)(10),g(11,bt,2,5,"sh-icon",40)(12,Gt,2,0,"sh-icon",41)(13,kt,2,0,"sh-icon",41)(14,Rt,2,0,"sh-icon",41)(15,Bt,2,0,"sh-icon",41),d()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(3),r=c(4),u=c(5),E=s(2);l(),m("for",u),l(),f(e.formView.isMandatory&&r?2:-1),l(),F(" ",o," "),l(),f(e.formView.longDescription?4:-1),l(),f(r&&e.formView.type==="Path"?5:-1),l(),f(e.formView.type=="Hostname"&&!r&&!E.isValidHostname(a)?6:-1),l(),f(e.formView.type=="Bucketname"&&!r&&!E.isValidBucketname(a)?7:-1),l(),m("type",e.formView.type==="Email"?"email":"text")("id",u)("ngModel",i);let V=a,w=E.hasLeadingSlash(V??"");l(),A(w&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),l(),A(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),l(),f(e.formView.type==="Path"?11:e.formView.type==="Email"?12:e.formView.type==="Hostname"?13:e.formView.type==="Bucketname"?14:15)}}function Kt(n,t){n&1&&(_(0,"sup",43),p(1,"*"),d())}function Xt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Ut(n,t){if(n&1){let e=N();_(0,"span",47),x("click",function(){T(e);let i=s(2).$implicit,a=s(2);return S(a.oauthStartTokenCreation(i.destinationType,i.fieldGroup,i.formView.name,i.formView.oauthVersion))}),p(1," AuthID "),d()}}function Ht(n,t){n&1&&(_(0,"sh-icon",41),p(1,"password"),d())}function jt(n,t){if(n&1){let e=N();_(0,"sh-icon",48),x("click",function(){T(e);let i=s(2).$implicit;return S(i.formView.showPassword=!i.formView.showPassword)}),p(1," eye "),d()}}function qt(n,t){if(n&1){let e=N();_(0,"sh-icon",48),x("click",function(){T(e);let i=s(2).$implicit;return S(i.formView.showPassword=!i.formView.showPassword)}),p(1," eye-slash "),d()}}function Wt(n,t){if(n&1){let e=N();_(0,"sh-form-field")(1,"label",30),g(2,Kt,2,0,"sup",43),p(3),g(4,Xt,2,1,"sh-icon",32),d(),_(5,"input",44),x("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),g(6,Ut,2,0,"span",45)(7,Ht,2,0,"sh-icon",41),g(8,jt,2,0,"sh-icon",46)(9,qt,2,0,"sh-icon",46),d()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),f(e.formView.longDescription?4:-1),l(),m("type",e.formView.showPassword?"text":"password")("id",r)("ngModel",i),l(),f(e.oauthField===e.formView.name?6:7),l(2),f(e.formView.showPassword?8:9)}}function Qt(n,t){n&1&&(_(0,"sup",50),p(1,"*"),d())}function Zt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function Jt(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Yt(n,t){if(n&1){let e=N();_(0,"sh-select",49)(1,"label",30),g(2,Qt,2,0,"sup",50),p(3),g(4,Zt,2,1,"sh-icon",32),d(),_(5,"input",33),x("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),G(6,Jt,1,2,"ng-template",null,2,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),E=c(5);m("options",o)("isClearable",!1)("optionTemplate",e),l(),m("for",E),l(),f(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),f(i.formView.longDescription?4:-1),l(),m("id",E)("ngModel",r)}}function en(n,t){if(n&1&&(L(0),g(1,Yt,8,9)),n&2){let e=s().$implicit,o=A(s(2).mapOptions(e.formView));l(),f(o?1:-1)}}function tn(n,t){n&1&&(_(0,"sup",53),p(1,"*"),d())}function nn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function on(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function an(n,t){if(n&1){let e=N();_(0,"sh-select",52)(1,"label",30),g(2,tn,2,0,"sup",53),p(3),g(4,nn,2,1,"sh-icon",32),d(),_(5,"input",33),x("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),G(6,on,1,2,"ng-template",null,3,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),E=c(5);m("options",o)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),l(),m("for",E),l(),f(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),f(i.formView.longDescription?4:-1),l(),m("id",E)("ngModel",r)}}function rn(n,t){n&1&&z(0,"sh-progress-bar",51)}function ln(n,t){if(n&1&&(L(0),g(1,an,8,10)(2,rn,1,0,"sh-progress-bar",51)),n&2){let e=s().$implicit,o=c(2),i=A(s(2).mapOptionsWithFreeText(e.formView,o));l(),f(i?1:2)}}function sn(n,t){n&1&&(_(0,"sup",55),p(1,"*"),d())}function _n(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function dn(n,t){if(n&1){let e=N();_(0,"app-size",54),x("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label",30),g(2,sn,2,0,"sup",55),p(3),g(4,_n,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);m("inputType",e.Name)("ngModel",i)("customId",r),l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),f(e.formView.longDescription?4:-1)}}function cn(n,t){n&1&&(_(0,"sup",56),p(1,"*"),d())}function pn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function mn(n,t){if(n&1){let e=N();_(0,"sh-form-field")(1,"label",30),g(2,cn,2,0,"sup",56),p(3),g(4,pn,2,1,"sh-icon",32),d(),_(5,"input",57),x("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d(),_(6,"sh-icon",41),p(7,"numpad"),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",r)("ngModel",i)}}function un(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Cn(n,t){if(n&1){let e=N();_(0,"sh-toggle",58),x("click",function(){T(e);let i=s().$implicit,a=c(2),r=s(2);return S(r.updateFieldValue(i.fieldGroup,i.formView.name,r.isTrue(a)?"false":"true"))}),_(1,"label",30),p(2),g(3,un,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(5),r=s(2);se("active",r.isTrue(i)),l(),m("for",a),l(),F(" ",o," "),l(),f(e.formView.longDescription?3:-1)}}function gn(n,t){n&1&&(_(0,"sup",60),p(1,"*"),d())}function fn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function Tn(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;_e(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Sn(n,t){if(n&1){let e=N();_(0,"sh-select",59)(1,"label",30),g(2,gn,2,0,"sup",60),p(3),g(4,fn,2,1,"sh-icon",32),d(),_(5,"input",61),x("ngModelChange",function(i){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),d()(),G(6,Tn,1,2,"ng-template",null,4,J)}if(n&2){let e=B(7);s();let o=c(0),i=s().$implicit,a=c(1),r=c(2),u=c(4),E=c(5);m("options",o)("selectMultiple",!0)("optionTemplate",e),l(),m("for",E),l(),f(i.formView.isMandatory&&u?2:-1),l(),F(" ",a," "),l(),f(i.formView.longDescription?4:-1),l(),m("ngModel",r)}}function hn(n,t){if(n&1&&(L(0),g(1,Sn,8,8)),n&2){let e=s().$implicit,o=A(s(2).mapOptions(e.formView));l(),f(o?1:-1)}}function xn(n,t){n&1&&(_(0,"sup",62),p(1,"*"),d())}function Nn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function En(n,t){if(n&1){let e=N();_(0,"app-timespan",54),x("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label",30),g(2,xn,2,0,"sup",62),p(3),g(4,Nn,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(1),i=c(2),a=c(4),r=c(5);m("inputType",e.formView.name)("ngModel",i)("customId",r),l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),F(" ",o," "),l(),f(e.formView.longDescription?4:-1)}}function In(n,t){n&1&&(_(0,"sup",64),p(1,"*"),d())}function yn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Dn(n,t){if(n&1){let e=N();_(0,"app-file-drop-textarea",63),x("ngModelChange",function(i){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,i))}),_(1,"label"),g(2,In,2,0,"sup",64),p(3),g(4,yn,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,o=c(2),i=c(4),a=c(5);m("ngModel",o)("customId",a)("placeholder",e.formView.longDescription),l(2),f(e.formView.isMandatory&&i?2:-1),l(),F(" ",e.formView.shortDescription??e.formView.name," "),l(),f(e.formView.longDescription?4:-1)}}function wn(n,t){if(n&1){let e=N();_(0,"button",65),x("click",function(){T(e);let i=s().$implicit,a=s(2);return S(a.removeAdvancedOption(i.formView.name))}),_(1,"sh-icon"),p(2,"x-circle"),d()()}}function An(n,t){if(n&1&&(_(0,"div",23),L(1)(2)(3)(4)(5),g(6,At,6,12,"app-file-tree",24)(7,Mt,6,9,"app-file-tree",25)(8,zt,16,13,"sh-form-field")(9,Wt,10,9,"sh-form-field")(10,en,2,2)(11,ln,3,2)(12,dn,5,7,"app-size",26)(13,mn,8,6,"sh-form-field")(14,Cn,4,5,"sh-toggle",27)(15,hn,2,2)(16,En,5,7,"app-timespan",26)(17,Dn,5,6,"app-file-drop-textarea",28),g(18,wn,3,0,"button",29),d()),n&2){let e=t.$implicit;s();let o=c(0),i=s();se("single-field",e.fieldGroup!=="advanced"),l(),A(e.formView.shortDescription??e.formView.name),l(),A(i.getFieldGroup(o,e.fieldGroup)[e.formView.name]),l();let a=A(i.getFieldValue(e.fieldGroup,e.formView.name));l(),A((a??"").toString().trim()===""),l(),A("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),l(),f(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"?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:-1),l(12),f(e.fieldGroup==="advanced"?18:-1)}}function Fn(n,t){if(n&1&&(L(0),j(1,gt,1,9,"ng-container",null,H),j(3,Tt,1,9,"ng-container",null,H),_(5,"sh-toggle-card",8),re(6,9)(7),De(8,5),W(),L(9),g(10,St,3,0,"button",10)(11,xt,17,2,"div",11),W(),g(12,Nt,1,3,"textarea",12)(13,yt,2,0),d(),G(14,An,19,9,"ng-template",null,0,J)),n&2){let e=s(),o=c(1);A(e.destinationForm()),l(),q(o.custom),l(2),q(o.dynamic),l(2),m("disallowToggle",!0),l(4),A(e.nonSelectedAdvancedFormViews()),l(),f(e.showTextArea()?10:11),l(2),f(e.showTextArea()?12:13)}}var at=class n{#t=M(et);#e=M(K);#n=M(it);#a=M(Te);injector=M(ye);targetUrl=be.required();useBackupState=ee(!1);#i=null;destinationType=P(()=>{let t=this.targetUrl();if(!t)return null;let e=X(t.split("://")[0]);return this.#i=e?.customKey??e?.key,this.#i});destinationForm=b({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=P(()=>Object.keys(this.destinationForm().advanced));destinationFormConfig=b(null);showTextArea=b(!1);nonSelectedAdvancedFormViews=P(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(o=>e.findIndex(i=>i===o.name)===-1)});destinationTypeEffect=Y(()=>{let t=this.destinationType()??"",e=X(t),o=e?.key,i=this.#a.backendModules().find(I=>I.Key===o)??{Key:t,DisplayName:t,Description:X(t).description,Options:[]};if(!i||!i.Options||!t)return;let a=e&&e.oauthField?e.oauthField:null,r=e&&e.customFields?e.customFields:{},u=e&&e.dynamicFields?e.dynamicFields:[],E=e&&e.advancedFields?e.advancedFields:[],V=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],w={destinationType:t,oauthField:a,custom:[],dynamic:[],advanced:[]};r&&Object.entries(r).forEach(([I,C],y)=>{let D=C.order??y;w.custom.push(O({order:900+D},C))});for(let I=0;I<i.Options.length;I++){let C=i.Options[I];if(C.Deprecated)continue;let y=u.find(D=>D===C.Name||C.Aliases?.includes(D.name)||D.name===C.Name);if(y){let D=C.Aliases?.indexOf(y.name)??-1,$=C.Aliases&&D>-1?C.Aliases[D]:C.Name,h=y&&typeof y!="string",he=h?y?.defaultValue??C.DefaultValue:C.DefaultValue,xe=h&&y?.order!==void 0?y.order:I,U={name:$,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,order:900+xe},Ne=h?O(O({},U),y):U;w.dynamic.push(Ne)}else{let D=C.Name;if(V.find(te=>te===D))continue;let h=E.find(te=>te===D||te.name===D),he=h&&typeof h!="string",xe=he&&h?.order!==void 0?h.order:I,U={name:D,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,defaultValue:C.DefaultValue,order:900+xe},Ne=he?O(O({},U),h):U;w.advanced.push(Ne)}}w.custom.sort((I,C)=>I.order-C.order),w.dynamic.sort((I,C)=>I.order-C.order),w.advanced.sort((I,C)=>I.order-C.order),this.destinationFormConfig.set(w);let R=this.targetUrl();if(!R)return;let v=Je(R);v&&this.destinationForm.set({custom:v.custom,dynamic:v.dynamic,advanced:v.advanced})});destinationFormEffect=Y(()=>{let t=this.#i,e=this.destinationForm();if(!e||!t)return;let o=Ze({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});o&&this.targetUrl.set(o)});getFieldValue(t,e){let i=this.destinationForm()[t][e];return i||null}getFormView(t,e){let i=this.destinationFormConfig()?.[t].find(a=>a.name===e);return i||null}getDefaultFormView(t){return{name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??!1}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(O({},e))}isValidBucketname(t){if(!t)return!1;let e=t.length;return!(e<3||e>63||!/^[a-z0-9.-]+$/.test(t)||!/^[a-z0-9]/.test(t)||!/[a-z0-9]$/.test(t)||/^\d{1,3}(\.\d{1,3}){3}$/.test(t)||/(\.\.)|(\.-)|(-\.)/.test(t))}isValidHostname(t){if(!t||t.length>253)return!1;let e=t.split(".");for(let o of e)if(!o||o.length>63||!/^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$/.test(o))return!1;return!0}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}onKeyDown(t,e,o,i){if(o==="Hostname"||o==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(i.key))return;if(i.key=="/"||i.key=="\\"||i.key==":"){i.preventDefault();return}}}updateFieldValue(t,e,o){let i=this.destinationForm();i[t][e]=o,this.destinationForm.set(O({},i))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(O({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let o=t.options;return o?o.map(i=>({key:i,value:i})):null}mapOptionsWithFreeText(t,e){let o=this.mapOptions(t);return o?(e&&e.length>0&&(o.find(a=>a.value===e)||o.push({key:e,value:e})),o):null}#o=b(!1);oauthStartTokenCreation(t,e,o,i){this.#o.set(!0);let a=(i??1)==2?this.#e.defaultOAuthUrlV2():this.#e.defaultOAuthUrl(),r=this.#n.serverSettings()?.["--oauth-url"];if(r&&r.length>0&&(a=r),this.useBackupState()){let C=this.#t.mapFormsToSettings().find(y=>y.Name==="--oauth-url")?.Value;C&&C.length>0&&(a=C)}let u=this.destinationForm().advanced["oauth-url"];u&&u.length>0&&(a=u);let E=`${a}?type=${t}`,V=450,w=600,R=screen.width/2-V/2,v=screen.height/2-w/2,I=window.open(E,"_blank","height="+w+",width="+V+",menubar=0,status=0,titlebar=0,toolbar=0,left="+R+",top="+v);return window.addEventListener("message",C=>{let y=C.data.startsWith("authid:"),D=y?C.data.replace("authid:",""):null;y&&(this.destinationForm.update($=>($[e][o]=D,$)),this.#o.set(!1),I?.close())}),!1}settingsAsText=P(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,o])=>{let i=e??"",a="";return typeof o=="boolean"?a=this.isTrue(o)?"True":"False":(typeof o=="number"||o!=null)&&(a=o.toString()),`${i}=${a}`}).join(`
|
|
7
|
+
`)});updateSettingsFromText(t){if(typeof t!="string")return;let e=t.split(`
|
|
8
|
+
`).map(i=>i.trim()).filter(i=>i.length>0),o={};for(let i of e){let[a,r]=i.split("=").map(u=>u.trim());a&&a.trim().length>0&&r!==void 0&&(o[a]=r)}this.destinationForm.update(i=>ne(O({},i),{advanced:o}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ae({type:n,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 o;o=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let i;i=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let r;r=$localize`This field is mandatory`;let u;u=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let E;E=$localize`Hostname is invalid`;let V;V=$localize`Bucket name is invalid`;let w;w=$localize`This field is mandatory`;let R;R=$localize`This field is mandatory`;let v;v=$localize`This field is mandatory`;let I;I=$localize`This field is mandatory`;let C;C=$localize`This field is mandatory`;let y;y=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let $;return $=$localize`This field is mandatory`,[["fieldTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],t,e,o,[1,"advanced-options",3,"disallowToggle"],["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"],[3,"hideShortcuts","enableCreateFolder","startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised",3,"active"],[3,"ngModel","customId","placeholder"],["shButton","","type","button",1,"outlined"],[3,"for"],["shTooltip",i],[1,"primary",3,"shTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["shTooltip",a],["shTooltip",r],["shTooltip",u,1,"warn"],["shTooltip",E,1,"error"],["shTooltip",V,1,"warn"],[3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["prefix","",3,"shTooltip"],["shTooltip",w],["autocomplete","off",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",R],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",v],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",I],["shTooltip",C],["type","number",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"click"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",y],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",$],["shButton","","type","button",1,"outlined",3,"click"]]},template:function(e,o){if(e&1&&(L(0)(1),g(2,Fn,16,5)),e&2){let i=A(o.destinationType());l();let a=A(o.destinationFormConfig());l(),f(i&&a?2:-1)}},dependencies:[Qe,ue,We,Ce,fe,ge,Ge,Ye,tt,nt,Se,Re,me,pe,Xe,Be,Ke,He,Ue,ze],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-500)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}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}"],changeDetection:0})};export{ot as a,Te as b,at as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-ETCRT3EV.js";import{_ as m,a as S,b as i,oa as c}from"./chunk-QDFCX6XE.js";function u(...a){let e=c(...a);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}function A(a,e,o=!1,s){let l=m(f);e=l.getItemParsed(a,o)??e;let n=u(e),r=n[S];s?.equal&&(r.equal=s.equal);function g(t){t==null?l.removeItem(a):l.setItemParsed(a,t,o)}return n.set=t=>{g(t),i(r,t)},n.update=t=>{let T=t(n());g(T),i(r,T)},n}export{A as a};
|