@duplicati/ngclient 0.0.150 → 0.0.158

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 (158) hide show
  1. package/assets/backgrounds/base-bg.svg +1 -1
  2. package/assets/dest-icons/s3compat.png +0 -0
  3. package/assets/sh-bold.woff2 +0 -0
  4. package/assets/sh.woff2 +0 -0
  5. package/assets/ship.css +12 -0
  6. package/chunk-2IE65QDC.js +1 -0
  7. package/chunk-2KH32RMH.js +1 -0
  8. package/chunk-363K6H7I.js +1 -0
  9. package/chunk-3AGOCPNZ.js +1 -0
  10. package/chunk-3AYCMVTF.js +1 -0
  11. package/chunk-3F7ADWPY.js +1 -0
  12. package/{chunk-DNDTLTUM.js → chunk-3LVCVLMO.js} +1 -1
  13. package/{chunk-DDWLL7XA.js → chunk-3NFAL4U4.js} +1 -1
  14. package/{chunk-2QJC4PGQ.js → chunk-4VY6SMSL.js} +1 -1
  15. package/chunk-5ZSBXGHQ.js +1 -0
  16. package/chunk-6XXAHUOH.js +1 -0
  17. package/{chunk-DELLEGXW.js → chunk-72HORZFV.js} +1 -1
  18. package/{chunk-QDFDQHU3.js → chunk-7FCBU2UO.js} +1 -1
  19. package/chunk-7TF7DTKJ.js +60 -0
  20. package/chunk-ABYM5HWA.js +1 -0
  21. package/chunk-BGKZFATT.js +1 -0
  22. package/chunk-BNWLPYK6.js +2 -0
  23. package/chunk-BTJVI7MG.js +1 -0
  24. package/chunk-C2VSATF5.js +1 -0
  25. package/chunk-CFN5U5PK.js +1 -0
  26. package/chunk-COUIDDUK.js +1 -0
  27. package/chunk-CUL5FHDH.js +1 -0
  28. package/chunk-EE5UMXWP.js +1 -0
  29. package/{chunk-POMLWQHO.js → chunk-ENNM55FS.js} +2 -2
  30. package/chunk-EVJPCAZV.js +1 -0
  31. package/chunk-FIOBQPE7.js +1 -0
  32. package/chunk-FIUF53BE.js +1 -0
  33. package/chunk-FMEVVC6D.js +7 -0
  34. package/{chunk-QHC3CY43.js → chunk-GXGIGJ4W.js} +1 -1
  35. package/chunk-HKL7ZJV5.js +1 -0
  36. package/chunk-HWCUMKYF.js +1 -0
  37. package/{chunk-TDKBGGNK.js → chunk-I2LW33GO.js} +1 -1
  38. package/chunk-ISNV5CM5.js +1 -0
  39. package/chunk-J2Y5AVUU.js +1 -0
  40. package/chunk-JH4DRDIH.js +1 -0
  41. package/chunk-JRDR23NB.js +2 -0
  42. package/chunk-JYWOYPSQ.js +1 -0
  43. package/chunk-K3VDFIJM.js +2 -0
  44. package/chunk-KSEFQ2XA.js +1 -0
  45. package/chunk-L3RU4D2N.js +1 -0
  46. package/chunk-LANFQDZE.js +1 -0
  47. package/{chunk-UP5EOICU.js → chunk-LN26XMBJ.js} +1 -1
  48. package/chunk-LYKQBVOC.js +1 -0
  49. package/chunk-M6SIMFCD.js +1 -0
  50. package/chunk-M7QQEZOU.js +1 -0
  51. package/chunk-MSX2SJC7.js +1 -0
  52. package/{chunk-VTSUHAP5.js → chunk-MTQKK2WN.js} +1 -1
  53. package/chunk-NC73IOHK.js +1 -0
  54. package/chunk-O4WI3VDE.js +1 -0
  55. package/chunk-PD73DDOS.js +2 -0
  56. package/chunk-QF4DQYEP.js +1 -0
  57. package/chunk-QONLYWYC.js +4 -0
  58. package/{chunk-GEI2CH2J.js → chunk-QWQKYLNR.js} +1 -1
  59. package/chunk-RADP6NAN.js +1 -0
  60. package/chunk-RDCD2W2C.js +1 -0
  61. package/chunk-RIFNOGGK.js +1 -0
  62. package/chunk-SKSEDWGR.js +2 -0
  63. package/{chunk-NQ27E6KP.js → chunk-SR4YENFS.js} +1 -1
  64. package/chunk-TG2ZSU7H.js +1 -0
  65. package/{chunk-DVDTYV66.js → chunk-TJIZJNCK.js} +1 -1
  66. package/chunk-TPBZNCDW.js +1 -0
  67. package/chunk-U4U2GCS5.js +1 -0
  68. package/{chunk-DFMGS3IN.js → chunk-UCS5RU7N.js} +1 -1
  69. package/chunk-UQY3P37P.js +1 -0
  70. package/chunk-VRV52R6I.js +1 -0
  71. package/chunk-VUKS2SJL.js +1 -0
  72. package/chunk-WNJSKJGQ.js +1 -0
  73. package/{chunk-UKQFDBNO.js → chunk-WXF4HUYT.js} +1 -1
  74. package/chunk-X3XJ26NZ.js +2 -0
  75. package/chunk-XH5CTH3O.js +1 -0
  76. package/chunk-XHITDSWR.js +1 -0
  77. package/{chunk-Z3EPZZGY.js → chunk-XVWOVBC4.js} +1 -1
  78. package/chunk-Y75ZS4Q2.js +1 -0
  79. package/chunk-YHOYPGPD.js +3 -0
  80. package/chunk-YJPY33RI.js +2 -0
  81. package/{chunk-O64ZZGQZ.js → chunk-Z27IQRKV.js} +1 -1
  82. package/chunk-Z35OG2DV.js +1 -0
  83. package/chunk-ZBVBVQO7.js +1 -0
  84. package/chunk-ZKX6JJ6S.js +1 -0
  85. package/{chunk-UIJYCGKA.js → chunk-ZSZLXWN6.js} +1 -1
  86. package/{chunk-ZUBWG65U.js → chunk-ZWO4SECL.js} +1 -1
  87. package/index.html +24 -4
  88. package/main-ATSCYMRN.js +1 -0
  89. package/package.json +1 -1
  90. package/polyfills-S663R3NQ.js +1 -0
  91. package/styles-DYNNLJCR.css +1 -0
  92. package/chunk-2RDLOXGA.js +0 -3
  93. package/chunk-2UCO57JQ.js +0 -1
  94. package/chunk-3EH5RFRF.js +0 -1
  95. package/chunk-43JMN2ZY.js +0 -1
  96. package/chunk-4EZ4GOK5.js +0 -1
  97. package/chunk-4TDUWDRL.js +0 -2
  98. package/chunk-5NRWNJ4J.js +0 -1
  99. package/chunk-6EWMK5CH.js +0 -1
  100. package/chunk-6LTGTS6B.js +0 -1
  101. package/chunk-6OPAGPKF.js +0 -1
  102. package/chunk-7IQY6U5W.js +0 -1
  103. package/chunk-7ZTBW6LJ.js +0 -1
  104. package/chunk-AJTK6HBC.js +0 -1
  105. package/chunk-CMYPDFDT.js +0 -8
  106. package/chunk-DKTUN7FF.js +0 -1
  107. package/chunk-DLMKZACT.js +0 -1
  108. package/chunk-E66CBA5F.js +0 -1
  109. package/chunk-EBIM5FBM.js +0 -1
  110. package/chunk-EQCT6Y4K.js +0 -1
  111. package/chunk-FCRM5DER.js +0 -1
  112. package/chunk-FUOS2UGQ.js +0 -1
  113. package/chunk-FUX6GJRD.js +0 -1
  114. package/chunk-FZHTJSDJ.js +0 -1
  115. package/chunk-FZTPUMUC.js +0 -1
  116. package/chunk-GFMGDQOH.js +0 -1
  117. package/chunk-GWQAMFY2.js +0 -1
  118. package/chunk-H7K35UUX.js +0 -1
  119. package/chunk-HI4XLHO3.js +0 -1
  120. package/chunk-HNWRQABR.js +0 -4
  121. package/chunk-HTBOWZJ4.js +0 -1
  122. package/chunk-IFW3O4YJ.js +0 -1
  123. package/chunk-J3ONM4TQ.js +0 -1
  124. package/chunk-K56EDP42.js +0 -3
  125. package/chunk-KAOPFWFX.js +0 -1
  126. package/chunk-KLW6HEOS.js +0 -1
  127. package/chunk-LF7PTCJR.js +0 -1
  128. package/chunk-LVP2TPMO.js +0 -1
  129. package/chunk-M6WWZKV7.js +0 -1
  130. package/chunk-MVNLSG6Z.js +0 -1
  131. package/chunk-N5SC4SKW.js +0 -1
  132. package/chunk-NJEX2N4Q.js +0 -1
  133. package/chunk-NJZSEKTD.js +0 -1
  134. package/chunk-NOPMCS2Z.js +0 -2
  135. package/chunk-NTZTXGGQ.js +0 -1
  136. package/chunk-O2AAKP7A.js +0 -1
  137. package/chunk-OKM5JN2Q.js +0 -1
  138. package/chunk-QCISEYZT.js +0 -1
  139. package/chunk-QITXA3NT.js +0 -1
  140. package/chunk-QLYO56NW.js +0 -1
  141. package/chunk-R5RIFWZO.js +0 -2
  142. package/chunk-RUXCS4ZK.js +0 -1
  143. package/chunk-SFSB73YO.js +0 -56
  144. package/chunk-TIWH4NKT.js +0 -2
  145. package/chunk-TK5QY2QD.js +0 -1
  146. package/chunk-TKO3OH2C.js +0 -1
  147. package/chunk-UAFHVSPY.js +0 -1
  148. package/chunk-UIQIL2X6.js +0 -1
  149. package/chunk-V5JXHJUD.js +0 -1
  150. package/chunk-VGUK4FJP.js +0 -1
  151. package/chunk-VHE3K2F5.js +0 -1
  152. package/chunk-VYAOTFOO.js +0 -1
  153. package/chunk-X7ZE7U56.js +0 -2
  154. package/chunk-YTYCTAUZ.js +0 -1
  155. package/main-BICH3CVD.js +0 -1
  156. package/polyfills-DNO7R5SL.js +0 -1
  157. package/styles-LRXGHWCZ.css +0 -1
  158. /package/{chunk-RHW5QVAY.js → chunk-6Q6SSTBK.js} +0 -0
@@ -0,0 +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.
2
+ If this is a self-signed certificate, you can choose to trust this certificate.
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
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
5
+ Do you want to REPLACE your CURRENT host key ${a}
6
+ with the REPORTED host key: ${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};