@duplicati/ngclient 0.0.158 → 0.0.160

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.
Files changed (82) hide show
  1. package/{chunk-KSEFQ2XA.js → chunk-2J4H7C6W.js} +1 -1
  2. package/{chunk-PD73DDOS.js → chunk-2QJVTZ56.js} +2 -2
  3. package/{chunk-COUIDDUK.js → chunk-4IXUXIXV.js} +1 -1
  4. package/{chunk-TJIZJNCK.js → chunk-4NBLWONL.js} +1 -1
  5. package/{chunk-FMEVVC6D.js → chunk-4OBQWIWP.js} +3 -3
  6. package/{chunk-L3RU4D2N.js → chunk-4XH2XMUL.js} +1 -1
  7. package/{chunk-7FCBU2UO.js → chunk-5EOS64VG.js} +1 -1
  8. package/{chunk-ENNM55FS.js → chunk-5WDKKAXO.js} +1 -1
  9. package/{chunk-HKL7ZJV5.js → chunk-66TRUOH6.js} +1 -1
  10. package/{chunk-VRV52R6I.js → chunk-6YGURBW6.js} +1 -1
  11. package/{chunk-K3VDFIJM.js → chunk-72QJ345F.js} +1 -1
  12. package/{chunk-XVWOVBC4.js → chunk-7LYN2XHO.js} +1 -1
  13. package/{chunk-TPBZNCDW.js → chunk-7RM3VKDO.js} +1 -1
  14. package/{chunk-X3XJ26NZ.js → chunk-C6F6FP4R.js} +1 -1
  15. package/{chunk-ZSZLXWN6.js → chunk-CCKT2GLS.js} +1 -1
  16. package/{chunk-EE5UMXWP.js → chunk-D4F7SID5.js} +1 -1
  17. package/chunk-DQGMVICD.js +1 -0
  18. package/{chunk-JRDR23NB.js → chunk-DUHMJQLC.js} +1 -1
  19. package/chunk-EKL66TNH.js +1 -0
  20. package/{chunk-2KH32RMH.js → chunk-EMRD3UKA.js} +1 -1
  21. package/{chunk-M6SIMFCD.js → chunk-ERFIISF6.js} +1 -1
  22. package/{chunk-3AGOCPNZ.js → chunk-EWLAEWGN.js} +1 -1
  23. package/{chunk-UQY3P37P.js → chunk-F6ME3VE6.js} +1 -1
  24. package/{chunk-WXF4HUYT.js → chunk-GCCJSS4C.js} +1 -1
  25. package/chunk-GNKFIYOX.js +1 -0
  26. package/{chunk-SKSEDWGR.js → chunk-GOVVHVP2.js} +1 -1
  27. package/chunk-GZ4YKLCY.js +1 -0
  28. package/chunk-H3UUJ5EW.js +1 -0
  29. package/{chunk-XHITDSWR.js → chunk-IXN3WMCO.js} +1 -1
  30. package/{chunk-EVJPCAZV.js → chunk-JTSI7UN4.js} +1 -1
  31. package/chunk-K6V2N3GS.js +1 -0
  32. package/chunk-KATY4JFV.js +1 -0
  33. package/{chunk-7TF7DTKJ.js → chunk-KXM6LF3X.js} +1 -1
  34. package/chunk-LVTEOKA4.js +1 -0
  35. package/{chunk-2IE65QDC.js → chunk-MBRRLME5.js} +1 -1
  36. package/{chunk-TG2ZSU7H.js → chunk-NM7WJRU7.js} +1 -1
  37. package/chunk-OQ3CIW34.js +1 -0
  38. package/{chunk-RADP6NAN.js → chunk-OXKNUQ4S.js} +1 -1
  39. package/{chunk-3AYCMVTF.js → chunk-PHQBBCUL.js} +1 -1
  40. package/{chunk-ISNV5CM5.js → chunk-PULERFBI.js} +1 -1
  41. package/chunk-Q65KFDJ5.js +1 -0
  42. package/{chunk-QWQKYLNR.js → chunk-QX3IRESN.js} +1 -1
  43. package/{chunk-J2Y5AVUU.js → chunk-RFQCUMV5.js} +1 -1
  44. package/{chunk-CUL5FHDH.js → chunk-RZVBW5HI.js} +1 -1
  45. package/{chunk-HWCUMKYF.js → chunk-SDXU6VMB.js} +1 -1
  46. package/{chunk-C2VSATF5.js → chunk-SWD3HS57.js} +1 -1
  47. package/{chunk-363K6H7I.js → chunk-TDJOG66Y.js} +1 -1
  48. package/{chunk-RIFNOGGK.js → chunk-TIGMPMCF.js} +1 -1
  49. package/{chunk-6XXAHUOH.js → chunk-TX6PGD4I.js} +1 -1
  50. package/chunk-TYUEMPMP.js +1 -0
  51. package/{chunk-XH5CTH3O.js → chunk-TZAOQANG.js} +1 -1
  52. package/{chunk-FIUF53BE.js → chunk-UST7PIBI.js} +1 -1
  53. package/{chunk-VUKS2SJL.js → chunk-USYSNGYO.js} +1 -1
  54. package/{chunk-3LVCVLMO.js → chunk-UTOT5S6Z.js} +1 -1
  55. package/chunk-UZVZ7QY6.js +1 -0
  56. package/chunk-V4JPJPZI.js +3 -0
  57. package/{chunk-ZWO4SECL.js → chunk-V7LUGECS.js} +1 -1
  58. package/chunk-WXTYJ7CH.js +1 -0
  59. package/{chunk-MTQKK2WN.js → chunk-XLDVUBTQ.js} +1 -1
  60. package/{chunk-RDCD2W2C.js → chunk-YHUSOICR.js} +1 -1
  61. package/chunk-YX7ZJ2VA.js +1 -0
  62. package/{chunk-BNWLPYK6.js → chunk-ZMTLDG46.js} +1 -1
  63. package/index.html +1 -1
  64. package/locale/messages.de.json +4 -4
  65. package/locale/messages.it.json +123 -3
  66. package/{main-ATSCYMRN.js → main-OUD7GLNU.js} +1 -1
  67. package/package.json +1 -1
  68. package/chunk-3F7ADWPY.js +0 -1
  69. package/chunk-72HORZFV.js +0 -1
  70. package/chunk-BGKZFATT.js +0 -1
  71. package/chunk-BTJVI7MG.js +0 -1
  72. package/chunk-CFN5U5PK.js +0 -1
  73. package/chunk-JH4DRDIH.js +0 -1
  74. package/chunk-LANFQDZE.js +0 -1
  75. package/chunk-LYKQBVOC.js +0 -1
  76. package/chunk-MSX2SJC7.js +0 -1
  77. package/chunk-NC73IOHK.js +0 -1
  78. package/chunk-O4WI3VDE.js +0 -1
  79. package/chunk-U4U2GCS5.js +0 -1
  80. package/chunk-Y75ZS4Q2.js +0 -1
  81. package/chunk-YHOYPGPD.js +0 -3
  82. package/chunk-ZKX6JJ6S.js +0 -1
@@ -1,7 +1,7 @@
1
- import{a as ot}from"./chunk-ZBVBVQO7.js";import{a as K,b as Ze,c as Ye,e as et}from"./chunk-X3XJ26NZ.js";import{h as it}from"./chunk-KSEFQ2XA.js";import{a as tt,d as nt}from"./chunk-VUKS2SJL.js";import{a as Qe}from"./chunk-VRV52R6I.js";import{a as R}from"./chunk-72HORZFV.js";import{a as z}from"./chunk-MTQKK2WN.js";import{B as ue,G as Ke,J as Ue,K as Je,O as Xe,U as He,V as je,X as qe,a as Re,c as de,e as ce,i as pe,k as ke,s as me,t as Be,u as Ce,z as ze}from"./chunk-QF4DQYEP.js";import{h as We}from"./chunk-PD73DDOS.js";import{ea as Ge}from"./chunk-5ZSBXGHQ.js";import{$b as s,Ab as X,Ac as Le,Bb as H,Bc as Pe,Cb as m,Cc as se,Db as _,Eb as d,Ec as _e,Fb as ie,Jb as oe,Jc as q,Kb as j,Lb as ae,Mb as x,Qc as P,Rc as W,Sa as l,Tb as Ne,Ub as xe,V as te,Vb as De,Wc as Q,Xc as $e,Zb as N,Zc as be,_ as V,ac as we,bc as Oe,cb as ne,ea as T,f as ee,fa as S,gc as Ae,hb as G,hc as Me,ic as B,ja as ye,kc as re,nc as p,pa as b,pc as A,qc as le,sc as Ve,tc as Fe,uc as ve,vc as L,wc as O,xb as g,xc as c,yb as f,zb as J}from"./chunk-QONLYWYC.js";import{a as M,b as Y}from"./chunk-EUDKD2JW.js";var at=class n{#t=V(We);#e=V(ze);#n=V(z);testDestination(t,e,i,o){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,i,o):this.testDestinationv1(t,e,i,o)}testDestinationv2(t,e,i,o){return new ee(a=>{this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:t,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){this.emitSuccessV2(a,t,e,r);return}this.handleGenericError(a,t,e,r.Error??"Unknown error",o)},error:r=>{let C=r?.error?.body;if(C?.Data?.FolderExists===!1||C?.StatusCode==="missing-folder"){i?this.handleMissingFolder(a,t,e):this.handleGenericError(a,t,e,$localize`The remote destination folder does not exist.`,o);return}if(C?.Data?.HostCertificate){this.handleMissingCertificate(a,t,e,C.Data?.HostCertificate);return}if(C?.Data?.ReportedHostKey){this.handleIncorrectKey(a,t,e,C.Data.ReportedHostKey,C.Data.AcceptedHostKey??null);return}this.handleGenericError(a,t,e,r?.message??"Unknown error",o)}})})}testDestinationv1(t,e,i,o){return new ee(a=>{this.#t.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:r=>{a.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:e}),a.complete()},error:r=>{this.handleDestinationErrorv1(r.message,t,e,i,o).subscribe(C=>{a.next(C)})}})})}handleMissingFolder(t,e,i){this.#e.open(R,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:o=>{if(!o){this.reportNoAction(t,e,i,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,i,a);return}else this.handleFolderCreateFailure(t,e,i,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}}):this.#t.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,i)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,i,o){this.#e.open(R,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),t.complete()}})}emitSuccessV2(t,e,i,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:i,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,i){this.#e.open(R,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),t.complete()}})}reportNoAction(t,e,i,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:i}),t.complete()}handleMissingCertificate(t,e,i,o){this.#e.open(R,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
1
+ import{a as ot}from"./chunk-ZBVBVQO7.js";import{a as K,b as Ze,c as Ye,e as et}from"./chunk-C6F6FP4R.js";import{h as it}from"./chunk-2J4H7C6W.js";import{a as tt,d as nt}from"./chunk-USYSNGYO.js";import{a as Qe}from"./chunk-6YGURBW6.js";import{a as R}from"./chunk-LVTEOKA4.js";import{a as z}from"./chunk-XLDVUBTQ.js";import{B as Ce,G as Ke,J as Ue,K as Je,O as Xe,U as He,V as je,X as qe,a as Re,c as de,e as ce,i as pe,k as ke,s as me,t as Be,u as ue,z as ze}from"./chunk-QF4DQYEP.js";import{h as We}from"./chunk-2QJVTZ56.js";import{ea as Ge}from"./chunk-5ZSBXGHQ.js";import{$b as s,Ab as X,Ac as Le,Bb as H,Bc as Pe,Cb as m,Cc as se,Db as _,Eb as d,Ec as _e,Fb as ie,Jb as oe,Jc as q,Kb as j,Lb as ae,Mb as E,Qc as P,Rc as W,Sa as l,Tb as Ne,Ub as xe,V as te,Vb as De,Wc as Q,Xc as $e,Zb as x,Zc as be,_ as V,ac as we,bc as Oe,cb as ne,ea as S,f as ee,fa as h,gc as Ae,hb as G,hc as Me,ic as B,ja as ye,kc as re,nc as p,pa as b,pc as A,qc as le,sc as Ve,tc as Fe,uc as ve,vc as L,wc as O,xb as g,xc as c,yb as f,zb as J}from"./chunk-QONLYWYC.js";import{a as M,b as Y}from"./chunk-EUDKD2JW.js";var at=class n{#t=V(We);#e=V(ze);#n=V(z);testDestination(t,e,i,o,a){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,i,o,a):this.testDestinationv1(t,e,i,o,a)}testDestinationv2(t,e,i,o,a){return new ee(r=>{this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:t,BackupId:e=="new"?null:e,AutoCreate:!1,Options:null}}).subscribe({next:u=>{if(u.Success){this.emitSuccessV2(r,t,i,u);return}this.handleGenericError(r,t,i,u.Error??"Unknown error",a)},error:u=>{let T=u?.error?.body;if(T?.Data?.FolderExists===!1||T?.StatusCode==="missing-folder"){o?this.handleMissingFolder(r,t,i):this.handleGenericError(r,t,i,$localize`The remote destination folder does not exist.`,a);return}if(T?.Data?.HostCertificate){this.handleMissingCertificate(r,t,i,T.Data?.HostCertificate);return}if(T?.Data?.ReportedHostKey){this.handleIncorrectKey(r,t,i,T.Data.ReportedHostKey,T.Data.AcceptedHostKey??null);return}this.handleGenericError(r,t,i,u?.message??"Unknown error",a)}})})}testDestinationv1(t,e,i,o,a){return new ee(r=>{this.#t.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e}}).subscribe({next:u=>{r.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:i}),r.complete()},error:u=>{this.handleDestinationErrorv1(u.message,t,i,o,a).subscribe(T=>{r.next(T)})}})})}handleMissingFolder(t,e,i){this.#e.open(R,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:o=>{if(!o){this.reportNoAction(t,e,i,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#t.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,i,a);return}else this.handleFolderCreateFailure(t,e,i,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}}):this.#t.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,i)},error:a=>{this.handleFolderCreateFailure(t,e,i,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,i,o){this.#e.open(R,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),t.complete()}})}emitSuccessV2(t,e,i,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:i,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,i){this.#e.open(R,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),t.complete()}})}reportNoAction(t,e,i,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:i}),t.complete()}handleMissingCertificate(t,e,i,o){this.#e.open(R,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
2
  If this is a self-signed certificate, you can choose to trust this certificate.
3
3
  The server reported the certificate hash: ${o}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,i,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:o,destinationIndex:i}),t.complete()}})}handleIncorrectKey(t,e,i,o,a){a?this.#e.open(R,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
4
4
  otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
5
5
  Do you want to REPLACE your CURRENT host key ${a}
6
- with the REPORTED host key: ${o}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,i,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),t.complete()}}):this.#e.open(R,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,i,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),t.complete()}})}handleGenericError(t,e,i,o,a){function r(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i,errorMessage:o}),t.complete()}if(a){r();return}this.#e.open(R,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:C=>r()})}handleDestinationErrorv1(t,e,i,o,a){return new ee(r=>{if(t==="missing-folder"){o?this.handleMissingFolder(r,e,i):this.handleGenericError(r,e,i,$localize`The remote destination folder does not exist.`,a);return}if(t.startsWith("incorrect-cert:")){let C=t.split("incorrect-cert:")[1];this.handleMissingCertificate(r,e,i,C);return}if(t.startsWith("incorrect-host-key:")){let C=t.split('incorrect-host-key:"')[1].split('",')[0],E=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(r,e,i,C,E);return}this.handleGenericError(r,e,i,t,a)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})};var ge=class n{#t=V(z);supportedDestinationTypes=P(()=>this.#t.backendModules().map(t=>{if(!t?.Key)return null;let e=K(t.Key);return e.isDefaultEntry===!0?Y(M({},e),{displayName:t.DisplayName||e.displayName||t.Key,description:t.Description||e.description||""}):e}).filter(t=>t!==null));destinationTypeOptions=P(()=>this.supportedDestinationTypes().map(t=>({key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description,icon:t.icon,searchTerms:[t.displayName,t.description,t.key,t.searchTerms??"",t.customKey??""].join(" "),sortOrder:t.sortOrder??0})));backendModules=P(()=>this.#t.backendModules()??[]);static \u0275fac=function(e){return new(e||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})};var _t=["fileInput"],dt=[[["label"]]],ct=["label"],fe=class n{customId=Q();content=b("");readonly=b(!1);placeholder=Q("Drop a file here or use the browse button");fileInputRef=$e("fileInput");onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0])}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0])}onDragOver(t){t.preventDefault()}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result)},e.readAsText(t)}triggerBrowse(){return this.fileInputRef()?.nativeElement.click(),!1}onChange=()=>{};onTouched=()=>{};onChangeEffect=W(()=>{this.onChange(this.content())});writeValue(t){this.content.set(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ne({type:n,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,i){e&1&&Ae(i.fileInputRef,_t,5),e&2&&Me()},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Le([{provide:Re,useExisting:n,multi:!0}])],ngContentSelectors:ct,decls:9,vars:3,consts:[["fileInput",""],[1,"browse-btn"],["shButton","","type","button",1,"small","outlined",3,"click"],[1,"textarea-container","textarea-wrap",3,"drop","dragover"],["rows","10",3,"ngModelChange","placeholder","ngModel","disabled"],["type","file",1,"hidden",3,"change"]],template:function(e,i){if(e&1){let o=x();we(dt),Oe(0,0,["ngProjectAs","label",5,["label"]]),_(1,"div",1)(2,"button",2),N("click",function(){return T(o),S(i.triggerBrowse())}),_(3,"sh-icon"),p(4,"upload"),d()()(),_(5,"div",3),N("drop",function(r){return T(o),S(i.onFileDrop(r))})("dragover",function(r){return T(o),S(i.onDragOver(r))}),_(6,"textarea",4),ve("ngModelChange",function(r){return T(o),Fe(i.content,r)||(i.content=r),S(r)}),d()(),_(7,"input",5,0),N("change",function(r){return T(o),S(i.onFileSelected(r))}),d()}e&2&&(l(6),m("placeholder",i.placeholder()),Ve("ngModel",i.content),m("disabled",i.readonly()))},dependencies:[me,de,ce,pe,Ce,ue],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var pt=(n,t,e,i)=>({index:n,fieldGroup:"custom",formView:t,destinationType:e,oauthField:i}),Ie=n=>({$implicit:n}),mt=(n,t,e,i)=>({index:n,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:i}),Ct=()=>({updateOn:"blur"}),ut=(n,t,e,i)=>({index:n,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:i});function gt(n,t){n&1&&ae(0)}function ft(n,t){if(n&1&&G(0,gt,1,0,"ng-container",13),n&2){let e=t.$implicit,i=t.$index;s();let o=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,Ie,_e(2,pt,i,e,a,r.oauthField)))}}function Tt(n,t){n&1&&ae(0)}function St(n,t){if(n&1&&G(0,Tt,1,0,"ng-container",13),n&2){let e=t.$implicit,i=t.$index;s();let o=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,Ie,_e(2,mt,i,e,a,r.oauthField)))}}function ht(n,t){if(n&1){let e=x();_(0,"button",14),N("click",function(){T(e);let o=s(2);return S(o.showTextArea.set(!1))}),Ne(1,6),ie(2,"sh-icon"),xe(),d()}}function Nt(n,t){if(n&1){let e=x();_(0,"button",21,1),N("click",function(){let o=T(e).$implicit,a=s(3);return S(a.addAdvancedOption(o))}),p(2),d()}if(n&2){let e=t.$implicit;l(2),A(" ",e.name," ")}}function xt(n,t){if(n&1){let e=x();_(0,"div",11)(1,"sh-menu",15)(2,"button",16),Ne(3,7),ie(4,"sh-icon"),xe(),d(),oe(5,17),X(6,Nt,3,1,"button",18,J),j(),d(),_(8,"sh-menu")(9,"button",19)(10,"sh-icon"),p(11,"dots-three-vertical"),d()(),oe(12,17),_(13,"button",20),N("click",function(){T(e);let o=s(2);return S(o.showTextArea.set(!0))}),_(14,"sh-icon"),p(15,"link"),d(),p(16," Edit contents as text "),d(),j(),d()()}if(n&2){s();let e=c(9);l(),m("searchable",!0),l(),m("disabled",e.length===0),l(4),H(e)}}function Et(n,t){if(n&1){let e=x();_(0,"textarea",22),N("ngModelChange",function(o){T(e);let a=s(2);return S(a.updateSettingsFromText(o))}),d()}if(n&2){let e=s(2);m("ngModel",e.settingsAsText())("ngModelOptions",Pe(2,Ct))}}function It(n,t){n&1&&ae(0)}function yt(n,t){if(n&1&&G(0,It,1,0,"ng-container",13),n&2){let e=t.$implicit,i=t.$index;s(2);let o=B(15),a=s(),r=c(0),C=c(1),E=a.getFormView("advanced",e)??a.getDefaultFormView(e);m("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,Ie,_e(2,ut,i,E,r,C.oauthField)))}}function Dt(n,t){if(n&1&&X(0,yt,1,9,"ng-container",null,J),n&2){let e=s(2);H(e.advancedFormFieldNames())}}function wt(n,t){n&1&&(_(0,"sup",31),p(1,"*"),d())}function Ot(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function At(n,t){if(n&1){let e=x();_(0,"app-file-tree",24)(1,"label",30),g(2,wt,2,0,"sup",31),p(3),g(4,Ot,2,1,"sh-icon",32),d(),_(5,"input",33),N("ngModelChange",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(3),r=c(4),C=c(5);m("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),m("for",C),l(),f(e.formView.isMandatory&&r?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",C)("ngModel",o)}}function Mt(n,t){n&1&&(_(0,"sup",34),p(1,"*"),d())}function Vt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Ft(n,t){if(n&1){let e=x();_(0,"app-file-tree",25)(1,"label",30),g(2,Mt,2,0,"sup",34),p(3),g(4,Vt,2,1,"sh-icon",32),d(),_(5,"input",33),N("ngModelChange",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(3),r=c(4),C=c(5);m("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a),l(),m("for",C),l(),f(e.formView.isMandatory&&r?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",C)("ngModel",o)}}function vt(n,t){n&1&&(_(0,"sup",35),p(1,"*"),d())}function Lt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Pt(n,t){n&1&&(_(0,"sh-icon",36),p(1," warning "),d())}function $t(n,t){n&1&&(_(0,"sh-icon",37),p(1,"x-circle"),d())}function bt(n,t){n&1&&(_(0,"sh-icon",38),p(1,"warning"),d())}function Gt(n,t){if(n&1&&(_(0,"sh-icon",42),p(1," link "),d()),n&2){s();let e=c(9),i=c(10);re("error",e&&i==="error")("warn",e&&i==="warning"),m("shTooltip",e)}}function Rt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"envelope"),d())}function kt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"hard-drives"),d())}function Bt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"jar"),d())}function zt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"textbox"),d())}function Kt(n,t){if(n&1){let e=x();_(0,"sh-form-field")(1,"label",30),g(2,vt,2,0,"sup",35),p(3),g(4,Lt,2,1,"sh-icon",32),g(5,Pt,2,0,"sh-icon",36),g(6,$t,2,0,"sh-icon",37),g(7,bt,2,0,"sh-icon",38),d(),_(8,"input",39),N("keydown",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d(),L(9)(10),g(11,Gt,2,5,"sh-icon",40)(12,Rt,2,0,"sh-icon",41)(13,kt,2,0,"sh-icon",41)(14,Bt,2,0,"sh-icon",41)(15,zt,2,0,"sh-icon",41),d()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(3),r=c(4),C=c(5),E=s(2);l(),m("for",C),l(),f(e.formView.isMandatory&&r?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),f(r&&e.formView.type==="Path"?5:-1),l(),f(e.formView.type=="Hostname"&&!r&&!E.isValidHostname(a)?6:-1),l(),f(e.formView.type=="Bucketname"&&!r&&!E.isValidBucketname(a)?7:-1),l(),m("type",e.formView.type==="Email"?"email":"text")("id",C)("ngModel",o);let F=a,w=E.hasLeadingSlash(F??"");l(),O(w&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),l(),O(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),l(),f(e.formView.type==="Path"?11:e.formView.type==="Email"?12:e.formView.type==="Hostname"?13:e.formView.type==="Bucketname"?14:15)}}function Ut(n,t){n&1&&(_(0,"sup",43),p(1,"*"),d())}function Jt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Xt(n,t){if(n&1){let e=x();_(0,"span",47),N("click",function(){T(e);let o=s(2).$implicit,a=s(2);return S(a.oauthStartTokenCreation(o.destinationType,o.fieldGroup,o.formView.name,o.formView.oauthVersion))}),p(1," AuthID "),d()}}function Ht(n,t){n&1&&(_(0,"sh-icon",41),p(1,"password"),d())}function jt(n,t){if(n&1){let e=x();_(0,"sh-icon",48),N("click",function(){T(e);let o=s(2).$implicit;return S(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye "),d()}}function qt(n,t){if(n&1){let e=x();_(0,"sh-icon",48),N("click",function(){T(e);let o=s(2).$implicit;return S(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye-slash "),d()}}function Wt(n,t){if(n&1){let e=x();_(0,"sh-form-field")(1,"label",30),g(2,Ut,2,0,"sup",43),p(3),g(4,Jt,2,1,"sh-icon",32),d(),_(5,"input",44),N("ngModelChange",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d(),g(6,Xt,2,0,"span",45)(7,Ht,2,0,"sh-icon",41),g(8,jt,2,0,"sh-icon",46)(9,qt,2,0,"sh-icon",46),d()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(4),r=c(5);l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),m("type",e.formView.showPassword?"text":"password")("id",r)("ngModel",o),l(),f(e.oauthField===e.formView.name?6:7),l(2),f(e.formView.showPassword?8:9)}}function Qt(n,t){n&1&&(_(0,"sup",50),p(1,"*"),d())}function Zt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function Yt(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;le(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function en(n,t){if(n&1){let e=x();_(0,"sh-select",49)(1,"label",30),g(2,Qt,2,0,"sup",50),p(3),g(4,Zt,2,1,"sh-icon",32),d(),_(5,"input",33),N("ngModelChange",function(o){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()(),G(6,Yt,1,2,"ng-template",null,2,q)}if(n&2){let e=B(7);s();let i=c(0),o=s().$implicit,a=c(1),r=c(2),C=c(4),E=c(5);m("options",i)("isClearable",!1)("optionTemplate",e),l(),m("for",E),l(),f(o.formView.isMandatory&&C?2:-1),l(),A(" ",a," "),l(),f(o.formView.longDescription?4:-1),l(),m("id",E)("ngModel",r)}}function tn(n,t){if(n&1&&(L(0),g(1,en,8,9)),n&2){let e=s().$implicit,i=O(s(2).mapOptions(e.formView));l(),f(i?1:-1)}}function nn(n,t){n&1&&(_(0,"sup",53),p(1,"*"),d())}function on(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function an(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;le(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function rn(n,t){if(n&1){let e=x();_(0,"sh-select",52)(1,"label",30),g(2,nn,2,0,"sup",53),p(3),g(4,on,2,1,"sh-icon",32),d(),_(5,"input",33),N("ngModelChange",function(o){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()(),G(6,an,1,2,"ng-template",null,3,q)}if(n&2){let e=B(7);s();let i=c(0),o=s().$implicit,a=c(1),r=c(2),C=c(4),E=c(5);m("options",i)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),l(),m("for",E),l(),f(o.formView.isMandatory&&C?2:-1),l(),A(" ",a," "),l(),f(o.formView.longDescription?4:-1),l(),m("id",E)("ngModel",r)}}function ln(n,t){n&1&&ie(0,"sh-progress-bar",51)}function sn(n,t){if(n&1&&(L(0),g(1,rn,8,10)(2,ln,1,0,"sh-progress-bar",51)),n&2){let e=s().$implicit,i=c(2),o=O(s(2).mapOptionsWithFreeText(e.formView,i));l(),f(o?1:2)}}function _n(n,t){n&1&&(_(0,"sup",55),p(1,"*"),d())}function dn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function cn(n,t){if(n&1){let e=x();_(0,"app-size",54),N("ngModelChange",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),_(1,"label",30),g(2,_n,2,0,"sup",55),p(3),g(4,dn,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(4),r=c(5);m("inputType",e.Name)("ngModel",o)("customId",r),l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1)}}function pn(n,t){n&1&&(_(0,"sup",56),p(1,"*"),d())}function mn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Cn(n,t){if(n&1){let e=x();_(0,"sh-form-field")(1,"label",30),g(2,pn,2,0,"sup",56),p(3),g(4,mn,2,1,"sh-icon",32),d(),_(5,"input",57),N("ngModelChange",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d(),_(6,"sh-icon",41),p(7,"numpad"),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(4),r=c(5);l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",r)("ngModel",o)}}function un(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function gn(n,t){if(n&1){let e=x();_(0,"sh-toggle",58),N("click",function(){T(e);let o=s().$implicit,a=c(2),r=s(2);return S(r.updateFieldValue(o.fieldGroup,o.formView.name,r.isTrue(a)?"false":"true"))}),_(1,"label",30),p(2),g(3,un,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(5),r=s(2);re("active",r.isTrue(o)),l(),m("for",a),l(),A(" ",i," "),l(),f(e.formView.longDescription?3:-1)}}function fn(n,t){n&1&&(_(0,"sup",60),p(1,"*"),d())}function Tn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function Sn(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;le(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function hn(n,t){if(n&1){let e=x();_(0,"sh-select",59)(1,"label",30),g(2,fn,2,0,"sup",60),p(3),g(4,Tn,2,1,"sh-icon",32),d(),_(5,"input",61),N("ngModelChange",function(o){T(e);let a=s(2).$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()(),G(6,Sn,1,2,"ng-template",null,4,q)}if(n&2){let e=B(7);s();let i=c(0),o=s().$implicit,a=c(1),r=c(2),C=c(4),E=c(5);m("options",i)("selectMultiple",!0)("optionTemplate",e),l(),m("for",E),l(),f(o.formView.isMandatory&&C?2:-1),l(),A(" ",a," "),l(),f(o.formView.longDescription?4:-1),l(),m("ngModel",r)}}function Nn(n,t){if(n&1&&(L(0),g(1,hn,8,8)),n&2){let e=s().$implicit,i=O(s(2).mapOptions(e.formView));l(),f(i?1:-1)}}function xn(n,t){n&1&&(_(0,"sup",62),p(1,"*"),d())}function En(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function In(n,t){if(n&1){let e=x();_(0,"app-timespan",54),N("ngModelChange",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),_(1,"label",30),g(2,xn,2,0,"sup",62),p(3),g(4,En,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(4),r=c(5);m("inputType",e.formView.name)("ngModel",o)("customId",r),l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1)}}function yn(n,t){n&1&&(_(0,"sup",64),p(1,"*"),d())}function Dn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function wn(n,t){if(n&1){let e=x();_(0,"app-file-drop-textarea",63),N("ngModelChange",function(o){T(e);let a=s().$implicit,r=s(2);return S(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),_(1,"label"),g(2,yn,2,0,"sup",64),p(3),g(4,Dn,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,i=c(2),o=c(4),a=c(5);m("ngModel",i)("customId",a)("placeholder",e.formView.longDescription),l(2),f(e.formView.isMandatory&&o?2:-1),l(),A(" ",e.formView.shortDescription??e.formView.name," "),l(),f(e.formView.longDescription?4:-1)}}function On(n,t){if(n&1){let e=x();_(0,"button",65),N("click",function(){T(e);let o=s().$implicit,a=s(2);return S(a.removeAdvancedOption(o.formView.name))}),_(1,"sh-icon"),p(2,"x-circle"),d()()}}function An(n,t){if(n&1&&(_(0,"div",23),L(1)(2)(3)(4)(5),g(6,At,6,12,"app-file-tree",24)(7,Ft,6,9,"app-file-tree",25)(8,Kt,16,13,"sh-form-field")(9,Wt,10,9,"sh-form-field")(10,tn,2,2)(11,sn,3,2)(12,cn,5,7,"app-size",26)(13,Cn,8,6,"sh-form-field")(14,gn,4,5,"sh-toggle",27)(15,Nn,2,2)(16,In,5,7,"app-timespan",26)(17,wn,5,6,"app-file-drop-textarea",28),g(18,On,3,0,"button",29),d()),n&2){let e=t.$implicit;s();let i=c(0),o=s();re("single-field",e.fieldGroup!=="advanced"),l(),O(e.formView.shortDescription??e.formView.name),l(),O(o.getFieldGroup(i,e.fieldGroup)[e.formView.name]),l();let a=O(o.getFieldValue(e.fieldGroup,e.formView.name));l(),O((a??"").toString().trim()===""),l(),O("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),l(),f(e.formView.type==="FileTree"?6:e.formView.type==="FolderTree"?7:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"||e.formView.type==="Hostname"||e.formView.type==="Bucketname"?8:e.formView.type==="Password"?9:e.formView.type==="Enumeration"?10:e.formView.type==="NonValidatedSelectableString"?11:e.formView.type==="Size"?12:e.formView.type==="Integer"?13:e.formView.type==="Boolean"?14:e.formView.type==="Flags"?15:e.formView.type==="Timespan"||e.formView.type==="DateTime"?16:e.formView.type==="FreeText"?17:-1),l(12),f(e.fieldGroup==="advanced"?18:-1)}}function Mn(n,t){if(n&1&&(L(0),X(1,ft,1,9,"ng-container",null,J),X(3,St,1,9,"ng-container",null,J),_(5,"sh-toggle-card",8),oe(6,9)(7),De(8,5),j(),L(9),g(10,ht,3,0,"button",10)(11,xt,17,2,"div",11),j(),g(12,Et,1,3,"textarea",12)(13,Dt,2,0),d(),G(14,An,19,9,"ng-template",null,0,q)),n&2){let e=s(),i=c(1);O(e.destinationForm()),l(),H(i.custom),l(2),H(i.dynamic),l(2),m("disallowToggle",!0),l(4),O(e.nonSelectedAdvancedFormViews()),l(),f(e.showTextArea()?10:11),l(2),f(e.showTextArea()?12:13)}}var rt=class n{#t=V(it);#e=V(z);#n=V(Qe);#a=V(ge);injector=V(ye);targetUrl=be.required();useBackupState=Q(!1);#i=null;destinationType=P(()=>{let t=this.targetUrl();if(!t)return null;let e=K(t.split("://")[0]);return this.#i=e?.customKey??e?.key,this.#i});destinationForm=b({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=P(()=>Object.keys(this.destinationForm().advanced));destinationFormConfig=b(null);showTextArea=b(!1);nonSelectedAdvancedFormViews=P(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(i=>e.findIndex(o=>o===i.name)===-1)});destinationTypeEffect=W(()=>{let t=this.destinationType()??"",e=K(t),i=e?.key,o=this.#a.backendModules().find(I=>I.Key===i)??{Key:t,DisplayName:t,Description:K(t).description,Options:[]};if(!o||!o.Options||!t)return;let a=e&&e.oauthField?e.oauthField:null,r=e&&e.customFields?e.customFields:{},C=e&&e.dynamicFields?e.dynamicFields:[],E=e&&e.advancedFields?e.advancedFields:[],F=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],w={destinationType:t,oauthField:a,custom:[],dynamic:[],advanced:[]};r&&Object.entries(r).forEach(([I,u],y)=>{let D=u.order??y;w.custom.push(M({order:900+D},u))});for(let I=0;I<o.Options.length;I++){let u=o.Options[I];if(u.Deprecated)continue;let y=C.find(D=>D===u.Name||u.Aliases?.includes(D.name)||D.name===u.Name);if(y){let D=u.Aliases?.indexOf(y.name)??-1,$=u.Aliases&&D>-1?u.Aliases[D]:u.Name,h=y&&typeof y!="string",Te=h?y?.defaultValue??u.DefaultValue:u.DefaultValue,Se=h&&y?.order!==void 0?y.order:I,U={name:$,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,order:900+Se},he=h?M(M({},U),y):U;w.dynamic.push(he)}else{let D=u.Name;if(F.find(Z=>Z===D))continue;let h=E.find(Z=>Z===D||Z.name===D),Te=h&&typeof h!="string",Se=Te&&h?.order!==void 0?h.order:I,U={name:D,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,defaultValue:u.DefaultValue,order:900+Se},he=Te?M(M({},U),h):U;w.advanced.push(he)}}w.custom.sort((I,u)=>I.order-u.order),w.dynamic.sort((I,u)=>I.order-u.order),w.advanced.sort((I,u)=>I.order-u.order),this.destinationFormConfig.set(w);let k=this.targetUrl();if(!k)return;let v=Ye(k);v&&this.destinationForm.set({custom:v.custom,dynamic:v.dynamic,advanced:v.advanced})});destinationFormEffect=W(()=>{let t=this.#i,e=this.destinationForm();if(!e||!t)return;let i=Ze({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});i&&this.targetUrl.set(i)});getFieldValue(t,e){let o=this.destinationForm()[t][e];return o||null}getFormView(t,e){let o=this.destinationFormConfig()?.[t].find(a=>a.name===e);return o||null}getDefaultFormView(t){return{name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??!1}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(M({},e))}isValidBucketname(t){if(!t)return!1;let e=t.length;return!(e<3||e>63||!/^[a-z0-9.-]+$/.test(t)||!/^[a-z0-9]/.test(t)||!/[a-z0-9]$/.test(t)||/^\d{1,3}(\.\d{1,3}){3}$/.test(t)||/(\.\.)|(\.-)|(-\.)/.test(t))}isValidHostname(t){if(!t||t.length>253)return!1;let e=t.split(".");for(let i of e)if(!i||i.length>63||!/^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$/.test(i))return!1;return!0}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}onKeyDown(t,e,i,o){if(i==="Hostname"||i==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(o.key))return;if(o.key=="/"||o.key=="\\"||o.key==":"){o.preventDefault();return}}}updateFieldValue(t,e,i){let o=this.destinationForm();o[t][e]=i,this.destinationForm.set(M({},o))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(M({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let i=t.options;return i?i.map(o=>({key:o,value:o})):null}mapOptionsWithFreeText(t,e){let i=this.mapOptions(t);return i?(e&&e.length>0&&(i.find(a=>a.value===e)||i.push({key:e,value:e})),i):null}#o=b(!1);oauthStartTokenCreation(t,e,i,o){this.#o.set(!0);let a=(o??1)==2?this.#e.defaultOAuthUrlV2():this.#e.defaultOAuthUrl(),r=this.#n.serverSettings()?.["--oauth-url"];if(r&&r.length>0&&(a=r),this.useBackupState()){let u=this.#t.mapFormsToSettings().find(y=>y.Name==="--oauth-url")?.Value;u&&u.length>0&&(a=u)}let C=this.destinationForm().advanced["oauth-url"];C&&C.length>0&&(a=C);let E=`${a}?type=${t}`,F=450,w=600,k=screen.width/2-F/2,v=screen.height/2-w/2,I=window.open(E,"_blank","height="+w+",width="+F+",menubar=0,status=0,titlebar=0,toolbar=0,left="+k+",top="+v);return window.addEventListener("message",u=>{let y=u.data.startsWith("authid:"),D=y?u.data.replace("authid:",""):null;y&&(this.destinationForm.update($=>($[e][i]=D,$)),this.#o.set(!1),I?.close())}),!1}settingsAsText=P(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,i])=>{let o=e??"",a="";return typeof i=="boolean"?a=this.isTrue(i)?"True":"False":(typeof i=="number"||i!=null)&&(a=i.toString()),`${o}=${a}`}).join(`
7
- `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=et(t);this.destinationForm.update(i=>Y(M({},i),{advanced:e}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ne({type:n,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let i;i=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let r;r=$localize`This field is mandatory`;let C;C=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let E;E=$localize`Hostname is invalid`;let F;F=$localize`Bucket name is invalid`;let w;w=$localize`This field is mandatory`;let k;k=$localize`This field is mandatory`;let v;v=$localize`This field is mandatory`;let I;I=$localize`This field is mandatory`;let u;u=$localize`This field is mandatory`;let y;y=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let $;return $=$localize`This field is mandatory`,[["fieldTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],t,e,i,[1,"advanced-options",3,"disallowToggle"],["title",""],["shButton","","type","button",1,"outlined","small"],[1,"actions"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["shButton","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["type","button",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"field-row"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","enableCreateFolder","startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised",3,"active"],[3,"ngModel","customId","placeholder"],["shButton","","type","button",1,"outlined"],[3,"for"],["shTooltip",o],[1,"primary",3,"shTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["shTooltip",a],["shTooltip",r],["shTooltip",C,1,"warn"],["shTooltip",E,1,"error"],["shTooltip",F,1,"warn"],[3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["prefix","",3,"shTooltip"],["shTooltip",w],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["shTooltip",k],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",v],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",I],["shTooltip",u],["type","number",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"click"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",y],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",$],["shButton","","type","button",1,"outlined",3,"click"]]},template:function(e,i){if(e&1&&(L(0)(1),g(2,Mn,16,5)),e&2){let o=O(i.destinationType());l();let a=O(i.destinationFormConfig());l(),f(o&&a?2:-1)}},dependencies:[Be,de,ke,ce,me,pe,Ge,tt,nt,ot,fe,Ke,ue,Ce,He,Ue,Xe,qe,je,Je],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.advanced-options[_ngcontent-%COMP%]{position:relative;z-index:1}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{at as a,ge as b,rt as c};
6
+ with the REPORTED host key: ${o}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,i,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),t.complete()}}):this.#e.open(R,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(t,e,i,$localize`The host key was not approved.`);return}t.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),t.complete()}})}handleGenericError(t,e,i,o,a){function r(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i,errorMessage:o}),t.complete()}if(a){r();return}this.#e.open(R,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:u=>r()})}handleDestinationErrorv1(t,e,i,o,a){return new ee(r=>{if(t==="missing-folder"){o?this.handleMissingFolder(r,e,i):this.handleGenericError(r,e,i,$localize`The remote destination folder does not exist.`,a);return}if(t.startsWith("incorrect-cert:")){let u=t.split("incorrect-cert:")[1];this.handleMissingCertificate(r,e,i,u);return}if(t.startsWith("incorrect-host-key:")){let u=t.split('incorrect-host-key:"')[1].split('",')[0],T=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(r,e,i,u,T);return}this.handleGenericError(r,e,i,t,a)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})};var ge=class n{#t=V(z);supportedDestinationTypes=P(()=>this.#t.backendModules().map(t=>{if(!t?.Key)return null;let e=K(t.Key);return e.isDefaultEntry===!0?Y(M({},e),{displayName:t.DisplayName||e.displayName||t.Key,description:t.Description||e.description||""}):e}).filter(t=>t!==null));destinationTypeOptions=P(()=>this.supportedDestinationTypes().map(t=>({key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description,icon:t.icon,searchTerms:[t.displayName,t.description,t.key,t.searchTerms??"",t.customKey??""].join(" "),sortOrder:t.sortOrder??0})));backendModules=P(()=>this.#t.backendModules()??[]);static \u0275fac=function(e){return new(e||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})};var _t=["fileInput"],dt=[[["label"]]],ct=["label"],fe=class n{customId=Q();content=b("");readonly=b(!1);placeholder=Q("Drop a file here or use the browse button");fileInputRef=$e("fileInput");onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0])}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0])}onDragOver(t){t.preventDefault()}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result)},e.readAsText(t)}triggerBrowse(){return this.fileInputRef()?.nativeElement.click(),!1}onChange=()=>{};onTouched=()=>{};onChangeEffect=W(()=>{this.onChange(this.content())});writeValue(t){this.content.set(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ne({type:n,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,i){e&1&&Ae(i.fileInputRef,_t,5),e&2&&Me()},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Le([{provide:Re,useExisting:n,multi:!0}])],ngContentSelectors:ct,decls:9,vars:3,consts:[["fileInput",""],[1,"browse-btn"],["shButton","","type","button",1,"small","outlined",3,"click"],[1,"textarea-container","textarea-wrap",3,"drop","dragover"],["rows","10",3,"ngModelChange","placeholder","ngModel","disabled"],["type","file",1,"hidden",3,"change"]],template:function(e,i){if(e&1){let o=E();we(dt),Oe(0,0,["ngProjectAs","label",5,["label"]]),_(1,"div",1)(2,"button",2),x("click",function(){return S(o),h(i.triggerBrowse())}),_(3,"sh-icon"),p(4,"upload"),d()()(),_(5,"div",3),x("drop",function(r){return S(o),h(i.onFileDrop(r))})("dragover",function(r){return S(o),h(i.onDragOver(r))}),_(6,"textarea",4),ve("ngModelChange",function(r){return S(o),Fe(i.content,r)||(i.content=r),h(r)}),d()(),_(7,"input",5,0),x("change",function(r){return S(o),h(i.onFileSelected(r))}),d()}e&2&&(l(6),m("placeholder",i.placeholder()),Ve("ngModel",i.content),m("disabled",i.readonly()))},dependencies:[me,de,ce,pe,ue,Ce],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var pt=(n,t,e,i)=>({index:n,fieldGroup:"custom",formView:t,destinationType:e,oauthField:i}),Ie=n=>({$implicit:n}),mt=(n,t,e,i)=>({index:n,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:i}),ut=()=>({updateOn:"blur"}),Ct=(n,t,e,i)=>({index:n,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:i});function gt(n,t){n&1&&ae(0)}function ft(n,t){if(n&1&&G(0,gt,1,0,"ng-container",13),n&2){let e=t.$implicit,i=t.$index;s();let o=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,Ie,_e(2,pt,i,e,a,r.oauthField)))}}function Tt(n,t){n&1&&ae(0)}function St(n,t){if(n&1&&G(0,Tt,1,0,"ng-container",13),n&2){let e=t.$implicit,i=t.$index;s();let o=B(15);s();let a=c(0),r=c(1);m("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,Ie,_e(2,mt,i,e,a,r.oauthField)))}}function ht(n,t){if(n&1){let e=E();_(0,"button",14),x("click",function(){S(e);let o=s(2);return h(o.showTextArea.set(!1))}),Ne(1,6),ie(2,"sh-icon"),xe(),d()}}function Nt(n,t){if(n&1){let e=E();_(0,"button",21,1),x("click",function(){let o=S(e).$implicit,a=s(3);return h(a.addAdvancedOption(o))}),p(2),d()}if(n&2){let e=t.$implicit;l(2),A(" ",e.name," ")}}function xt(n,t){if(n&1){let e=E();_(0,"div",11)(1,"sh-menu",15)(2,"button",16),Ne(3,7),ie(4,"sh-icon"),xe(),d(),oe(5,17),X(6,Nt,3,1,"button",18,J),j(),d(),_(8,"sh-menu")(9,"button",19)(10,"sh-icon"),p(11,"dots-three-vertical"),d()(),oe(12,17),_(13,"button",20),x("click",function(){S(e);let o=s(2);return h(o.showTextArea.set(!0))}),_(14,"sh-icon"),p(15,"link"),d(),p(16," Edit contents as text "),d(),j(),d()()}if(n&2){s();let e=c(9);l(),m("searchable",!0),l(),m("disabled",e.length===0),l(4),H(e)}}function Et(n,t){if(n&1){let e=E();_(0,"textarea",22),x("ngModelChange",function(o){S(e);let a=s(2);return h(a.updateSettingsFromText(o))}),d()}if(n&2){let e=s(2);m("ngModel",e.settingsAsText())("ngModelOptions",Pe(2,ut))}}function It(n,t){n&1&&ae(0)}function yt(n,t){if(n&1&&G(0,It,1,0,"ng-container",13),n&2){let e=t.$implicit,i=t.$index;s(2);let o=B(15),a=s(),r=c(0),u=c(1),T=a.getFormView("advanced",e)??a.getDefaultFormView(e);m("ngTemplateOutlet",o)("ngTemplateOutletContext",se(7,Ie,_e(2,Ct,i,T,r,u.oauthField)))}}function Dt(n,t){if(n&1&&X(0,yt,1,9,"ng-container",null,J),n&2){let e=s(2);H(e.advancedFormFieldNames())}}function wt(n,t){n&1&&(_(0,"sup",31),p(1,"*"),d())}function Ot(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function At(n,t){if(n&1){let e=E();_(0,"app-file-tree",24)(1,"label",30),g(2,wt,2,0,"sup",31),p(3),g(4,Ot,2,1,"sh-icon",32),d(),_(5,"input",33),x("ngModelChange",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(3),r=c(4),u=c(5);m("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),m("for",u),l(),f(e.formView.isMandatory&&r?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",u)("ngModel",o)}}function Mt(n,t){n&1&&(_(0,"sup",34),p(1,"*"),d())}function Vt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Ft(n,t){if(n&1){let e=E();_(0,"app-file-tree",25)(1,"label",30),g(2,Mt,2,0,"sup",34),p(3),g(4,Vt,2,1,"sh-icon",32),d(),_(5,"input",33),x("ngModelChange",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(3),r=c(4),u=c(5);m("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a),l(),m("for",u),l(),f(e.formView.isMandatory&&r?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",u)("ngModel",o)}}function vt(n,t){n&1&&(_(0,"sup",35),p(1,"*"),d())}function Lt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Pt(n,t){n&1&&(_(0,"sh-icon",36),p(1," warning "),d())}function $t(n,t){n&1&&(_(0,"sh-icon",37),p(1,"x-circle"),d())}function bt(n,t){n&1&&(_(0,"sh-icon",38),p(1,"warning"),d())}function Gt(n,t){if(n&1&&(_(0,"sh-icon",42),p(1," link "),d()),n&2){s();let e=c(9),i=c(10);re("error",e&&i==="error")("warn",e&&i==="warning"),m("shTooltip",e)}}function Rt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"envelope"),d())}function kt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"hard-drives"),d())}function Bt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"jar"),d())}function zt(n,t){n&1&&(_(0,"sh-icon",41),p(1,"textbox"),d())}function Kt(n,t){if(n&1){let e=E();_(0,"sh-form-field")(1,"label",30),g(2,vt,2,0,"sup",35),p(3),g(4,Lt,2,1,"sh-icon",32),g(5,Pt,2,0,"sh-icon",36),g(6,$t,2,0,"sh-icon",37),g(7,bt,2,0,"sh-icon",38),d(),_(8,"input",39),x("keydown",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d(),L(9)(10),g(11,Gt,2,5,"sh-icon",40)(12,Rt,2,0,"sh-icon",41)(13,kt,2,0,"sh-icon",41)(14,Bt,2,0,"sh-icon",41)(15,zt,2,0,"sh-icon",41),d()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(3),r=c(4),u=c(5),T=s(2);l(),m("for",u),l(),f(e.formView.isMandatory&&r?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),f(r&&e.formView.type==="Path"?5:-1),l(),f(e.formView.type=="Hostname"&&!r&&!T.isValidHostname(a)?6:-1),l(),f(e.formView.type=="Bucketname"&&!r&&!T.isValidBucketname(a)?7:-1),l(),m("type",e.formView.type==="Email"?"email":"text")("id",u)("ngModel",o);let F=a,w=T.hasLeadingSlash(F??"");l(),O(w&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),l(),O(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),l(),f(e.formView.type==="Path"?11:e.formView.type==="Email"?12:e.formView.type==="Hostname"?13:e.formView.type==="Bucketname"?14:15)}}function Ut(n,t){n&1&&(_(0,"sup",43),p(1,"*"),d())}function Jt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function Xt(n,t){if(n&1){let e=E();_(0,"span",47),x("click",function(){S(e);let o=s(2).$implicit,a=s(2);return h(a.oauthStartTokenCreation(o.destinationType,o.fieldGroup,o.formView.name,o.formView.oauthVersion))}),p(1," AuthID "),d()}}function Ht(n,t){n&1&&(_(0,"sh-icon",41),p(1,"password"),d())}function jt(n,t){if(n&1){let e=E();_(0,"sh-icon",48),x("click",function(){S(e);let o=s(2).$implicit;return h(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye "),d()}}function qt(n,t){if(n&1){let e=E();_(0,"sh-icon",48),x("click",function(){S(e);let o=s(2).$implicit;return h(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye-slash "),d()}}function Wt(n,t){if(n&1){let e=E();_(0,"sh-form-field")(1,"label",30),g(2,Ut,2,0,"sup",43),p(3),g(4,Jt,2,1,"sh-icon",32),d(),_(5,"input",44),x("ngModelChange",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d(),g(6,Xt,2,0,"span",45)(7,Ht,2,0,"sh-icon",41),g(8,jt,2,0,"sh-icon",46)(9,qt,2,0,"sh-icon",46),d()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(4),r=c(5);l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),m("type",e.formView.showPassword?"text":"password")("id",r)("ngModel",o),l(),f(e.oauthField===e.formView.name?6:7),l(2),f(e.formView.showPassword?8:9)}}function Qt(n,t){n&1&&(_(0,"sup",50),p(1,"*"),d())}function Zt(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function Yt(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;le(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function en(n,t){if(n&1){let e=E();_(0,"sh-select",49)(1,"label",30),g(2,Qt,2,0,"sup",50),p(3),g(4,Zt,2,1,"sh-icon",32),d(),_(5,"input",33),x("ngModelChange",function(o){S(e);let a=s(2).$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()(),G(6,Yt,1,2,"ng-template",null,2,q)}if(n&2){let e=B(7);s();let i=c(0),o=s().$implicit,a=c(1),r=c(2),u=c(4),T=c(5);m("options",i)("isClearable",!1)("optionTemplate",e),l(),m("for",T),l(),f(o.formView.isMandatory&&u?2:-1),l(),A(" ",a," "),l(),f(o.formView.longDescription?4:-1),l(),m("id",T)("ngModel",r)}}function tn(n,t){if(n&1&&(L(0),g(1,en,8,9)),n&2){let e=s().$implicit,i=O(s(2).mapOptions(e.formView));l(),f(i?1:-1)}}function nn(n,t){n&1&&(_(0,"sup",53),p(1,"*"),d())}function on(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function an(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;le(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function rn(n,t){if(n&1){let e=E();_(0,"sh-select",52)(1,"label",30),g(2,nn,2,0,"sup",53),p(3),g(4,on,2,1,"sh-icon",32),d(),_(5,"input",33),x("ngModelChange",function(o){S(e);let a=s(2).$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()(),G(6,an,1,2,"ng-template",null,3,q)}if(n&2){let e=B(7);s();let i=c(0),o=s().$implicit,a=c(1),r=c(2),u=c(4),T=c(5);m("options",i)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),l(),m("for",T),l(),f(o.formView.isMandatory&&u?2:-1),l(),A(" ",a," "),l(),f(o.formView.longDescription?4:-1),l(),m("id",T)("ngModel",r)}}function ln(n,t){n&1&&ie(0,"sh-progress-bar",51)}function sn(n,t){if(n&1&&(L(0),g(1,rn,8,10)(2,ln,1,0,"sh-progress-bar",51)),n&2){let e=s().$implicit,i=c(2),o=O(s(2).mapOptionsWithFreeText(e.formView,i));l(),f(o?1:2)}}function _n(n,t){n&1&&(_(0,"sup",55),p(1,"*"),d())}function dn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function cn(n,t){if(n&1){let e=E();_(0,"app-size",54),x("ngModelChange",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),_(1,"label",30),g(2,_n,2,0,"sup",55),p(3),g(4,dn,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(4),r=c(5);m("inputType",e.Name)("ngModel",o)("customId",r),l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1)}}function pn(n,t){n&1&&(_(0,"sup",56),p(1,"*"),d())}function mn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function un(n,t){if(n&1){let e=E();_(0,"sh-form-field")(1,"label",30),g(2,pn,2,0,"sup",56),p(3),g(4,mn,2,1,"sh-icon",32),d(),_(5,"input",57),x("ngModelChange",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d(),_(6,"sh-icon",41),p(7,"numpad"),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(4),r=c(5);l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1),l(),m("id",r)("ngModel",o)}}function Cn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function gn(n,t){if(n&1){let e=E();_(0,"sh-toggle",58),x("click",function(){S(e);let o=s().$implicit,a=c(2),r=s(2);return h(r.updateFieldValue(o.fieldGroup,o.formView.name,r.isTrue(a)?"false":"true"))}),_(1,"label",30),p(2),g(3,Cn,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(5),r=s(2);re("active",r.isTrue(o)),l(),m("for",a),l(),A(" ",i," "),l(),f(e.formView.longDescription?3:-1)}}function fn(n,t){n&1&&(_(0,"sup",60),p(1,"*"),d())}function Tn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(3).$implicit;m("shTooltip",e.formView.longDescription)}}function Sn(n,t){if(n&1&&p(0),n&2){let e=t.$implicit;le(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function hn(n,t){if(n&1){let e=E();_(0,"sh-select",59)(1,"label",30),g(2,fn,2,0,"sup",60),p(3),g(4,Tn,2,1,"sh-icon",32),d(),_(5,"input",61),x("ngModelChange",function(o){S(e);let a=s(2).$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),d()(),G(6,Sn,1,2,"ng-template",null,4,q)}if(n&2){let e=B(7);s();let i=c(0),o=s().$implicit,a=c(1),r=c(2),u=c(4),T=c(5);m("options",i)("selectMultiple",!0)("optionTemplate",e),l(),m("for",T),l(),f(o.formView.isMandatory&&u?2:-1),l(),A(" ",a," "),l(),f(o.formView.longDescription?4:-1),l(),m("ngModel",r)}}function Nn(n,t){if(n&1&&(L(0),g(1,hn,8,8)),n&2){let e=s().$implicit,i=O(s(2).mapOptions(e.formView));l(),f(i?1:-1)}}function xn(n,t){n&1&&(_(0,"sup",62),p(1,"*"),d())}function En(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function In(n,t){if(n&1){let e=E();_(0,"app-timespan",54),x("ngModelChange",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),_(1,"label",30),g(2,xn,2,0,"sup",62),p(3),g(4,En,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,i=c(1),o=c(2),a=c(4),r=c(5);m("inputType",e.formView.name)("ngModel",o)("customId",r),l(),m("for",r),l(),f(e.formView.isMandatory&&a?2:-1),l(),A(" ",i," "),l(),f(e.formView.longDescription?4:-1)}}function yn(n,t){n&1&&(_(0,"sup",64),p(1,"*"),d())}function Dn(n,t){if(n&1&&(_(0,"sh-icon",32),p(1,"question"),d()),n&2){let e=s(2).$implicit;m("shTooltip",e.formView.longDescription)}}function wn(n,t){if(n&1){let e=E();_(0,"app-file-drop-textarea",63),x("ngModelChange",function(o){S(e);let a=s().$implicit,r=s(2);return h(r.updateFieldValue(a.fieldGroup,a.formView.name,o))}),_(1,"label"),g(2,yn,2,0,"sup",64),p(3),g(4,Dn,2,1,"sh-icon",32),d()()}if(n&2){let e=s().$implicit,i=c(2),o=c(4),a=c(5);m("ngModel",i)("customId",a)("placeholder",e.formView.longDescription),l(2),f(e.formView.isMandatory&&o?2:-1),l(),A(" ",e.formView.shortDescription??e.formView.name," "),l(),f(e.formView.longDescription?4:-1)}}function On(n,t){if(n&1){let e=E();_(0,"button",65),x("click",function(){S(e);let o=s().$implicit,a=s(2);return h(a.removeAdvancedOption(o.formView.name))}),_(1,"sh-icon"),p(2,"x-circle"),d()()}}function An(n,t){if(n&1&&(_(0,"div",23),L(1)(2)(3)(4)(5),g(6,At,6,12,"app-file-tree",24)(7,Ft,6,9,"app-file-tree",25)(8,Kt,16,13,"sh-form-field")(9,Wt,10,9,"sh-form-field")(10,tn,2,2)(11,sn,3,2)(12,cn,5,7,"app-size",26)(13,un,8,6,"sh-form-field")(14,gn,4,5,"sh-toggle",27)(15,Nn,2,2)(16,In,5,7,"app-timespan",26)(17,wn,5,6,"app-file-drop-textarea",28),g(18,On,3,0,"button",29),d()),n&2){let e=t.$implicit;s();let i=c(0),o=s();re("single-field",e.fieldGroup!=="advanced"),l(),O(e.formView.shortDescription??e.formView.name),l(),O(o.getFieldGroup(i,e.fieldGroup)[e.formView.name]),l();let a=O(o.getFieldValue(e.fieldGroup,e.formView.name));l(),O((a??"").toString().trim()===""),l(),O("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),l(),f(e.formView.type==="FileTree"?6:e.formView.type==="FolderTree"?7:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"||e.formView.type==="Hostname"||e.formView.type==="Bucketname"?8:e.formView.type==="Password"?9:e.formView.type==="Enumeration"?10:e.formView.type==="NonValidatedSelectableString"?11:e.formView.type==="Size"?12:e.formView.type==="Integer"?13:e.formView.type==="Boolean"?14:e.formView.type==="Flags"?15:e.formView.type==="Timespan"||e.formView.type==="DateTime"?16:e.formView.type==="FreeText"?17:-1),l(12),f(e.fieldGroup==="advanced"?18:-1)}}function Mn(n,t){if(n&1&&(L(0),X(1,ft,1,9,"ng-container",null,J),X(3,St,1,9,"ng-container",null,J),_(5,"sh-toggle-card",8),oe(6,9)(7),De(8,5),j(),L(9),g(10,ht,3,0,"button",10)(11,xt,17,2,"div",11),j(),g(12,Et,1,3,"textarea",12)(13,Dt,2,0),d(),G(14,An,19,9,"ng-template",null,0,q)),n&2){let e=s(),i=c(1);O(e.destinationForm()),l(),H(i.custom),l(2),H(i.dynamic),l(2),m("disallowToggle",!0),l(4),O(e.nonSelectedAdvancedFormViews()),l(),f(e.showTextArea()?10:11),l(2),f(e.showTextArea()?12:13)}}var rt=class n{#t=V(it);#e=V(z);#n=V(Qe);#a=V(ge);injector=V(ye);targetUrl=be.required();useBackupState=Q(!1);#i=null;destinationType=P(()=>{let t=this.targetUrl();if(!t)return null;let e=K(t.split("://")[0]);return this.#i=e?.customKey??e?.key,this.#i});destinationForm=b({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=P(()=>Object.keys(this.destinationForm().advanced));destinationFormConfig=b(null);showTextArea=b(!1);nonSelectedAdvancedFormViews=P(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(i=>e.findIndex(o=>o===i.name)===-1)});destinationTypeEffect=W(()=>{let t=this.destinationType()??"",e=K(t),i=e?.key,o=this.#a.backendModules().find(I=>I.Key===i)??{Key:t,DisplayName:t,Description:K(t).description,Options:[]};if(!o||!o.Options||!t)return;let a=e&&e.oauthField?e.oauthField:null,r=e&&e.customFields?e.customFields:{},u=e&&e.dynamicFields?e.dynamicFields:[],T=e&&e.advancedFields?e.advancedFields:[],F=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],w={destinationType:t,oauthField:a,custom:[],dynamic:[],advanced:[]};r&&Object.entries(r).forEach(([I,C],y)=>{let D=C.order??y;w.custom.push(M({order:900+D},C))});for(let I=0;I<o.Options.length;I++){let C=o.Options[I];if(C.Deprecated)continue;let y=u.find(D=>D===C.Name||C.Aliases?.includes(D.name)||D.name===C.Name);if(y){let D=C.Aliases?.indexOf(y.name)??-1,$=C.Aliases&&D>-1?C.Aliases[D]:C.Name,N=y&&typeof y!="string",Te=N?y?.defaultValue??C.DefaultValue:C.DefaultValue,Se=N&&y?.order!==void 0?y.order:I,U={name:$,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,order:900+Se},he=N?M(M({},U),y):U;w.dynamic.push(he)}else{let D=C.Name;if(F.find(Z=>Z===D))continue;let N=T.find(Z=>Z===D||Z.name===D),Te=N&&typeof N!="string",Se=Te&&N?.order!==void 0?N.order:I,U={name:D,type:C.Type,shortDescription:C.ShortDescription??void 0,longDescription:C.LongDescription??void 0,options:C.ValidValues,defaultValue:C.DefaultValue,order:900+Se},he=Te?M(M({},U),N):U;w.advanced.push(he)}}w.custom.sort((I,C)=>I.order-C.order),w.dynamic.sort((I,C)=>I.order-C.order),w.advanced.sort((I,C)=>I.order-C.order),this.destinationFormConfig.set(w);let k=this.targetUrl();if(!k)return;let v=Ye(k);v&&this.destinationForm.set({custom:v.custom,dynamic:v.dynamic,advanced:v.advanced})});destinationFormEffect=W(()=>{let t=this.#i,e=this.destinationForm();if(!e||!t)return;let i=Ze({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});i&&this.targetUrl.set(i)});getFieldValue(t,e){let o=this.destinationForm()[t][e];return o||null}getFormView(t,e){let o=this.destinationFormConfig()?.[t].find(a=>a.name===e);return o||null}getDefaultFormView(t){return{name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??!1}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(M({},e))}isValidBucketname(t){if(!t)return!1;let e=t.length;return!(e<3||e>63||!/^[a-z0-9.-]+$/.test(t)||!/^[a-z0-9]/.test(t)||!/[a-z0-9]$/.test(t)||/^\d{1,3}(\.\d{1,3}){3}$/.test(t)||/(\.\.)|(\.-)|(-\.)/.test(t))}isValidHostname(t){if(!t||t.length>253)return!1;let e=t.split(".");for(let i of e)if(!i||i.length>63||!/^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$/.test(i))return!1;return!0}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}onKeyDown(t,e,i,o){if(i==="Hostname"||i==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(o.key))return;if(o.key=="/"||o.key=="\\"||o.key==":"){o.preventDefault();return}}}updateFieldValue(t,e,i){let o=this.destinationForm();o[t][e]=i,this.destinationForm.set(M({},o))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(M({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let i=t.options;return i?i.map(o=>({key:o,value:o})):null}mapOptionsWithFreeText(t,e){let i=this.mapOptions(t);return i?(e&&e.length>0&&(i.find(a=>a.value===e)||i.push({key:e,value:e})),i):null}#o=b(!1);oauthStartTokenCreation(t,e,i,o){this.#o.set(!0);let a=(o??1)==2?this.#e.defaultOAuthUrlV2():this.#e.defaultOAuthUrl(),r=this.#n.serverSettings()?.["--oauth-url"];if(r&&r.length>0&&(a=r),this.useBackupState()){let C=this.#t.mapFormsToSettings().find(y=>y.Name==="--oauth-url")?.Value;C&&C.length>0&&(a=C)}let u=this.destinationForm().advanced["oauth-url"];u&&u.length>0&&(a=u);let T=`${a}?type=${t}`,F=450,w=600,k=screen.width/2-F/2,v=screen.height/2-w/2,I=window.open(T,"_blank","height="+w+",width="+F+",menubar=0,status=0,titlebar=0,toolbar=0,left="+k+",top="+v);return window.addEventListener("message",C=>{let y=C.data.startsWith("authid:"),D=y?C.data.replace("authid:",""):null;y&&(this.destinationForm.update($=>($[e][i]=D,$)),this.#o.set(!1),I?.close())}),!1}settingsAsText=P(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,i])=>{let o=e??"",a="";return typeof i=="boolean"?a=this.isTrue(i)?"True":"False":(typeof i=="number"||i!=null)&&(a=i.toString()),`${o}=${a}`}).join(`
7
+ `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=et(t);this.destinationForm.update(i=>Y(M({},i),{advanced:e}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ne({type:n,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let i;i=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let r;r=$localize`This field is mandatory`;let u;u=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let T;T=$localize`Hostname is invalid`;let F;F=$localize`Bucket name is invalid`;let w;w=$localize`This field is mandatory`;let k;k=$localize`This field is mandatory`;let v;v=$localize`This field is mandatory`;let I;I=$localize`This field is mandatory`;let C;C=$localize`This field is mandatory`;let y;y=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let $;return $=$localize`This field is mandatory`,[["fieldTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],t,e,i,[1,"advanced-options",3,"disallowToggle"],["title",""],["shButton","","type","button",1,"outlined","small"],[1,"actions"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["shButton","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["type","button",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"field-row"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","enableCreateFolder","startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised",3,"active"],[3,"ngModel","customId","placeholder"],["shButton","","type","button",1,"outlined"],[3,"for"],["shTooltip",o],[1,"primary",3,"shTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["shTooltip",a],["shTooltip",r],["shTooltip",u,1,"warn"],["shTooltip",T,1,"error"],["shTooltip",F,1,"warn"],[3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["prefix","",3,"shTooltip"],["shTooltip",w],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["shTooltip",k],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",v],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",I],["shTooltip",C],["type","number",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"click"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",y],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",$],["shButton","","type","button",1,"outlined",3,"click"]]},template:function(e,i){if(e&1&&(L(0)(1),g(2,Mn,16,5)),e&2){let o=O(i.destinationType());l();let a=O(i.destinationFormConfig());l(),f(o&&a?2:-1)}},dependencies:[Be,de,ke,ce,me,pe,Ge,tt,nt,ot,fe,Ke,Ce,ue,He,Ue,Xe,qe,je,Je],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.advanced-options[_ngcontent-%COMP%]{position:relative;z-index:1}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{at as a,ge as b,rt as c};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-TPBZNCDW.js";import{b as h}from"./chunk-Z27IQRKV.js";import"./chunk-RDCD2W2C.js";import"./chunk-TJIZJNCK.js";import"./chunk-ZSZLXWN6.js";import"./chunk-72HORZFV.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MTQKK2WN.js";import"./chunk-LN26XMBJ.js";import"./chunk-XVWOVBC4.js";import"./chunk-WXF4HUYT.js";import{b as M,e as O}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B,u as R}from"./chunk-QF4DQYEP.js";import{h as A}from"./chunk-PD73DDOS.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{Ab as T,Bb as g,Db as F,Eb as a,Fb as _,Qc as L,Sa as i,Tb as c,Ub as d,Vb as l,Yb as p,Zb as I,_ as C,cb as f,nc as E,pa as r,pc as N,xb as s,yb as u,zb as S}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";function $(e,t){e&1&&l(0,2,1)}function P(e,t){e&1&&l(0,2,2)}function k(e,t){e&1&&l(0,2,3)}function v(e,t){e&1&&l(0,2,4)}function U(e,t){if(e&1&&(E(0),_(1,"br")),e&2){let n=t.$implicit;N(" ",n," ")}}var D=class e{#t=C(A);#e=C(M);#n=h(this.#e.params);runId=L(()=>this.#n()?.runId);offset=r(0);status=r("starting");messageLog=r([]);interval=setInterval(()=>{this.#t.getApiV1CommandlineByRunid({runid:this.runId(),offset:this.offset(),pagesize:100}).subscribe(t=>{this.offset.set(t.Count),this.evalStatus(t),this.messageLog.update(n=>[...n,...t.Items])})},1e3);evalStatus(t){t.Started===!0&&t.Finished===!0&&(this.status.set("finished"),clearInterval(this.interval)),t.Started===!0&&t.Finished===!1&&this.status.set("started")}abort(){this.#t.postApiV1CommandlineByRunidAbort({runid:this.runId()}).subscribe({next:t=>{this.status.set("aborted"),clearInterval(this.interval)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=f({type:e,selectors:[["app-commandline-result"]],decls:18,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;n=$localize` Running commandline task... ${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON:Abort${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_BUTTON:`;let o;return o=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Starting... ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_IF_1: Started! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_IF_2: Finished! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_IF_3: Aborted! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:`,o=p(o),[t,n,o,[1,"back"],["type","button","shButton","","routerLink","../",1,"small"],["type","button","shButton","",1,"small",3,"click"],[1,"status"]]},template:function(n,o){n&1&&(_(0,"app-status-bar"),F(1,"section")(2,"div",3)(3,"button",4),c(4,0),_(5,"sh-icon"),d(),a()(),F(6,"h3"),c(7,1),F(8,"button",5),I("click",function(){return o.abort()}),a(),d(),a(),F(9,"div",6),c(10,2),s(11,$,1,0),s(12,P,1,0),s(13,k,1,0),s(14,v,1,0),d(),a(),F(15,"code"),T(16,U,2,1,null,null,S),a()()),n&2&&(i(11),u(o.status()==="starting"?11:-1),i(),u(o.status()==="started"?12:-1),i(),u(o.status()==="finished"?13:-1),i(),u(o.status()==="aborted"?14:-1),i(2),g(o.messageLog()))},dependencies:[b,R,B,O],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;padding:2.5rem;gap:1.25rem}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{D as default};
1
+ import{a as b}from"./chunk-7RM3VKDO.js";import{b as h}from"./chunk-Z27IQRKV.js";import"./chunk-YHUSOICR.js";import"./chunk-4NBLWONL.js";import"./chunk-CCKT2GLS.js";import"./chunk-LVTEOKA4.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import"./chunk-LN26XMBJ.js";import"./chunk-7LYN2XHO.js";import"./chunk-GCCJSS4C.js";import{b as M,e as O}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B,u as R}from"./chunk-QF4DQYEP.js";import{h as A}from"./chunk-2QJVTZ56.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{Ab as T,Bb as g,Db as F,Eb as a,Fb as _,Qc as L,Sa as i,Tb as c,Ub as d,Vb as l,Yb as p,Zb as I,_ as C,cb as f,nc as E,pa as r,pc as N,xb as s,yb as u,zb as S}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";function $(e,t){e&1&&l(0,2,1)}function P(e,t){e&1&&l(0,2,2)}function k(e,t){e&1&&l(0,2,3)}function v(e,t){e&1&&l(0,2,4)}function U(e,t){if(e&1&&(E(0),_(1,"br")),e&2){let n=t.$implicit;N(" ",n," ")}}var D=class e{#t=C(A);#e=C(M);#n=h(this.#e.params);runId=L(()=>this.#n()?.runId);offset=r(0);status=r("starting");messageLog=r([]);interval=setInterval(()=>{this.#t.getApiV1CommandlineByRunid({runid:this.runId(),offset:this.offset(),pagesize:100}).subscribe(t=>{this.offset.set(t.Count),this.evalStatus(t),this.messageLog.update(n=>[...n,...t.Items])})},1e3);evalStatus(t){t.Started===!0&&t.Finished===!0&&(this.status.set("finished"),clearInterval(this.interval)),t.Started===!0&&t.Finished===!1&&this.status.set("started")}abort(){this.#t.postApiV1CommandlineByRunidAbort({runid:this.runId()}).subscribe({next:t=>{this.status.set("aborted"),clearInterval(this.interval)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=f({type:e,selectors:[["app-commandline-result"]],decls:18,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;n=$localize` Running commandline task... ${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON:Abort${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_BUTTON:`;let o;return o=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Starting... ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_IF_1: Started! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_IF_2: Finished! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_IF_3: Aborted! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:`,o=p(o),[t,n,o,[1,"back"],["type","button","shButton","","routerLink","../",1,"small"],["type","button","shButton","",1,"small",3,"click"],[1,"status"]]},template:function(n,o){n&1&&(_(0,"app-status-bar"),F(1,"section")(2,"div",3)(3,"button",4),c(4,0),_(5,"sh-icon"),d(),a()(),F(6,"h3"),c(7,1),F(8,"button",5),I("click",function(){return o.abort()}),a(),d(),a(),F(9,"div",6),c(10,2),s(11,$,1,0),s(12,P,1,0),s(13,k,1,0),s(14,v,1,0),d(),a(),F(15,"code"),T(16,U,2,1,null,null,S),a()()),n&2&&(i(11),u(o.status()==="starting"?11:-1),i(),u(o.status()==="started"?12:-1),i(),u(o.status()==="finished"?13:-1),i(),u(o.status()==="aborted"?14:-1),i(2),g(o.messageLog()))},dependencies:[b,R,B,O],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;padding:2.5rem;gap:1.25rem}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{D as default};
@@ -1 +1 @@
1
- import{a as u}from"./chunk-RDCD2W2C.js";import{h as m}from"./chunk-PD73DDOS.js";import{B as d,F as o,H as p,R as h,Rc as l,V as N,_ as r,n as c,pa as s,x as f}from"./chunk-QONLYWYC.js";var b=class a{#e=r(m);#o=r(u);serverState=this.#o.serverState;serverStateEffect=l(()=>{let t=this.#o.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#s=-1;#a=s(!1);#t=s([]);#i=s([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#s!==t&&(this.#s=t,this.getNotifications())}getNotifications(){this.#a.set(!0),this.#e.getApiV1Notifications().pipe(o(1),h(t=>this.#t.set(t)),p(()=>this.#a.set(!1))).subscribe()}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(o(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(o(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(d(()=>c(e))));f(i).pipe(o(1)).subscribe({next:e=>{let g=e.filter(n=>n!=null&&"ID"in n);this.#t.set(g),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||a)};static \u0275prov=N({token:a,factory:a.\u0275fac,providedIn:"root"})};export{b as a};
1
+ import{a as u}from"./chunk-YHUSOICR.js";import{h as m}from"./chunk-2QJVTZ56.js";import{B as d,F as o,H as p,R as h,Rc as l,V as N,_ as r,n as c,pa as s,x as f}from"./chunk-QONLYWYC.js";var b=class a{#e=r(m);#o=r(u);serverState=this.#o.serverState;serverStateEffect=l(()=>{let t=this.#o.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#s=-1;#a=s(!1);#t=s([]);#i=s([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#s!==t&&(this.#s=t,this.getNotifications())}getNotifications(){this.#a.set(!0),this.#e.getApiV1Notifications().pipe(o(1),h(t=>this.#t.set(t)),p(()=>this.#a.set(!1))).subscribe()}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(o(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(o(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(d(()=>c(e))));f(i).pipe(o(1)).subscribe({next:e=>{let g=e.filter(n=>n!=null&&"ID"in n);this.#t.set(g),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||a)};static \u0275prov=N({token:a,factory:a.\u0275fac,providedIn:"root"})};export{b as a};
@@ -1,2 +1,2 @@
1
- import{B as U,S as z,u as w}from"./chunk-QF4DQYEP.js";import{h as J}from"./chunk-PD73DDOS.js";import{la as y}from"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as g,Ab as C,Bb as f,Cb as L,Db as i,Eb as a,Fb as h,Fc as x,H as F,Hc as A,Mb as M,Rc as k,Sa as _,Tb as $,Ub as B,Vb as r,Zb as N,_ as G,cb as b,ea as S,fa as u,jc as I,kc as v,nc as d,oc as m,pa as l,xb as O,yb as T,zb as E}from"./chunk-QONLYWYC.js";import{a as P,b as D}from"./chunk-EUDKD2JW.js";function X(o,e){if(o&1&&(i(0,"li"),d(1),a()),o&2){let t=e.$implicit;_(),m(t)}}function V(o,e){if(o&1&&(i(0,"tr")(1,"td",12)(2,"code")(3,"ol",13),C(4,X,2,1,"li",null,E),a()()()()),o&2){let t=g().$implicit,n=g();_(),I("grid-column","1 / -1")("height","auto"),_(3),f(n.breakIntoLines(t.Exception))}}function j(o,e){if(o&1){let t=M();i(0,"tr",9),N("click",function(){let s=S(t).$index,c=g();return u(c.toggleRow(s))}),i(1,"td"),d(2),x(3,"date"),a(),i(4,"td",10),d(5),a(),i(6,"td"),d(7),a(),i(8,"td")(9,"button",11)(10,"sh-icon"),d(11,"caret-down"),a()()()(),O(12,V,6,4,"tr")}if(o&2){let t=e.$implicit,n=e.$index,s=g();_(2),m(t.Timestamp?A(3,6,t.Timestamp*1e3,"medium"):"-"),_(3),m(t.BackupID>=0?t.BackupID:"-"),_(2),m(t.Message),_(2),v("rotated-icon",n===s.openRowIndex()),_(3),T(n===s.openRowIndex()?12:-1)}}function K(o,e){o&1&&r(0,4,1)}function q(o,e){o&1&&r(0,4,2)}var H=["BackupID","Timestamp","Message","actions"],R=class o{#e=G(J);displayedColumns=l(H);openRowIndex=l(null);noMoreItems=l(!1);logsIsLoading=l(!1);logs=l([]);pagination=l({offsetTime:void 0,pagesize:10});paginationEffect=k(()=>{let e=this.pagination();this.getLogs()});ngOnInit(){this.getLogs()}getLogs(){this.logsIsLoading.set(!0);let e=this.pagination();this.#e.getApiV1LogdataLog({pagesize:e.pagesize,offset:e.offsetTime}).pipe(F(()=>this.logsIsLoading.set(!1))).subscribe({next:t=>{t.length===0&&this.noMoreItems.set(!0),this.logs.update(n=>[...n,...t])}})}toggleRow(e){this.openRowIndex.set(e===this.openRowIndex()?null:e)}breakIntoLines(e){return e?e.split(`
1
+ import{B as U,S as z,u as w}from"./chunk-QF4DQYEP.js";import{h as J}from"./chunk-2QJVTZ56.js";import{la as y}from"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as g,Ab as C,Bb as f,Cb as L,Db as i,Eb as a,Fb as h,Fc as x,H as F,Hc as A,Mb as M,Rc as k,Sa as _,Tb as $,Ub as B,Vb as r,Zb as N,_ as G,cb as b,ea as S,fa as u,jc as I,kc as v,nc as d,oc as m,pa as l,xb as O,yb as T,zb as E}from"./chunk-QONLYWYC.js";import{a as P,b as D}from"./chunk-EUDKD2JW.js";function X(o,e){if(o&1&&(i(0,"li"),d(1),a()),o&2){let t=e.$implicit;_(),m(t)}}function V(o,e){if(o&1&&(i(0,"tr")(1,"td",12)(2,"code")(3,"ol",13),C(4,X,2,1,"li",null,E),a()()()()),o&2){let t=g().$implicit,n=g();_(),I("grid-column","1 / -1")("height","auto"),_(3),f(n.breakIntoLines(t.Exception))}}function j(o,e){if(o&1){let t=M();i(0,"tr",9),N("click",function(){let s=S(t).$index,c=g();return u(c.toggleRow(s))}),i(1,"td"),d(2),x(3,"date"),a(),i(4,"td",10),d(5),a(),i(6,"td"),d(7),a(),i(8,"td")(9,"button",11)(10,"sh-icon"),d(11,"caret-down"),a()()()(),O(12,V,6,4,"tr")}if(o&2){let t=e.$implicit,n=e.$index,s=g();_(2),m(t.Timestamp?A(3,6,t.Timestamp*1e3,"medium"):"-"),_(3),m(t.BackupID>=0?t.BackupID:"-"),_(2),m(t.Message),_(2),v("rotated-icon",n===s.openRowIndex()),_(3),T(n===s.openRowIndex()?12:-1)}}function K(o,e){o&1&&r(0,4,1)}function q(o,e){o&1&&r(0,4,2)}var H=["BackupID","Timestamp","Message","actions"],R=class o{#e=G(J);displayedColumns=l(H);openRowIndex=l(null);noMoreItems=l(!1);logsIsLoading=l(!1);logs=l([]);pagination=l({offsetTime:void 0,pagesize:10});paginationEffect=k(()=>{let e=this.pagination();this.getLogs()});ngOnInit(){this.getLogs()}getLogs(){this.logsIsLoading.set(!0);let e=this.pagination();this.#e.getApiV1LogdataLog({pagesize:e.pagesize,offset:e.offsetTime}).pipe(F(()=>this.logsIsLoading.set(!1))).subscribe({next:t=>{t.length===0&&this.noMoreItems.set(!0),this.logs.update(n=>[...n,...t])}})}toggleRow(e){this.openRowIndex.set(e===this.openRowIndex()?null:e)}breakIntoLines(e){return e?e.split(`
2
2
  `):[]}loadMore(){let e=this.logs().at(-1)?.Timestamp;this.pagination.update(t=>D(P({},t),{offsetTime:e}))}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=b({type:o,selectors:[["app-logs-stored"]],decls:18,vars:6,consts:()=>{let e;e=$localize`Timestamp`;let t;t=$localize`Backup ID`;let n;n=$localize`Message`;let s;s=$localize`No data available`;let c;return c=$localize`${"\uFFFD*16:1\uFFFD"}:START_BLOCK_IF: No more items ${"\uFFFD/*16:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*17:2\uFFFD"}:START_BLOCK_ELSE: Load more ${"\uFFFD/*17:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,[e,t,n,s,c,[1,"type-b",3,"data","loading"],["table-header",""],["table-no-rows",""],["shButton","",1,"primary","raised",3,"click","disabled"],[3,"click"],[1,"id"],["shButton","","type","button",1,"outlined","small"],[2,"white-space","pre-wrap"],[1,"line-numbers-ol"]]},template:function(t,n){if(t&1){let s=M();i(0,"sh-table",5)(1,"tr",6)(2,"th"),r(3,0),a(),i(4,"th"),r(5,1),a(),i(6,"th"),r(7,2),a(),h(8,"th"),a(),C(9,j,13,9,null,null,E),i(11,"div",7),r(12,3),a()(),i(13,"footer")(14,"button",8),N("click",function(){return S(s),u(n.loadMore())}),$(15,4),O(16,K,1,0)(17,q,1,0),B(),a()()}if(t&2){let s=n.logs();I("grid-template-columns","1fr 1fr 1fr auto"),L("data",s)("loading",n.logsIsLoading()),_(9),f(s),_(5),L("disabled",n.logsIsLoading()||n.noMoreItems()),_(2),T(n.noMoreItems()?16:17)}},dependencies:[z,w,U,y],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}sh-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 0 0}"],changeDetection:0})};export{R as default};
@@ -1 +1 @@
1
- import{a as A}from"./chunk-TPBZNCDW.js";import"./chunk-RDCD2W2C.js";import"./chunk-TJIZJNCK.js";import"./chunk-ZSZLXWN6.js";import"./chunk-72HORZFV.js";import"./chunk-6Q6SSTBK.js";import"./chunk-MTQKK2WN.js";import"./chunk-LN26XMBJ.js";import"./chunk-XVWOVBC4.js";import"./chunk-WXF4HUYT.js";import{c as u,e as N,f as c}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{T as S}from"./chunk-QF4DQYEP.js";import"./chunk-PD73DDOS.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{Db as e,Eb as t,Fb as T,Vb as n,cb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var l=class s{static \u0275fac=function(o){return new(o||s)};static \u0275cmp=g({type:s,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let i;i=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let C;C=$localize`System info`;let a;a=$localize`Server settings`;let E;E=$localize`Logs`;let O;return O=$localize`Crash log`,[i,o,r,C,a,E,O,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(T(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),T(18,"router-outlet"),t()())},dependencies:[A,S,u,N,c],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{l as default};
1
+ import{a as A}from"./chunk-7RM3VKDO.js";import"./chunk-YHUSOICR.js";import"./chunk-4NBLWONL.js";import"./chunk-CCKT2GLS.js";import"./chunk-LVTEOKA4.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import"./chunk-LN26XMBJ.js";import"./chunk-7LYN2XHO.js";import"./chunk-GCCJSS4C.js";import{c as u,e as N,f as c}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{T as S}from"./chunk-QF4DQYEP.js";import"./chunk-2QJVTZ56.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{Db as e,Eb as t,Fb as T,Vb as n,cb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var l=class s{static \u0275fac=function(o){return new(o||s)};static \u0275cmp=g({type:s,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let i;i=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let C;C=$localize`System info`;let a;a=$localize`Server settings`;let E;E=$localize`Logs`;let O;return O=$localize`Crash log`,[i,o,r,C,a,E,O,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(T(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),T(18,"router-outlet"),t()())},dependencies:[A,S,u,N,c],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{l as default};
@@ -1 +1 @@
1
- import{b as g}from"./chunk-Z27IQRKV.js";import{h as o}from"./chunk-PD73DDOS.js";import{Qc as n,V as r,_ as i,pa as s}from"./chunk-QONLYWYC.js";var a=class e{#e=i(o);#r=g(this.#e.getApiV1Serversettings());#t=s(void 0);serverSettings=n(()=>this.#t()||this.#r());refreshServerSettings(){this.#e.getApiV1Serversettings().subscribe({next:t=>{this.#t.set(t)}})}static \u0275fac=function(p){return new(p||e)};static \u0275prov=r({token:e,factory:e.\u0275fac,providedIn:"root"})};export{a};
1
+ import{b as g}from"./chunk-Z27IQRKV.js";import{h as o}from"./chunk-2QJVTZ56.js";import{Qc as n,V as r,_ as i,pa as s}from"./chunk-QONLYWYC.js";var a=class e{#e=i(o);#r=g(this.#e.getApiV1Serversettings());#t=s(void 0);serverSettings=n(()=>this.#t()||this.#r());refreshServerSettings(){this.#e.getApiV1Serversettings().subscribe({next:t=>{this.#t.set(t)}})}static \u0275fac=function(p){return new(p||e)};static \u0275prov=r({token:e,factory:e.\u0275fac,providedIn:"root"})};export{a};
@@ -1,2 +1,2 @@
1
- import{h as P}from"./chunk-PD73DDOS.js";import"./chunk-FPPZ4BUR.js";import{$b as L,Ab as v,Bb as b,Gb as o,H as p,Hb as i,Qc as x,Sa as s,V as h,_ as r,cb as u,jc as E,nc as a,oc as M,pa as c,xb as f,yb as C,zb as _}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var l=class e{#e=r(P);isLoaded=c(!1);crashLog=c(null);load(){this.isLoaded()||this.#e.getApiV1LogdataCrashlog().pipe(p(()=>this.isLoaded.set(!0))).subscribe({next:t=>{this.crashLog.set(t.Logdata??null)}})}static \u0275fac=function(n){return new(n||e)};static \u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"})};function O(e,t){e&1&&(o(0,"div",0),a(1,"Loading ..."),i())}function S(e,t){e&1&&(o(0,"div",0),a(1,"No crash log found"),i())}function w(e,t){if(e&1&&(o(0,"li"),a(1),i()),e&2){let n=t.$implicit;s(),M(n)}}function D(e,t){if(e&1&&(o(0,"div",2)(1,"code")(2,"ol",3),v(3,w,2,1,"li",null,_),i()()()),e&2){let n=L();E("grid-column","1 / -1")("height","auto"),s(3),b(n.breakIntoLines(n.crashLog()))}}var g=class e{#e=r(l);logsLoading=x(()=>!this.#e.isLoaded());crashLog=this.#e.crashLog;ngOnInit(){this.#e.load()}breakIntoLines(t){return t?t.split(`
1
+ import{h as P}from"./chunk-2QJVTZ56.js";import"./chunk-FPPZ4BUR.js";import{$b as L,Ab as v,Bb as b,Gb as o,H as p,Hb as i,Qc as x,Sa as s,V as h,_ as r,cb as u,jc as E,nc as a,oc as M,pa as c,xb as f,yb as C,zb as _}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var l=class e{#e=r(P);isLoaded=c(!1);crashLog=c(null);load(){this.isLoaded()||this.#e.getApiV1LogdataCrashlog().pipe(p(()=>this.isLoaded.set(!0))).subscribe({next:t=>{this.crashLog.set(t.Logdata??null)}})}static \u0275fac=function(n){return new(n||e)};static \u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"})};function O(e,t){e&1&&(o(0,"div",0),a(1,"Loading ..."),i())}function S(e,t){e&1&&(o(0,"div",0),a(1,"No crash log found"),i())}function w(e,t){if(e&1&&(o(0,"li"),a(1),i()),e&2){let n=t.$implicit;s(),M(n)}}function D(e,t){if(e&1&&(o(0,"div",2)(1,"code")(2,"ol",3),v(3,w,2,1,"li",null,_),i()()()),e&2){let n=L();E("grid-column","1 / -1")("height","auto"),s(3),b(n.breakIntoLines(n.crashLog()))}}var g=class e{#e=r(l);logsLoading=x(()=>!this.#e.isLoaded());crashLog=this.#e.crashLog;ngOnInit(){this.#e.load()}breakIntoLines(t){return t?t.split(`
2
2
  `):[]}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=u({type:e,selectors:[["app-crashlogs"]],decls:5,vars:1,consts:[[1,"loading"],[2,"white-space","pre-wrap",3,"grid-column","height"],[2,"white-space","pre-wrap"],[1,"line-numbers-ol"]],template:function(n,d){if(n&1&&(o(0,"h3"),a(1,"Crash log"),i(),f(2,O,2,0,"div",0)(3,S,2,0,"div",0)(4,D,5,4,"div",1)),n&2){let m;s(2),C(d.logsLoading()?2:d.crashLog()==null||((m=d.crashLog())==null?null:m.length)===0?3:4)}},styles:["[_nghost-%COMP%]{display:block;padding:0 2.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}sh-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{g as default};
@@ -1 +1 @@
1
- import{a as f}from"./chunk-WXF4HUYT.js";import{_ as m,a as S,b as i,pa as c}from"./chunk-QONLYWYC.js";function u(...a){let e=c(...a);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}function A(a,e,o=!1,s){let l=m(f);e=l.getItemParsed(a,o)??e;let n=u(e),r=n[S];s?.equal&&(r.equal=s.equal);function g(t){t==null?l.removeItem(a):l.setItemParsed(a,t,o)}return n.set=t=>{g(t),i(r,t)},n.update=t=>{let T=t(n());g(T),i(r,T)},n}export{A as a};
1
+ import{a as f}from"./chunk-GCCJSS4C.js";import{_ as m,a as S,b as i,pa as c}from"./chunk-QONLYWYC.js";function u(...a){let e=c(...a);return Object.defineProperty(e,"value",{get:e.asReadonly(),set:e.set.bind(e)})}function A(a,e,o=!1,s){let l=m(f);e=l.getItemParsed(a,o)??e;let n=u(e),r=n[S];s?.equal&&(r.equal=s.equal);function g(t){t==null?l.removeItem(a):l.setItemParsed(a,t,o)}return n.set=t=>{g(t),i(r,t)},n.update=t=>{let T=t(n());g(T),i(r,T)},n}export{A as a};
@@ -1 +1 @@
1
- import{a as Pe}from"./chunk-RDCD2W2C.js";import{a as Ne}from"./chunk-TJIZJNCK.js";import{a as Oe}from"./chunk-ZSZLXWN6.js";import{a as Ee}from"./chunk-MTQKK2WN.js";import{b as oe}from"./chunk-WXF4HUYT.js";import{B as Te,D as pe,G as ce,K as de,L as me,N as ge,O as Ce,c as ae,e as se,i as le,k as _e,s as x,u as re,w as ue,z as Se}from"./chunk-QF4DQYEP.js";import{h as P}from"./chunk-PD73DDOS.js";import{a as fe}from"./chunk-I2LW33GO.js";import{la as ie}from"./chunk-5ZSBXGHQ.js";import{$b as d,Ab as Z,Bb as q,Cb as R,Db as s,Eb as l,Fb as C,Fc as H,Gc as te,H as U,Hc as ne,Mb as D,Qc as G,Sa as _,Tb as E,Ub as O,Vb as S,Vc as k,Yb as Q,Zb as T,_ as c,cb as N,ea as h,fa as M,jc as ee,kc as m,nc as g,pa as p,pc as v,qc as z,sc as b,tc as B,uc as L,xb as I,yb as F,zb as Y}from"./chunk-QONLYWYC.js";function De(a,n){if(a&1){let i=D();s(0,"sh-radio",10),T("click",function(){let t=h(i).$implicit,o=d();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=d();m("active",e.pauseOption()===i.value),_(),v(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=c(P);pauseOptions=p(be);closed=k();isSubmitting=p(!1);pauseTransfers=p(!1);pauseOption=p(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),S(2,0),l()(),s(3,"div",6)(4,"div",7),Z(5,De,2,3,"sh-radio",8,Y),l(),s(7,"div",9)(8,"sh-checkbox",10),T("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),S(9,1),l(),s(10,"sh-alert",11),S(11,2),l()()(),s(12,"footer",12)(13,"button",13),T("click",function(){return e.closed.emit()}),S(14,3),l(),s(15,"button",14),T("click",function(){return e.submit()}),S(16,4),l()()),i&2&&(_(5),q(e.pauseOptions()),_(3),m("active",e.pauseTransfers()),_(7),m("loader",e.isSubmitting()))},dependencies:[x,me,pe,ue],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Ie=8,V=1024,w=V*1024,W=w*1024,K=W*1024,Fe=K*1024,Le={B:1,KB:V,MB:w,GB:W,TB:K,PB:Fe},Ge=1e3,X=Ge*1e3,J=X*1e3,ye=[{threshold:Fe,unitPrefix:"PByte"},{threshold:K,unitPrefix:"TByte"},{threshold:W,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:V,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],y=class a{#e=c(P);closed=k();isSubmitting=p(!1);sizeOptions=p([...Be]);maxUpload=p(0);maxDownload=p(0);maxUploadUnit=p("mbps");maxDownloadUnit=p("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(Le[i.toUpperCase()]||w)*Ie;return t===0?{value:0,unit:"mbps"}:t>=J?{value:parseFloat((t/J).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/X).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*J;break;case"mbps":e=n*X;break}let t=e/Ie;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:r}of ye)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:r};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,r=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(e,t),A=Me[f];A?n=`${u}${A}`:console.error(`Invalid unit prefix for API submission (upload): ${f}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(o,r),A=Me[f];A?i=`${u}${A}`:console.error(`Invalid unit prefix for API submission (download): ${f}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let r;return r=$localize` Update settings `,[n,i,e,t,o,r,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),S(2,0),l(),s(3,"p"),S(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),S(9,2),l(),s(10,"sh-form-field")(11,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),L("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),S(16,3),l(),s(17,"sh-form-field")(18,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),L("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),T("click",function(){return e.closed.emit(!1)}),S(23,4),l(),s(24,"button",14),T("click",function(){return e.submit()}),S(25,5),l()()),i&2&&(_(11),b("ngModel",e.maxUpload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxUploadUnit),_(5),b("ngModel",e.maxDownload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxDownloadUnit),_(4),m("loader",e.isSubmitting()))},dependencies:[x,ae,_e,se,le,ce,Ce],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ue(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=d();_(),z("",i.statusData().actionText," - ",i.statusData().statusText),_(),R("value",i.statusData().progress*100)}}function ve(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=d();_(),v(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),_(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function ke(a,n){a&1&&(s(0,"div",7),S(1,1),l())}function xe(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(_(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&I(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=d();F(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Je(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Re=new Date,j=class a{#e=c(P);#t=c(Pe);#n=c(Se);#a=c(Ne);#s=c(oe);#l=c(Ee);#i=c(Oe);minsAgo=Re.setMinutes(Re.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=G(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=G(()=>this.runningTask()==this.#o());#o=p(-1);pgState=G(()=>this.#i.serverState());nextBackup=G(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(y,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),I(2,Ue,3,3)(3,ve,7,8,"div",7)(4,ke,2,0,"div",7)(5,xe,3,4,"div",8),l(),s(6,"div",9),I(7,ze,2,1),s(8,"button",10),T("click",function(){return e.pauseResume()}),E(9,0),I(10,He,2,0)(11,Je,2,0),O(),l(),s(12,"button",10),T("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;_(2),F((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),_(5),F(e.runningTask()?7:-1),_(),m("loader",e.isResuming()),_(2),F(e.clientIsRunning()?10:11)}},dependencies:[de,re,Te,ge,fe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
1
+ import{a as Pe}from"./chunk-YHUSOICR.js";import{a as Ne}from"./chunk-4NBLWONL.js";import{a as Oe}from"./chunk-CCKT2GLS.js";import{a as Ee}from"./chunk-XLDVUBTQ.js";import{b as oe}from"./chunk-GCCJSS4C.js";import{B as Te,D as pe,G as ce,K as de,L as me,N as ge,O as Ce,c as ae,e as se,i as le,k as _e,s as x,u as re,w as ue,z as Se}from"./chunk-QF4DQYEP.js";import{h as P}from"./chunk-2QJVTZ56.js";import{a as fe}from"./chunk-I2LW33GO.js";import{la as ie}from"./chunk-5ZSBXGHQ.js";import{$b as d,Ab as Z,Bb as q,Cb as R,Db as s,Eb as l,Fb as C,Fc as H,Gc as te,H as U,Hc as ne,Mb as D,Qc as G,Sa as _,Tb as E,Ub as O,Vb as S,Vc as k,Yb as Q,Zb as T,_ as c,cb as N,ea as h,fa as M,jc as ee,kc as m,nc as g,pa as p,pc as v,qc as z,sc as b,tc as B,uc as L,xb as I,yb as F,zb as Y}from"./chunk-QONLYWYC.js";function De(a,n){if(a&1){let i=D();s(0,"sh-radio",10),T("click",function(){let t=h(i).$implicit,o=d();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=d();m("active",e.pauseOption()===i.value),_(),v(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=c(P);pauseOptions=p(be);closed=k();isSubmitting=p(!1);pauseTransfers=p(!1);pauseOption=p(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),S(2,0),l()(),s(3,"div",6)(4,"div",7),Z(5,De,2,3,"sh-radio",8,Y),l(),s(7,"div",9)(8,"sh-checkbox",10),T("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),S(9,1),l(),s(10,"sh-alert",11),S(11,2),l()()(),s(12,"footer",12)(13,"button",13),T("click",function(){return e.closed.emit()}),S(14,3),l(),s(15,"button",14),T("click",function(){return e.submit()}),S(16,4),l()()),i&2&&(_(5),q(e.pauseOptions()),_(3),m("active",e.pauseTransfers()),_(7),m("loader",e.isSubmitting()))},dependencies:[x,me,pe,ue],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Ie=8,V=1024,w=V*1024,W=w*1024,K=W*1024,Fe=K*1024,Le={B:1,KB:V,MB:w,GB:W,TB:K,PB:Fe},Ge=1e3,X=Ge*1e3,J=X*1e3,ye=[{threshold:Fe,unitPrefix:"PByte"},{threshold:K,unitPrefix:"TByte"},{threshold:W,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:V,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],y=class a{#e=c(P);closed=k();isSubmitting=p(!1);sizeOptions=p([...Be]);maxUpload=p(0);maxDownload=p(0);maxUploadUnit=p("mbps");maxDownloadUnit=p("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(Le[i.toUpperCase()]||w)*Ie;return t===0?{value:0,unit:"mbps"}:t>=J?{value:parseFloat((t/J).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/X).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*J;break;case"mbps":e=n*X;break}let t=e/Ie;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:r}of ye)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:r};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,r=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(e,t),A=Me[f];A?n=`${u}${A}`:console.error(`Invalid unit prefix for API submission (upload): ${f}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(o,r),A=Me[f];A?i=`${u}${A}`:console.error(`Invalid unit prefix for API submission (download): ${f}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let r;return r=$localize` Update settings `,[n,i,e,t,o,r,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),S(2,0),l(),s(3,"p"),S(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),S(9,2),l(),s(10,"sh-form-field")(11,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),L("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),S(16,3),l(),s(17,"sh-form-field")(18,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),L("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),T("click",function(){return e.closed.emit(!1)}),S(23,4),l(),s(24,"button",14),T("click",function(){return e.submit()}),S(25,5),l()()),i&2&&(_(11),b("ngModel",e.maxUpload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxUploadUnit),_(5),b("ngModel",e.maxDownload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxDownloadUnit),_(4),m("loader",e.isSubmitting()))},dependencies:[x,ae,_e,se,le,ce,Ce],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ue(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=d();_(),z("",i.statusData().actionText," - ",i.statusData().statusText),_(),R("value",i.statusData().progress*100)}}function ve(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=d();_(),v(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),_(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function ke(a,n){a&1&&(s(0,"div",7),S(1,1),l())}function xe(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(_(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&I(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=d();F(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Je(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Re=new Date,j=class a{#e=c(P);#t=c(Pe);#n=c(Se);#a=c(Ne);#s=c(oe);#l=c(Ee);#i=c(Oe);minsAgo=Re.setMinutes(Re.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=G(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=G(()=>this.runningTask()==this.#o());#o=p(-1);pgState=G(()=>this.#i.serverState());nextBackup=G(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(y,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),I(2,Ue,3,3)(3,ve,7,8,"div",7)(4,ke,2,0,"div",7)(5,xe,3,4,"div",8),l(),s(6,"div",9),I(7,ze,2,1),s(8,"button",10),T("click",function(){return e.pauseResume()}),E(9,0),I(10,He,2,0)(11,Je,2,0),O(),l(),s(12,"button",10),T("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;_(2),F((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),_(5),F(e.runningTask()?7:-1),_(),m("loader",e.isResuming()),_(2),F(e.clientIsRunning()?10:11)}},dependencies:[de,re,Te,ge,fe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};