@duplicati/ngclient 0.0.206 → 0.0.207
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/sh.woff2 +0 -0
- package/{chunk-4GQJ6TJZ.js → chunk-4HB376H3.js} +1 -1
- package/{chunk-2E2AU7CO.js → chunk-AG7H2MR5.js} +1 -1
- package/chunk-AZEV3A4R.js +11 -0
- package/{chunk-ZKGGCQ2N.js → chunk-C5OYK6UC.js} +1 -1
- package/chunk-CAJQ2FEU.js +1 -0
- package/{chunk-ISG53K32.js → chunk-DRRYACBV.js} +1 -1
- package/{chunk-5QAUCDEV.js → chunk-I2T6IA4K.js} +1 -1
- package/{chunk-NWNCATHF.js → chunk-IAZGVY3O.js} +1 -1
- package/{chunk-KICR4V2W.js → chunk-IPGH33MU.js} +1 -1
- package/{chunk-HFNC6WUL.js → chunk-JRXD2X7B.js} +1 -1
- package/{chunk-6ETVPQVI.js → chunk-JWPG4EWG.js} +1 -1
- package/{chunk-AJF77BHX.js → chunk-L22UB6DH.js} +1 -1
- package/{chunk-A5F2OWRS.js → chunk-OL5HI5OG.js} +1 -1
- package/{chunk-X5JLWZ7R.js → chunk-OOL5FC7N.js} +1 -1
- package/{chunk-7T44DW2B.js → chunk-P7TJCJ64.js} +1 -1
- package/chunk-R45TV6JI.js +1 -0
- package/{chunk-4OBMW6MZ.js → chunk-RJM43XMN.js} +1 -1
- package/chunk-SMUUHPDS.js +1 -0
- package/{chunk-GJGFMZUV.js → chunk-T2KOS3XX.js} +1 -1
- package/{chunk-FNGDI6JY.js → chunk-VUKQJ766.js} +1 -1
- package/{chunk-MT6UNBGG.js → chunk-XTFBRBQX.js} +1 -1
- package/{chunk-YYAHWCC5.js → chunk-Z2BNW4KI.js} +1 -1
- package/index.html +1 -1
- package/{main-DLNEYRGV.js → main-DIGDM6JP.js} +1 -1
- package/package.json +1 -1
- package/chunk-5HB22USV.js +0 -1
- package/chunk-AAECT3VT.js +0 -1
- package/chunk-AWL7E6ZQ.js +0 -11
- package/chunk-V5ZJABDA.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-XTFBRBQX.js")},{path:"encryption",loadComponent:()=>import("./chunk-L22UB6DH.js")},{path:"select-files",loadComponent:()=>import("./chunk-RJM43XMN.js")},{path:"options",loadComponent:()=>import("./chunk-DRRYACBV.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-OOL5FC7N.js")}],t=o;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as a,o as b}from"./chunk-
|
|
1
|
+
import{n as a,o as b}from"./chunk-AZEV3A4R.js";import"./chunk-RWDQ3L3C.js";import"./chunk-CAJQ2FEU.js";import"./chunk-ZPIR5QIQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-O3GGVB2B.js";import"./chunk-OAAXQ2BE.js";import"./chunk-7E5J43IH.js";import"./chunk-3MS6SVET.js";import"./chunk-4VYR5E5I.js";import"./chunk-KLAJGS5T.js";import"./chunk-NGKFJLI2.js";import"./chunk-KUX6NGQU.js";import"./chunk-Y46QCSB5.js";import"./chunk-JJY6UOEY.js";import"./chunk-2K74TI2N.js";import"./chunk-G3FMV74P.js";import"./chunk-LU7RSOI6.js";import"./chunk-VLMNSWR3.js";import"./chunk-VKNFRCHQ.js";import"./chunk-QY4Y5NJB.js";import"./chunk-7CGTOI24.js";export{a as createSourceDataForm,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ne}from"./chunk-
|
|
1
|
+
import{a as ne}from"./chunk-C5OYK6UC.js";import{p as ee}from"./chunk-AZEV3A4R.js";import"./chunk-RWDQ3L3C.js";import{d as Z}from"./chunk-CAJQ2FEU.js";import"./chunk-ZPIR5QIQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-O3GGVB2B.js";import"./chunk-OAAXQ2BE.js";import"./chunk-7E5J43IH.js";import"./chunk-3MS6SVET.js";import"./chunk-4VYR5E5I.js";import"./chunk-KLAJGS5T.js";import"./chunk-NGKFJLI2.js";import"./chunk-KUX6NGQU.js";import{B as j,H as Q,P as q,c as X,e as W,i as z,k as V,s as H,v as Y}from"./chunk-Y46QCSB5.js";import"./chunk-JJY6UOEY.js";import{b as U,d as J}from"./chunk-2K74TI2N.js";import"./chunk-G3FMV74P.js";import"./chunk-LU7RSOI6.js";import"./chunk-VLMNSWR3.js";import"./chunk-VKNFRCHQ.js";import{Ac as D,Bb as m,Cb as i,Db as a,Eb as P,Lb as g,Sa as p,Sb as N,Tb as E,Ub as l,Vc as K,Yb as f,Z as C,_b as c,ca as O,da as S,fb as $,fc as v,gc as B,jc as x,oa as w,rc as d,sc as T,tc as u,vb as L,wb as G}from"./chunk-QY4Y5NJB.js";import"./chunk-7CGTOI24.js";var te=["formRef"],ie=()=>["--skip-files-larger-than","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function oe(s,r){s&1&&(i(0,"p"),l(1,4),a())}function ae(s,r){if(s&1){let n=g();i(0,"p"),l(1,5),a(),i(2,"app-timespan",21),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionTime,o)||(t.optionsFields.backupRetentionTime=o),S(o)}),i(3,"label",22),l(4,6),a()()}if(s&2){let n=c();p(2),m("customId","backupRetentionTime"),d("ngModel",n.optionsFields.backupRetentionTime)}}function se(s,r){if(s&1){let n=g();i(0,"p"),l(1,7),a(),i(2,"sh-form-field")(3,"label",23),l(4,8),a(),i(5,"input",24),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionVersions,o)||(t.optionsFields.backupRetentionVersions=o),S(o)}),a()()}if(s&2){let n=c();p(5),d("ngModel",n.optionsFields.backupRetentionVersions)}}function _e(s,r){s&1&&(i(0,"p"),l(1,9),a())}function le(s,r){if(s&1){let n=g();i(0,"p"),l(1,10),a(),i(2,"sh-form-field")(3,"p"),l(4,11),a(),i(5,"label",25),l(6,12),a(),i(7,"input",26),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionCustom,o)||(t.optionsFields.backupRetentionCustom=o),S(o)}),a()()}if(s&2){let n=c();p(7),d("ngModel",n.optionsFields.backupRetentionCustom)}}var re=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],h=class s{#e=C(ee);#n=C(J);#t=C(U);formRef=K.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=w(re);goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){switch(this.#e.validateBeforeSubmit()){case"general":this.#n.navigate(["general"],{relativeTo:this.#t.parent});return;case"destination":this.#n.navigate(["destination"],{relativeTo:this.#t.parent});return;case"source":this.#n.navigate(["source-data"],{relativeTo:this.#t.parent});return}this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=$({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,te,5),n&2&&B()},decls:20,vars:12,consts:()=>{let r;r=$localize`Options`;let n;n=$localize`Backup retention`;let e;e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let t;t=$localize`Nothing will be deleted. The backup size will grow with each change.`;let M;M=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let I;I=$localize`Time to keep versions`;let R;R=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let b;b=$localize`Number of versions`;let A;A=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let y;y=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let F;return F=$localize`Retention expression`,[r,n,e,o,t,M,I,R,b,A,y,k,F,[1,"title-30"],["value","value","label","name",3,"options","inlineSearch","isClearable"],["for","size"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[3,"ngModelChange","customId","ngModel"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(i(0,"section")(1,"h3",13),l(2,0),a(),i(3,"sh-select",14)(4,"label",15),l(5,1),a(),i(6,"input",16),u("ngModelChange",function(t){return T(e.optionsFields.backupRetention,t)||(e.optionsFields.backupRetention=t),t}),a()(),L(7,oe,2,0,"p")(8,ae,5,2)(9,se,6,1)(10,_e,2,0,"p")(11,le,8,1),i(12,"app-options-list",17),u("optionsChange",function(t){return T(e.settings,t)||(e.settings=t),t}),a(),i(13,"div",18)(14,"button",19),f("click",function(){return e.goBack()}),N(15,2),P(16,"sh-icon"),E(),a(),i(17,"button",20),f("click",function(){return e.submit()}),N(18,3),P(19,"sh-icon"),E(),a()()()),n&2&&(p(3),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),p(3),d("ngModel",e.optionsFields.backupRetention),p(),G(e.optionsFields.backupRetention()==="all"?7:e.optionsFields.backupRetention()==="time"?8:e.optionsFields.backupRetention()==="versions"?9:e.optionsFields.backupRetention()==="smart"?10:e.optionsFields.backupRetention()==="custom"?11:-1),p(5),d("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",D(11,ie)),p(5),x("loading",e.isSubmitting()))},dependencies:[H,X,V,W,z,ne,Z,j,Y,q,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:37.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as pe}from"./chunk-NWNCATHF.js";import"./chunk-ZKGGCQ2N.js";import{b as de,c as Se,l as ue,p as Ee,q as Ce}from"./chunk-AWL7E6ZQ.js";import"./chunk-RWDQ3L3C.js";import"./chunk-V5ZJABDA.js";import{c as Te,d as ge}from"./chunk-ZPIR5QIQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-EG3PT3XW.js";import"./chunk-O3GGVB2B.js";import"./chunk-OAAXQ2BE.js";import{a as M}from"./chunk-7E5J43IH.js";import"./chunk-3MS6SVET.js";import"./chunk-4VYR5E5I.js";import"./chunk-KLAJGS5T.js";import"./chunk-NGKFJLI2.js";import"./chunk-KUX6NGQU.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,v as oe,w as re,y as ae,z as se}from"./chunk-Y46QCSB5.js";import"./chunk-JJY6UOEY.js";import{b as j,d as q}from"./chunk-2K74TI2N.js";import"./chunk-G3FMV74P.js";import"./chunk-LU7RSOI6.js";import"./chunk-VLMNSWR3.js";import"./chunk-VKNFRCHQ.js";import{Ac as K,Bb as D,Cb as r,Db as a,Eb as O,Ib as V,Jb as W,Lb as u,Pc as $,Sa as T,Sb as E,Tb as C,Ub as I,Vc as w,Xb as z,Yb as d,Z as m,_b as c,ca as l,da as _,fb as B,fc as J,ga as v,gc as X,mc as P,oa as N,rc as f,sc as R,tc as h,uc as A,vb as p,vc as y,wb as F,wc as L,zc as H}from"./chunk-QY4Y5NJB.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){l(e);let t=c(2);return _(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=u();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),P(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){c();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=u();r(0,"app-destination-list-item",17)(1,"button",20),d("click",function(){l(e);let t=c();return _(t.removeDestination())}),I(2,8),a()()}if(o&2){c();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=u();r(0,"app-destination-list",26),d("setDestination",function(t){l(e);let s=c();return _(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=u();r(0,"app-single-destination",27),h("targetUrlChange",function(t){l(e);let s=c();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),_(t)}),a()}if(o&2){let e=c();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function Pe(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Ae(o,i){if(o&1){let e=u();r(0,"sh-dialog",28),h("isOpenChange",function(t){l(e);let s=c();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),_(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){l(e);let s=c();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),_(t)}),a()()(),r(10,"footer",34)(11,"button",20),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!1))}),P(12,"Cancel"),a(),r(13,"button",35),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=c();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ee])],decls:25,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let b;b=$localize`Edit target URL`;let G;G=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,b,G,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=u();A(0),r(1,"form",12,0),d("submit",function(){return l(t),_(n.next())}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return l(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),_(g)})("testSignalChange",function(g){return l(t),R(n.testSignal,g)||(n.testSignal=g),_(g)}),a(),A(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),d("click",function(){return l(t),_(n.goBack())}),E(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),E(21,4),p(22,Me,2,0,"sh-icon",22)(23,Pe,2,0,"sh-icon"),C(),a()()(),p(24,Ae,16,4,"sh-dialog",23)}if(e&2){let t=y(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=y(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[Ce,Se,de,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,ue],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
|
|
1
|
+
import{g as pe}from"./chunk-IAZGVY3O.js";import"./chunk-C5OYK6UC.js";import{b as de,c as Se,l as ue,p as Ee,q as Ce}from"./chunk-AZEV3A4R.js";import"./chunk-RWDQ3L3C.js";import"./chunk-CAJQ2FEU.js";import{c as Te,d as ge}from"./chunk-ZPIR5QIQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-EG3PT3XW.js";import"./chunk-O3GGVB2B.js";import"./chunk-OAAXQ2BE.js";import{a as M}from"./chunk-7E5J43IH.js";import"./chunk-3MS6SVET.js";import"./chunk-4VYR5E5I.js";import"./chunk-KLAJGS5T.js";import"./chunk-NGKFJLI2.js";import"./chunk-KUX6NGQU.js";import{B as le,H as _e,K as ce,c as Q,e as Y,f as Z,g as ee,i as te,j as ne,s as ie,v as oe,w as re,y as ae,z as se}from"./chunk-Y46QCSB5.js";import"./chunk-JJY6UOEY.js";import{b as j,d as q}from"./chunk-2K74TI2N.js";import"./chunk-G3FMV74P.js";import"./chunk-LU7RSOI6.js";import"./chunk-VLMNSWR3.js";import"./chunk-VKNFRCHQ.js";import{Ac as K,Bb as D,Cb as r,Db as a,Eb as O,Ib as V,Jb as W,Lb as u,Pc as $,Sa as T,Sb as E,Tb as C,Ub as I,Vc as w,Xb as z,Yb as d,Z as m,_b as c,ca as l,da as _,fb as B,fc as J,ga as v,gc as X,mc as P,oa as N,rc as f,sc as R,tc as h,uc as A,vb as p,vc as y,wb as F,wc as L,zc as H}from"./chunk-QY4Y5NJB.js";import"./chunk-7CGTOI24.js";var Fe=["formRef"],Oe=["testUrl"],me=()=>({maxWidth:"700px",width:"100%"});function Re(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),E(1,5),O(2,"sh-icon"),C(),a()}}function Ne(o,i){if(o&1){let e=u();r(0,"button",24),d("click",function(){l(e);let t=c(2);return _(t.copyTargetUrl())}),E(1,7),O(2,"sh-icon"),C(),a()}}function De(o,i){if(o&1){let e=u();r(0,"sh-menu")(1,"button",15)(2,"sh-icon"),P(3,"dots-three-vertical"),a()(),V(4,25),r(5,"button",24),d("click",function(){l(e);let t=c();return _(t.openTargetUrlDialog())}),E(6,6),O(7,"sh-icon"),C(),a(),p(8,Ne,3,0,"button",15),W(),a()}if(o&2){c();let e=L(0);T(8),F(e?8:-1)}}function Ie(o,i){if(o&1){let e=u();r(0,"app-destination-list-item",17)(1,"button",20),d("click",function(){l(e);let t=c();return _(t.removeDestination())}),I(2,8),a()()}if(o&2){c();let e=L(12);D("destination",e)}}function fe(o,i){if(o&1){let e=u();r(0,"app-destination-list",26),d("setDestination",function(t){l(e);let s=c();return _(s.setDestination(t))}),a()}}function he(o,i){if(o&1){let e=u();r(0,"app-single-destination",27),h("targetUrlChange",function(t){l(e);let s=c();return R(s.targetUrlModel,t)||(s.targetUrlModel=t),_(t)}),a()}if(o&2){let e=c();f("targetUrl",e.targetUrlModel)}}function Me(o,i){o&1&&(E(0,4,1),O(1,"sh-icon",22),C())}function Pe(o,i){o&1&&(E(0,4,2),O(1,"sh-icon"),C())}function Ae(o,i){if(o&1){let e=u();r(0,"sh-dialog",28),h("isOpenChange",function(t){l(e);let s=c();return R(s.targetUrlDialogOpen,t)||(s.targetUrlDialogOpen=t),_(t)}),r(1,"header",29)(2,"div",30)(3,"h2"),I(4,9),a(),r(5,"sh-alert",31),I(6,10),a()()(),r(7,"div",32)(8,"sh-form-field")(9,"textarea",33),h("ngModelChange",function(t){l(e);let s=c();return R(s.targetUrlCtrl,t)||(s.targetUrlCtrl=t),_(t)}),a()()(),r(10,"footer",34)(11,"button",20),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!1))}),P(12,"Cancel"),a(),r(13,"button",35),d("click",function(){l(e);let t=c();return _(t.closeTargetUrlDialog(!0))}),E(14,11),O(15,"sh-icon"),C(),a()()()}if(o&2){let e=c();f("isOpen",e.targetUrlDialogOpen),D("options",K(3,me)),T(9),f("ngModel",e.targetUrlCtrl)}}var x=class o{#i=m(q);#o=m(j);#n=m(se);injector=m(v);#e=m(pe);formRef=w.required("formRef");testUrlComponent=w.required("testUrl");testSignal=this.#e.destinationTestSignal;targetUrlModel=this.#e.destinationTargetUrl;targetUrlCtrl=N(null);targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);toggleNewDestination=N(!0);selectedDestinationType=$(()=>{let i=this.#e.destinationTargetUrl();return i?Te(i):null});selectedDestinationTypeOption=$(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.#e.destinationTargetUrl()??"")}openTargetUrlDialog(){let i=this.#e.destinationTargetUrl();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||e===n||!e||this.#e.updateTargetUrl(e)}setDestination(i){let e=ge(i??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.#e.updateTargetUrl(n);return}this.#e.updateTargetUrl(`${i}://`)}}removeDestination(){this.#e.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.testSignal();if(i===null){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testUrlComponent()?.testDestination(!1)?.then(t=>{t.action==="success"&&t.containsBackup?this.#t():this.#n.open(M,{data:{title:$localize`Test did not succeed`,message:t.errorMessage??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#t()}});return}let e=typeof i=="string"?null:i;if(e?.action!=="success"||!e.containsBackup){this.#n.open(M,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Edit destination`,cancelText:$localize`Yes, continue`},closed:n=>{n||this.#t()}});return}this.#t()}#t(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=B({type:o,selectors:[["app-restore-destination"]],viewQuery:function(e,n){e&1&&J(n.formRef,Fe,5)(n.testUrlComponent,Oe,5),e&2&&X(2)},features:[H([Ee])],decls:25,vars:17,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*22:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*22:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*23:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*23:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=z(n);let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let s;s=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let g;g=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let U;U=$localize`Change`;let b;b=$localize`Edit target URL`;let G;G=$localize`Be careful, this will overwrite everything you have in your destination.`;let k;return k=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["testUrl",""],i,e,n,t,s,g,U,b,G,k,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click"],["menu",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,n){if(e&1){let t=u();A(0),r(1,"form",12,0),d("submit",function(){return l(t),_(n.next())}),r(3,"header")(4,"h3",13)(5,"span"),I(6,2),a(),r(7,"div",14),p(8,Re,3,0,"button",15)(9,De,9,1,"sh-menu"),a()(),r(10,"app-test-url",16,1),h("targetUrlChange",function(g){return l(t),R(n.targetUrlModel,g)||(n.targetUrlModel=g),_(g)})("testSignalChange",function(g){return l(t),R(n.testSignal,g)||(n.testSignal=g),_(g)}),a(),A(12),p(13,Ie,3,1,"app-destination-list-item",17),a(),p(14,fe,1,0,"app-destination-list"),p(15,he,1,1,"app-single-destination",18),r(16,"div",19)(17,"button",20),d("click",function(){return l(t),_(n.goBack())}),E(18,3),O(19,"sh-icon"),C(),a(),r(20,"button",21),E(21,4),p(22,Me,2,0,"sh-icon",22)(23,Pe,2,0,"sh-icon"),C(),a()()(),p(24,Ae,16,4,"sh-dialog",23)}if(e&2){let t=y(!!n.targetUrlModel());T(8),F(t?9:8),T(2),f("targetUrl",n.targetUrlModel)("testSignal",n.testSignal),D("backupId",null)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!1)("testExpectation","containsBackup")("moduleType","Backend"),T(2);let s=y(n.selectedDestinationTypeOption());T(),F(s?13:-1),T(),F(t?-1:14),T(),F(t?15:-1),T(5),D("disabled",n.testSignal()=="testing"||!t),T(2),F(n.testSignal()=="testing"?22:23),T(2),F(n.targetUrlDialogOpen()?24:-1)}},dependencies:[Ce,Se,de,ie,ne,Q,Y,Z,te,ee,le,_e,ce,oe,ae,re,ue],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as yt,b as $t,c as Ut,l as Lt,p as Rt,q as vt}from"./chunk-AWL7E6ZQ.js";import"./chunk-RWDQ3L3C.js";import"./chunk-V5ZJABDA.js";import{b as Mt,c as Ft,d as wt}from"./chunk-ZPIR5QIQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-O3GGVB2B.js";import"./chunk-OAAXQ2BE.js";import"./chunk-7E5J43IH.js";import"./chunk-3MS6SVET.js";import"./chunk-4VYR5E5I.js";import"./chunk-KLAJGS5T.js";import"./chunk-NGKFJLI2.js";import"./chunk-KUX6NGQU.js";import{B as It,C as ht,G as ft,H as Ot,K as Dt,L as Pt,V as xt,W as At,c as ct,e as dt,f as Ct,g as gt,i as ut,j as Tt,r as pt,s as mt,v as St,w as Nt,y as Et}from"./chunk-Y46QCSB5.js";import"./chunk-JJY6UOEY.js";import{b as lt,d as _t}from"./chunk-2K74TI2N.js";import"./chunk-G3FMV74P.js";import"./chunk-LU7RSOI6.js";import"./chunk-VLMNSWR3.js";import"./chunk-VKNFRCHQ.js";import{Ab as F,Ac as rt,Bb as E,Cb as a,Db as s,Eb as I,Ib as L,Jb as R,Lb as N,Pc as w,Sa as d,Sb as f,Tb as O,Ub as S,Wc as st,Yb as C,Z as P,_b as r,ca as _,da as c,fb as nt,fc as it,ga as et,gc as ot,jc as v,mc as g,nc as D,oa as h,qa as U,rc as b,sc as G,tc as k,uc as at,vb as T,vc as B,wb as p,wc as x,xb as A,zb as M}from"./chunk-QY4Y5NJB.js";import"./chunk-7CGTOI24.js";var bt=["testUrl"],Gt=()=>({maxWidth:"700px",width:"100%"});function kt(o,e){if(o&1){let t=N();a(0,"sh-card",30)(1,"div",32)(2,"h3"),S(3,4),s(),a(4,"button",33),C("click",function(){_(t);let i=r(3);return c(i.closeCustomList())}),g(5," Cancel "),a(6,"sh-icon"),g(7,"x-bold"),s()()(),a(8,"app-destination-list",34),C("setDestination",function(i){_(t);let l=r(3);return c(l.setDestination(i))}),s()()}}function Bt(o,e){if(o&1){let t=N();a(0,"div",40)(1,"sh-toggle",43),C("click",function(){_(t);let i=r(2).$index,l=r(2);return c(l.toggleSave(i))}),a(2,"span",44),S(3,8),s()()()}if(o&2){let t=r(2).$implicit;d(),v("active",t.save),E("color","primary")("variant","raised")}}function Vt(o,e){if(o&1){let t=N();a(0,"sh-toggle-card",31),L(1,35),a(2,"app-destination-list-item",36)(3,"button",33),C("click",function(){_(t);let i=r().$index,l=r(2);return c(l.changeDestination(i))}),g(4,"Change"),s(),a(5,"sh-menu",37),C("click",function(i){return _(t),c(i.stopPropagation())}),a(6,"button",38)(7,"sh-icon"),g(8,"dots-three-vertical"),s()(),L(9,39),a(10,"button",33),C("click",function(){_(t);let i=r().$index,l=r(2);return c(l.openTargetUrlDialog(i))}),f(11,5),I(12,"sh-icon"),O(),s(),a(13,"button",33),C("click",function(){_(t);let i=r().$index,l=r(2);return c(l.copyTargetUrl(i))}),f(14,6),I(15,"sh-icon"),O(),s(),a(16,"button",33),C("click",function(){_(t);let i=r().$index,l=r(2);return c(l.removeDestination(i))}),f(17,7),I(18,"sh-icon"),O(),s(),R(),s()(),R(),T(19,Bt,4,4,"div",40),a(20,"app-test-url",41,1),C("targetUrlChange",function(i){_(t);let l=r().$index,m=r(2);return c(m.updateTargetUrl(l,i))})("testSignalChange",function(i){_(t);let l=r().$index,m=r(2);return c(m.updateTestState(l,i))}),s(),a(22,"app-single-destination",42),C("targetUrlChange",function(i){_(t);let l=r().$index,m=r(2);return c(m.updateTargetUrl(l,i))}),s()()}if(o&2){let t=r(),n=t.$implicit,i=t.$index,l=r(2);E("disableToggle",!0)("isActive",!0),d(2),E("targetUrl",n.url)("connectionStringId",n.connectionStringId),d(17),p(n.connectionStringId?-1:19),d(),E("targetUrl",n.url)("testSignal",l.testStates()[i]||null)("backupId",l.backupId())("connectionStringId",n.connectionStringId)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!0)("testExpectation",l.isNew()?"destinationEmpty":"any")("moduleType","Backend"),d(2),E("targetUrl",n.url)("useBackupState",!0)}}function Kt(o,e){if(o&1&&T(0,kt,9,0,"sh-card",30)(1,Vt,23,16,"sh-toggle-card",31),o&2){let t=e.$index,n=r(2);p(n.showCustomList()&&n.currentEditingIndex()===t?0:1)}}function Jt(o,e){if(o&1&&M(0,Kt,2,1,null,null,A),o&2){r();let t=x(0);F(t)}}function Xt(o,e){o&1&&(a(0,"div",45),I(1,"sh-progress-bar",46),a(2,"div",47)(3,"h3"),S(4,9),s()()())}function zt(o,e){o&1&&(a(0,"sh-divider"),S(1,12),s())}function Ht(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit;d(),D(t.Description)}}function jt(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit,n=r(4);d(),D(n.getSimplePath(t.BaseUrl))}}function Wt(o,e){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=_(t).$implicit,l=r(4);return c(l.selectSavedDestination(i))}),a(1,"h3",51),g(2),s(),T(3,Ht,2,1,"p",52)(4,jt,2,1,"p",52),s()}if(o&2){let t=e.$implicit;E("targetUrl",t.BaseUrl),d(2),D(t.Name||t.BaseUrl),d(),p(t.Description?3:4)}}function Qt(o,e){if(o&1){let t=N();a(0,"sh-card",48),C("click",function(){_(t);let i=r(3);return c(i.toggleCustomList())}),a(1,"sh-icon"),g(2,"plus-circle"),s(),a(3,"div",47)(4,"h3"),S(5,10),s(),a(6,"p"),S(7,11),s()()(),T(8,zt,2,0,"sh-divider"),M(9,Wt,5,3,"app-destination-list-item",49,A)}if(o&2){let t=r(3);d(8),p(t.destinations().length>0?8:-1),d(),F(t.destinations())}}function qt(o,e){if(o&1&&T(0,Xt,5,0,"div",45)(1,Qt,11,1),o&2){let t=r(2);p(t.isLoadingDestinations()?0:1)}}function Yt(o,e){o&1&&(a(0,"sh-divider"),S(1,15),s())}function Zt(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit;d(),D(t.Description)}}function te(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit,n=r(3);d(),D(n.getSimplePath(t.BaseUrl))}}function ee(o,e){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=_(t).$implicit,l=r(3);return c(l.selectSavedDestination(i))}),a(1,"h3",51),g(2),s(),T(3,Zt,2,1,"p",52)(4,te,2,1,"p",52),s()}if(o&2){let t=e.$implicit;E("targetUrl",t.BaseUrl),d(2),D(t.Name||t.BaseUrl),d(),p(t.Description?3:4)}}function ne(o,e){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){_(t);let i=r(2);return c(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),s(),g(4," Back "),s()(),a(5,"sh-card",48),C("click",function(){_(t);let i=r(2);return c(i.toggleCustomList())}),a(6,"sh-icon"),g(7,"plus-circle"),s(),a(8,"div",47)(9,"h3"),S(10,13),s(),a(11,"p"),S(12,14),s()()(),T(13,Yt,2,0,"sh-divider"),M(14,ee,5,3,"app-destination-list-item",49,A)}if(o&2){let t=r(2);d(13),p(t.destinations().length>0?13:-1),d(),F(t.destinations())}}function ie(o,e){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){_(t);let i=r(3);return c(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),s()(),a(4,"h3"),S(5,16),s()()}}function oe(o,e){if(o&1){let t=N();T(0,ie,6,0,"div",53),a(1,"app-destination-list",34),C("setDestination",function(i){_(t);let l=r(2);return c(l.setDestination(i))}),s()}if(o&2){let t=r(2),n=x(0);p(t.destinations().length>0||n.length>0?0:-1)}}function ae(o,e){if(o&1&&T(0,qt,2,1)(1,ne,16,1)(2,oe,2,1),o&2){let t=r(),n=x(1);p(!t.showCustomList()&&!n&&!t.isAddingNew()?0:t.isAddingNew()&&!t.showCustomList()?1:2)}}function re(o,e){if(o&1){let t=N();a(0,"div",25)(1,"button",55),C("click",function(){_(t);let i=r();return c(i.startAddingNew())}),a(2,"sh-icon"),g(3,"plus"),s(),g(4," Add another destination "),s()()}}function se(o,e){o&1&&(a(0,"h2"),S(1,19),s())}function le(o,e){o&1&&(a(0,"h2"),S(1,20),s())}function _e(o,e){if(o&1){let t=N();a(0,"sh-dialog",56),k("isOpenChange",function(i){_(t);let l=r();return G(l.targetUrlDialogOpen,i)||(l.targetUrlDialogOpen=i),c(i)}),a(1,"header",57)(2,"div",58),T(3,se,2,0,"h2")(4,le,2,0,"h2"),a(5,"sh-alert",59),S(6,17),s()()(),a(7,"div",60)(8,"sh-form-field")(9,"textarea",61),k("ngModelChange",function(i){_(t);let l=r();return G(l.targetUrlCtrl,i)||(l.targetUrlCtrl=i),c(i)}),s()()(),a(10,"footer",62)(11,"button",27),C("click",function(){_(t);let i=r();return c(i.closeTargetUrlDialog(!1))}),g(12,"Cancel"),s(),a(13,"button",63),C("click",function(){_(t);let i=r();return c(i.closeTargetUrlDialog(!0))}),f(14,18),I(15,"sh-icon"),O(),s()()()}if(o&2){let t=r(),n=x(1);b("isOpen",t.targetUrlDialogOpen),E("options",rt(4,Gt)),d(3),p(n?4:3),d(6),b("ngModel",t.targetUrlCtrl)}}var y=new pt,Ae=(o={destinations:[]})=>y.group({destinations:y.array(o.destinations)}),Me=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>y.group({destinationType:y.control(o),custom:e,dynamic:t,advanced:n}),V=class o{#n=P(_t);#i=P(lt);#t=P(Rt);#e=P(yt);injector=P(et);testUrlComponents=st("testUrl");testStates=h([]);targetUrls=this.#t.targetUrls;targetUrlModel=w(()=>this.targetUrls()[0]?.url??null);targetUrlCtrl=h(null);targetUrlInitial=h(null);currentEditingIndex=h(null);targetUrlDialogOpen=h(!1);showCustomList=h(!1);isConnectionStringSaved=this.#t.isConnectionStringSaved;destinations=this.#e.destinations;isLoadingDestinations=this.#e.resourceDestinations.isLoading;isNew=this.#t.isNew;backupId=this.#t.backupId;selectedDestinationType=w(()=>{let e=this.targetUrlModel();return e?Ft(e)??null:null});isLoadingDestinationEffect=U(()=>{let e=this.isLoadingDestinations(),t=this.destinations(),n=this.targetUrls();!e&&t.length==0&&n.length==0&&this.toggleCustomList()});selectedDestinationTypeOption=w(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});getConnectionString(e){let t=this.#e.destinations().find(n=>n.ID===e);return console.log("connection",t),t}getSimplePath(e){return e?Mt(e):""}copyTargetUrl(e=0){let t=this.targetUrls()[e]?.url;t&&navigator.clipboard.writeText(t)}openTargetUrlDialog(e=0){let t=this.targetUrls()[e]?.url??null;this.targetUrlCtrl.set(t),this.targetUrlInitial.set(t),this.currentEditingIndex.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();if(!e||t===n||!t)return;let i=this.currentEditingIndex();if(i!==null){let l=this.targetUrls()[i]?.connectionStringId??null,m=this.targetUrls()[i]?.urlKey??null;this.#t.updateTargetUrl(i,t,l,m)}else this.#t.setTargetUrl(t);this.currentEditingIndex.set(null)}setDestination(e){let t=wt(e??"");if(!t)return;let n=t.mapper.default?t.mapper.default(this.#t.backupName()??""):`${e}://`;if(this.currentEditingIndex()!==null){this.#t.updateTargetUrl(this.currentEditingIndex(),n,null,null),this.updateTestState(this.currentEditingIndex(),null),this.currentEditingIndex.set(null),this.showCustomList.set(!1);return}this.showCustomList()?(this.#t.addTargetUrl(n,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)):(this.#t.addTargetUrl(n,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1))}targetUrlsEffect=U(()=>{let e=this.targetUrls();this.testStates.update(t=>{if(t.length===e.length)return t;let n=[...t];if(n.length<e.length)for(let i=n.length;i<e.length;i++)n.push(null);else n.length=e.length;return n})},{allowSignalWrites:!0});selectSavedDestination(e){e.BaseUrl&&e.BaseUrl&&(this.targetUrls().length===0?this.#t.setTargetUrl(e.BaseUrl,!0,e.ID,null):(this.#t.addTargetUrl(e.BaseUrl,e.ID,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)))}toggleCustomList(){this.currentEditingIndex.set(null),this.showCustomList.set(!0)}isAddingNew=h(!1);startAddingNew(){this.isAddingNew.set(!0),this.destinations().length===0&&this.showCustomList.set(!0)}changeDestination(e){this.currentEditingIndex.set(e),this.showCustomList.set(!0)}closeCustomList(){this.showCustomList.set(!1),this.currentEditingIndex.set(null),this.isAddingNew.set(!1)}removeDestination(e){this.#t.removeTargetUrl(e)}updateTargetUrl(e,t){if(!t)return;let n=this.targetUrls()[e]?.connectionStringId??null,i=this.targetUrls()[e]?.urlKey??null;this.#t.updateTargetUrl(e,t,n,i),this.updateTestState(e,null)}updateTestState(e,t){this.testStates.update(n=>{let i=[...n];return i[e]=t,i})}toggleSave(e){this.#t.toggleSaveConnectionString(e)}goBack(){this.#n.navigate(["general"],{relativeTo:this.#i.parent})}async next(){if(!this.#t.isNew()){this.#o();return}let t=this.testUrlComponents(),n=this.testStates();for(let i=0;i<t.length;i++){let l=t[i],m=this.testStates()[i];if(m&&typeof m!="string"&&m.action==="success")continue;if((await l.testDestination(!1))?.action!=="success")return}this.#o()}#o(){this.#t.shouldAutoSave()&&this.#t.submit(!0),this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=nt({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&it(n.testUrlComponents,bt,5),t&2&&ot()},decls:19,vars:9,consts:()=>{let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`Change destination type`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let l;l=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let m;m=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Remove `;let $;$=$localize`Save as connection string`;let K;K=$localize`Loading destinations...`;let J;J=$localize`Configure a new destination`;let X;X=$localize`Configure a one-off or new storage location.`;let z;z=$localize`Or select a saved destination`;let H;H=$localize`Configure a new destination`;let j;j=$localize`Configure a one-off or new storage location.`;let W;W=$localize`Or select a saved destination`;let Q;Q=$localize`Select storage type`;let q;q=$localize`Be careful, this will overwrite everything you have in your destination.`;let Y;Y=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Z;Z=$localize`Set target URL`;let tt;return tt=$localize`Edit target URL`,[["formRef",""],["testUrl",""],e,t,n,i,l,m,$,K,J,X,z,H,j,W,Q,q,Y,Z,tt,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"add-destination-container"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[3,"isOpen","options"],[1,"destination-card","type-c","editing"],[1,"destination-card","type-a",3,"disableToggle","isActive"],[1,"editing-header"],["shButton","","type","button",1,"small",3,"click"],[3,"setDestination"],["title",""],[3,"targetUrl","connectionStringId"],[1,"actions",3,"click"],["shButton","","type","button",1,"small","icon-only"],["menu",""],[1,"options-row",2,"margin","0 1rem 1rem 1rem"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","connectionStringId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"click","color","variant"],["label",""],[1,"loading-list"],[1,"indeterminate","primary"],[1,"text"],[1,"type-a","actionable","add-new",3,"click"],["variant","type-a",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["displayName",""],["description",""],[1,"custom-list-header"],["shButton","","iconOnly","","variant","ghost","type","button",3,"click"],["shButton","","type","button",1,"secondary",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let i=N();at(0)(1),a(2,"form",21,0),C("submit",function(){return _(i),c(n.next())}),a(4,"div",22),I(5,"input",23)(6,"input",24),s(),a(7,"header"),T(8,Jt,2,0),s(),T(9,ae,3,1),T(10,re,5,0,"div",25),a(11,"div",26)(12,"button",27),C("click",function(){return _(i),c(n.goBack())}),f(13,2),I(14,"sh-icon"),O(),s(),a(15,"button",28),f(16,3),I(17,"sh-icon"),O(),s()()(),T(18,_e,16,5,"sh-dialog",29)}if(t&2){let i=B(n.targetUrls());d();let l=B(i.length>0);d(7),p(n.currentEditingIndex()!==null||!n.showCustomList()&&!n.isAddingNew()?8:-1),d(),p((!l||n.showCustomList()||n.isAddingNew())&&n.currentEditingIndex()===null?9:-1),d(),p(l&&!n.showCustomList()&&!n.isAddingNew()?10:-1),d(5),v("loading",n.isNew()&&n.testStates().length>0&&n.testStates()[0]==="testing"),E("disabled",!l),d(3),p(n.targetUrlDialogOpen()?18:-1)}},dependencies:[vt,Ut,$t,Lt,mt,Tt,ct,dt,Ct,ut,gt,It,Ot,Dt,St,Et,Nt,ht,ft,Pt,xt,At],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:1.5rem}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}.loading-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center;padding:4rem}.loading-list[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8);cursor:pointer}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-list-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.save-connection-string[_ngcontent-%COMP%]{margin:1rem 0}sh-card.destination-card[_ngcontent-%COMP%]{padding:1.5rem}.destination-card[_ngcontent-%COMP%]{position:relative;overflow:visible}.destination-card[_ngcontent-%COMP%] app-destination-list-item[_ngcontent-%COMP%]{width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{position:static;transform:none}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.destination-card[_ngcontent-%COMP%] sh-toggle-card[_ngcontent-%COMP%] .header{width:100%}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{Ae as createDestinationForm,Me as createDestinationFormGroup,V as default};
|
|
1
|
+
import{a as yt,b as $t,c as Ut,l as Lt,p as Rt,q as vt}from"./chunk-AZEV3A4R.js";import"./chunk-RWDQ3L3C.js";import"./chunk-CAJQ2FEU.js";import{b as Mt,c as Ft,d as wt}from"./chunk-ZPIR5QIQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-O3GGVB2B.js";import"./chunk-OAAXQ2BE.js";import"./chunk-7E5J43IH.js";import"./chunk-3MS6SVET.js";import"./chunk-4VYR5E5I.js";import"./chunk-KLAJGS5T.js";import"./chunk-NGKFJLI2.js";import"./chunk-KUX6NGQU.js";import{B as It,C as ht,G as ft,H as Ot,K as Dt,L as Pt,V as xt,W as At,c as ct,e as dt,f as Ct,g as gt,i as ut,j as Tt,r as pt,s as mt,v as St,w as Nt,y as Et}from"./chunk-Y46QCSB5.js";import"./chunk-JJY6UOEY.js";import{b as lt,d as _t}from"./chunk-2K74TI2N.js";import"./chunk-G3FMV74P.js";import"./chunk-LU7RSOI6.js";import"./chunk-VLMNSWR3.js";import"./chunk-VKNFRCHQ.js";import{Ab as F,Ac as rt,Bb as E,Cb as a,Db as s,Eb as I,Ib as L,Jb as R,Lb as N,Pc as w,Sa as d,Sb as f,Tb as O,Ub as S,Wc as st,Yb as C,Z as P,_b as r,ca as _,da as c,fb as nt,fc as it,ga as et,gc as ot,jc as v,mc as g,nc as D,oa as h,qa as U,rc as b,sc as G,tc as k,uc as at,vb as T,vc as B,wb as p,wc as x,xb as A,zb as M}from"./chunk-QY4Y5NJB.js";import"./chunk-7CGTOI24.js";var bt=["testUrl"],Gt=()=>({maxWidth:"700px",width:"100%"});function kt(o,e){if(o&1){let t=N();a(0,"sh-card",30)(1,"div",32)(2,"h3"),S(3,4),s(),a(4,"button",33),C("click",function(){_(t);let i=r(3);return c(i.closeCustomList())}),g(5," Cancel "),a(6,"sh-icon"),g(7,"x-bold"),s()()(),a(8,"app-destination-list",34),C("setDestination",function(i){_(t);let l=r(3);return c(l.setDestination(i))}),s()()}}function Bt(o,e){if(o&1){let t=N();a(0,"div",40)(1,"sh-toggle",43),C("click",function(){_(t);let i=r(2).$index,l=r(2);return c(l.toggleSave(i))}),a(2,"span",44),S(3,8),s()()()}if(o&2){let t=r(2).$implicit;d(),v("active",t.save),E("color","primary")("variant","raised")}}function Vt(o,e){if(o&1){let t=N();a(0,"sh-toggle-card",31),L(1,35),a(2,"app-destination-list-item",36)(3,"button",33),C("click",function(){_(t);let i=r().$index,l=r(2);return c(l.changeDestination(i))}),g(4,"Change"),s(),a(5,"sh-menu",37),C("click",function(i){return _(t),c(i.stopPropagation())}),a(6,"button",38)(7,"sh-icon"),g(8,"dots-three-vertical"),s()(),L(9,39),a(10,"button",33),C("click",function(){_(t);let i=r().$index,l=r(2);return c(l.openTargetUrlDialog(i))}),f(11,5),I(12,"sh-icon"),O(),s(),a(13,"button",33),C("click",function(){_(t);let i=r().$index,l=r(2);return c(l.copyTargetUrl(i))}),f(14,6),I(15,"sh-icon"),O(),s(),a(16,"button",33),C("click",function(){_(t);let i=r().$index,l=r(2);return c(l.removeDestination(i))}),f(17,7),I(18,"sh-icon"),O(),s(),R(),s()(),R(),T(19,Bt,4,4,"div",40),a(20,"app-test-url",41,1),C("targetUrlChange",function(i){_(t);let l=r().$index,m=r(2);return c(m.updateTargetUrl(l,i))})("testSignalChange",function(i){_(t);let l=r().$index,m=r(2);return c(m.updateTestState(l,i))}),s(),a(22,"app-single-destination",42),C("targetUrlChange",function(i){_(t);let l=r().$index,m=r(2);return c(m.updateTargetUrl(l,i))}),s()()}if(o&2){let t=r(),n=t.$implicit,i=t.$index,l=r(2);E("disableToggle",!0)("isActive",!0),d(2),E("targetUrl",n.url)("connectionStringId",n.connectionStringId),d(17),p(n.connectionStringId?-1:19),d(),E("targetUrl",n.url)("testSignal",l.testStates()[i]||null)("backupId",l.backupId())("connectionStringId",n.connectionStringId)("sourcePrefix",null)("suppressErrorDialogs",!1)("askToCreate",!0)("testExpectation",l.isNew()?"destinationEmpty":"any")("moduleType","Backend"),d(2),E("targetUrl",n.url)("useBackupState",!0)}}function Kt(o,e){if(o&1&&T(0,kt,9,0,"sh-card",30)(1,Vt,23,16,"sh-toggle-card",31),o&2){let t=e.$index,n=r(2);p(n.showCustomList()&&n.currentEditingIndex()===t?0:1)}}function Jt(o,e){if(o&1&&M(0,Kt,2,1,null,null,A),o&2){r();let t=x(0);F(t)}}function Xt(o,e){o&1&&(a(0,"div",45),I(1,"sh-progress-bar",46),a(2,"div",47)(3,"h3"),S(4,9),s()()())}function zt(o,e){o&1&&(a(0,"sh-divider"),S(1,12),s())}function Ht(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit;d(),D(t.Description)}}function jt(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit,n=r(4);d(),D(n.getSimplePath(t.BaseUrl))}}function Wt(o,e){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=_(t).$implicit,l=r(4);return c(l.selectSavedDestination(i))}),a(1,"h3",51),g(2),s(),T(3,Ht,2,1,"p",52)(4,jt,2,1,"p",52),s()}if(o&2){let t=e.$implicit;E("targetUrl",t.BaseUrl),d(2),D(t.Name||t.BaseUrl),d(),p(t.Description?3:4)}}function Qt(o,e){if(o&1){let t=N();a(0,"sh-card",48),C("click",function(){_(t);let i=r(3);return c(i.toggleCustomList())}),a(1,"sh-icon"),g(2,"plus-circle"),s(),a(3,"div",47)(4,"h3"),S(5,10),s(),a(6,"p"),S(7,11),s()()(),T(8,zt,2,0,"sh-divider"),M(9,Wt,5,3,"app-destination-list-item",49,A)}if(o&2){let t=r(3);d(8),p(t.destinations().length>0?8:-1),d(),F(t.destinations())}}function qt(o,e){if(o&1&&T(0,Xt,5,0,"div",45)(1,Qt,11,1),o&2){let t=r(2);p(t.isLoadingDestinations()?0:1)}}function Yt(o,e){o&1&&(a(0,"sh-divider"),S(1,15),s())}function Zt(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit;d(),D(t.Description)}}function te(o,e){if(o&1&&(a(0,"p",52),g(1),s()),o&2){let t=r().$implicit,n=r(3);d(),D(n.getSimplePath(t.BaseUrl))}}function ee(o,e){if(o&1){let t=N();a(0,"app-destination-list-item",50),C("click",function(){let i=_(t).$implicit,l=r(3);return c(l.selectSavedDestination(i))}),a(1,"h3",51),g(2),s(),T(3,Zt,2,1,"p",52)(4,te,2,1,"p",52),s()}if(o&2){let t=e.$implicit;E("targetUrl",t.BaseUrl),d(2),D(t.Name||t.BaseUrl),d(),p(t.Description?3:4)}}function ne(o,e){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){_(t);let i=r(2);return c(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),s(),g(4," Back "),s()(),a(5,"sh-card",48),C("click",function(){_(t);let i=r(2);return c(i.toggleCustomList())}),a(6,"sh-icon"),g(7,"plus-circle"),s(),a(8,"div",47)(9,"h3"),S(10,13),s(),a(11,"p"),S(12,14),s()()(),T(13,Yt,2,0,"sh-divider"),M(14,ee,5,3,"app-destination-list-item",49,A)}if(o&2){let t=r(2);d(13),p(t.destinations().length>0?13:-1),d(),F(t.destinations())}}function ie(o,e){if(o&1){let t=N();a(0,"div",53)(1,"button",54),C("click",function(){_(t);let i=r(3);return c(i.closeCustomList())}),a(2,"sh-icon"),g(3,"arrow-left"),s()(),a(4,"h3"),S(5,16),s()()}}function oe(o,e){if(o&1){let t=N();T(0,ie,6,0,"div",53),a(1,"app-destination-list",34),C("setDestination",function(i){_(t);let l=r(2);return c(l.setDestination(i))}),s()}if(o&2){let t=r(2),n=x(0);p(t.destinations().length>0||n.length>0?0:-1)}}function ae(o,e){if(o&1&&T(0,qt,2,1)(1,ne,16,1)(2,oe,2,1),o&2){let t=r(),n=x(1);p(!t.showCustomList()&&!n&&!t.isAddingNew()?0:t.isAddingNew()&&!t.showCustomList()?1:2)}}function re(o,e){if(o&1){let t=N();a(0,"div",25)(1,"button",55),C("click",function(){_(t);let i=r();return c(i.startAddingNew())}),a(2,"sh-icon"),g(3,"plus"),s(),g(4," Add another destination "),s()()}}function se(o,e){o&1&&(a(0,"h2"),S(1,19),s())}function le(o,e){o&1&&(a(0,"h2"),S(1,20),s())}function _e(o,e){if(o&1){let t=N();a(0,"sh-dialog",56),k("isOpenChange",function(i){_(t);let l=r();return G(l.targetUrlDialogOpen,i)||(l.targetUrlDialogOpen=i),c(i)}),a(1,"header",57)(2,"div",58),T(3,se,2,0,"h2")(4,le,2,0,"h2"),a(5,"sh-alert",59),S(6,17),s()()(),a(7,"div",60)(8,"sh-form-field")(9,"textarea",61),k("ngModelChange",function(i){_(t);let l=r();return G(l.targetUrlCtrl,i)||(l.targetUrlCtrl=i),c(i)}),s()()(),a(10,"footer",62)(11,"button",27),C("click",function(){_(t);let i=r();return c(i.closeTargetUrlDialog(!1))}),g(12,"Cancel"),s(),a(13,"button",63),C("click",function(){_(t);let i=r();return c(i.closeTargetUrlDialog(!0))}),f(14,18),I(15,"sh-icon"),O(),s()()()}if(o&2){let t=r(),n=x(1);b("isOpen",t.targetUrlDialogOpen),E("options",rt(4,Gt)),d(3),p(n?4:3),d(6),b("ngModel",t.targetUrlCtrl)}}var y=new pt,Ae=(o={destinations:[]})=>y.group({destinations:y.array(o.destinations)}),Me=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>y.group({destinationType:y.control(o),custom:e,dynamic:t,advanced:n}),V=class o{#n=P(_t);#i=P(lt);#t=P(Rt);#e=P(yt);injector=P(et);testUrlComponents=st("testUrl");testStates=h([]);targetUrls=this.#t.targetUrls;targetUrlModel=w(()=>this.targetUrls()[0]?.url??null);targetUrlCtrl=h(null);targetUrlInitial=h(null);currentEditingIndex=h(null);targetUrlDialogOpen=h(!1);showCustomList=h(!1);isConnectionStringSaved=this.#t.isConnectionStringSaved;destinations=this.#e.destinations;isLoadingDestinations=this.#e.resourceDestinations.isLoading;isNew=this.#t.isNew;backupId=this.#t.backupId;selectedDestinationType=w(()=>{let e=this.targetUrlModel();return e?Ft(e)??null:null});isLoadingDestinationEffect=U(()=>{let e=this.isLoadingDestinations(),t=this.destinations(),n=this.targetUrls();!e&&t.length==0&&n.length==0&&this.toggleCustomList()});selectedDestinationTypeOption=w(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});getConnectionString(e){let t=this.#e.destinations().find(n=>n.ID===e);return console.log("connection",t),t}getSimplePath(e){return e?Mt(e):""}copyTargetUrl(e=0){let t=this.targetUrls()[e]?.url;t&&navigator.clipboard.writeText(t)}openTargetUrlDialog(e=0){let t=this.targetUrls()[e]?.url??null;this.targetUrlCtrl.set(t),this.targetUrlInitial.set(t),this.currentEditingIndex.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();if(!e||t===n||!t)return;let i=this.currentEditingIndex();if(i!==null){let l=this.targetUrls()[i]?.connectionStringId??null,m=this.targetUrls()[i]?.urlKey??null;this.#t.updateTargetUrl(i,t,l,m)}else this.#t.setTargetUrl(t);this.currentEditingIndex.set(null)}setDestination(e){let t=wt(e??"");if(!t)return;let n=t.mapper.default?t.mapper.default(this.#t.backupName()??""):`${e}://`;if(this.currentEditingIndex()!==null){this.#t.updateTargetUrl(this.currentEditingIndex(),n,null,null),this.updateTestState(this.currentEditingIndex(),null),this.currentEditingIndex.set(null),this.showCustomList.set(!1);return}this.showCustomList()?(this.#t.addTargetUrl(n,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)):(this.#t.addTargetUrl(n,null,null),this.showCustomList.set(!1),this.isAddingNew.set(!1))}targetUrlsEffect=U(()=>{let e=this.targetUrls();this.testStates.update(t=>{if(t.length===e.length)return t;let n=[...t];if(n.length<e.length)for(let i=n.length;i<e.length;i++)n.push(null);else n.length=e.length;return n})},{allowSignalWrites:!0});selectSavedDestination(e){e.BaseUrl&&e.BaseUrl&&(this.targetUrls().length===0?this.#t.setTargetUrl(e.BaseUrl,!0,e.ID,null):(this.#t.addTargetUrl(e.BaseUrl,e.ID,null),this.showCustomList.set(!1),this.isAddingNew.set(!1)))}toggleCustomList(){this.currentEditingIndex.set(null),this.showCustomList.set(!0)}isAddingNew=h(!1);startAddingNew(){this.isAddingNew.set(!0),this.destinations().length===0&&this.showCustomList.set(!0)}changeDestination(e){this.currentEditingIndex.set(e),this.showCustomList.set(!0)}closeCustomList(){this.showCustomList.set(!1),this.currentEditingIndex.set(null),this.isAddingNew.set(!1)}removeDestination(e){this.#t.removeTargetUrl(e)}updateTargetUrl(e,t){if(!t)return;let n=this.targetUrls()[e]?.connectionStringId??null,i=this.targetUrls()[e]?.urlKey??null;this.#t.updateTargetUrl(e,t,n,i),this.updateTestState(e,null)}updateTestState(e,t){this.testStates.update(n=>{let i=[...n];return i[e]=t,i})}toggleSave(e){this.#t.toggleSaveConnectionString(e)}goBack(){this.#n.navigate(["general"],{relativeTo:this.#i.parent})}async next(){if(!this.#t.isNew()){this.#o();return}let t=this.testUrlComponents(),n=this.testStates();for(let i=0;i<t.length;i++){let l=t[i],m=this.testStates()[i];if(m&&typeof m!="string"&&m.action==="success")continue;if((await l.testDestination(!1))?.action!=="success")return}this.#o()}#o(){this.#t.shouldAutoSave()&&this.#t.submit(!0),this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=nt({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&it(n.testUrlComponents,bt,5),t&2&&ot()},decls:19,vars:9,consts:()=>{let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let n;n=$localize`Change destination type`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let l;l=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let m;m=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Remove `;let $;$=$localize`Save as connection string`;let K;K=$localize`Loading destinations...`;let J;J=$localize`Configure a new destination`;let X;X=$localize`Configure a one-off or new storage location.`;let z;z=$localize`Or select a saved destination`;let H;H=$localize`Configure a new destination`;let j;j=$localize`Configure a one-off or new storage location.`;let W;W=$localize`Or select a saved destination`;let Q;Q=$localize`Select storage type`;let q;q=$localize`Be careful, this will overwrite everything you have in your destination.`;let Y;Y=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Z;Z=$localize`Set target URL`;let tt;return tt=$localize`Edit target URL`,[["formRef",""],["testUrl",""],e,t,n,i,l,m,$,K,J,X,z,H,j,W,Q,q,Y,Z,tt,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"add-destination-container"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[3,"isOpen","options"],[1,"destination-card","type-c","editing"],[1,"destination-card","type-a",3,"disableToggle","isActive"],[1,"editing-header"],["shButton","","type","button",1,"small",3,"click"],[3,"setDestination"],["title",""],[3,"targetUrl","connectionStringId"],[1,"actions",3,"click"],["shButton","","type","button",1,"small","icon-only"],["menu",""],[1,"options-row",2,"margin","0 1rem 1rem 1rem"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","connectionStringId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","moduleType"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"click","color","variant"],["label",""],[1,"loading-list"],[1,"indeterminate","primary"],[1,"text"],[1,"type-a","actionable","add-new",3,"click"],["variant","type-a",1,"actionable",3,"targetUrl"],["variant","type-a",1,"actionable",3,"click","targetUrl"],["displayName",""],["description",""],[1,"custom-list-header"],["shButton","","iconOnly","","variant","ghost","type","button",3,"click"],["shButton","","type","button",1,"secondary",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],[1,"warn"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let i=N();at(0)(1),a(2,"form",21,0),C("submit",function(){return _(i),c(n.next())}),a(4,"div",22),I(5,"input",23)(6,"input",24),s(),a(7,"header"),T(8,Jt,2,0),s(),T(9,ae,3,1),T(10,re,5,0,"div",25),a(11,"div",26)(12,"button",27),C("click",function(){return _(i),c(n.goBack())}),f(13,2),I(14,"sh-icon"),O(),s(),a(15,"button",28),f(16,3),I(17,"sh-icon"),O(),s()()(),T(18,_e,16,5,"sh-dialog",29)}if(t&2){let i=B(n.targetUrls());d();let l=B(i.length>0);d(7),p(n.currentEditingIndex()!==null||!n.showCustomList()&&!n.isAddingNew()?8:-1),d(),p((!l||n.showCustomList()||n.isAddingNew())&&n.currentEditingIndex()===null?9:-1),d(),p(l&&!n.showCustomList()&&!n.isAddingNew()?10:-1),d(5),v("loading",n.isNew()&&n.testStates().length>0&&n.testStates()[0]==="testing"),E("disabled",!l),d(3),p(n.targetUrlDialogOpen()?18:-1)}},dependencies:[vt,Ut,$t,Lt,mt,Tt,ct,dt,Ct,ut,gt,It,Ot,Dt,St,Et,Nt,ht,ft,Pt,xt,At],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:1.5rem}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}.loading-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;align-items:center;padding:4rem}.loading-list[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}.add-new[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1.5rem;padding:1.5rem;background:var(--base-1);color:var(--primary-8);cursor:pointer}.add-new[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:.8}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}.custom-list-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.save-connection-string[_ngcontent-%COMP%]{margin:1rem 0}sh-card.destination-card[_ngcontent-%COMP%]{padding:1.5rem}.destination-card[_ngcontent-%COMP%]{position:relative;overflow:visible}.destination-card[_ngcontent-%COMP%] app-destination-list-item[_ngcontent-%COMP%]{width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0}.destination-card[_ngcontent-%COMP%] .card-header-content[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{position:static;transform:none}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.destination-card[_ngcontent-%COMP%] .editing-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.destination-card[_ngcontent-%COMP%] sh-toggle-card[_ngcontent-%COMP%] .header{width:100%}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{Ae as createDestinationForm,Me as createDestinationFormGroup,V as default};
|
package/index.html
CHANGED
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
<body>
|
|
125
125
|
<app-root></app-root>
|
|
126
126
|
<div class="loading">Connecting ...</div>
|
|
127
|
-
<link rel="modulepreload" href="chunk-VPUFUCR3.js"><link rel="modulepreload" href="chunk-6COK7FLL.js"><link rel="modulepreload" href="chunk-WLAJ3YIP.js"><link rel="modulepreload" href="chunk-23UYU3M3.js"><link rel="modulepreload" href="chunk-GGW26MAG.js"><link rel="modulepreload" href="chunk-FJFREVRV.js"><link rel="modulepreload" href="chunk-OWBBT5WF.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-EG3PT3XW.js"><link rel="modulepreload" href="chunk-7E5J43IH.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-
|
|
127
|
+
<link rel="modulepreload" href="chunk-VPUFUCR3.js"><link rel="modulepreload" href="chunk-6COK7FLL.js"><link rel="modulepreload" href="chunk-WLAJ3YIP.js"><link rel="modulepreload" href="chunk-23UYU3M3.js"><link rel="modulepreload" href="chunk-GGW26MAG.js"><link rel="modulepreload" href="chunk-FJFREVRV.js"><link rel="modulepreload" href="chunk-OWBBT5WF.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-EG3PT3XW.js"><link rel="modulepreload" href="chunk-7E5J43IH.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-DIGDM6JP.js" type="module"></script></body>
|
|
128
128
|
</html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ke,c as Ae}from"./chunk-VPUFUCR3.js";import{a as Te}from"./chunk-6COK7FLL.js";import{a as Ie}from"./chunk-WLAJ3YIP.js";import{b as k}from"./chunk-23UYU3M3.js";import"./chunk-GGW26MAG.js";import{a as Me}from"./chunk-FJFREVRV.js";import{b as Ee}from"./chunk-OWBBT5WF.js";import{a as D}from"./chunk-6Q6SSTBK.js";import{a as Re}from"./chunk-EG3PT3XW.js";import"./chunk-7E5J43IH.js";import"./chunk-QY5UGQ3R.js";import"./chunk-KLAJGS5T.js";import{a as H}from"./chunk-NGKFJLI2.js";import{a as h,b as be,c as v,d as we,e as I}from"./chunk-KUX6NGQU.js";import{u as Ce,x as ve}from"./chunk-Y46QCSB5.js";import{a as ye,e as Se}from"./chunk-JJY6UOEY.js";import{c as me,d as de,g as ue,h as he,i as fe,j as ge}from"./chunk-2K74TI2N.js";import{a as re}from"./chunk-G3FMV74P.js";import{a as se,b as ie,c as ae,e as pe,f as le,g as ce}from"./chunk-LU7RSOI6.js";import{fa as oe,ka as ne}from"./chunk-VLMNSWR3.js";import"./chunk-VKNFRCHQ.js";import{E as M,Eb as Z,I as K,K as T,Lc as ee,M as _,Mc as te,U as C,X as q,Z as s,f as W,fb as Y,g as $,ga as z,ha as X,l as G,m as B,oa as d,p as w,qa as Q,y as P,z as J}from"./chunk-QY4Y5NJB.js";import"./chunk-7CGTOI24.js";var A=class e{#e=s(h);#a=s(v);ngOnInit(){be(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=Y({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Z(0,"router-outlet")},dependencies:[me],encapsulation:2})};var Ne={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new q("ENVIRONMENT");var N=class e{#e=s(Se);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#e.getApiV1Webmodules().pipe(_(n=>this.webmodules.set(n)),M(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Fe=()=>{let e=s(I);return e.token()?!0:e.checkProxyAuthed().pipe(T(t=>t?G(!0):e.refreshToken().pipe(w(()=>!0))))},We=()=>{let e=s(v),t=s(k),o=s(z),n=e.relayIsEnabled()?"longpoll":"websocket",a=[o.get(H).preload(!0),o.get(H).preloadFilterGroups(!0),o.get(N).preload(!0)];return e.configLoaded===null?P(a).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(a)))},$e=()=>!0,Oe={path:"connect/:typeParam",loadComponent:()=>import("./chunk-NJBOYRXU.js")},Ge=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},xe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-7JHU54QM.js")},{path:"logout",loadComponent:()=>import("./chunk-OVLGKJ3Z.js")},{path:"",canActivate:[Fe],children:[{path:"",canActivate:[We,$e,Ge],children:[{path:"welcome",loadComponent:()=>import("./chunk-UOZTEZ7B.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-TBQPNXMN.js")},Oe]},{path:"",loadComponent:()=>import("./chunk-NGPZXZJJ.js"),children:[{path:"",loadComponent:()=>import("./chunk-STB3WOIA.js")},Oe,{path:"destinations",loadComponent:()=>import("./chunk-2E2AU7CO.js")},{path:"add-backup",loadComponent:()=>import("./chunk-I7MAEY3S.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-AI6EYFMY.js")},{path:"backup/import",loadComponent:()=>import("./chunk-XHDAWK7I.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-5QAUCDEV.js"),loadChildren:()=>import("./chunk-AAECT3VT.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-5QAUCDEV.js"),loadChildren:()=>import("./chunk-AAECT3VT.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-A57TBTOD.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-RNE4Z2E4.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-7T44DW2B.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-XZHXN75E.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-KYTPZ3WD.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-ZFREX3ZV.js")},{path:"from-config",loadComponent:()=>import("./chunk-R4E5IO3A.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-HFNC6WUL.js"),loadChildren:()=>import("./chunk-5HB22USV.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-HFNC6WUL.js"),loadChildren:()=>import("./chunk-5HB22USV.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-HFNC6WUL.js"),loadChildren:()=>import("./chunk-5HB22USV.js")},{path:"status",loadComponent:()=>import("./chunk-2FPYV4EW.js")},{path:"settings",loadComponent:()=>import("./chunk-A5F2OWRS.js")},{path:"about",loadComponent:()=>import("./chunk-5T2JCBPV.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MMF252RQ.js")},{path:"changelog",loadComponent:()=>import("./chunk-7HFTVA4J.js")},{path:"libraries",loadComponent:()=>import("./chunk-PGISF7LM.js")},{path:"system-info",loadComponent:()=>import("./chunk-SFW3N5OL.js")},{path:"server-settings",loadComponent:()=>import("./chunk-VNF7NNO5.js")},{path:"logs",loadChildren:()=>import("./chunk-RFCIV3AX.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-V63YAEPZ.js")}]}]}]}]}]}];var U=null,Le=(e,t)=>{let o=s(I),n=s(de),a=s(h),p=s(f),i=a.getItem("locale"),u=s(ve),l=ke(i),r=ye.BASE||"",m=e.url===`${r}/api/v1/auth/login`,S=e.url===`${r}/api/v1/auth/logout`,g=e.url===`${r}/api/v1/auth/refresh`,b=e.url===`${r}/api/v1/progressstate`,E=e.url===`${r}/api/v1/remoteoperation/test`,Ue=e.url===`${r}/api/v1/filesystem/validate`,je=e.url.startsWith(`${r}/api/v2/`),L=o.token(),j=e,F=e.headers.has("custom-proxy-check")||L===we;if(L&&e.url.startsWith(r+p.baseUrl)&&!F){let c=e.headers.set("Authorization",`Bearer ${L}`);i&&i!=="en-US"&&(c=c.set("X-Ui-Language",l)),j=e.clone({headers:c})}return t(j).pipe(w(c=>{if(c.type===4&&c.status===200&&je){let y=c.body;if(y?.Success===!1)throw{status:200,message:y?.Error??"Unknown error",error:{Error:y?.Error??"Unknown error"},requestBody:y}}return c}),J(c=>{let y=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;if(!F){let R=!0;if((b&&c.status===404||E||Ue)&&(R=!1),g&&c.status===401&&(R=!1,o.logout(),n.navigate(["/logout"])),!m&&!g&&!S&&c.status===401)return R=!1,U??=o.refreshToken().pipe(K()),U.pipe(T(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),M(()=>U=null));R&&u.error(y)}return B(()=>({error:c,message:y}))}))};var O=class e{#e=s(X);showError(t){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=t||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Be="1.0.0",Pe=`portal-proxy-client-${D()}`,Je=1,x=class e{#e=1e3;#a=s(f);#d=s(O);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#l=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#c=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=Q(()=>{let t=this.#p(),o=this.#u(),n=this.#l();if(!n||!t||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(t){this.#s||(this.#s=!0,this.#d.showError(t||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(t){let o=Uint8Array.from(atob(t),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#l.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#l.set(t),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let l={token:t,publicKey:"",clientVersion:Be,protocolVersion:Je},r=this.createResponse(i,"authportal",l);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#c.length>0;){let l=this.#c.pop();l&&this.#r[l.messageId]&&this.activateCommand(l)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let l=this.#r[i.messageId];if(l){if(i.errorMessage)this.#i(i.errorMessage),l.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),l.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(l.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let a={from:Pe,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(t,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((l,r)=>{let m=D(),g={from:Pe,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},b={resolve:l,reject:r,timer:window.setTimeout(()=>{let E=this.#r[m];E&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),E.reject("Timeout"))},u)};this.#r[m]=b,this.#n()?this.activateCommand(g):this.#c.push(g)})}activateCommand(t){this.#t?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Ke(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function He(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let a=Ke(t.body),p={};t.headers.keys().forEach(r=>{p[r]=t.headers.get(r)??""});let i=t.headers.get("timeout"),u=i!==null?parseInt(i):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let l=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,a,p,u);return new W(r=>{l.then(m=>{let S=new se;p!=null&&Object.keys(p).forEach(b=>{S.set(b,p[b])});let g=new ie({body:m.body,status:m.statusCode,statusText:"OK",headers:S});r.next(g),r.complete()}).catch(m=>{r.error(new ae({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var De=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(x)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new $;return o.relayconfigState.configLoaded.subscribe(p=>{p&&He(o,e,t).subscribe(a)}),a}return He(o,e,t)};var Ve={providers:[ee(),he(xe,ge(),fe(ue)),pe(ce(),le([De,Le])),h,{provide:f,useValue:Ne},{provide:te,useValue:Ae()},{provide:Ce,useValue:{alertVariant:"simple"}},Te,k,Ee,ne,Re,oe,Me,Ie]};re(A,Ve);
|
|
1
|
+
import{b as ke,c as Ae}from"./chunk-VPUFUCR3.js";import{a as Te}from"./chunk-6COK7FLL.js";import{a as Ie}from"./chunk-WLAJ3YIP.js";import{b as k}from"./chunk-23UYU3M3.js";import"./chunk-GGW26MAG.js";import{a as Me}from"./chunk-FJFREVRV.js";import{b as Ee}from"./chunk-OWBBT5WF.js";import{a as D}from"./chunk-6Q6SSTBK.js";import{a as Re}from"./chunk-EG3PT3XW.js";import"./chunk-7E5J43IH.js";import"./chunk-QY5UGQ3R.js";import"./chunk-KLAJGS5T.js";import{a as H}from"./chunk-NGKFJLI2.js";import{a as h,b as be,c as v,d as we,e as I}from"./chunk-KUX6NGQU.js";import{u as Ce,x as ve}from"./chunk-Y46QCSB5.js";import{a as ye,e as Se}from"./chunk-JJY6UOEY.js";import{c as me,d as de,g as ue,h as he,i as fe,j as ge}from"./chunk-2K74TI2N.js";import{a as re}from"./chunk-G3FMV74P.js";import{a as se,b as ie,c as ae,e as pe,f as le,g as ce}from"./chunk-LU7RSOI6.js";import{fa as oe,ka as ne}from"./chunk-VLMNSWR3.js";import"./chunk-VKNFRCHQ.js";import{E as M,Eb as Z,I as K,K as T,Lc as ee,M as _,Mc as te,U as C,X as q,Z as s,f as W,fb as Y,g as $,ga as z,ha as X,l as G,m as B,oa as d,p as w,qa as Q,y as P,z as J}from"./chunk-QY4Y5NJB.js";import"./chunk-7CGTOI24.js";var A=class e{#e=s(h);#a=s(v);ngOnInit(){be(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=Y({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Z(0,"router-outlet")},dependencies:[me],encapsulation:2})};var Ne={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new q("ENVIRONMENT");var N=class e{#e=s(Se);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#e.getApiV1Webmodules().pipe(_(n=>this.webmodules.set(n)),M(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Fe=()=>{let e=s(I);return e.token()?!0:e.checkProxyAuthed().pipe(T(t=>t?G(!0):e.refreshToken().pipe(w(()=>!0))))},We=()=>{let e=s(v),t=s(k),o=s(z),n=e.relayIsEnabled()?"longpoll":"websocket",a=[o.get(H).preload(!0),o.get(H).preloadFilterGroups(!0),o.get(N).preload(!0)];return e.configLoaded===null?P(a).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(a)))},$e=()=>!0,Oe={path:"connect/:typeParam",loadComponent:()=>import("./chunk-NJBOYRXU.js")},Ge=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},xe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-7JHU54QM.js")},{path:"logout",loadComponent:()=>import("./chunk-OVLGKJ3Z.js")},{path:"",canActivate:[Fe],children:[{path:"",canActivate:[We,$e,Ge],children:[{path:"welcome",loadComponent:()=>import("./chunk-UOZTEZ7B.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-TBQPNXMN.js")},Oe]},{path:"",loadComponent:()=>import("./chunk-NGPZXZJJ.js"),children:[{path:"",loadComponent:()=>import("./chunk-STB3WOIA.js")},Oe,{path:"destinations",loadComponent:()=>import("./chunk-AG7H2MR5.js")},{path:"add-backup",loadComponent:()=>import("./chunk-I7MAEY3S.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-AI6EYFMY.js")},{path:"backup/import",loadComponent:()=>import("./chunk-XHDAWK7I.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-I2T6IA4K.js"),loadChildren:()=>import("./chunk-R45TV6JI.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-I2T6IA4K.js"),loadChildren:()=>import("./chunk-R45TV6JI.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-A57TBTOD.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-RNE4Z2E4.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-P7TJCJ64.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-XZHXN75E.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-KYTPZ3WD.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-ZFREX3ZV.js")},{path:"from-config",loadComponent:()=>import("./chunk-R4E5IO3A.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-JRXD2X7B.js"),loadChildren:()=>import("./chunk-SMUUHPDS.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-JRXD2X7B.js"),loadChildren:()=>import("./chunk-SMUUHPDS.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-JRXD2X7B.js"),loadChildren:()=>import("./chunk-SMUUHPDS.js")},{path:"status",loadComponent:()=>import("./chunk-2FPYV4EW.js")},{path:"settings",loadComponent:()=>import("./chunk-OL5HI5OG.js")},{path:"about",loadComponent:()=>import("./chunk-5T2JCBPV.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MMF252RQ.js")},{path:"changelog",loadComponent:()=>import("./chunk-7HFTVA4J.js")},{path:"libraries",loadComponent:()=>import("./chunk-PGISF7LM.js")},{path:"system-info",loadComponent:()=>import("./chunk-SFW3N5OL.js")},{path:"server-settings",loadComponent:()=>import("./chunk-VNF7NNO5.js")},{path:"logs",loadChildren:()=>import("./chunk-RFCIV3AX.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-V63YAEPZ.js")}]}]}]}]}]}];var U=null,Le=(e,t)=>{let o=s(I),n=s(de),a=s(h),p=s(f),i=a.getItem("locale"),u=s(ve),l=ke(i),r=ye.BASE||"",m=e.url===`${r}/api/v1/auth/login`,S=e.url===`${r}/api/v1/auth/logout`,g=e.url===`${r}/api/v1/auth/refresh`,b=e.url===`${r}/api/v1/progressstate`,E=e.url===`${r}/api/v1/remoteoperation/test`,Ue=e.url===`${r}/api/v1/filesystem/validate`,je=e.url.startsWith(`${r}/api/v2/`),L=o.token(),j=e,F=e.headers.has("custom-proxy-check")||L===we;if(L&&e.url.startsWith(r+p.baseUrl)&&!F){let c=e.headers.set("Authorization",`Bearer ${L}`);i&&i!=="en-US"&&(c=c.set("X-Ui-Language",l)),j=e.clone({headers:c})}return t(j).pipe(w(c=>{if(c.type===4&&c.status===200&&je){let y=c.body;if(y?.Success===!1)throw{status:200,message:y?.Error??"Unknown error",error:{Error:y?.Error??"Unknown error"},requestBody:y}}return c}),J(c=>{let y=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;if(!F){let R=!0;if((b&&c.status===404||E||Ue)&&(R=!1),g&&c.status===401&&(R=!1,o.logout(),n.navigate(["/logout"])),!m&&!g&&!S&&c.status===401)return R=!1,U??=o.refreshToken().pipe(K()),U.pipe(T(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),M(()=>U=null));R&&u.error(y)}return B(()=>({error:c,message:y}))}))};var O=class e{#e=s(X);showError(t){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=t||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Be="1.0.0",Pe=`portal-proxy-client-${D()}`,Je=1,x=class e{#e=1e3;#a=s(f);#d=s(O);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#l=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#c=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=Q(()=>{let t=this.#p(),o=this.#u(),n=this.#l();if(!n||!t||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(t){this.#s||(this.#s=!0,this.#d.showError(t||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(t){let o=Uint8Array.from(atob(t),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#l.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#l.set(t),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let l={token:t,publicKey:"",clientVersion:Be,protocolVersion:Je},r=this.createResponse(i,"authportal",l);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#c.length>0;){let l=this.#c.pop();l&&this.#r[l.messageId]&&this.activateCommand(l)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let l=this.#r[i.messageId];if(l){if(i.errorMessage)this.#i(i.errorMessage),l.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),l.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(l.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let a={from:Pe,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(t,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((l,r)=>{let m=D(),g={from:Pe,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},b={resolve:l,reject:r,timer:window.setTimeout(()=>{let E=this.#r[m];E&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),E.reject("Timeout"))},u)};this.#r[m]=b,this.#n()?this.activateCommand(g):this.#c.push(g)})}activateCommand(t){this.#t?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Ke(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function He(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let a=Ke(t.body),p={};t.headers.keys().forEach(r=>{p[r]=t.headers.get(r)??""});let i=t.headers.get("timeout"),u=i!==null?parseInt(i):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let l=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,a,p,u);return new W(r=>{l.then(m=>{let S=new se;p!=null&&Object.keys(p).forEach(b=>{S.set(b,p[b])});let g=new ie({body:m.body,status:m.statusCode,statusText:"OK",headers:S});r.next(g),r.complete()}).catch(m=>{r.error(new ae({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var De=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(x)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new $;return o.relayconfigState.configLoaded.subscribe(p=>{p&&He(o,e,t).subscribe(a)}),a}return He(o,e,t)};var Ve={providers:[ee(),he(xe,ge(),fe(ue)),pe(ce(),le([De,Le])),h,{provide:f,useValue:Ne},{provide:te,useValue:Ae()},{provide:Ce,useValue:{alertVariant:"simple"}},Te,k,Ee,ne,Re,oe,Me,Ie]};re(A,Ve);
|
package/package.json
CHANGED
package/chunk-5HB22USV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-MT6UNBGG.js")},{path:"encryption",loadComponent:()=>import("./chunk-AJF77BHX.js")},{path:"select-files",loadComponent:()=>import("./chunk-4OBMW6MZ.js")},{path:"options",loadComponent:()=>import("./chunk-ISG53K32.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-X5JLWZ7R.js")}],t=o;export{t as default};
|
package/chunk-AAECT3VT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-4GQJ6TJZ.js")},{path:"destination",loadComponent:()=>import("./chunk-YYAHWCC5.js")},{path:"source-data",loadComponent:()=>import("./chunk-GJGFMZUV.js")},{path:"schedule",loadComponent:()=>import("./chunk-KICR4V2W.js")},{path:"options",loadComponent:()=>import("./chunk-FNGDI6JY.js")}];export{o as default};
|