homebridge-config-ui-x 5.0.0-beta.76 → 5.0.0-beta.77

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 (87) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/dist/modules/server/server.controller.d.ts +5 -1
  3. package/dist/modules/server/server.controller.js +43 -2
  4. package/dist/modules/server/server.controller.js.map +1 -1
  5. package/dist/modules/server/server.service.d.ts +2 -0
  6. package/dist/modules/server/server.service.js +16 -0
  7. package/dist/modules/server/server.service.js.map +1 -1
  8. package/package.json +1 -1
  9. package/public/{chunk-5W6SCDV6.js → chunk-25ISVLXC.js} +1 -1
  10. package/public/{chunk-DONFV37G.js → chunk-2MSFZNDZ.js} +1 -1
  11. package/public/{chunk-OVVOFARC.js → chunk-2UWTSMX3.js} +1 -1
  12. package/public/{chunk-FPB7CGNC.js → chunk-2ZEWMLQG.js} +1 -1
  13. package/public/{chunk-ZHNSZ7X2.js → chunk-37FVXLTH.js} +1 -1
  14. package/public/{chunk-6A5CZTWZ.js → chunk-3S5DXXOF.js} +1 -1
  15. package/public/{chunk-ZRQ5KKRJ.js → chunk-3TQRIWPA.js} +1 -1
  16. package/public/chunk-3YH76G4Q.js +1 -0
  17. package/public/chunk-4AUMYN6J.js +1 -0
  18. package/public/{chunk-U6S6F3SC.js → chunk-4VIXAFH5.js} +1 -1
  19. package/public/{chunk-SB7IBDLB.js → chunk-55BN66AX.js} +1 -1
  20. package/public/{chunk-GKWVMOET.js → chunk-5X2MRBQA.js} +1 -1
  21. package/public/{chunk-ETPKWO5V.js → chunk-6FASN3MD.js} +1 -1
  22. package/public/{chunk-3HFD5GJN.js → chunk-6HKI724F.js} +1 -1
  23. package/public/{chunk-5BL6PCNR.js → chunk-7GYDUXMU.js} +1 -1
  24. package/public/{chunk-7S7G7E6P.js → chunk-7TVHJ2GH.js} +1 -1
  25. package/public/chunk-AWO5LOJT.js +1 -0
  26. package/public/{chunk-5NGLQJJS.js → chunk-C375S7ZB.js} +1 -1
  27. package/public/{chunk-PWSUWMHH.js → chunk-CQ242CGY.js} +1 -1
  28. package/public/{chunk-CNVA3LLU.js → chunk-CZLQGA7E.js} +1 -1
  29. package/public/{chunk-V2SMMSMC.js → chunk-DG3NLZF3.js} +1 -1
  30. package/public/chunk-DGB4Z6YE.js +1 -0
  31. package/public/{chunk-2VTMBAA3.js → chunk-EP6Z6H7W.js} +1 -1
  32. package/public/{chunk-A3GH5UM5.js → chunk-EPVBHJMO.js} +1 -1
  33. package/public/{chunk-OOXWGEYZ.js → chunk-ESOONFXO.js} +1 -1
  34. package/public/{chunk-DTEN7TFT.js → chunk-GJSBDQUE.js} +1 -1
  35. package/public/{chunk-HVJ23MRE.js → chunk-HOS4YIX7.js} +1 -1
  36. package/public/chunk-I3CUYGV7.js +1 -0
  37. package/public/{chunk-Z3ALWMOS.js → chunk-IBU5YEEM.js} +1 -1
  38. package/public/{chunk-XH4RYJ6Y.js → chunk-IEZW2VEP.js} +1 -1
  39. package/public/chunk-IMOI4TFW.js +1 -0
  40. package/public/{chunk-ILUFFLLG.js → chunk-JOVQADHI.js} +1 -1
  41. package/public/{chunk-T6FL3CCM.js → chunk-KXCGRB3G.js} +1 -1
  42. package/public/{chunk-GSNP5K6X.js → chunk-LHN4UAQA.js} +1 -1
  43. package/public/{chunk-BW24SUSK.js → chunk-LNYT3SKC.js} +1 -1
  44. package/public/{chunk-6ROJUYIC.js → chunk-M2R6QPFI.js} +1 -1
  45. package/public/chunk-MTQTKA5O.js +1 -0
  46. package/public/chunk-NMIYLSIZ.js +1 -0
  47. package/public/chunk-OC33GC55.js +1 -0
  48. package/public/chunk-PGKEDZHN.js +1 -0
  49. package/public/{chunk-LUWQZ3SC.js → chunk-PZKA3UJH.js} +1 -1
  50. package/public/chunk-PZUTTO4V.js +1 -0
  51. package/public/chunk-QIFR6XR6.js +1 -0
  52. package/public/{chunk-MYN3AAWO.js → chunk-QIV7YSY4.js} +1 -1
  53. package/public/chunk-QQOK3KJT.js +1 -0
  54. package/public/{chunk-IP3KHS2K.js → chunk-S54GY5PX.js} +1 -1
  55. package/public/{chunk-TCJEY6SZ.js → chunk-SBMAEWZL.js} +1 -1
  56. package/public/{chunk-UHL5ARSB.js → chunk-SGZRBB5V.js} +1 -1
  57. package/public/{chunk-J4USS3TJ.js → chunk-SOF2B4MD.js} +1 -1
  58. package/public/{chunk-3TXWUXFU.js → chunk-SX6UWGJ4.js} +1 -1
  59. package/public/{chunk-4RLAAHQO.js → chunk-TE7XO5CJ.js} +1 -1
  60. package/public/{chunk-GFBM6MCU.js → chunk-UFV3R2Q7.js} +1 -1
  61. package/public/chunk-VEN3Q2Q4.js +1 -0
  62. package/public/{chunk-2UMHCTKQ.js → chunk-VS5PRHN6.js} +1 -1
  63. package/public/{chunk-G43HU5Q5.js → chunk-WP2UTBVE.js} +1 -1
  64. package/public/chunk-WTFNIBFS.js +1 -0
  65. package/public/{chunk-66WXYXRV.js → chunk-XPN5TMQN.js} +1 -1
  66. package/public/chunk-YKWTDK3T.js +1 -0
  67. package/public/{chunk-3KEKNJHK.js → chunk-Z7KU3HYE.js} +1 -1
  68. package/public/{chunk-WNQ3ZPRR.js → chunk-ZSBJ7N3G.js} +1 -1
  69. package/public/index.html +1 -1
  70. package/public/main-QPGMWLZX.js +1 -0
  71. package/public/chunk-2IFXAVZX.js +0 -1
  72. package/public/chunk-2LXRWE65.js +0 -1
  73. package/public/chunk-2WSC6B2N.js +0 -1
  74. package/public/chunk-4PXS64Y6.js +0 -1
  75. package/public/chunk-BCSWG6SE.js +0 -1
  76. package/public/chunk-CX3YFWUG.js +0 -1
  77. package/public/chunk-CZCRTSM7.js +0 -1
  78. package/public/chunk-HLYXUMFJ.js +0 -1
  79. package/public/chunk-ILS4HCUL.js +0 -1
  80. package/public/chunk-IZSJEHPY.js +0 -1
  81. package/public/chunk-S7QXG5F2.js +0 -1
  82. package/public/chunk-T34MBGSG.js +0 -1
  83. package/public/chunk-WXKGTM52.js +0 -1
  84. package/public/chunk-X63C4XBV.js +0 -1
  85. package/public/chunk-YXX7ION6.js +0 -1
  86. package/public/chunk-Z26UR5NK.js +0 -1
  87. package/public/main-RD7O64IM.js +0 -1
@@ -1 +1 @@
1
- import{A as j,c as O,d as C,e as T,f as N,g as q,j as w,m as H,p as z,q as D,w as G,x as Q,z as A}from"./chunk-HLSZVFAU.js";import{d as U}from"./chunk-QR7L4UUP.js";import{c as X}from"./chunk-5BL6PCNR.js";import{b as K}from"./chunk-G43HU5Q5.js";import{j as J}from"./chunk-ZHNSZ7X2.js";import{b as W}from"./chunk-DJKI5XBW.js";import{$a as n,Ac as l,Bc as d,Hb as p,Ib as u,Lc as b,M as I,Nb as m,Nc as P,Ob as r,Pb as a,Qb as s,Xa as x,Xb as M,Yb as F,bd as B,dc as f,ec as L,ed as R,fb as k,h as y,jc as c,kc as v,la as g,lb as E,lc as V,sd as $,w as S,wc as h}from"./chunk-U4V4ICSI.js";var Z=["password"],ee=["username"],te=["otp"],ie=e=>({background:e}),Y=e=>({"is-invalid":e});function ne(e,_){if(e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",13),a(),s(3,"input",14,0),l(5,"translate"),a(),r(6,"div",8)(7,"span",12),s(8,"i",15),a(),s(9,"input",16,1),l(11,"translate"),a()),e&2){let i=F();n(3),m("placeholder",d(5,4,"users.label_username"))("ngClass",h(8,Y,i.form.controls.username.dirty&&i.form.controls.username.errors)),n(6),m("placeholder",d(11,6,"users.label_password"))("ngClass",h(10,Y,i.form.controls.password.dirty&&i.form.controls.password.errors))}}function oe(e,_){e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",17),a(),s(3,"input",18,2),l(5,"translate"),a()),e&2&&(n(3),m("placeholder",d(5,1,"login.label_2fa_code")))}function ae(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),c(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(n(5),v(d(6,2,"login.invalid_credentials")),n(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}function re(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),c(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(n(5),v(d(6,2,"login.invalid_code")),n(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}var _e=(()=>{class e{cdr;$auth=g(X);$router=g(U);$settings=g(K);passwordInput=b("password");usernameInput=b("username");otpInput=b("otp");form;backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;targetRoute;constructor(i){this.cdr=i}ngOnInit(){this.form=new q({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(I(500)).subscribe(i=>{let o=this.passwordInput()?.nativeElement.value;o&&o!==i.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}ngAfterViewChecked(){this.cdr.detectChanges()}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield S(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash&&this.$settings.env.customWallpaperHash){let i=`${J.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${i}') center/cover`}})}onSubmit(){return y(this,null,function*(){this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0,document.getElementById("submit-button")?.blur();let i=this.passwordInput()?.nativeElement.value;i&&i!==this.form.get("password").value&&this.form.controls.password.setValue(i);let o=this.usernameInput()?.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let t=this.otpInput()?.nativeElement.value;t&&t!==this.form.get("otp").value&&this.form.controls.username.setValue(t)}try{yield this.$auth.login(this.form.getRawValue()),this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}catch(t){t.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[C.required,C.minLength(6),C.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}this.inProgress=!1})}static \u0275fac=function(o){return new(o||e)(k(P))};static \u0275cmp=E({type:e,selectors:[["ng-component"]],viewQuery:function(o,t){o&1&&(f(t.passwordInput,Z,5),f(t.usernameInput,ee,5),f(t.otpInput,te,5)),o&2&&L(3)},decls:15,vars:15,consts:[["username",""],["password",""],["otp",""],[1,"login-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle"],[1,"w-100","login-card","d-flex","py-4","flex-column"],["ngSrc","/assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],["novalidate","",3,"ngSubmit","formGroup"],[1,"mb-4","text-center"],[1,"input-group","mb-4"],[1,"input-group","no-border","mb-4"],[1,"text-center"],["tabindex","3","id","submit-button","type","submit",1,"btn","btn-primary","mb-4",3,"disabled"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-key","primary-text","fa-lg"],["formControlName","otp","type","text","id","form-ota","autofocus","","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","custom-input",3,"placeholder"],[1,"fas","fa-fw","fa-exclamation-triangle","pink-text","fa-lg"],[1,"form-control","custom-input"],[1,"small","grey-text","fw-semibold"],[1,"small","grey-text",3,"innerHTML"]],template:function(o,t){o&1&&(r(0,"div",3)(1,"div",4),s(2,"img",5),r(3,"form",6),M("ngSubmit",function(){return t.onSubmit()}),r(4,"h4",7),c(5),l(6,"translate"),a(),p(7,ne,12,12),p(8,oe,6,3,"div",8),p(9,ae,9,6,"div",9),p(10,re,9,6,"div",9),r(11,"div",10)(12,"button",11),c(13),l(14,"translate"),a()()()()()),o&2&&(m("ngStyle",h(13,ie,t.backgroundStyle)),n(3),m("formGroup",t.form),n(2),v(d(6,9,"setup.welcome_to_homebridge")),n(2),u(t.twoFactorCodeRequired?-1:7),n(),u(t.twoFactorCodeRequired?8:-1),n(),u(t.invalidCredentials?9:-1),n(),u(t.invalid2faCode?10:-1),n(2),m("disabled",t.form.invalid),n(),V(" ",d(14,11,"form.label_continue")," "))},dependencies:[R,A,H,O,T,N,G,Q,j,z,D,B,W,$],styles:["body{overflow:scroll!important} body.dark-mode .login-card{background-color:#2b2b2b;color:#fff}.login-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%;-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.login-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.login-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}.btn-primary[_ngcontent-%COMP%]{background-color:#4a266c!important;border-color:#4a266c!important}"]})}return e})();export{_e as a};
1
+ import{A as j,c as O,d as C,e as T,f as N,g as q,j as w,m as H,p as z,q as D,w as G,x as Q,z as A}from"./chunk-HLSZVFAU.js";import{d as U}from"./chunk-QR7L4UUP.js";import{c as X}from"./chunk-7GYDUXMU.js";import{b as K}from"./chunk-WP2UTBVE.js";import{j as J}from"./chunk-37FVXLTH.js";import{b as W}from"./chunk-DJKI5XBW.js";import{$a as n,Ac as l,Bc as d,Hb as p,Ib as u,Lc as b,M as I,Nb as m,Nc as P,Ob as r,Pb as a,Qb as s,Xa as x,Xb as M,Yb as F,bd as B,dc as f,ec as L,ed as R,fb as k,h as y,jc as c,kc as v,la as g,lb as E,lc as V,sd as $,w as S,wc as h}from"./chunk-U4V4ICSI.js";var Z=["password"],ee=["username"],te=["otp"],ie=e=>({background:e}),Y=e=>({"is-invalid":e});function ne(e,_){if(e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",13),a(),s(3,"input",14,0),l(5,"translate"),a(),r(6,"div",8)(7,"span",12),s(8,"i",15),a(),s(9,"input",16,1),l(11,"translate"),a()),e&2){let i=F();n(3),m("placeholder",d(5,4,"users.label_username"))("ngClass",h(8,Y,i.form.controls.username.dirty&&i.form.controls.username.errors)),n(6),m("placeholder",d(11,6,"users.label_password"))("ngClass",h(10,Y,i.form.controls.password.dirty&&i.form.controls.password.errors))}}function oe(e,_){e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",17),a(),s(3,"input",18,2),l(5,"translate"),a()),e&2&&(n(3),m("placeholder",d(5,1,"login.label_2fa_code")))}function ae(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),c(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(n(5),v(d(6,2,"login.invalid_credentials")),n(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}function re(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),c(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(n(5),v(d(6,2,"login.invalid_code")),n(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}var _e=(()=>{class e{cdr;$auth=g(X);$router=g(U);$settings=g(K);passwordInput=b("password");usernameInput=b("username");otpInput=b("otp");form;backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;targetRoute;constructor(i){this.cdr=i}ngOnInit(){this.form=new q({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(I(500)).subscribe(i=>{let o=this.passwordInput()?.nativeElement.value;o&&o!==i.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}ngAfterViewChecked(){this.cdr.detectChanges()}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield S(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash&&this.$settings.env.customWallpaperHash){let i=`${J.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${i}') center/cover`}})}onSubmit(){return y(this,null,function*(){this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0,document.getElementById("submit-button")?.blur();let i=this.passwordInput()?.nativeElement.value;i&&i!==this.form.get("password").value&&this.form.controls.password.setValue(i);let o=this.usernameInput()?.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let t=this.otpInput()?.nativeElement.value;t&&t!==this.form.get("otp").value&&this.form.controls.username.setValue(t)}try{yield this.$auth.login(this.form.getRawValue()),this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}catch(t){t.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[C.required,C.minLength(6),C.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}this.inProgress=!1})}static \u0275fac=function(o){return new(o||e)(k(P))};static \u0275cmp=E({type:e,selectors:[["ng-component"]],viewQuery:function(o,t){o&1&&(f(t.passwordInput,Z,5),f(t.usernameInput,ee,5),f(t.otpInput,te,5)),o&2&&L(3)},decls:15,vars:15,consts:[["username",""],["password",""],["otp",""],[1,"login-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle"],[1,"w-100","login-card","d-flex","py-4","flex-column"],["ngSrc","/assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],["novalidate","",3,"ngSubmit","formGroup"],[1,"mb-4","text-center"],[1,"input-group","mb-4"],[1,"input-group","no-border","mb-4"],[1,"text-center"],["tabindex","3","id","submit-button","type","submit",1,"btn","btn-primary","mb-4",3,"disabled"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-key","primary-text","fa-lg"],["formControlName","otp","type","text","id","form-ota","autofocus","","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","custom-input",3,"placeholder"],[1,"fas","fa-fw","fa-exclamation-triangle","pink-text","fa-lg"],[1,"form-control","custom-input"],[1,"small","grey-text","fw-semibold"],[1,"small","grey-text",3,"innerHTML"]],template:function(o,t){o&1&&(r(0,"div",3)(1,"div",4),s(2,"img",5),r(3,"form",6),M("ngSubmit",function(){return t.onSubmit()}),r(4,"h4",7),c(5),l(6,"translate"),a(),p(7,ne,12,12),p(8,oe,6,3,"div",8),p(9,ae,9,6,"div",9),p(10,re,9,6,"div",9),r(11,"div",10)(12,"button",11),c(13),l(14,"translate"),a()()()()()),o&2&&(m("ngStyle",h(13,ie,t.backgroundStyle)),n(3),m("formGroup",t.form),n(2),v(d(6,9,"setup.welcome_to_homebridge")),n(2),u(t.twoFactorCodeRequired?-1:7),n(),u(t.twoFactorCodeRequired?8:-1),n(),u(t.invalidCredentials?9:-1),n(),u(t.invalid2faCode?10:-1),n(2),m("disabled",t.form.invalid),n(),V(" ",d(14,11,"form.label_continue")," "))},dependencies:[R,A,H,O,T,N,G,Q,j,z,D,B,W,$],styles:["body{overflow:scroll!important} body.dark-mode .login-card{background-color:#2b2b2b;color:#fff}.login-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%;-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.login-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.login-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}.btn-primary[_ngcontent-%COMP%]{background-color:#4a266c!important;border-color:#4a266c!important}"]})}return e})();export{_e as a};
@@ -1 +1 @@
1
- import{a as j}from"./chunk-WNQ3ZPRR.js";import"./chunk-WM3ZC7RY.js";import"./chunk-A3GH5UM5.js";import{c as M}from"./chunk-CHQVUHUA.js";import"./chunk-XZR7OZ6I.js";import{q as u}from"./chunk-7S2SCSTB.js";import{A as d,z as l}from"./chunk-HLSZVFAU.js";import{d as h,g as a}from"./chunk-QR7L4UUP.js";import"./chunk-G43HU5Q5.js";import{h as v,k as y}from"./chunk-ZHNSZ7X2.js";import"./chunk-ASBFWS7L.js";import{a as g,c as C}from"./chunk-DJKI5XBW.js";import{ga as c,h as s,ha as i,kd as p,la as e,mb as n,w as f}from"./chunk-U4V4ICSI.js";var m=(()=>{class o{$api=e(y);$router=e(h);$toastr=e(v);$translate=e(g);constructor(){}resolve(){return s(this,null,function*(){try{let r=yield f(this.$api.get("/config-editor"));return JSON.stringify(r,null,4)}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(t){return new(t||o)};static \u0275prov=c({token:o,factory:o.\u0275fac})}return o})();var $=[{path:"",loadComponent:()=>import("./chunk-2LXRWE65.js").then(o=>o.ConfigEditorComponent),resolve:{config:m}}],R=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=n({type:o});static \u0275inj=i({imports:[a.forChild($),a]})}return o})();var Q=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=n({type:o});static \u0275inj=i({providers:[m],imports:[p,l,d,M,u,C.forChild(),R,j]})}return o})();export{Q as ConfigEditorModule};
1
+ import{a as j}from"./chunk-ZSBJ7N3G.js";import"./chunk-WM3ZC7RY.js";import"./chunk-EPVBHJMO.js";import{c as M}from"./chunk-CHQVUHUA.js";import"./chunk-XZR7OZ6I.js";import{q as u}from"./chunk-7S2SCSTB.js";import{A as d,z as l}from"./chunk-HLSZVFAU.js";import{d as h,g as a}from"./chunk-QR7L4UUP.js";import"./chunk-WP2UTBVE.js";import{h as v,k as y}from"./chunk-37FVXLTH.js";import"./chunk-ASBFWS7L.js";import{a as g,c as C}from"./chunk-DJKI5XBW.js";import{ga as c,h as s,ha as i,kd as p,la as e,mb as n,w as f}from"./chunk-U4V4ICSI.js";var m=(()=>{class o{$api=e(y);$router=e(h);$toastr=e(v);$translate=e(g);constructor(){}resolve(){return s(this,null,function*(){try{let r=yield f(this.$api.get("/config-editor"));return JSON.stringify(r,null,4)}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(t){return new(t||o)};static \u0275prov=c({token:o,factory:o.\u0275fac})}return o})();var $=[{path:"",loadComponent:()=>import("./chunk-3YH76G4Q.js").then(o=>o.ConfigEditorComponent),resolve:{config:m}}],R=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=n({type:o});static \u0275inj=i({imports:[a.forChild($),a]})}return o})();var Q=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=n({type:o});static \u0275inj=i({providers:[m],imports:[p,l,d,M,u,C.forChild(),R,j]})}return o})();export{Q as ConfigEditorModule};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-ZSBJ7N3G.js";import"./chunk-WM3ZC7RY.js";import"./chunk-EPVBHJMO.js";import"./chunk-CHQVUHUA.js";import"./chunk-XZR7OZ6I.js";import"./chunk-7S2SCSTB.js";import"./chunk-HLSZVFAU.js";import"./chunk-QR7L4UUP.js";import"./chunk-WP2UTBVE.js";import"./chunk-37FVXLTH.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as ConfigEditorComponent};
@@ -0,0 +1 @@
1
+ import{a as ye}from"./chunk-SX6UWGJ4.js";import{a as Ee}from"./chunk-ESOONFXO.js";import{v as Ie}from"./chunk-55BN66AX.js";import{a as Be}from"./chunk-EPVBHJMO.js";import{g as X,m as T,n as Y}from"./chunk-7S2SCSTB.js";import{A as Q,b as W,c as pe,e as q,f as ce,g as te,j as D,k as me,l as K,m as ue,n as _e,o as ge,p as be,q as ve,r as fe,s as xe,t as he,u as Ce,v as Se,z as J}from"./chunk-HLSZVFAU.js";import{d as H,e as ke}from"./chunk-QR7L4UUP.js";import{b as Z}from"./chunk-WP2UTBVE.js";import{h as N,j as we,k as M}from"./chunk-37FVXLTH.js";import{a as A,b as E}from"./chunk-DJKI5XBW.js";import{$a as t,Ac as l,Bc as o,Cc as j,Gb as x,Hb as v,Ib as f,Kb as F,Lb as V,M as ee,Mb as R,Nb as _,Ob as i,Pb as n,Qb as c,Ub as w,Xa as re,Xb as b,Ya as le,Yb as g,bd as L,gd as G,h as B,jc as r,kc as p,la as C,lb as y,lc as u,qc as oe,ra as S,rc as se,sa as k,sc as de,w as I,wc as P,xc as $,yc as O}from"./chunk-U4V4ICSI.js";function Re(a,m){a&1&&(i(0,"div",12),c(1,"i",13),n(),i(2,"p",14),r(3),l(4,"translate"),n()),a&2&&(t(3),p(o(4,1,"reset.no_accessories")))}function De(a,m){a&1&&(i(0,"div",12),c(1,"i",15),n(),i(2,"ul",16)(3,"li"),r(4),l(5,"translate"),n(),i(6,"li"),r(7),l(8,"translate"),n(),i(9,"li"),r(10),l(11,"translate"),n()(),i(12,"ngb-alert",17)(13,"p",18),r(14),l(15,"translate"),n()()),a&2&&(t(4),p(o(5,5,"reset.accessory_all.list_1")),t(3),p(o(8,7,"reset.accessory_all.list_2")),t(3),p(o(11,9,"reset.accessory_all.list_3")),t(2),_("dismissible",!1),t(2),p(o(15,11,"reset.action_is_irreversible")))}function Pe(a,m){if(a&1){let e=w();i(0,"button",19),l(1,"translate"),b("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(2),l(3,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),x("aria-label",o(1,3,"form.button_close")),t(2),u(" ",o(3,5,"form.button_close")," ")}}function He(a,m){if(a&1){let e=w();i(0,"button",20),l(1,"translate"),b("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(2),l(3,"translate"),n()}a&2&&(x("aria-label",o(1,2,"form.button_close")),t(2),u(" ",o(3,4,"form.button_close")," "))}function Ue(a,m){a&1&&(r(0),l(1,"translate")),a&2&&u(" ",o(1,1,"form.button_remove")," ")}function Oe(a,m){a&1&&c(0,"i",22)}function Le(a,m){if(a&1){let e=w();i(0,"button",21),b("click",function(){S(e);let s=g();return k(s.onResetCachedAccessoriesClick())}),v(1,Ue,2,3),v(2,Oe,1,0,"i",22),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),f(e.clicked?-1:1),t(),f(e.clicked?2:-1)}}var $e=(()=>{class a{$activeModal=C(T);$api=C(M);$router=C(H);$toastr=C(N);$translate=C(A);clicked=!1;cachedAccessories=[];constructor(){}ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return B(this,null,function*(){try{this.cachedAccessories=yield I(this.$api.get("/server/cached-accessories"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}onResetCachedAccessoriesClick(){return this.clicked=!0,this.$api.put("/server/reset-cached-accessories",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.delete_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=y({type:a,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),b("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),v(8,Re,5,3),v(9,De,16,13),n(),i(10,"div",5)(11,"div",6),v(12,Pe,4,7,"button",7),n(),i(13,"div",8),v(14,He,4,6,"button",9),n(),i(15,"div",10),v(16,Le,3,3,"button",11),n()()()),d&2&&(t(3),p(o(4,8,"reset.accessory_all.title")),t(2),_("disabled",s.clicked),x("aria-label",o(6,10,"form.button_close")),t(3),f(s.cachedAccessories.length===0?8:-1),t(),f(s.cachedAccessories.length>0?9:-1),t(3),f(s.cachedAccessories.length>0?12:-1),t(2),f(s.cachedAccessories.length===0?14:-1),t(2),f(s.cachedAccessories.length>0?16:-1))},dependencies:[X,E],encapsulation:2})}return a})();var ze=(a,m)=>({"green-text":a,"grey-text":m}),je=(a,m)=>({"btn-danger":a,"btn-elegant":m}),Ge=(a,m,e)=>({"fa-broom":a,"fa-undo":m,"fa-spinner fa-pulse":e});function We(a,m){a&1&&(i(0,"div",12),c(1,"i",13),n(),i(2,"p",14),r(3),l(4,"translate"),n()),a&2&&(t(3),p(o(4,1,"reset.bridge_accessories.empty")))}function qe(a,m){if(a&1){let e=w();i(0,"li",18)(1,"span"),r(2),c(3,"br"),i(4,"small",19),c(5,"i",20),r(6),l(7,"translate"),i(8,"span",21),r(9),n()()(),i(10,"button",22),l(11,"translate"),b("click",function(){let s=S(e).$implicit,h=g(2);return k(h.toggleList(s._id))}),c(12,"i",23),n()()}if(a&2){let e=m.$implicit,d=g(2);t(2),u(" ",e.name," "),t(3),_("ngClass",$(12,ze,e._isPaired,!e._isPaired)),t(),u(" ",o(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),_("disabled",d.clicked)("ngClass",$(15,je,!d.toDelete.includes(e._id),d.toDelete.includes(e._id))),x("aria-label",o(11,10,"form.button_delete")),t(2),_("ngClass",O(18,Ge,!d.toDelete.includes(e._id),d.toDelete.includes(e._id)&&!d.clicked,d.toDelete.includes(e._id)&&d.clicked))}}function Ke(a,m){if(a&1&&(i(0,"div",12),c(1,"i",15),n(),i(2,"ul",16)(3,"li"),r(4),l(5,"translate"),n(),i(6,"li"),r(7),l(8,"translate"),n(),i(9,"li"),r(10),l(11,"translate"),n()(),i(12,"ul",17),V(13,qe,13,22,"li",18,F),n()),a&2){let e=g();t(4),p(o(5,3,"reset.bridge_accessories.list_1")),t(3),p(o(8,5,"reset.clear_cache_single.list_3")),t(3),p(o(11,7,"reset.bridge_accessories.list_2")),t(3),R(e.pairings)}}function Je(a,m){if(a&1){let e=w();i(0,"button",24),b("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(1),l(2,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),u(" ",o(2,2,"form.button_close")," ")}}function Qe(a,m){if(a&1){let e=w();i(0,"button",25),b("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(1),l(2,"translate"),n()}a&2&&(t(),u(" ",o(2,1,"form.button_close")," "))}function Xe(a,m){if(a&1&&r(0),a&2){let e=g(3);u(" (",e.toDelete.length,") ")}}function Ye(a,m){if(a&1&&(r(0),l(1,"translate"),v(2,Xe,1,1)),a&2){let e=g(2);u(" ",o(1,2,"form.button_remove")," "),t(2),f(e.toDelete.length>0?2:-1)}}function Ze(a,m){a&1&&c(0,"i",27)}function et(a,m){if(a&1){let e=w();i(0,"button",26),b("click",function(){S(e);let s=g();return k(s.cleanBridges())}),v(1,Ye,3,4),v(2,Ze,1,0,"i",27),n()}if(a&2){let e=g();_("disabled",!e.toDelete.length||e.clicked),t(),f(e.clicked?-1:1),t(),f(e.clicked?2:-1)}}var Te=(()=>{class a{$activeModal=C(T);$api=C(M);$router=C(H);$toastr=C(N);$translate=C(A);clicked=!1;pairings=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return B(this,null,function*(){try{this.pairings=(yield I(this.$api.get("/server/pairings"))).filter(e=>e._category==="bridge"&&!e._main).sort((e,d)=>e.name.localeCompare(d.name))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e){this.toDelete.includes(e)?this.toDelete=this.toDelete.filter(d=>d!==e):this.toDelete.push(e)}cleanBridges(){return this.clicked=!0,this.$api.delete("/server/pairings/accessories",{body:this.toDelete.map(e=>({id:e}))}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=y({type:a,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-broom","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),b("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),v(8,We,5,3),v(9,Ke,15,9),n(),i(10,"div",5)(11,"div",6),v(12,Je,3,4,"button",7),n(),i(13,"div",8),v(14,Qe,3,3,"button",9),n(),i(15,"div",10),v(16,et,3,3,"button",11),n()()()),d&2&&(t(3),p(o(4,8,"reset.bridge_accessories.title")),t(2),_("disabled",s.clicked),x("aria-label",o(6,10,"form.button_close")),t(3),f(s.pairings.length===0?8:-1),t(),f(s.pairings.length>0?9:-1),t(3),f(s.pairings.length>0?12:-1),t(2),f(s.pairings.length===0?14:-1),t(2),f(s.pairings.length>0?16:-1))},dependencies:[L,E],encapsulation:2})}return a})();function tt(a,m){a&1&&(r(0),l(1,"translate")),a&2&&u(" ",o(1,1,"form.button_reset")," ")}function it(a,m){a&1&&c(0,"i",16)}var Ae=(()=>{class a{$activeModal=C(T);$api=C(M);$route=C(H);$toastr=C(N);$translate=C(A);clicked;constructor(){}onResetHomebridgeAccessoryClick(){return this.clicked=!0,this.$api.put("/server/reset-homebridge-accessory",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_reset"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$route.navigate(["/restart"])},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=y({type:a,selectors:[["ng-component"]],decls:38,vars:33,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),b("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4)(8,"div",5),c(9,"i",6),n(),i(10,"ul",7)(11,"li"),r(12),l(13,"translate"),n(),i(14,"li"),r(15),l(16,"translate"),n(),i(17,"li"),r(18),l(19,"translate"),n(),i(20,"li"),r(21),l(22,"translate"),n()(),i(23,"ngb-alert",8)(24,"p",9),r(25),l(26,"translate"),n()()(),i(27,"div",10)(28,"div",11)(29,"button",12),l(30,"translate"),b("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(31),l(32,"translate"),n()(),c(33,"div",13),i(34,"div",14)(35,"button",15),b("click",function(){return s.onResetHomebridgeAccessoryClick()}),v(36,tt,2,3),v(37,it,1,0,"i",16),n()()()()),d&2&&(t(3),p(o(4,15,"reset.bridge_all.title")),t(2),_("disabled",s.clicked),x("aria-label",o(6,17,"form.button_close")),t(7),p(o(13,19,"reset.bridge_all.list_1")),t(3),p(o(16,21,"reset.bridge_all.list_2")),t(3),p(o(19,23,"reset.bridge_all.list_3")),t(3),p(o(22,25,"reset.bridge_all.list_4")),t(2),_("dismissible",!1),t(2),p(o(26,27,"reset.action_is_irreversible")),t(4),_("disabled",s.clicked),x("aria-label",o(30,29,"form.button_close")),t(2),u(" ",o(32,31,"form.button_close")," "),t(4),_("disabled",s.clicked),t(),f(s.clicked?-1:36),t(),f(s.clicked?37:-1))},dependencies:[X,E],encapsulation:2})}return a})();var ie=(a,m)=>({"green-text":a,"grey-text":m}),ne=(a,m)=>({"btn-danger":a,"btn-elegant":m}),Ne=(a,m,e)=>({"fa-refresh":a,"fa-undo":m,"fa-spinner fa-pulse":e}),nt=(a,m,e)=>({"fa-trash":a,"fa-undo":m,"fa-spinner fa-pulse":e});function at(a,m){a&1&&(i(0,"div",12),c(1,"i",13),n(),i(2,"p",14),r(3),l(4,"translate"),n()),a&2&&(t(3),p(o(4,1,"reset.bridges.empty")))}function rt(a,m){if(a&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),l(7,"translate"),i(8,"span",23),r(9),n(),r(10),l(11,"titlecase"),n()(),i(12,"button",24),l(13,"translate"),b("click",function(){let s=S(e).$implicit,h=g(3);return k(h.toggleList(s._id,!1))}),c(14,"i",25),n()()}if(a&2){let e=m.$implicit,d=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",$(15,ie,e._isPaired,!e._isPaired)),t(),u(" ",o(7,9,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),u(" \xB7 ",e._main?"Homebridge":o(11,11,e._category)," "),t(2),_("disabled",d.clicked)("ngClass",$(18,ne,!d.isInList(e._id),d.isInList(e._id))),x("aria-label",o(13,13,"form.button_unpair")),t(2),_("ngClass",O(21,Ne,!d.isInList(e._id),d.isInList(e._id)&&!d.clicked,d.isInList(e._id)&&d.clicked))}}function lt(a,m){if(a&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),l(4,"translate"),n(),i(5,"p",19),r(6),l(7,"translate"),n()(),V(8,rt,15,25,"li",20,F),n()),a&2){let e=g(2);t(3),p(o(4,2,"reset.bridge_ind.head_non_child")),t(3),p(o(7,4,"reset.bridge_ind.desc_non_child")),t(2),R(e.pairingsNonChild)}}function ot(a,m){if(a&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),l(7,"translate"),i(8,"span",23),r(9),n()()(),i(10,"button",24),l(11,"translate"),b("click",function(){let s=S(e).$implicit,h=g(3);return k(h.toggleList(s._id,!0))}),c(12,"i",25),n()()}if(a&2){let e=m.$implicit,d=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",$(12,ie,e._isPaired,!e._isPaired)),t(),u(" ",o(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),_("disabled",d.clicked)("ngClass",$(15,ne,!d.isInList(e._id),d.isInList(e._id))),x("aria-label",o(11,10,"form.button_unpair")),t(2),_("ngClass",O(18,Ne,!d.isInList(e._id),d.isInList(e._id)&&!d.clicked,d.isInList(e._id)&&d.clicked))}}function st(a,m){if(a&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),l(4,"translate"),n(),i(5,"p",19),r(6),l(7,"translate"),n()(),V(8,ot,13,22,"li",20,F),n()),a&2){let e=g(2);t(3),p(o(4,2,"reset.bridge_ind.head_child_active")),t(3),p(o(7,4,"reset.bridge_ind.desc_child_active")),t(2),R(e.pairingsChildActive)}}function dt(a,m){if(a&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),l(7,"translate"),i(8,"span",23),r(9),n()()(),i(10,"button",24),l(11,"translate"),b("click",function(){let s=S(e).$implicit,h=g(3);return k(h.toggleList(s._id,!1))}),c(12,"i",25),n()()}if(a&2){let e=m.$implicit,d=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",$(12,ie,e._isPaired,!e._isPaired)),t(),u(" ",o(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),_("disabled",d.clicked)("ngClass",$(15,ne,!d.isInList(e._id),d.isInList(e._id))),x("aria-label",o(11,10,"form.button_unpair")),t(2),_("ngClass",O(18,nt,!d.isInList(e._id),d.isInList(e._id)&&!d.clicked,d.isInList(e._id)&&d.clicked))}}function pt(a,m){if(a&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),l(4,"translate"),n(),i(5,"p",19),r(6),l(7,"translate"),n()(),V(8,dt,13,22,"li",20,F),n()),a&2){let e=g(2);t(3),p(o(4,2,"reset.bridge_ind.head_child_stale")),t(3),p(o(7,4,"reset.bridge_ind.desc_child_stale")),t(2),R(e.pairingsChildStale)}}function ct(a,m){if(a&1&&(i(0,"div",12),c(1,"i",15),n(),v(2,lt,10,6,"ul",16),v(3,st,10,6,"ul",16),v(4,pt,10,6,"ul",16)),a&2){let e=g();t(2),f(e.pairingsNonChild.length>0?2:-1),t(),f(e.pairingsChildActive.length>0?3:-1),t(),f(e.pairingsChildStale.length>0?4:-1)}}function mt(a,m){if(a&1){let e=w();i(0,"button",26),b("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(1),l(2,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),u(" ",o(2,2,"form.button_close")," ")}}function ut(a,m){if(a&1){let e=w();i(0,"button",27),b("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(1),l(2,"translate"),n()}a&2&&(t(),u(" ",o(2,1,"form.button_close")," "))}function _t(a,m){if(a&1&&r(0),a&2){let e=g(3);u(" (",e.toDelete.length,") ")}}function gt(a,m){if(a&1&&(r(0),l(1,"translate"),v(2,_t,1,1)),a&2){let e=g(2);u(" ",o(1,2,"form.button_reset")," "),t(2),f(e.toDelete.length>0?2:-1)}}function bt(a,m){a&1&&c(0,"i",29)}function vt(a,m){if(a&1){let e=w();i(0,"button",28),b("click",function(){S(e);let s=g();return k(s.removeBridges())}),v(1,gt,3,4),v(2,bt,1,0,"i",29),n()}if(a&2){let e=g();_("disabled",!e.toDelete.length||e.clicked),t(),f(e.clicked?-1:1),t(),f(e.clicked?2:-1)}}var Me=(()=>{class a{$activeModal=C(T);$api=C(M);$router=C(H);$toastr=C(N);$translate=C(A);clicked=!1;pairingsNonChild=[];pairingsChildActive=[];pairingsChildStale=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return B(this,null,function*(){try{let e=(yield I(this.$api.get("/server/pairings"))).filter(d=>!d._main).sort((d,s)=>d.name.localeCompare(s.name));this.pairingsChildActive=e.filter(d=>d._category==="bridge"&&!d._couldBeStale),this.pairingsNonChild=e.filter(d=>d._category!=="bridge"),this.pairingsChildStale=e.filter(d=>d._category==="bridge"&&d._couldBeStale)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e,d=!1){this.toDelete.some(s=>s.id===e)?this.toDelete=this.toDelete.filter(s=>s.id!==e):this.toDelete.push({id:e,resetPairingInfo:d})}isInList(e){return this.toDelete.some(d=>d.id===e)}removeBridges(){return this.clicked=!0,this.$api.delete("/server/pairings",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.bridge_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.bridge_ind.fail"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=y({type:a,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"text-center","mb-0"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"list-group-item"],[1,"mb-1","text-center"],[1,"mb-0","small","grey-text","text-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),b("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),v(8,at,5,3),v(9,ct,5,3),n(),i(10,"div",5)(11,"div",6),v(12,mt,3,4,"button",7),n(),i(13,"div",8),v(14,ut,3,3,"button",9),n(),i(15,"div",10),v(16,vt,3,3,"button",11),n()()()),d&2&&(t(3),p(o(4,8,"reset.bridge_ind.title")),t(2),_("disabled",s.clicked),x("aria-label",o(6,10,"form.button_close")),t(3),f(s.pairingsChildActive.length===0&&s.pairingsChildStale.length===0&&s.pairingsNonChild.length===0?8:-1),t(),f(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?9:-1),t(3),f(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?12:-1),t(2),f(s.pairingsChildActive.length===0&&s.pairingsChildStale.length===0&&s.pairingsNonChild.length===0?14:-1),t(2),f(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?16:-1))},dependencies:[L,G,E],encapsulation:2})}return a})();function xt(a,m){if(a&1){let e=w();i(0,"li",10)(1,"span")(2,"label",17)(3,"input",18),de("ngModelChange",function(s){let h=S(e).$implicit;return se(h.selected,s)||(h.selected=s),k(s)}),n(),i(4,"span"),r(5),n(),c(6,"span",19),n()(),i(7,"span",20),r(8),n()()}if(a&2){let e=m.$implicit;t(2),_("for","adapter"+e.iface),t(),_("id","adapter"+e.iface),oe("ngModel",e.selected),t(2),p(e.iface),t(3),p(e.ip4||e.ip6)}}var Fe=(()=>{class a{$activeModal=C(T);availableNetworkAdapters=[];bridgeNetworkAdapters=[];constructor(){}submit(){this.$activeModal.close(this.availableNetworkAdapters.filter(e=>e.selected).map(e=>e.iface))}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=y({type:a,selectors:[["ng-component"]],inputs:{availableNetworkAdapters:"availableNetworkAdapters",bridgeNetworkAdapters:"bridgeNetworkAdapters"},decls:35,vars:24,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-ethernet","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","flex-row","justify-content-between"],[1,"list-group-item","d-flex","flex-row","flex-wrap","justify-content-between"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"],[1,"hb-uix-switch","d-inline","pe-3",3,"for"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"hb-uix-slider","hb-uix-round"],[1,"font-monospace"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),b("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4)(8,"div",5),c(9,"i",6),n(),i(10,"ul",7)(11,"li"),r(12),l(13,"translate"),n()(),i(14,"ul",8)(15,"li",9)(16,"strong"),r(17),l(18,"translate"),n(),i(19,"strong"),r(20),l(21,"translate"),n()(),V(22,xt,9,5,"li",10,F),n()(),i(24,"div",11)(25,"div",12)(26,"button",13),l(27,"translate"),b("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(28),l(29,"translate"),n()(),c(30,"div",14),i(31,"div",15)(32,"button",16),b("click",function(){return s.submit()}),r(33),l(34,"translate"),n()()()()),d&2&&(t(3),p(o(4,8,"settings.network.title_network_interfaces")),t(2),x("aria-label",o(6,10,"form.button_close")),t(7),p(o(13,12,"settings.network.message_network_interface")),t(5),p(o(18,14,"settings.network.label_interface_name")),t(3),p(o(21,16,"settings.network.label_ip_address")),t(2),R(s.availableNetworkAdapters),t(4),x("aria-label",o(27,18,"form.button_close")),t(2),u(" ",o(29,20,"form.button_close")," "),t(5),u(" ",o(34,22,"form.button_save")," "))},dependencies:[J,W,q,K,E],encapsulation:2})}return a})();var ht=a=>({maxFileSizeText:a});function Ct(a,m){if(a&1&&c(0,"img",9),a&2){let e=g();_("src",e.wallpaperUrl,le)}}function St(a,m){a&1&&c(0,"div",10)}var Ve=(()=>{class a{$activeModal=C(T);$api=C(M);$modal=C(Y);$settings=C(Z);$toastr=C(N);$translate=C(A);clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;wallpaperUrl=null;originalWallpaperUrl=null;constructor(){}ngOnInit(){this.$settings.env.customWallpaperHash&&(this.wallpaperUrl=`${we.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`,this.originalWallpaperUrl=this.wallpaperUrl)}onFileChange(e){if(e.length){this.selectedFile=e[0];let d=new FileReader;d.onload=s=>{this.wallpaperUrl=s.target.result},d.readAsDataURL(this.selectedFile)}else delete this.selectedFile,this.wallpaperUrl=this.originalWallpaperUrl}saveWallpaper(){this.clicked=!0;let e=new FormData;e.append("wallpaper",this.selectedFile,this.selectedFile.name),this.$api.post("/server/wallpaper",e).subscribe({next:()=>{this.clicked=!1,this.$modal.open(Be,{size:"lg",backdrop:"static"}),this.$activeModal.close()},error:d=>{console.error(d),this.$toastr.error(d.error?.message,this.$translate.instant("toast.title_error")),this.clicked=!1}})}cancel(){this.$activeModal.dismiss()}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=y({type:a,selectors:[["ng-component"]],decls:38,vars:31,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-image","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"mb-3","text-center"],["alt","Current Wallpaper",1,"img-fluid","rounded","mx-auto","d-block",2,"max-height","200px","max-width","50%",3,"src"],[1,"gradient","rounded",2,"height","200px","max-width","50%","margin","0 auto"],[1,"mb-0"],["type","file","id","wallpaper","accept","image/*",1,"form-control",3,"change"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),b("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4)(8,"div",5),c(9,"i",6),n(),i(10,"ul",7)(11,"li"),r(12),l(13,"translate"),n(),i(14,"li"),r(15),l(16,"translate"),n(),i(17,"li"),r(18),l(19,"translate"),n(),i(20,"li"),r(21),l(22,"translate"),n()(),i(23,"div",8),v(24,Ct,1,1,"img",9)(25,St,1,0,"div",10),n(),i(26,"div",11)(27,"input",12),b("change",function(U){return s.onFileChange(U.target.files)}),n()()(),i(28,"div",13)(29,"div",14)(30,"button",15),b("click",function(){return s.cancel()}),r(31),l(32,"translate"),n()(),c(33,"div",16),i(34,"div",17)(35,"button",18),b("click",function(){return s.saveWallpaper()}),r(36),l(37,"translate"),n()()()()),d&2&&(t(3),p(o(4,12,"settings.display.wallpaper")),t(2),_("disabled",s.clicked),x("aria-label",o(6,14,"form.button_close")),t(7),p(o(13,16,"settings.display.wallpaper_intro")),t(3),p(j(16,18,"settings.display.wallpaper_rule",P(29,ht,s.maxFileSizeText))),t(3),p(o(19,21,"settings.display.wallpaper_rule2")),t(3),p(o(22,23,"settings.display.wallpaper_rule3")),t(3),f(s.wallpaperUrl?24:25),t(6),_("disabled",s.clicked),t(),u(" ",o(32,25,"form.button_close")," "),t(4),_("disabled",!s.selectedFile||s.clicked),t(),u(" ",o(37,27,"form.button_save")," "))},dependencies:[Q,E],encapsulation:2})}return a})();var ae=a=>({"is-invalid":a}),kt=a=>({link:a}),wt=a=>({"fa-pulse":a}),yt=(a,m)=>({"badge-danger":a,"badge-info":m});function Et(a,m){a&1&&(i(0,"li",22)(1,"small",23),r(2),l(3,"translate"),n(),i(4,"button",24),l(5,"translate"),r(6),l(7,"translate"),n()()),a&2&&(t(2),p(o(3,3,"settings.changes.saved")),t(2),x("aria-label",o(5,5,"menu.tooltip_restart")),t(2),u(" ",o(7,7,"menu.tooltip_restart")," "))}function Bt(a,m){if(a&1){let e=w();i(0,"ul",5)(1,"li",14)(2,"span"),r(3,"Homebridge Name"),n(),i(4,"div",15),c(5,"input",16),l(6,"translate"),n()(),i(7,"li",17)(8,"span",18),r(9),l(10,"translate"),n(),i(11,"button",19),l(12,"translate"),b("click",function(){S(e);let s=g();return k(s.openUiSettings())}),c(13,"i",20),n()(),i(14,"li",17)(15,"span",18),r(16),l(17,"translate"),n(),i(18,"button",19),l(19,"translate"),b("click",function(){S(e);let s=g();return k(s.openBackupModal())}),c(20,"i",20),n()(),i(21,"li",17)(22,"span",18),r(23),l(24,"translate"),n(),i(25,"a",21),l(26,"translate"),c(27,"i",20),n()(),v(28,Et,8,9,"li",22),n()}if(a&2){let e=g();t(5),_("formControl",e.hbNameFormControl)("ngClass",P(24,ae,e.isInvalidHbName)),x("aria-label",o(6,10,"settings.network.port_ui")),t(4),p(o(10,12,"menu.label_settings_advanced")),t(2),x("aria-label",o(12,14,"menu.label_settings_advanced")),t(5),u(" ",o(17,16,"backup.title_backup")," "),t(2),x("aria-label",o(19,18,"backup.title_backup")),t(5),u(" ",o(24,20,"menu.tooltip_user_accounts")," "),t(2),x("aria-label",o(26,22,"menu.tooltip_user_accounts")),t(3),f(e.hasChangedHbName&&!e.isInvalidHbName?28:-1)}}function It(a,m){if(a&1){let e=w();i(0,"ul",6)(1,"li",14),r(2),l(3,"translate"),i(4,"div",25)(5,"select",26),b("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("lang",s))}),i(6,"option",27),r(7),l(8,"translate"),n(),i(9,"option",28),r(10,"Bulgarian (bg)"),n(),i(11,"option",29),r(12,"Catalan (ca)"),n(),i(13,"option",30),r(14,"Chinese - Simplified (zh-CN)"),n(),i(15,"option",31),r(16,"Chinese - Traditional (zh-TW)"),n(),i(17,"option",32),r(18,"Czech (cs)"),n(),i(19,"option",33),r(20,"Dutch (nl)"),n(),i(21,"option",34),r(22,"English (en)"),n(),i(23,"option",35),r(24,"Finnish (fi)"),n(),i(25,"option",36),r(26,"French (fr)"),n(),i(27,"option",37),r(28,"German (de)"),n(),i(29,"option",38),r(30,"Hebrew (he)"),n(),i(31,"option",39),r(32,"Hungarian (hu)"),n(),i(33,"option",40),r(34,"Indonesian (id)"),n(),i(35,"option",41),r(36,"Italian (it)"),n(),i(37,"option",42),r(38,"Japanese (ja)"),n(),i(39,"option",43),r(40,"Korean (ko)"),n(),i(41,"option",44),r(42,"Macedonian (mk)"),n(),i(43,"option",45),r(44,"Norwegian (no)"),n(),i(45,"option",46),r(46,"Polish (pl)"),n(),i(47,"option",47),r(48,"Portuguese (Brazil)"),n(),i(49,"option",48),r(50,"Portuguese (Portugal)"),n(),i(51,"option",49),r(52,"Russian (ru)"),n(),i(53,"option",50),r(54,"Slovenian (sl)"),n(),i(55,"option",51),r(56,"Spanish (es)"),n(),i(57,"option",52),r(58,"Swedish (sv)"),n(),i(59,"option",53),r(60,"Thai (th)"),n(),i(61,"option",54),r(62,"Turkish (tr)"),n(),i(63,"option",55),r(64,"Ukrainian (uk)"),n()()()(),i(65,"li",14),r(66),l(67,"translate"),i(68,"div",25)(69,"select",26),b("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("theme",s))}),i(70,"option",56),r(71),l(72,"translate"),n(),i(73,"option",57),r(74),l(75,"translate"),n(),i(76,"option",58),r(77),l(78,"translate"),n(),i(79,"option",59),r(80),l(81,"translate"),n(),i(82,"option",60),r(83),l(84,"translate"),n(),i(85,"option",61),r(86),l(87,"translate"),n(),i(88,"option",62),r(89),l(90,"translate"),n(),i(91,"option",63),r(92),l(93,"translate"),n(),i(94,"option",64),r(95),l(96,"translate"),n(),i(97,"option",65),r(98),l(99,"translate"),n(),i(100,"option",66),r(101),l(102,"translate"),n(),i(103,"option",67),r(104),l(105,"translate"),n(),i(106,"option",68),r(107),l(108,"translate"),n()()()(),i(109,"li",14),r(110),l(111,"translate"),i(112,"div",25)(113,"select",26),b("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("lightingMode",s))}),i(114,"option",27),r(115),l(116,"translate"),n(),i(117,"option",69),r(118),l(119,"translate"),n(),i(120,"option",70),r(121),l(122,"translate"),n()()()(),i(123,"li",14),r(124),l(125,"translate"),i(126,"div",25)(127,"select",26),b("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("menuMode",s))}),i(128,"option",71),r(129),l(130,"translate"),n(),i(131,"option",72),r(132),l(133,"translate"),n()()()(),i(134,"li",14),r(135),l(136,"translate"),i(137,"div",25)(138,"select",26),b("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("tempUnits",s))}),i(139,"option",73),r(140),l(141,"translate"),n(),i(142,"option",74),r(143),l(144,"translate"),n()()()(),i(145,"li",17)(146,"span",18),r(147),l(148,"translate"),n(),i(149,"button",19),l(150,"translate"),b("click",function(){S(e);let s=g();return k(s.openWallpaperModal())}),c(151,"i",20),n()()()}if(a&2){let e=g();t(2),u(" ",o(3,33,"settings.display.lang")," "),t(3),_("ngModel",e.$settings.env.lang),t(2),p(o(8,35,"form.select.auto")),t(59),u(" ",o(67,37,"settings.display.theme")," "),t(3),_("ngModel",e.$settings.theme),t(2),p(o(72,39,"settings.display.orange")),t(3),p(o(75,41,"settings.display.red")),t(3),p(o(78,43,"settings.display.pink")),t(3),p(o(81,45,"settings.display.purple")),t(3),p(o(84,47,"settings.display.deep_purple")),t(3),p(o(87,49,"settings.display.indigo")),t(3),p(o(90,51,"settings.display.blue")),t(3),p(o(93,53,"settings.display.bluegrey")),t(3),p(o(96,55,"settings.display.cyan")),t(3),p(o(99,57,"settings.display.green")),t(3),p(o(102,59,"settings.display.teal")),t(3),p(o(105,61,"settings.display.grey")),t(3),p(o(108,63,"settings.display.brown")),t(3),u(" ",o(111,65,"settings.display.lighting_mode")," "),t(3),_("ngModel",e.$settings.lightingMode),t(2),p(o(116,67,"form.select.auto")),t(3),p(o(119,69,"settings.display.light")),t(3),p(o(122,71,"settings.display.dark")),t(3),u(" ",o(125,73,"settings.display.menu_mode")," "),t(3),_("ngModel",e.$settings.menuMode),t(2),p(o(130,75,"settings.display.menu_default")),t(3),p(o(133,77,"settings.display.menu_freeze")),t(3),u(" ",o(136,79,"settings.display.temp_units")," "),t(3),_("ngModel",e.$settings.env.temperatureUnits),t(2),p(o(141,81,"settings.display.temp_units.c")),t(3),p(o(144,83,"settings.display.temp_units.f")),t(4),p(o(148,85,"settings.display.wallpaper")),t(2),x("aria-label",o(150,87,"settings.display.wallpaper"))}}function $t(a,m){a&1&&(i(0,"li",17)(1,"span"),r(2),l(3,"translate"),c(4,"br"),i(5,"small",75),r(6),l(7,"translate"),n()(),i(8,"a",86),l(9,"translate"),c(10,"i",20),n()()),a&2&&(t(2),u(" ",o(3,3,"menu.docker.startup_script")),t(4),p(o(7,5,"platform.docker.script_help")),t(2),x("aria-label",o(9,7,"menu.docker.startup_script")))}function Tt(a,m){a&1&&(i(0,"li",22)(1,"small",23),r(2),l(3,"translate"),n(),i(4,"button",24),l(5,"translate"),r(6),l(7,"translate"),n()()),a&2&&(t(2),p(o(3,3,"settings.changes.saved")),t(2),x("aria-label",o(5,5,"menu.tooltip_restart")),t(2),u(" ",o(7,7,"menu.tooltip_restart")," "))}function At(a,m){if(a&1&&(i(0,"ul",8)(1,"li",17)(2,"span"),r(3),l(4,"translate"),i(5,"code"),r(6,"-D"),n(),c(7,"br"),i(8,"small",75),r(9),l(10,"translate"),n()(),c(11,"input",76),l(12,"translate"),c(13,"label",77),n(),i(14,"li",17)(15,"span"),r(16),l(17,"translate"),i(18,"code"),r(19,"-I"),n(),c(20,"br"),i(21,"small",75),r(22),l(23,"translate"),n()(),c(24,"input",78),l(25,"translate"),c(26,"label",79),n(),i(27,"li",17)(28,"span"),r(29),l(30,"translate"),i(31,"code"),r(32,"-K"),n(),c(33,"br"),i(34,"small",75),r(35),l(36,"translate"),n()(),c(37,"input",80),l(38,"translate"),c(39,"label",81),n(),i(40,"li",14)(41,"span")(42,"span",82),r(43,"DEBUG"),n(),c(44,"br")(45,"small",83),l(46,"translate"),n(),i(47,"div",25),c(48,"input",84),n()(),i(49,"li",14)(50,"span")(51,"span",82),r(52,"NODE_OPTIONS"),n(),c(53,"br"),i(54,"small",75),r(55),l(56,"translate"),n()(),i(57,"div",25),c(58,"input",85),n()(),v(59,$t,11,9,"li",17),v(60,Tt,8,9,"li",22),n()),a&2){let e=g();t(3),u(" ",o(4,13,"settings.startup.debug")," "),t(6),u(" ",o(10,15,e.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),t(2),x("aria-label",o(12,17,"settings.startup.debug")),t(5),u(" ",o(17,19,"settings.startup.insecure")," "),t(6),p(o(23,21,"settings.startup.insecure_desc")),t(2),x("aria-label",o(25,23,"settings.startup.insecure")),t(5),u(" ",o(30,25,"settings.startup.keep_accessories")," "),t(6),p(o(36,27,"settings.startup.keep_accessories_desc")),t(2),x("aria-label",o(38,29,"settings.startup.keep_accessories")),t(8),_("innerHTML",j(46,31,"settings.service.debug_tooltip",P(36,kt,e.linkDebug)),re),t(10),p(o(56,34,"settings.service.node_tooltip")),t(4),f(e.$settings.env.runningInDocker?59:-1),t(),f(e.hasChangedService?60:-1)}}function Nt(a,m){a&1&&c(0,"i",98)}function Mt(a,m){if(a&1&&(i(0,"span",88),v(1,Nt,1,0,"i",98),r(2),i(3,"span",99),r(4),l(5,"translate"),n()()),a&2){let e=m.$implicit;_("ngClass",$(6,yt,e.missing,!e.missing)),t(),f(e.missing?1:-1),t(),u(" ",e.iface,": "),t(2),p(e.missing?o(5,4,"settings.mdns_advertiser_not_connected"):e.ip4||e.ip6)}}function Ft(a,m){a&1&&(i(0,"option",92),r(1),l(2,"translate"),n()),a&2&&(t(),u("Avahi (",o(2,1,"settings.mdns_advertiser_rec"),")"))}function Vt(a,m){a&1&&(i(0,"option",95),r(1),l(2,"translate"),n()),a&2&&(t(),u("systemd-resolved (",o(2,1,"settings.mdns_advertiser_exp"),")"))}function Rt(a,m){a&1&&(i(0,"li",22)(1,"small",23),r(2),l(3,"translate"),n(),i(4,"button",24),l(5,"translate"),r(6),l(7,"translate"),n()()),a&2&&(t(2),p(o(3,3,"settings.changes.saved")),t(2),x("aria-label",o(5,5,"menu.tooltip_restart")),t(2),u(" ",o(7,7,"menu.tooltip_restart")," "))}function Dt(a,m){if(a&1){let e=w();i(0,"ul",9)(1,"li",17)(2,"span",18),r(3),l(4,"translate"),c(5,"br"),i(6,"div",87),r(7),l(8,"translate"),n(),V(9,Mt,6,9,"span",88,F),n(),i(11,"button",89),l(12,"translate"),b("click",function(){S(e);let s=g();return k(s.selectNetworkInterfaces())}),c(13,"i",90),n()(),i(14,"li",14)(15,"span"),r(16),l(17,"translate"),c(18,"br"),i(19,"small",75),r(20),l(21,"translate"),n()(),i(22,"div",25)(23,"select",91),l(24,"translate"),v(25,Ft,3,3,"option",92),i(26,"option",93),r(27),l(28,"translate"),n(),i(29,"option",94),r(30,"Bonjour HAP"),n(),v(31,Vt,3,3,"option",95),n()()(),i(32,"li",14)(33,"span"),r(34),l(35,"translate"),c(36,"br"),i(37,"small",75),r(38),l(39,"translate"),n()(),i(40,"div",25),c(41,"input",96),l(42,"translate"),n()(),i(43,"li",14)(44,"span"),r(45),l(46,"translate"),c(47,"br"),i(48,"small",75),r(49),l(50,"translate"),n()(),i(51,"div",25),c(52,"input",97),l(53,"translate"),n()(),v(54,Rt,8,9,"li",22),n()}if(a&2){let e=g();t(3),u(" ",o(4,22,"settings.network.title_network_interfaces")),t(4),p(o(8,24,"settings.network.message_network_interface")),t(2),R(e.bridgeNetworkAdapters),t(2),_("disabled",!e.availableNetworkAdapters.length),x("aria-label",o(12,26,"settings.network.title_network_interfaces")),t(2),_("ngClass",P(48,wt,!e.availableNetworkAdapters.length)),t(3),u(" ",o(17,28,"settings.mdns_advertiser")),t(4),p(o(21,30,"settings.mdns_advertiser_help")),t(3),_("formControl",e.legacyMdnsFormControl),x("aria-label",o(24,32,"settings.mdns_advertiser")),t(2),f(e.showAvahiMdnsOption?25:-1),t(2),u(" Ciao ",e.showAvahiMdnsOption?"":"("+o(28,34,"settings.mdns_advertiser_rec")+")"," "),t(4),f(e.showResolvedMdnsOption?31:-1),t(3),u(" ",o(35,36,"settings.network.port_hb")),t(4),p(o(39,38,"settings.network.port_hb_desc")),t(3),_("formControl",e.hbPortFormControl)("ngClass",P(50,ae,e.isInvalidHbPort)),x("aria-label",o(42,40,"settings.network.port_ui")),t(4),u(" ",o(46,42,"settings.network.port_ui")),t(4),p(o(50,44,"settings.network.port_ui_desc")),t(3),_("ngClass",P(52,ae,e.isInvalidHbUiPort)),x("aria-label",o(53,46,"settings.network.port_ui")),t(2),f(e.hasChangedHbPort&&!e.isInvalidHbPort||e.hasChangedUiSettings||e.hasChangedMdns||e.hasChangedBridgeNetworkAdapters?54:-1)}}function Pt(a,m){a&1&&(i(0,"p",10),r(1),l(2,"translate"),n()),a&2&&(t(),p(o(2,1,"settings.cache.desc")))}function Ht(a,m){if(a&1){let e=w();i(0,"ul",11)(1,"li",17)(2,"span",18),r(3),l(4,"translate"),c(5,"br"),i(6,"small",75),r(7),l(8,"translate"),n()(),i(9,"button",19),l(10,"translate"),b("click",function(){S(e);let s=g();return k(s.removeSingleCachedAccessories())}),c(11,"i",20),n()(),i(12,"li",17)(13,"span",18),r(14),l(15,"translate"),c(16,"br"),i(17,"small",75),r(18),l(19,"translate"),n()(),i(20,"button",19),l(21,"translate"),b("click",function(){S(e);let s=g();return k(s.removeBridgeAccessories())}),c(22,"i",20),n()(),i(23,"li",17)(24,"span",18),r(25),l(26,"translate"),c(27,"br"),i(28,"small",75),r(29),l(30,"translate"),n()(),i(31,"button",19),l(32,"translate"),b("click",function(){S(e);let s=g();return k(s.removeAllCachedAccessories())}),c(33,"i",20),n()()()}a&2&&(t(3),u(" ",o(4,9,"reset.accessory_ind.title")),t(4),p(o(8,11,"reset.accessory_ind.desc")),t(2),x("aria-label",o(10,13,"reset.accessory_ind.title")),t(5),u(" ",o(15,15,"reset.bridge_accessories.title")),t(4),p(o(19,17,"reset.bridge_accessories.desc")),t(2),x("aria-label",o(21,19,"reset.accessory_all.title")),t(5),u(" ",o(26,21,"reset.accessory_all.title")),t(4),p(o(30,23,"reset.accessory_all.desc")),t(2),x("aria-label",o(32,25,"reset.accessory_all.title")))}function Ut(a,m){a&1&&(i(0,"p",10),r(1),l(2,"translate"),n()),a&2&&(t(),p(o(2,1,"reset.bridges.desc")))}function Ot(a,m){if(a&1){let e=w();i(0,"ul",12)(1,"li",17)(2,"span",18),r(3),l(4,"translate"),c(5,"br"),i(6,"small",75),r(7),l(8,"translate"),n()(),i(9,"button",19),l(10,"translate"),b("click",function(){S(e);let s=g();return k(s.unpairAccessory())}),c(11,"i",20),n()(),i(12,"li",17)(13,"span",18),r(14),l(15,"translate"),l(16,"titlecase"),c(17,"br"),i(18,"small",75),r(19),l(20,"translate"),n()(),i(21,"button",19),l(22,"translate"),b("click",function(){S(e);let s=g();return k(s.resetHomebridgeState())}),c(23,"i",20),n()()()}a&2&&(t(3),u(" ",o(4,6,"reset.bridge_ind.title")),t(4),p(o(8,8,"reset.bridge_ind.desc")),t(2),x("aria-label",o(10,10,"reset.bridge_ind.title")),t(5),u(" ",o(16,14,o(15,12,"reset.bridge_all.title"))),t(5),p(o(20,16,"reset.bridge_all.desc")),t(2),x("aria-label",o(22,18,"reset.bridge_all.title")))}var gn=(()=>{class a{$api=C(M);$modal=C(Y);$plugin=C(Ie);$settings=C(Z);$toastr=C(N);$translate=C(A);originalServiceForm={HOMEBRIDGE_DEBUG:!1,HOMEBRIDGE_KEEP_ORPHANS:!1,HOMEBRIDGE_INSECURE:!0,ENV_DEBUG:"",ENV_NODE_OPTIONS:""};originalUiSettingsForm={port:0};originalMdnsSetting="";originalBridgeNetworkAdapters=[];originalHbPort=0;originalHbName="";hasChangedService=!1;hasChangedUiSettings=!1;hasChangedMdns=!1;hasChangedBridgeNetworkAdapters=!1;hasChangedHbPort=!1;hasChangedHbName=!1;isInvalidHbPort=!1;isInvalidHbName=!1;isInvalidHbUiPort=!1;serviceForm=new te({HOMEBRIDGE_DEBUG:new D(!1),HOMEBRIDGE_KEEP_ORPHANS:new D(!1),HOMEBRIDGE_INSECURE:new D(!0),ENV_DEBUG:new D(""),ENV_NODE_OPTIONS:new D("")});uiSettingsForm=new te({port:new D(0)});legacyMdnsFormControl=new me(!1);showAvahiMdnsOption=!1;showResolvedMdnsOption=!1;availableNetworkAdapters=[];bridgeNetworkAdapters=[];hbPortFormControl=new D(0);hbNameFormControl=new D("");isHbV2=!1;showFields={general:!0,display:!0,startup:!0,network:!0,reset:!0,cache:!0};linkDebug='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Debug-Common-Values" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){}ngOnInit(){this.isHbV2=this.$settings.env.homebridgeVersion.startsWith("2"),this.hbNameFormControl.patchValue(this.$settings.env.homebridgeInstanceName),this.hbNameFormControl.valueChanges.subscribe(e=>this.setHomebridgeName(e)),this.originalHbName=this.$settings.env.homebridgeInstanceName,this.initUiSettingsForm(),this.initNetworkingOptions(),this.initStartupSettingsForm()}initUiSettingsForm(){this.originalUiSettingsForm={port:this.$settings.env.port},this.uiSettingsForm.patchValue({port:this.$settings.env.port}),this.uiSettingsForm.valueChanges.pipe(ee(500)).subscribe(e=>{let d=!1;Object.keys(e).forEach(s=>{this.originalUiSettingsForm[s]!==e[s]&&(this.saveUiSettingChange(s,e[s]),d=!0)}),this.hasChangedUiSettings=d})}initStartupSettingsForm(){this.$api.get("/platform-tools/hb-service/homebridge-startup-settings").subscribe({next:e=>{Object.keys(e).forEach(d=>{this.originalServiceForm[d]=e[d]}),this.serviceForm.patchValue(e),this.serviceForm.valueChanges.pipe(ee(500)).subscribe(this.saveStartupSettingsSettings.bind(this))},error:e=>{console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}saveUiSettingChange(e,d){switch(e){case"lang":this.$settings.setLang(d);break;case"lightingMode":this.$settings.setLightingMode(d,"user");break;case"menuMode":this.$settings.setMenuMode(d),window.location.reload();break;case"theme":this.$settings.setTheme(d);break;case"tempUnits":this.$settings.setEnvItem("temperatureUnits",d);break;case"port":if(!d||typeof d!="number"||d<1025||d>65533||Number.isInteger(d)===!1||d===this.hbPortFormControl.value){this.isInvalidHbUiPort=!0;return}this.$settings.setEnvItem("port",d),this.isInvalidHbUiPort=!1;break}I(this.$api.put("/config-editor/ui",{key:e,value:d})).catch(s=>{console.error(s),this.$toastr.error(s.message,this.$translate.instant("toast.title_error"))})}openUiSettings(){this.$plugin.settings({name:"homebridge-config-ui-x",displayName:"Homebridge UI",settingsSchema:!0,links:{}})}openBackupModal(){this.$modal.open(ye,{size:"lg",backdrop:"static"})}openWallpaperModal(){this.$modal.open(Ve,{size:"lg",backdrop:"static"})}saveStartupSettingsSettings(e=this.serviceForm.value){this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",e).subscribe({next:()=>{this.hasChangedService=JSON.stringify(e)!==JSON.stringify(this.originalServiceForm)},error:d=>{console.error(d),this.$toastr.error(d.message,this.$translate.instant("toast.title_error"))}})}resetHomebridgeState(){this.$modal.open(Ae,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(Me,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open($e,{size:"lg",backdrop:"static"})}removeSingleCachedAccessories(){this.$modal.open(Ee,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open(Te,{size:"lg",backdrop:"static"})}initNetworkingOptions(){return B(this,null,function*(){try{this.getNetworkSettings(),(this.$settings.env.runningInLinux||this.$settings.env.runningInDocker||this.$settings.env.runningInSynologyPackage||this.$settings.env.runningInPackageMode)&&(this.showAvahiMdnsOption=!0,this.showResolvedMdnsOption=!0)}catch{}})}getNetworkSettings(){return B(this,null,function*(){return Promise.all([I(this.$api.get("/server/network-interfaces/system")),I(this.$api.get("/server/network-interfaces/bridge")),I(this.$api.get("/server/mdns-advertiser")),I(this.$api.get("/server/port"))]).then(([e,d,s,h])=>{this.availableNetworkAdapters=e,this.buildBridgeNetworkAdapterList(d),this.legacyMdnsFormControl.patchValue(s.advertiser),this.originalMdnsSetting=s.advertiser,this.originalBridgeNetworkAdapters=this.bridgeNetworkAdapters.map(U=>U.iface),this.legacyMdnsFormControl.valueChanges.subscribe(U=>{this.setHomebridgeMdnsSetting(U)}),this.hbPortFormControl.patchValue(h.port),this.hbPortFormControl.valueChanges.subscribe(U=>this.setHomebridgePort(U)),this.originalHbPort=h.port})})}setHomebridgeMdnsSetting(e){return B(this,null,function*(){this.$api.put("/server/mdns-advertiser",{advertiser:e}).subscribe({next:()=>{this.hasChangedMdns=e!==this.originalMdnsSetting},error:d=>{console.error(d),this.$toastr.error(d.message,this.$translate.instant("toast.title_error"))}})})}setNetworkInterfaces(e){return B(this,null,function*(){this.$api.put("/server/network-interfaces/bridge",{adapters:e}).subscribe({next:()=>{this.hasChangedBridgeNetworkAdapters=this.originalBridgeNetworkAdapters.join(",")!==e.join(",")},error:d=>{console.error(d),this.$toastr.error(d.message,this.$translate.instant("toast.title_error"))}})})}setHomebridgeName(e){return B(this,null,function*(){if(!e||!/^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u.test(e)){this.isInvalidHbName=!0;return}this.$api.put("/server/name",{name:e}).subscribe({next:()=>{this.hasChangedHbName=this.originalHbName!==e,this.$settings.setEnvItem("homebridgeInstanceName",e),this.isInvalidHbName=!1},error:()=>{this.isInvalidHbName=!0}})})}setHomebridgePort(e){return B(this,null,function*(){if(e===this.uiSettingsForm.get("port").value){this.isInvalidHbPort=!0;return}this.$api.put("/server/port",{port:e}).subscribe({next:()=>{this.hasChangedHbPort=this.originalHbPort!==e,this.isInvalidHbPort=!1},error:()=>{this.isInvalidHbPort=!0}})})}buildBridgeNetworkAdapterList(e){if(!e.length){this.bridgeNetworkAdapters=[];return}this.bridgeNetworkAdapters=e.map(d=>{let s=this.availableNetworkAdapters.find(h=>h.iface===d);return s?(s.selected=!0,s.missing=!1,s):{iface:d,missing:!0}})}selectNetworkInterfaces(){let e=this.$modal.open(Fe,{size:"lg",backdrop:"static"});e.componentInstance.availableNetworkAdapters=this.availableNetworkAdapters,e.componentInstance.bridgeNetworkAdapters=this.bridgeNetworkAdapters,e.result.then(d=>{this.buildBridgeNetworkAdapterList(d),this.setNetworkInterfaces(d)}).catch(()=>{})}toggleSection(e){this.showFields[e]=!this.showFields[e]}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=y({type:a,selectors:[["ng-component"]],decls:48,vars:49,consts:[[1,"primary-text","m-0"],[1,"my-4"],["role","button","tabindex","0",1,"mt-3","hover-pointer",3,"click"],[1,"primary-text"],[1,"fa","fa-fw",3,"ngClass"],["id","fieldsGeneral",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsDisplay",1,"list-group","list-group-box","mt-2","mx-0"],["novalidate","",1,"my-4",3,"formGroup"],["id","fieldsStartup",1,"list-group","list-group-box","mb-4","mx-0"],["id","fieldsNetwork",1,"list-group","list-group-box","mt-2","mx-0"],[1,"small","grey-text","mb-2","mx-0"],["id","fieldsCache",1,"list-group","list-group-box","mb-4","mx-0"],["id","fieldsReset",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],[1,"list-group-item","d-block","d-md-flex","justify-content-between","align-items-center"],[1,"my-3","my-md-0","pl-0","pl-md-5","w-auto"],["type","text",1,"form-control","custom-input","resp-input",3,"formControl","ngClass"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pe-2"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["routerLink","/users",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"list-group-item","d-flex","flex-column","align-items-center"],[1,"grey-text","my-2"],["routerLink","/restart",1,"btn","btn-primary","waves-effect","my-2"],[1,"my-3","my-md-0","ps-0","ps-md-5","w-auto"],[1,"custom-select","resp-select",3,"ngModelChange","ngModel"],["value","auto"],["value","bg"],["value","ca"],["value","zh-CN"],["value","zh-TW"],["value","cs"],["value","nl"],["value","en"],["value","fi"],["value","fr"],["value","de"],["value","he"],["value","hu"],["value","id"],["value","it"],["value","ja"],["value","ko"],["value","mk"],["value","no"],["value","pl"],["value","pt-BR"],["value","pt"],["value","ru"],["value","sl"],["value","es"],["value","sv"],["value","th"],["value","tr"],["value","uk"],["value","orange"],["value","red"],["value","pink"],["value","purple"],["value","deep-purple"],["value","indigo"],["value","blue"],["value","blue-grey"],["value","cyan"],["value","green"],["value","teal"],["value","grey"],["value","brown"],["value","light"],["value","dark"],["value","default"],["value","freeze"],["value","c"],["value","f"],[1,"grey-text","pe-2"],["type","checkbox","id","homebridgeDebugMode","formControlName","HOMEBRIDGE_DEBUG",1,"rendux-input"],["for","homebridgeDebugMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeInsecureMode","formControlName","HOMEBRIDGE_INSECURE",1,"rendux-input"],["for","homebridgeInsecureMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeKeepOrphans","formControlName","HOMEBRIDGE_KEEP_ORPHANS",1,"rendux-input"],["for","homebridgeKeepOrphans",1,"rendux-label","ms-3",2,"min-width","50px"],[1,"font-monospace"],[1,"grey-text","pe-2",3,"innerHTML"],["formControlName","ENV_DEBUG","type","text","placeholder","HAP-NodeJS:Advertiser,HAP-NodeJS:Service",1,"form-control","custom-input","resp-input"],["formControlName","ENV_NODE_OPTIONS","type","text","placeholder","--max-old-space-size=512 --max-http-header-size=8192",1,"form-control","custom-input","resp-input"],["routerLink","/platform-tools/docker/startup-script",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"small","grey-text","pe-2"],[1,"badge","badge-primary","me-1",3,"ngClass"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right",3,"ngClass"],[1,"custom-select","resp-select",3,"formControl"],["value","avahi"],["value","ciao"],["value","bonjour-hap"],["value","resolved"],["type","number","min","1025","max","65533",1,"form-control","custom-input","resp-input",3,"formControl","ngClass"],["type","number","min","1025","max","65533","placeholder","8581","formControlName","port",1,"form-control","custom-input","resp-input",3,"ngClass"],[1,"fas","fa-fw","fa-exclamation-triangle"],[1,"fw-normal"]],template:function(d,s){d&1&&(i(0,"h3",0),r(1),l(2,"translate"),n(),i(3,"div",1)(4,"div",2),b("click",function(){return s.toggleSection("general")}),i(5,"h5",3),c(6,"i",4),r(7),l(8,"translate"),n()(),v(9,Bt,29,26,"ul",5),n(),i(10,"div",1)(11,"div",2),b("click",function(){return s.toggleSection("display")}),i(12,"h5",3),c(13,"i",4),r(14),l(15,"translate"),n()(),v(16,It,152,89,"ul",6),n(),i(17,"form",7)(18,"div",2),b("click",function(){return s.toggleSection("startup")}),i(19,"h5",3),c(20,"i",4),r(21),l(22,"translate"),n()(),v(23,At,61,38,"ul",8),n(),i(24,"form",7)(25,"div",2),b("click",function(){return s.toggleSection("network")}),i(26,"h5",3),c(27,"i",4),r(28),l(29,"translate"),n()(),v(30,Dt,55,54,"ul",9),n(),i(31,"div",1)(32,"div",2),b("click",function(){return s.toggleSection("cache")}),i(33,"h5",3),c(34,"i",4),r(35),l(36,"translate"),n()(),v(37,Pt,3,3,"p",10),v(38,Ht,34,27,"ul",11),n(),i(39,"div",1)(40,"div",2),b("click",function(){return s.toggleSection("reset")}),i(41,"h5",3),c(42,"i",4),r(43),l(44,"translate"),n()(),v(45,Ut,3,3,"p",10),v(46,Ot,24,20,"ul",12),n(),c(47,"div",13)),d&2&&(t(),p(o(2,35,"menu.settings.title")),t(3),x("aria-expanded",s.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),t(2),_("ngClass",s.showFields.general?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",o(8,37,"settings.general.title_general")," "),t(2),f(s.showFields.general?9:-1),t(2),x("aria-expanded",s.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),t(2),_("ngClass",s.showFields.display?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",o(15,39,"settings.general.title_display")," "),t(2),f(s.showFields.display?16:-1),t(),_("formGroup",s.serviceForm),t(),x("aria-expanded",s.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),t(2),_("ngClass",s.showFields.startup?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",o(22,41,"settings.title_startup_options")," "),t(2),f(s.showFields.startup?23:-1),t(),_("formGroup",s.uiSettingsForm),t(),x("aria-expanded",s.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),t(2),_("ngClass",s.showFields.network?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",o(29,43,"settings.network.title_network")," "),t(2),f(s.showFields.network?30:-1),t(2),x("aria-expanded",s.showFields.cache?"true":"false")("aria-controls","fieldsCache"),t(2),_("ngClass",s.showFields.cache?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",o(36,45,"settings.cache.title")," "),t(2),f(s.showFields.cache?37:-1),t(),f(s.showFields.cache?38:-1),t(2),x("aria-expanded",s.showFields.reset?"true":"false")("aria-controls","fieldsReset"),t(2),_("ngClass",s.showFields.reset?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",o(44,47,"reset.bridges.title")," "),t(2),f(s.showFields.reset?45:-1),t(),f(s.showFields.reset?46:-1))},dependencies:[L,ke,J,ue,xe,he,pe,_e,W,fe,q,ce,Se,Ce,K,Q,ge,be,ve,G,E],encapsulation:2})}return a})();export{$e as a,Ae as b,Fe as c,Ve as d,gn as e};
@@ -1 +1 @@
1
- import"./chunk-2UMHCTKQ.js";import{q as p}from"./chunk-7S2SCSTB.js";import{A as m}from"./chunk-HLSZVFAU.js";import{g as i}from"./chunk-QR7L4UUP.js";import"./chunk-G43HU5Q5.js";import"./chunk-ZHNSZ7X2.js";import"./chunk-ASBFWS7L.js";import{c as s}from"./chunk-DJKI5XBW.js";import{ha as t,kd as n,mb as r}from"./chunk-U4V4ICSI.js";var a=[{path:"",loadComponent:()=>import("./chunk-7S7G7E6P.js").then(o=>o.PowerOptionsComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(a),i]})}return o})();var j=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,u,p,m,s]})}return o})();export{j as PowerOptionsModule};
1
+ import"./chunk-VS5PRHN6.js";import{q as p}from"./chunk-7S2SCSTB.js";import{A as m}from"./chunk-HLSZVFAU.js";import{g as i}from"./chunk-QR7L4UUP.js";import"./chunk-WP2UTBVE.js";import"./chunk-37FVXLTH.js";import"./chunk-ASBFWS7L.js";import{c as s}from"./chunk-DJKI5XBW.js";import{ha as t,kd as n,mb as r}from"./chunk-U4V4ICSI.js";var a=[{path:"",loadComponent:()=>import("./chunk-7TVHJ2GH.js").then(o=>o.PowerOptionsComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(a),i]})}return o})();var j=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,u,p,m,s]})}return o})();export{j as PowerOptionsModule};
@@ -1,4 +1,4 @@
1
- import{a as uu,b as Z6}from"./chunk-A3GH5UM5.js";import{a as S1}from"./chunk-CHQVUHUA.js";import{a as en,b as tn}from"./chunk-3VIG5M5R.js";import{a as T1}from"./chunk-XZR7OZ6I.js";import{a as O1}from"./chunk-ETPKWO5V.js";import{a as P1}from"./chunk-FHMZVMZK.js";import{a as of}from"./chunk-JMCN2SQV.js";import{a as A1,b as k1}from"./chunk-YXEV6KOV.js";import{a as ss}from"./chunk-LTDUXFUG.js";import{a as $1}from"./chunk-2PGR64P5.js";import{a as Ur,b as Wr,c as Gr,d as Kr,e as Jr,f as Xr,g as Yi,m as ve,n as it,o as Zi}from"./chunk-7S2SCSTB.js";import{A as as,a as E1,b as Gi,c as Ki,e as vt,f as _1,h as y1,i as v1,k as B1,l as Yu,m as x1,o as Ji,r as Xi,s as yi,t as vi,y as w1,z as tu}from"./chunk-HLSZVFAU.js";import{a as Qi}from"./chunk-XH4RYJ6Y.js";import{d as cu}from"./chunk-QR7L4UUP.js";import{a as I1}from"./chunk-5BL6PCNR.js";import{b as Ve}from"./chunk-G43HU5Q5.js";import{h as _e,j as Zu,k as he}from"./chunk-ZHNSZ7X2.js";import{e as b1}from"./chunk-ASBFWS7L.js";import{a as Ee,b as Be}from"./chunk-DJKI5XBW.js";import{$a as l,Ac as v,Bc as B,Ca as Hu,Cc as Ye,D as f1,Da as s1,Fa as Uu,Gb as K,Hb as w,Ib as S,Jc as gt,Kb as nt,Kc as z,Lb as ft,Lc as Xu,M as Vr,Mb as rt,Nb as b,Nc as h1,Ob as c,Pb as p,Qb as I,Rb as c1,Sb as p1,Ub as U,Xa as de,Xb as M,Yb as h,Z as ns,_a as D1,a as X,aa as rf,ac as fs,b as Se,bc as rs,bd as zt,cc as os,cd as _i,dc as Wu,dd as bt,e as F,eb as Lr,ec as Gu,fa as r1,fb as yu,g as ze,ga as Ot,gc as Qt,gd as g1,h as G,ha as Hi,hb as Ei,hc as Ku,ic as Z,ja as o1,jc as _,k as t1,ka as a1,kc as H,kd as Hr,la as x,lb as Y,lc as q,mb as Ui,mc as Bu,n as Pt,nb as vu,nc as m1,o as is,ob as l1,q as u1,qc as Te,ra as j,rb as ce,rc as Pe,sa as N,sc as Oe,tb as d1,tc as F1,ub as zr,uc as C1,v as i1,vc as Xe,w as se,wc as eu,x as n1,xc as Ju,yc as xu,za as Rr,zc as Wi}from"./chunk-U4V4ICSI.js";var Df=F(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var af=class{};be._CodeOrName=af;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Bi=class extends af{constructor(u){if(super(),!be.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=Bi;var Ht=class extends af{constructor(u){super(),this._items=typeof u=="string"?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let u=this._items[0];return u===""||u==='""'}get str(){var u;return(u=this._str)!==null&&u!==void 0?u:this._str=this._items.reduce((t,i)=>`${t}${i}`,"")}get names(){var u;return(u=this._names)!==null&&u!==void 0?u:this._names=this._items.reduce((t,i)=>(i instanceof Bi&&(t[i.str]=(t[i.str]||0)+1),t),{})}};be._Code=Ht;be.nil=new Ht("");function M1(e,...u){let t=[e[0]],i=0;for(;i<u.length;)ls(t,u[i]),t.push(e[++i]);return new Ht(t)}be._=M1;var Ds=new Ht("+");function j1(e,...u){let t=[sf(e[0])],i=0;for(;i<u.length;)t.push(Ds),ls(t,u[i]),t.push(Ds,sf(e[++i]));return eb(t),new Ht(t)}be.str=j1;function ls(e,u){u instanceof Ht?e.push(...u._items):u instanceof Bi?e.push(u):e.push(ib(u))}be.addCodeArg=ls;function eb(e){let u=1;for(;u<e.length-1;){if(e[u]===Ds){let t=tb(e[u-1],e[u+1]);if(t!==void 0){e.splice(u-1,3,t);continue}e[u++]="+"}u++}}function tb(e,u){if(u==='""')return e;if(e==='""')return u;if(typeof e=="string")return u instanceof Bi||e[e.length-1]!=='"'?void 0:typeof u!="string"?`${e.slice(0,-1)}${u}"`:u[0]==='"'?e.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(e instanceof Bi))return`"${e}${u.slice(1)}`}function ub(e,u){return u.emptyStr()?e:e.emptyStr()?u:j1`${e}${u}`}be.strConcat=ub;function ib(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:sf(Array.isArray(e)?e.join(","):e)}function nb(e){return new Ht(sf(e))}be.stringify=nb;function sf(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=sf;function fb(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new Ht(`.${e}`):M1`[${e}]`}be.getProperty=fb;function rb(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new Ht(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=rb;function ob(e){return new Ht(e.toString())}be.regexpCode=ob});var ps=F(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ValueScope=xt.ValueScopeName=xt.Scope=xt.varKinds=xt.UsedValueState=void 0;var Bt=Df(),ds=class extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}},Yr=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(Yr||(xt.UsedValueState=Yr={}));xt.varKinds={const:new Bt.Name("const"),let:new Bt.Name("let"),var:new Bt.Name("var")};var Zr=class{constructor({prefixes:u,parent:t}={}){this._names={},this._prefixes=u,this._parent=t}toName(u){return u instanceof Bt.Name?u:this.name(u)}name(u){return new Bt.Name(this._newName(u))}_newName(u){let t=this._names[u]||this._nameGroup(u);return`${u}${t.index++}`}_nameGroup(u){var t,i;if(!((i=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||i===void 0)&&i.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}};xt.Scope=Zr;var Qr=class extends Bt.Name{constructor(u,t){super(t),this.prefix=u}setValue(u,{property:t,itemIndex:i}){this.value=u,this.scopePath=(0,Bt._)`.${new Bt.Name(t)}[${i}]`}};xt.ValueScopeName=Qr;var ab=(0,Bt._)`\n`,cs=class extends Zr{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts=Se(X({},u),{_n:u.lines?ab:Bt.nil})}get(){return this._scope}name(u){return new Qr(u,this._newName(u))}value(u,t){var i;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(u),{prefix:f}=n,r=(i=t.key)!==null&&i!==void 0?i:t.ref,o=this._values[f];if(o){let D=o.get(r);if(D)return D}else o=this._values[f]=new Map;o.set(r,n);let a=this._scope[f]||(this._scope[f]=[]),s=a.length;return a[s]=t.ref,n.setValue(t,{property:f,itemIndex:s}),n}getValue(u,t){let i=this._values[u];if(i)return i.get(t)}scopeRefs(u,t=this._values){return this._reduceValues(t,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,Bt._)`${u}${i.scopePath}`})}scopeCode(u=this._values,t,i){return this._reduceValues(u,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,i)}_reduceValues(u,t,i={},n){let f=Bt.nil;for(let r in u){let o=u[r];if(!o)continue;let a=i[r]=i[r]||new Map;o.forEach(s=>{if(a.has(s))return;a.set(s,Yr.Started);let D=t(s);if(D){let d=this.opts.es5?xt.varKinds.var:xt.varKinds.const;f=(0,Bt._)`${f}${d} ${s} = ${D};${this.opts._n}`}else if(D=n?.(s))f=(0,Bt._)`${f}${D}${this.opts._n}`;else throw new ds(s);a.set(s,Yr.Completed)})}return f}};xt.ValueScope=cs});var ee=F(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.or=ae.and=ae.not=ae.CodeGen=ae.operators=ae.varKinds=ae.ValueScopeName=ae.ValueScope=ae.Scope=ae.Name=ae.regexpCode=ae.stringify=ae.getProperty=ae.nil=ae.strConcat=ae.str=ae._=void 0;var Fe=Df(),iu=ps(),Qu=Df();Object.defineProperty(ae,"_",{enumerable:!0,get:function(){return Qu._}});Object.defineProperty(ae,"str",{enumerable:!0,get:function(){return Qu.str}});Object.defineProperty(ae,"strConcat",{enumerable:!0,get:function(){return Qu.strConcat}});Object.defineProperty(ae,"nil",{enumerable:!0,get:function(){return Qu.nil}});Object.defineProperty(ae,"getProperty",{enumerable:!0,get:function(){return Qu.getProperty}});Object.defineProperty(ae,"stringify",{enumerable:!0,get:function(){return Qu.stringify}});Object.defineProperty(ae,"regexpCode",{enumerable:!0,get:function(){return Qu.regexpCode}});Object.defineProperty(ae,"Name",{enumerable:!0,get:function(){return Qu.Name}});var no=ps();Object.defineProperty(ae,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(ae,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(ae,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(ae,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});ae.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var wu=class{optimizeNodes(){return this}optimizeNames(u,t){return this}},ms=class extends wu{constructor(u,t,i){super(),this.varKind=u,this.name=t,this.rhs=i}render({es5:u,_n:t}){let i=u?iu.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+t}optimizeNames(u,t){if(u[this.name.str])return this.rhs&&(this.rhs=nn(this.rhs,u,t)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},to=class extends wu{constructor(u,t,i){super(),this.lhs=u,this.rhs=t,this.sideEffects=i}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,t){if(!(this.lhs instanceof Fe.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=nn(this.rhs,u,t),this}get names(){let u=this.lhs instanceof Fe.Name?{}:X({},this.lhs.names);return io(u,this.rhs)}},Fs=class extends to{constructor(u,t,i,n){super(u,i,n),this.op=t}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}},Cs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}},hs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}},gs=class extends wu{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}},bs=class extends wu{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,t){return this.code=nn(this.code,u,t),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},lf=class extends wu{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((t,i)=>t+i.render(u),"")}optimizeNodes(){let{nodes:u}=this,t=u.length;for(;t--;){let i=u[t].optimizeNodes();Array.isArray(i)?u.splice(t,1,...i):i?u[t]=i:u.splice(t,1)}return u.length>0?this:void 0}optimizeNames(u,t){let{nodes:i}=this,n=i.length;for(;n--;){let f=i[n];f.optimizeNames(u,t)||(sb(u,f.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((u,t)=>xi(u,t.names),{})}},Su=class extends lf{render(u){return"{"+u._n+super.render(u)+"}"+u._n}},Es=class extends lf{},_s=(()=>{class e extends Su{}return e.kind="else",e})(),eo=(()=>{class e extends Su{constructor(t,i){super(i),this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);return this.else&&(i+="else "+this.else.render(t)),i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let n=i.optimizeNodes();i=this.else=Array.isArray(n)?new _s(n):n}if(i)return t===!1?i instanceof e?i:i.nodes:this.nodes.length?this:new e(L1(t),i instanceof e?[i]:i.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,i){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,i),!!(super.optimizeNames(t,i)||this.else))return this.condition=nn(this.condition,t,i),this}get names(){let t=super.names;return io(t,this.condition),this.else&&xi(t,this.else.names),t}}return e.kind="if",e})(),fo=(()=>{class e extends Su{}return e.kind="for",e})(),ys=class extends fo{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iteration=nn(this.iteration,u,t),this}get names(){return xi(super.names,this.iteration.names)}},vs=class extends fo{constructor(u,t,i,n){super(),this.varKind=u,this.name=t,this.from=i,this.to=n}render(u){let t=u.es5?iu.varKinds.var:this.varKind,{name:i,from:n,to:f}=this;return`for(${t} ${i}=${n}; ${i}<${f}; ${i}++)`+super.render(u)}get names(){let u=io(super.names,this.from);return io(u,this.to)}},uo=class extends fo{constructor(u,t,i,n){super(),this.loop=u,this.varKind=t,this.name=i,this.iterable=n}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iterable=nn(this.iterable,u,t),this}get names(){return xi(super.names,this.iterable.names)}},N1=(()=>{class e extends Su{constructor(t,i,n){super(),this.name=t,this.args=i,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),q1=(()=>{class e extends lf{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Bs=class extends Su{render(u){let t="try"+super.render(u);return this.catch&&(t+=this.catch.render(u)),this.finally&&(t+=this.finally.render(u)),t}optimizeNodes(){var u,t;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(u,t){var i,n;return super.optimizeNames(u,t),(i=this.catch)===null||i===void 0||i.optimizeNames(u,t),(n=this.finally)===null||n===void 0||n.optimizeNames(u,t),this}get names(){let u=super.names;return this.catch&&xi(u,this.catch.names),this.finally&&xi(u,this.finally.names),u}},V1=(()=>{class e extends Su{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),R1=(()=>{class e extends Su{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),xs=class{constructor(u,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Se(X({},t),{_n:t.lines?`
1
+ import{a as uu,b as Z6}from"./chunk-EPVBHJMO.js";import{a as S1}from"./chunk-CHQVUHUA.js";import{a as en,b as tn}from"./chunk-3VIG5M5R.js";import{a as T1}from"./chunk-XZR7OZ6I.js";import{a as O1}from"./chunk-6FASN3MD.js";import{a as P1}from"./chunk-FHMZVMZK.js";import{a as of}from"./chunk-JMCN2SQV.js";import{a as A1,b as k1}from"./chunk-YXEV6KOV.js";import{a as ss}from"./chunk-LTDUXFUG.js";import{a as $1}from"./chunk-2PGR64P5.js";import{a as Ur,b as Wr,c as Gr,d as Kr,e as Jr,f as Xr,g as Yi,m as ve,n as it,o as Zi}from"./chunk-7S2SCSTB.js";import{A as as,a as E1,b as Gi,c as Ki,e as vt,f as _1,h as y1,i as v1,k as B1,l as Yu,m as x1,o as Ji,r as Xi,s as yi,t as vi,y as w1,z as tu}from"./chunk-HLSZVFAU.js";import{a as Qi}from"./chunk-IEZW2VEP.js";import{d as cu}from"./chunk-QR7L4UUP.js";import{a as I1}from"./chunk-7GYDUXMU.js";import{b as Ve}from"./chunk-WP2UTBVE.js";import{h as _e,j as Zu,k as he}from"./chunk-37FVXLTH.js";import{e as b1}from"./chunk-ASBFWS7L.js";import{a as Ee,b as Be}from"./chunk-DJKI5XBW.js";import{$a as l,Ac as v,Bc as B,Ca as Hu,Cc as Ye,D as f1,Da as s1,Fa as Uu,Gb as K,Hb as w,Ib as S,Jc as gt,Kb as nt,Kc as z,Lb as ft,Lc as Xu,M as Vr,Mb as rt,Nb as b,Nc as h1,Ob as c,Pb as p,Qb as I,Rb as c1,Sb as p1,Ub as U,Xa as de,Xb as M,Yb as h,Z as ns,_a as D1,a as X,aa as rf,ac as fs,b as Se,bc as rs,bd as zt,cc as os,cd as _i,dc as Wu,dd as bt,e as F,eb as Lr,ec as Gu,fa as r1,fb as yu,g as ze,ga as Ot,gc as Qt,gd as g1,h as G,ha as Hi,hb as Ei,hc as Ku,ic as Z,ja as o1,jc as _,k as t1,ka as a1,kc as H,kd as Hr,la as x,lb as Y,lc as q,mb as Ui,mc as Bu,n as Pt,nb as vu,nc as m1,o as is,ob as l1,q as u1,qc as Te,ra as j,rb as ce,rc as Pe,sa as N,sc as Oe,tb as d1,tc as F1,ub as zr,uc as C1,v as i1,vc as Xe,w as se,wc as eu,x as n1,xc as Ju,yc as xu,za as Rr,zc as Wi}from"./chunk-U4V4ICSI.js";var Df=F(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var af=class{};be._CodeOrName=af;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Bi=class extends af{constructor(u){if(super(),!be.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=Bi;var Ht=class extends af{constructor(u){super(),this._items=typeof u=="string"?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let u=this._items[0];return u===""||u==='""'}get str(){var u;return(u=this._str)!==null&&u!==void 0?u:this._str=this._items.reduce((t,i)=>`${t}${i}`,"")}get names(){var u;return(u=this._names)!==null&&u!==void 0?u:this._names=this._items.reduce((t,i)=>(i instanceof Bi&&(t[i.str]=(t[i.str]||0)+1),t),{})}};be._Code=Ht;be.nil=new Ht("");function M1(e,...u){let t=[e[0]],i=0;for(;i<u.length;)ls(t,u[i]),t.push(e[++i]);return new Ht(t)}be._=M1;var Ds=new Ht("+");function j1(e,...u){let t=[sf(e[0])],i=0;for(;i<u.length;)t.push(Ds),ls(t,u[i]),t.push(Ds,sf(e[++i]));return eb(t),new Ht(t)}be.str=j1;function ls(e,u){u instanceof Ht?e.push(...u._items):u instanceof Bi?e.push(u):e.push(ib(u))}be.addCodeArg=ls;function eb(e){let u=1;for(;u<e.length-1;){if(e[u]===Ds){let t=tb(e[u-1],e[u+1]);if(t!==void 0){e.splice(u-1,3,t);continue}e[u++]="+"}u++}}function tb(e,u){if(u==='""')return e;if(e==='""')return u;if(typeof e=="string")return u instanceof Bi||e[e.length-1]!=='"'?void 0:typeof u!="string"?`${e.slice(0,-1)}${u}"`:u[0]==='"'?e.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(e instanceof Bi))return`"${e}${u.slice(1)}`}function ub(e,u){return u.emptyStr()?e:e.emptyStr()?u:j1`${e}${u}`}be.strConcat=ub;function ib(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:sf(Array.isArray(e)?e.join(","):e)}function nb(e){return new Ht(sf(e))}be.stringify=nb;function sf(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=sf;function fb(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new Ht(`.${e}`):M1`[${e}]`}be.getProperty=fb;function rb(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new Ht(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=rb;function ob(e){return new Ht(e.toString())}be.regexpCode=ob});var ps=F(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ValueScope=xt.ValueScopeName=xt.Scope=xt.varKinds=xt.UsedValueState=void 0;var Bt=Df(),ds=class extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}},Yr=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(Yr||(xt.UsedValueState=Yr={}));xt.varKinds={const:new Bt.Name("const"),let:new Bt.Name("let"),var:new Bt.Name("var")};var Zr=class{constructor({prefixes:u,parent:t}={}){this._names={},this._prefixes=u,this._parent=t}toName(u){return u instanceof Bt.Name?u:this.name(u)}name(u){return new Bt.Name(this._newName(u))}_newName(u){let t=this._names[u]||this._nameGroup(u);return`${u}${t.index++}`}_nameGroup(u){var t,i;if(!((i=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||i===void 0)&&i.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}};xt.Scope=Zr;var Qr=class extends Bt.Name{constructor(u,t){super(t),this.prefix=u}setValue(u,{property:t,itemIndex:i}){this.value=u,this.scopePath=(0,Bt._)`.${new Bt.Name(t)}[${i}]`}};xt.ValueScopeName=Qr;var ab=(0,Bt._)`\n`,cs=class extends Zr{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts=Se(X({},u),{_n:u.lines?ab:Bt.nil})}get(){return this._scope}name(u){return new Qr(u,this._newName(u))}value(u,t){var i;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(u),{prefix:f}=n,r=(i=t.key)!==null&&i!==void 0?i:t.ref,o=this._values[f];if(o){let D=o.get(r);if(D)return D}else o=this._values[f]=new Map;o.set(r,n);let a=this._scope[f]||(this._scope[f]=[]),s=a.length;return a[s]=t.ref,n.setValue(t,{property:f,itemIndex:s}),n}getValue(u,t){let i=this._values[u];if(i)return i.get(t)}scopeRefs(u,t=this._values){return this._reduceValues(t,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,Bt._)`${u}${i.scopePath}`})}scopeCode(u=this._values,t,i){return this._reduceValues(u,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,i)}_reduceValues(u,t,i={},n){let f=Bt.nil;for(let r in u){let o=u[r];if(!o)continue;let a=i[r]=i[r]||new Map;o.forEach(s=>{if(a.has(s))return;a.set(s,Yr.Started);let D=t(s);if(D){let d=this.opts.es5?xt.varKinds.var:xt.varKinds.const;f=(0,Bt._)`${f}${d} ${s} = ${D};${this.opts._n}`}else if(D=n?.(s))f=(0,Bt._)`${f}${D}${this.opts._n}`;else throw new ds(s);a.set(s,Yr.Completed)})}return f}};xt.ValueScope=cs});var ee=F(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.or=ae.and=ae.not=ae.CodeGen=ae.operators=ae.varKinds=ae.ValueScopeName=ae.ValueScope=ae.Scope=ae.Name=ae.regexpCode=ae.stringify=ae.getProperty=ae.nil=ae.strConcat=ae.str=ae._=void 0;var Fe=Df(),iu=ps(),Qu=Df();Object.defineProperty(ae,"_",{enumerable:!0,get:function(){return Qu._}});Object.defineProperty(ae,"str",{enumerable:!0,get:function(){return Qu.str}});Object.defineProperty(ae,"strConcat",{enumerable:!0,get:function(){return Qu.strConcat}});Object.defineProperty(ae,"nil",{enumerable:!0,get:function(){return Qu.nil}});Object.defineProperty(ae,"getProperty",{enumerable:!0,get:function(){return Qu.getProperty}});Object.defineProperty(ae,"stringify",{enumerable:!0,get:function(){return Qu.stringify}});Object.defineProperty(ae,"regexpCode",{enumerable:!0,get:function(){return Qu.regexpCode}});Object.defineProperty(ae,"Name",{enumerable:!0,get:function(){return Qu.Name}});var no=ps();Object.defineProperty(ae,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(ae,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(ae,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(ae,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});ae.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var wu=class{optimizeNodes(){return this}optimizeNames(u,t){return this}},ms=class extends wu{constructor(u,t,i){super(),this.varKind=u,this.name=t,this.rhs=i}render({es5:u,_n:t}){let i=u?iu.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+t}optimizeNames(u,t){if(u[this.name.str])return this.rhs&&(this.rhs=nn(this.rhs,u,t)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},to=class extends wu{constructor(u,t,i){super(),this.lhs=u,this.rhs=t,this.sideEffects=i}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,t){if(!(this.lhs instanceof Fe.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=nn(this.rhs,u,t),this}get names(){let u=this.lhs instanceof Fe.Name?{}:X({},this.lhs.names);return io(u,this.rhs)}},Fs=class extends to{constructor(u,t,i,n){super(u,i,n),this.op=t}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}},Cs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}},hs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}},gs=class extends wu{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}},bs=class extends wu{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,t){return this.code=nn(this.code,u,t),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},lf=class extends wu{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((t,i)=>t+i.render(u),"")}optimizeNodes(){let{nodes:u}=this,t=u.length;for(;t--;){let i=u[t].optimizeNodes();Array.isArray(i)?u.splice(t,1,...i):i?u[t]=i:u.splice(t,1)}return u.length>0?this:void 0}optimizeNames(u,t){let{nodes:i}=this,n=i.length;for(;n--;){let f=i[n];f.optimizeNames(u,t)||(sb(u,f.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((u,t)=>xi(u,t.names),{})}},Su=class extends lf{render(u){return"{"+u._n+super.render(u)+"}"+u._n}},Es=class extends lf{},_s=(()=>{class e extends Su{}return e.kind="else",e})(),eo=(()=>{class e extends Su{constructor(t,i){super(i),this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);return this.else&&(i+="else "+this.else.render(t)),i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let n=i.optimizeNodes();i=this.else=Array.isArray(n)?new _s(n):n}if(i)return t===!1?i instanceof e?i:i.nodes:this.nodes.length?this:new e(L1(t),i instanceof e?[i]:i.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,i){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,i),!!(super.optimizeNames(t,i)||this.else))return this.condition=nn(this.condition,t,i),this}get names(){let t=super.names;return io(t,this.condition),this.else&&xi(t,this.else.names),t}}return e.kind="if",e})(),fo=(()=>{class e extends Su{}return e.kind="for",e})(),ys=class extends fo{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iteration=nn(this.iteration,u,t),this}get names(){return xi(super.names,this.iteration.names)}},vs=class extends fo{constructor(u,t,i,n){super(),this.varKind=u,this.name=t,this.from=i,this.to=n}render(u){let t=u.es5?iu.varKinds.var:this.varKind,{name:i,from:n,to:f}=this;return`for(${t} ${i}=${n}; ${i}<${f}; ${i}++)`+super.render(u)}get names(){let u=io(super.names,this.from);return io(u,this.to)}},uo=class extends fo{constructor(u,t,i,n){super(),this.loop=u,this.varKind=t,this.name=i,this.iterable=n}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iterable=nn(this.iterable,u,t),this}get names(){return xi(super.names,this.iterable.names)}},N1=(()=>{class e extends Su{constructor(t,i,n){super(),this.name=t,this.args=i,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),q1=(()=>{class e extends lf{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Bs=class extends Su{render(u){let t="try"+super.render(u);return this.catch&&(t+=this.catch.render(u)),this.finally&&(t+=this.finally.render(u)),t}optimizeNodes(){var u,t;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(u,t){var i,n;return super.optimizeNames(u,t),(i=this.catch)===null||i===void 0||i.optimizeNames(u,t),(n=this.finally)===null||n===void 0||n.optimizeNames(u,t),this}get names(){let u=super.names;return this.catch&&xi(u,this.catch.names),this.finally&&xi(u,this.finally.names),u}},V1=(()=>{class e extends Su{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),R1=(()=>{class e extends Su{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),xs=class{constructor(u,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Se(X({},t),{_n:t.lines?`
2
2
  `:""}),this._extScope=u,this._scope=new iu.Scope({parent:u}),this._nodes=[new Es]}toString(){return this._root.render(this.opts)}name(u){return this._scope.name(u)}scopeName(u){return this._extScope.name(u)}scopeValue(u,t){let i=this._extScope.value(u,t);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(u,t){return this._extScope.getValue(u,t)}scopeRefs(u){return this._extScope.scopeRefs(u,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(u,t,i,n){let f=this._scope.toName(t);return i!==void 0&&n&&(this._constants[f.str]=i),this._leafNode(new ms(u,f,i)),f}const(u,t,i){return this._def(iu.varKinds.const,u,t,i)}let(u,t,i){return this._def(iu.varKinds.let,u,t,i)}var(u,t,i){return this._def(iu.varKinds.var,u,t,i)}assign(u,t,i){return this._leafNode(new to(u,t,i))}add(u,t){return this._leafNode(new Fs(u,ae.operators.ADD,t))}code(u){return typeof u=="function"?u():u!==Fe.nil&&this._leafNode(new bs(u)),this}object(...u){let t=["{"];for(let[i,n]of u)t.length>1&&t.push(","),t.push(i),(i!==n||this.opts.es5)&&(t.push(":"),(0,Fe.addCodeArg)(t,n));return t.push("}"),new Fe._Code(t)}if(u,t,i){if(this._blockNode(new eo(u)),t&&i)this.code(t).else().code(i).endIf();else if(t)this.code(t).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(u){return this._elseNode(new eo(u))}else(){return this._elseNode(new _s)}endIf(){return this._endBlockNode(eo,_s)}_for(u,t){return this._blockNode(u),t&&this.code(t).endFor(),this}for(u,t){return this._for(new ys(u),t)}forRange(u,t,i,n,f=this.opts.es5?iu.varKinds.var:iu.varKinds.let){let r=this._scope.toName(u);return this._for(new vs(f,r,t,i),()=>n(r))}forOf(u,t,i,n=iu.varKinds.const){let f=this._scope.toName(u);if(this.opts.es5){let r=t instanceof Fe.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Fe._)`${r}.length`,o=>{this.var(f,(0,Fe._)`${r}[${o}]`),i(f)})}return this._for(new uo("of",n,f,t),()=>i(f))}forIn(u,t,i,n=this.opts.es5?iu.varKinds.var:iu.varKinds.const){if(this.opts.ownProperties)return this.forOf(u,(0,Fe._)`Object.keys(${t})`,i);let f=this._scope.toName(u);return this._for(new uo("in",n,f,t),()=>i(f))}endFor(){return this._endBlockNode(fo)}label(u){return this._leafNode(new Cs(u))}break(u){return this._leafNode(new hs(u))}return(u){let t=new q1;if(this._blockNode(t),this.code(u),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(q1)}try(u,t,i){if(!t&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Bs;if(this._blockNode(n),this.code(u),t){let f=this.name("e");this._currNode=n.catch=new V1(f),t(f)}return i&&(this._currNode=n.finally=new R1,this.code(i)),this._endBlockNode(V1,R1)}throw(u){return this._leafNode(new gs(u))}block(u,t){return this._blockStarts.push(this._nodes.length),u&&this.code(u).endBlock(t),this}endBlock(u){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-t;if(i<0||u!==void 0&&i!==u)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${u} expected`);return this._nodes.length=t,this}func(u,t=Fe.nil,i,n){return this._blockNode(new N1(u,t,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(N1)}optimize(u=1){for(;u-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(u){return this._currNode.nodes.push(u),this}_blockNode(u){this._currNode.nodes.push(u),this._nodes.push(u)}_endBlockNode(u,t){let i=this._currNode;if(i instanceof u||t&&i instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${u.kind}/${t.kind}`:u.kind}"`)}_elseNode(u){let t=this._currNode;if(!(t instanceof eo))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=u,this}get _root(){return this._nodes[0]}get _currNode(){let u=this._nodes;return u[u.length-1]}set _currNode(u){let t=this._nodes;t[t.length-1]=u}};ae.CodeGen=xs;function xi(e,u){for(let t in u)e[t]=(e[t]||0)+(u[t]||0);return e}function io(e,u){return u instanceof Fe._CodeOrName?xi(e,u.names):e}function nn(e,u,t){if(e instanceof Fe.Name)return i(e);if(!n(e))return e;return new Fe._Code(e._items.reduce((f,r)=>(r instanceof Fe.Name&&(r=i(r)),r instanceof Fe._Code?f.push(...r._items):f.push(r),f),[]));function i(f){let r=t[f.str];return r===void 0||u[f.str]!==1?f:(delete u[f.str],r)}function n(f){return f instanceof Fe._Code&&f._items.some(r=>r instanceof Fe.Name&&u[r.str]===1&&t[r.str]!==void 0)}}function sb(e,u){for(let t in u)e[t]=(e[t]||0)-(u[t]||0)}function L1(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Fe._)`!${ws(e)}`}ae.not=L1;var Db=z1(ae.operators.AND);function lb(...e){return e.reduce(Db)}ae.and=lb;var db=z1(ae.operators.OR);function cb(...e){return e.reduce(db)}ae.or=cb;function z1(e){return(u,t)=>u===Fe.nil?t:t===Fe.nil?u:(0,Fe._)`${ws(u)} ${e} ${ws(t)}`}function ws(e){return e instanceof Fe.Name?e:(0,Fe._)`(${e})`}});var le=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var Ie=ee(),pb=Df();function mb(e){let u={};for(let t of e)u[t]=!0;return u}De.toHash=mb;function Fb(e,u){return typeof u=="boolean"?u:Object.keys(u).length===0?!0:(W1(e,u),!G1(u,e.self.RULES.all))}De.alwaysValidSchema=Fb;function W1(e,u=e.schema){let{opts:t,self:i}=e;if(!t.strictSchema||typeof u=="boolean")return;let n=i.RULES.keywords;for(let f in u)n[f]||X1(e,`unknown keyword: "${f}"`)}De.checkUnknownRules=W1;function G1(e,u){if(typeof e=="boolean")return!e;for(let t in e)if(u[t])return!0;return!1}De.schemaHasRules=G1;function Cb(e,u){if(typeof e=="boolean")return!e;for(let t in e)if(t!=="$ref"&&u.all[t])return!0;return!1}De.schemaHasRulesButRef=Cb;function hb({topSchemaRef:e,schemaPath:u},t,i,n){if(!n){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Ie._)`${t}`}return(0,Ie._)`${e}${u}${(0,Ie.getProperty)(i)}`}De.schemaRefOrVal=hb;function gb(e){return K1(decodeURIComponent(e))}De.unescapeFragment=gb;function bb(e){return encodeURIComponent(Is(e))}De.escapeFragment=bb;function Is(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Is;function K1(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=K1;function Eb(e,u){if(Array.isArray(e))for(let t of e)u(t);else u(e)}De.eachItem=Eb;function H1({mergeNames:e,mergeToName:u,mergeValues:t,resultToName:i}){return(n,f,r,o)=>{let a=r===void 0?f:r instanceof Ie.Name?(f instanceof Ie.Name?e(n,f,r):u(n,f,r),r):f instanceof Ie.Name?(u(n,r,f),f):t(f,r);return o===Ie.Name&&!(a instanceof Ie.Name)?i(n,a):a}}De.mergeEvaluated={props:H1({mergeNames:(e,u,t)=>e.if((0,Ie._)`${t} !== true && ${u} !== undefined`,()=>{e.if((0,Ie._)`${u} === true`,()=>e.assign(t,!0),()=>e.assign(t,(0,Ie._)`${t} || {}`).code((0,Ie._)`Object.assign(${t}, ${u})`))}),mergeToName:(e,u,t)=>e.if((0,Ie._)`${t} !== true`,()=>{u===!0?e.assign(t,!0):(e.assign(t,(0,Ie._)`${t} || {}`),As(e,t,u))}),mergeValues:(e,u)=>e===!0?!0:X(X({},e),u),resultToName:J1}),items:H1({mergeNames:(e,u,t)=>e.if((0,Ie._)`${t} !== true && ${u} !== undefined`,()=>e.assign(t,(0,Ie._)`${u} === true ? true : ${t} > ${u} ? ${t} : ${u}`)),mergeToName:(e,u,t)=>e.if((0,Ie._)`${t} !== true`,()=>e.assign(t,u===!0?!0:(0,Ie._)`${t} > ${u} ? ${t} : ${u}`)),mergeValues:(e,u)=>e===!0?!0:Math.max(e,u),resultToName:(e,u)=>e.var("items",u)})};function J1(e,u){if(u===!0)return e.var("props",!0);let t=e.var("props",(0,Ie._)`{}`);return u!==void 0&&As(e,t,u),t}De.evaluatedPropsToName=J1;function As(e,u,t){Object.keys(t).forEach(i=>e.assign((0,Ie._)`${u}${(0,Ie.getProperty)(i)}`,!0))}De.setEvaluated=As;var U1={};function _b(e,u){return e.scopeValue("func",{ref:u,code:U1[u.code]||(U1[u.code]=new pb._Code(u.code))})}De.useFunc=_b;var Ss=function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e}(Ss||(De.Type=Ss={}));function yb(e,u,t){if(e instanceof Ie.Name){let i=u===Ss.Num;return t?i?(0,Ie._)`"[" + ${e} + "]"`:(0,Ie._)`"['" + ${e} + "']"`:i?(0,Ie._)`"/" + ${e}`:(0,Ie._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Ie.getProperty)(e).toString():"/"+Is(e)}De.getErrorPath=yb;function X1(e,u,t=e.opts.strictSchema){if(t){if(u=`strict mode: ${u}`,t===!0)throw new Error(u);e.self.logger.warn(u)}}De.checkStrictMode=X1});var Ut=F(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var lt=ee(),vb={data:new lt.Name("data"),valCxt:new lt.Name("valCxt"),instancePath:new lt.Name("instancePath"),parentData:new lt.Name("parentData"),parentDataProperty:new lt.Name("parentDataProperty"),rootData:new lt.Name("rootData"),dynamicAnchors:new lt.Name("dynamicAnchors"),vErrors:new lt.Name("vErrors"),errors:new lt.Name("errors"),this:new lt.Name("this"),self:new lt.Name("self"),scope:new lt.Name("scope"),json:new lt.Name("json"),jsonPos:new lt.Name("jsonPos"),jsonLen:new lt.Name("jsonLen"),jsonPart:new lt.Name("jsonPart")};ks.default=vb});var df=F(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.extendErrors=dt.resetErrorsCount=dt.reportExtraError=dt.reportError=dt.keyword$DataError=dt.keywordError=void 0;var ge=ee(),ro=le(),Et=Ut();dt.keywordError={message:({keyword:e})=>(0,ge.str)`must pass "${e}" keyword validation`};dt.keyword$DataError={message:({keyword:e,schemaType:u})=>u?(0,ge.str)`"${e}" keyword must be ${u} ($data)`:(0,ge.str)`"${e}" keyword is invalid ($data)`};function Bb(e,u=dt.keywordError,t,i){let{it:n}=e,{gen:f,compositeRule:r,allErrors:o}=n,a=Q1(e,u,t);i??(r||o)?Y1(f,a):Z1(n,(0,ge._)`[${a}]`)}dt.reportError=Bb;function xb(e,u=dt.keywordError,t){let{it:i}=e,{gen:n,compositeRule:f,allErrors:r}=i,o=Q1(e,u,t);Y1(n,o),f||r||Z1(i,Et.default.vErrors)}dt.reportExtraError=xb;function wb(e,u){e.assign(Et.default.errors,u),e.if((0,ge._)`${Et.default.vErrors} !== null`,()=>e.if(u,()=>e.assign((0,ge._)`${Et.default.vErrors}.length`,u),()=>e.assign(Et.default.vErrors,null)))}dt.resetErrorsCount=wb;function Sb({gen:e,keyword:u,schemaValue:t,data:i,errsCount:n,it:f}){if(n===void 0)throw new Error("ajv implementation error");let r=e.name("err");e.forRange("i",n,Et.default.errors,o=>{e.const(r,(0,ge._)`${Et.default.vErrors}[${o}]`),e.if((0,ge._)`${r}.instancePath === undefined`,()=>e.assign((0,ge._)`${r}.instancePath`,(0,ge.strConcat)(Et.default.instancePath,f.errorPath))),e.assign((0,ge._)`${r}.schemaPath`,(0,ge.str)`${f.errSchemaPath}/${u}`),f.opts.verbose&&(e.assign((0,ge._)`${r}.schema`,t),e.assign((0,ge._)`${r}.data`,i))})}dt.extendErrors=Sb;function Y1(e,u){let t=e.const("err",u);e.if((0,ge._)`${Et.default.vErrors} === null`,()=>e.assign(Et.default.vErrors,(0,ge._)`[${t}]`),(0,ge._)`${Et.default.vErrors}.push(${t})`),e.code((0,ge._)`${Et.default.errors}++`)}function Z1(e,u){let{gen:t,validateName:i,schemaEnv:n}=e;n.$async?t.throw((0,ge._)`new ${e.ValidationError}(${u})`):(t.assign((0,ge._)`${i}.errors`,u),t.return(!1))}var wi={keyword:new ge.Name("keyword"),schemaPath:new ge.Name("schemaPath"),params:new ge.Name("params"),propertyName:new ge.Name("propertyName"),message:new ge.Name("message"),schema:new ge.Name("schema"),parentSchema:new ge.Name("parentSchema")};function Q1(e,u,t){let{createErrors:i}=e.it;return i===!1?(0,ge._)`{}`:Ib(e,u,t)}function Ib(e,u,t={}){let{gen:i,it:n}=e,f=[Ab(n,t),kb(e,t)];return $b(e,u,f),i.object(...f)}function Ab({errorPath:e},{instancePath:u}){let t=u?(0,ge.str)`${e}${(0,ro.getErrorPath)(u,ro.Type.Str)}`:e;return[Et.default.instancePath,(0,ge.strConcat)(Et.default.instancePath,t)]}function kb({keyword:e,it:{errSchemaPath:u}},{schemaPath:t,parentSchema:i}){let n=i?u:(0,ge.str)`${u}/${e}`;return t&&(n=(0,ge.str)`${n}${(0,ro.getErrorPath)(t,ro.Type.Str)}`),[wi.schemaPath,n]}function $b(e,{params:u,message:t},i){let{keyword:n,data:f,schemaValue:r,it:o}=e,{opts:a,propertyName:s,topSchemaRef:D,schemaPath:d}=o;i.push([wi.keyword,n],[wi.params,typeof u=="function"?u(e):u||(0,ge._)`{}`]),a.messages&&i.push([wi.message,typeof t=="function"?t(e):t]),a.verbose&&i.push([wi.schema,r],[wi.parentSchema,(0,ge._)`${D}${d}`],[Et.default.data,f]),s&&i.push([wi.propertyName,s])}});var td=F(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.boolOrEmptySchema=fn.topBoolOrEmptySchema=void 0;var Tb=df(),Pb=ee(),Ob=Ut(),Mb={message:"boolean schema is false"};function jb(e){let{gen:u,schema:t,validateName:i}=e;t===!1?ed(e,!1):typeof t=="object"&&t.$async===!0?u.return(Ob.default.data):(u.assign((0,Pb._)`${i}.errors`,null),u.return(!0))}fn.topBoolOrEmptySchema=jb;function Nb(e,u){let{gen:t,schema:i}=e;i===!1?(t.var(u,!1),ed(e)):t.var(u,!0)}fn.boolOrEmptySchema=Nb;function ed(e,u){let{gen:t,data:i}=e,n={gen:t,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Tb.reportError)(n,Mb,void 0,u)}});var $s=F(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.getRules=rn.isJSONType=void 0;var qb=["string","number","integer","boolean","null","object","array"],Vb=new Set(qb);function Rb(e){return typeof e=="string"&&Vb.has(e)}rn.isJSONType=Rb;function Lb(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:Se(X({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}rn.getRules=Lb});var Ts=F(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.shouldUseRule=ei.shouldUseGroup=ei.schemaHasRulesForType=void 0;function zb({schema:e,self:u},t){let i=u.RULES.types[t];return i&&i!==!0&&ud(e,i)}ei.schemaHasRulesForType=zb;function ud(e,u){return u.rules.some(t=>id(e,t))}ei.shouldUseGroup=ud;function id(e,u){var t;return e[u.keyword]!==void 0||((t=u.definition.implements)===null||t===void 0?void 0:t.some(i=>e[i]!==void 0))}ei.shouldUseRule=id});var cf=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.reportTypeError=ct.checkDataTypes=ct.checkDataType=ct.coerceAndCheckDataType=ct.getJSONTypes=ct.getSchemaTypes=ct.DataType=void 0;var Hb=$s(),Ub=Ts(),Wb=df(),re=ee(),nd=le(),on=function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e}(on||(ct.DataType=on={}));function Gb(e){let u=fd(e.type);if(u.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!u.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&u.push("null")}return u}ct.getSchemaTypes=Gb;function fd(e){let u=Array.isArray(e)?e:e?[e]:[];if(u.every(Hb.isJSONType))return u;throw new Error("type must be JSONType or JSONType[]: "+u.join(","))}ct.getJSONTypes=fd;function Kb(e,u){let{gen:t,data:i,opts:n}=e,f=Jb(u,n.coerceTypes),r=u.length>0&&!(f.length===0&&u.length===1&&(0,Ub.schemaHasRulesForType)(e,u[0]));if(r){let o=Os(u,i,n.strictNumbers,on.Wrong);t.if(o,()=>{f.length?Xb(e,u,f):Ms(e)})}return r}ct.coerceAndCheckDataType=Kb;var rd=new Set(["string","number","integer","boolean","null"]);function Jb(e,u){return u?e.filter(t=>rd.has(t)||u==="array"&&t==="array"):[]}function Xb(e,u,t){let{gen:i,data:n,opts:f}=e,r=i.let("dataType",(0,re._)`typeof ${n}`),o=i.let("coerced",(0,re._)`undefined`);f.coerceTypes==="array"&&i.if((0,re._)`${r} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,re._)`${n}[0]`).assign(r,(0,re._)`typeof ${n}`).if(Os(u,n,f.strictNumbers),()=>i.assign(o,n))),i.if((0,re._)`${o} !== undefined`);for(let s of t)(rd.has(s)||s==="array"&&f.coerceTypes==="array")&&a(s);i.else(),Ms(e),i.endIf(),i.if((0,re._)`${o} !== undefined`,()=>{i.assign(n,o),Yb(e,o)});function a(s){switch(s){case"string":i.elseIf((0,re._)`${r} == "number" || ${r} == "boolean"`).assign(o,(0,re._)`"" + ${n}`).elseIf((0,re._)`${n} === null`).assign(o,(0,re._)`""`);return;case"number":i.elseIf((0,re._)`${r} == "boolean" || ${n} === null
3
3
  || (${r} == "string" && ${n} && ${n} == +${n})`).assign(o,(0,re._)`+${n}`);return;case"integer":i.elseIf((0,re._)`${r} === "boolean" || ${n} === null
4
4
  || (${r} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(o,(0,re._)`+${n}`);return;case"boolean":i.elseIf((0,re._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(o,!1).elseIf((0,re._)`${n} === "true" || ${n} === 1`).assign(o,!0);return;case"null":i.elseIf((0,re._)`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(o,null);return;case"array":i.elseIf((0,re._)`${r} === "string" || ${r} === "number"
@@ -1 +1 @@
1
- import{a as E}from"./chunk-XH4RYJ6Y.js";import{d as w}from"./chunk-QR7L4UUP.js";import{b}from"./chunk-G43HU5Q5.js";import{h as k,k as S}from"./chunk-ZHNSZ7X2.js";import{a as $,b as T}from"./chunk-DJKI5XBW.js";import{$a as i,Ac as c,Bc as l,Cc as y,Hb as m,Ib as p,Nb as g,Ob as r,Pb as n,Qb as u,Xa as _,Yb as v,jc as o,kc as s,la as a,lb as x,wc as C}from"./chunk-U4V4ICSI.js";var I=t=>({command:t});function R(t,h){t&1&&(r(0,"p",7),o(1),c(2,"translate"),n()),t&2&&(i(),s(l(2,1,"restart.please_wait_while_server_restarts")))}function D(t,h){if(t&1&&(r(0,"div",8),o(1),n()),t&2){let e=v();i(),s(e.error)}}function B(t,h){t&1&&(r(0,"div",9)(1,"div",11),u(2,"i",12),n()())}function M(t,h){if(t&1&&(r(0,"div",10)(1,"p"),o(2),c(3,"translate"),n(),u(4,"p",13),c(5,"translate"),n()),t&2){let e=v();i(2),s(l(3,2,"platform.docker.server_long_time")),i(2),g("innerHTML",y(5,4,"platform.docker.run_with_restart",C(7,I,e.command)),_)}}var N=(()=>{class t{$api=a(S);$router=a(w);$settings=a(b);$toastr=a(k);$translate=a($);$ws=a(E);checkTimeout;checkDelay;resp={};timeout=!1;error=!1;command='<span class="font-monospace">--restart=always</span>';io;constructor(){}ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(e),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=x({type:t,selectors:[["ng-component"]],decls:15,vars:10,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fab","fa-fw","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"grey-text"],[1,"alert","alert-error","my-4"],[1,"justify-content-center","my-4"],[1,"alert","alert-warning","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(d,f){d&1&&(r(0,"div",0)(1,"h3",1),o(2),c(3,"translate"),n()(),r(4,"div",2)(5,"div",3),u(6,"i",4),n(),r(7,"div",5)(8,"h4",6),o(9),c(10,"translate"),n(),m(11,R,3,3,"p",7),m(12,D,2,1,"div",8),m(13,B,3,0,"div",9),m(14,M,6,9,"div",10),n()()),d&2&&(i(2),s(l(3,6,"menu.restart.title")),i(7),s(l(10,8,"platform.docker.title_restarting")),i(2),p(f.error?-1:11),i(),p(f.error?12:-1),i(),p(f.error?-1:13),i(),p(f.timeout?14:-1))},dependencies:[T],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{N as a};
1
+ import{a as E}from"./chunk-IEZW2VEP.js";import{d as w}from"./chunk-QR7L4UUP.js";import{b}from"./chunk-WP2UTBVE.js";import{h as k,k as S}from"./chunk-37FVXLTH.js";import{a as $,b as T}from"./chunk-DJKI5XBW.js";import{$a as i,Ac as c,Bc as l,Cc as y,Hb as m,Ib as p,Nb as g,Ob as r,Pb as n,Qb as u,Xa as _,Yb as v,jc as o,kc as s,la as a,lb as x,wc as C}from"./chunk-U4V4ICSI.js";var I=t=>({command:t});function R(t,h){t&1&&(r(0,"p",7),o(1),c(2,"translate"),n()),t&2&&(i(),s(l(2,1,"restart.please_wait_while_server_restarts")))}function D(t,h){if(t&1&&(r(0,"div",8),o(1),n()),t&2){let e=v();i(),s(e.error)}}function B(t,h){t&1&&(r(0,"div",9)(1,"div",11),u(2,"i",12),n()())}function M(t,h){if(t&1&&(r(0,"div",10)(1,"p"),o(2),c(3,"translate"),n(),u(4,"p",13),c(5,"translate"),n()),t&2){let e=v();i(2),s(l(3,2,"platform.docker.server_long_time")),i(2),g("innerHTML",y(5,4,"platform.docker.run_with_restart",C(7,I,e.command)),_)}}var N=(()=>{class t{$api=a(S);$router=a(w);$settings=a(b);$toastr=a(k);$translate=a($);$ws=a(E);checkTimeout;checkDelay;resp={};timeout=!1;error=!1;command='<span class="font-monospace">--restart=always</span>';io;constructor(){}ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(e),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=x({type:t,selectors:[["ng-component"]],decls:15,vars:10,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fab","fa-fw","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"grey-text"],[1,"alert","alert-error","my-4"],[1,"justify-content-center","my-4"],[1,"alert","alert-warning","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(d,f){d&1&&(r(0,"div",0)(1,"h3",1),o(2),c(3,"translate"),n()(),r(4,"div",2)(5,"div",3),u(6,"i",4),n(),r(7,"div",5)(8,"h4",6),o(9),c(10,"translate"),n(),m(11,R,3,3,"p",7),m(12,D,2,1,"div",8),m(13,B,3,0,"div",9),m(14,M,6,9,"div",10),n()()),d&2&&(i(2),s(l(3,6,"menu.restart.title")),i(7),s(l(10,8,"platform.docker.title_restarting")),i(2),p(f.error?-1:11),i(),p(f.error?12:-1),i(),p(f.error?-1:13),i(),p(f.timeout?14:-1))},dependencies:[T],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{N as a};
@@ -1,4 +1,4 @@
1
- import{a as k}from"./chunk-Q7VA22QV.js";import{a as z,b as A}from"./chunk-YXEV6KOV.js";import{a as l}from"./chunk-XH4RYJ6Y.js";import{M as n,g as r,ga as c,la as d,n as h}from"./chunk-U4V4ICSI.js";var f=r(z(),1),a=r(A(),1),p=r(k(),1);var $=(()=>{class t{$ws=d(l);term;io;fitAddon;webLinksAddon;resize;elementResize;pluginName;constructor(){}startTerminal(m,s={},u,w){this.pluginName=w,this.elementResize=u,this.io=this.$ws.connectToNamespace("log"),this.term=new f.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new a.FitAddon,this.webLinksAddon=new p.WebLinksAddon,this.resize=new h,this.term.open(m.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.subscribe(()=>{this.term.reset(),this.io.socket.emit("tail-log",{cols:this.term.cols,rows:this.term.rows})}),this.io.socket.on("disconnect",()=>{this.term.write(`
1
+ import{a as k}from"./chunk-Q7VA22QV.js";import{a as z,b as A}from"./chunk-YXEV6KOV.js";import{a as l}from"./chunk-IEZW2VEP.js";import{M as n,g as r,ga as c,la as d,n as h}from"./chunk-U4V4ICSI.js";var f=r(z(),1),a=r(A(),1),p=r(k(),1);var $=(()=>{class t{$ws=d(l);term;io;fitAddon;webLinksAddon;resize;elementResize;pluginName;constructor(){}startTerminal(m,s={},u,w){this.pluginName=w,this.elementResize=u,this.io=this.$ws.connectToNamespace("log"),this.term=new f.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new a.FitAddon,this.webLinksAddon=new p.WebLinksAddon,this.resize=new h,this.term.open(m.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.subscribe(()=>{this.term.reset(),this.io.socket.emit("tail-log",{cols:this.term.cols,rows:this.term.rows})}),this.io.socket.on("disconnect",()=>{this.term.write(`
2
2
  \r
3
3
  \rWebsocket failed to connect. Is the server running?
4
4
  \r
@@ -1 +1 @@
1
- import{a as R}from"./chunk-UHL5ARSB.js";import"./chunk-GKWVMOET.js";import{c as S}from"./chunk-CHQVUHUA.js";import"./chunk-XZR7OZ6I.js";import{q as d}from"./chunk-7S2SCSTB.js";import{A as f,z as u}from"./chunk-HLSZVFAU.js";import"./chunk-XH4RYJ6Y.js";import{d as C,g as m}from"./chunk-QR7L4UUP.js";import"./chunk-5BL6PCNR.js";import"./chunk-G43HU5Q5.js";import{h as v,k as g}from"./chunk-ZHNSZ7X2.js";import"./chunk-ASBFWS7L.js";import{a as M,c as h}from"./chunk-DJKI5XBW.js";import{ga as c,h as p,ha as i,kd as l,la as e,mb as a,w as s}from"./chunk-U4V4ICSI.js";var n=(()=>{class t{$api=e(g);$router=e(C);$toastr=e(v);$translate=e(M);constructor(){}resolve(){return p(this,null,function*(){try{return yield s(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var j=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-2IFXAVZX.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:n}},{path:"restart-container",loadComponent:()=>import("./chunk-CX3YFWUG.js").then(t=>t.ContainerRestartComponent)}],$=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[m.forChild(j),m]})}return t})();var Q=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[n],imports:[l,u,f,S,d,h.forChild(),$,R]})}return t})();export{Q as DockerModule};
1
+ import{a as R}from"./chunk-SGZRBB5V.js";import"./chunk-5X2MRBQA.js";import{c as S}from"./chunk-CHQVUHUA.js";import"./chunk-XZR7OZ6I.js";import{q as d}from"./chunk-7S2SCSTB.js";import{A as f,z as u}from"./chunk-HLSZVFAU.js";import"./chunk-IEZW2VEP.js";import{d as C,g as m}from"./chunk-QR7L4UUP.js";import"./chunk-7GYDUXMU.js";import"./chunk-WP2UTBVE.js";import{h as v,k as g}from"./chunk-37FVXLTH.js";import"./chunk-ASBFWS7L.js";import{a as M,c as h}from"./chunk-DJKI5XBW.js";import{ga as c,h as p,ha as i,kd as l,la as e,mb as a,w as s}from"./chunk-U4V4ICSI.js";var n=(()=>{class t{$api=e(g);$router=e(C);$toastr=e(v);$translate=e(M);constructor(){}resolve(){return p(this,null,function*(){try{return yield s(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var j=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-IMOI4TFW.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:n}},{path:"restart-container",loadComponent:()=>import("./chunk-DGB4Z6YE.js").then(t=>t.ContainerRestartComponent)}],$=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[m.forChild(j),m]})}return t})();var Q=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[n],imports:[l,u,f,S,d,h.forChild(),$,R]})}return t})();export{Q as DockerModule};
@@ -1 +1 @@
1
- import{a as _,b as D}from"./chunk-G43HU5Q5.js";import{j as c,k as S}from"./chunk-ZHNSZ7X2.js";import{f as x}from"./chunk-ASBFWS7L.js";import{C as v,g as O,ga as h,h as a,ha as E,ja as y,ka as l,la as f,mb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-U4V4ICSI.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{m as a,F as b,q as c};
1
+ import{a as _,b as D}from"./chunk-WP2UTBVE.js";import{j as c,k as S}from"./chunk-37FVXLTH.js";import{f as x}from"./chunk-ASBFWS7L.js";import{C as v,g as O,ga as h,h as a,ha as E,ja as y,ka as l,la as f,mb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-U4V4ICSI.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{m as a,F as b,q as c};
@@ -1 +1 @@
1
- import{a}from"./chunk-2UMHCTKQ.js";import"./chunk-7S2SCSTB.js";import"./chunk-HLSZVFAU.js";import"./chunk-QR7L4UUP.js";import"./chunk-G43HU5Q5.js";import"./chunk-ZHNSZ7X2.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as PowerOptionsComponent};
1
+ import{a}from"./chunk-VS5PRHN6.js";import"./chunk-7S2SCSTB.js";import"./chunk-HLSZVFAU.js";import"./chunk-QR7L4UUP.js";import"./chunk-WP2UTBVE.js";import"./chunk-37FVXLTH.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as PowerOptionsComponent};
@@ -0,0 +1 @@
1
+ import{e as a}from"./chunk-HOS4YIX7.js";import"./chunk-FHMZVMZK.js";import"./chunk-7S2SCSTB.js";import"./chunk-HLSZVFAU.js";import"./chunk-QR7L4UUP.js";import"./chunk-7GYDUXMU.js";import"./chunk-WP2UTBVE.js";import"./chunk-37FVXLTH.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as UsersComponent};