homebridge-config-ui-x 5.0.0-beta.42 → 5.0.0-beta.43

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 (156) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/config.schema.json +0 -130
  3. package/dist/core/auth/auth.controller.d.ts +0 -2
  4. package/dist/core/config/config.service.d.ts +1 -6
  5. package/dist/core/config/config.service.js +2 -6
  6. package/dist/core/config/config.service.js.map +1 -1
  7. package/dist/index.js +3 -75
  8. package/dist/index.js.map +1 -1
  9. package/dist/modules/backup/backup.service.js +3 -63
  10. package/dist/modules/backup/backup.service.js.map +1 -1
  11. package/dist/modules/child-bridges/child-bridges.service.js +0 -7
  12. package/dist/modules/child-bridges/child-bridges.service.js.map +1 -1
  13. package/dist/modules/log/log.gateway.d.ts +2 -1
  14. package/dist/modules/log/log.gateway.js.map +1 -1
  15. package/dist/modules/platform-tools/hb-service/hb-service.controller.js +1 -1
  16. package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
  17. package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +2 -1
  18. package/dist/modules/platform-tools/terminal/terminal.gateway.js.map +1 -1
  19. package/dist/modules/plugins/plugins.service.js +5 -8
  20. package/dist/modules/plugins/plugins.service.js.map +1 -1
  21. package/dist/modules/server/server.controller.js +0 -10
  22. package/dist/modules/server/server.controller.js.map +1 -1
  23. package/dist/modules/server/server.service.js +1 -29
  24. package/dist/modules/server/server.service.js.map +1 -1
  25. package/dist/modules/status/status.controller.d.ts +0 -1
  26. package/dist/modules/status/status.controller.js +0 -1
  27. package/dist/modules/status/status.controller.js.map +1 -1
  28. package/dist/modules/status/status.gateway.d.ts +0 -1
  29. package/dist/modules/status/status.service.d.ts +0 -1
  30. package/dist/modules/status/status.service.js +12 -37
  31. package/dist/modules/status/status.service.js.map +1 -1
  32. package/package.json +10 -10
  33. package/public/{chunk-FLTVAPLJ.js → chunk-2GU2VOTQ.js} +1 -1
  34. package/public/{chunk-FFBZNIV4.js → chunk-2MK4YF4F.js} +1 -1
  35. package/public/{chunk-PYUYYML6.js → chunk-2MK7AEG4.js} +1 -1
  36. package/public/{chunk-XK6YFVEM.js → chunk-2PD576LT.js} +1 -1
  37. package/public/chunk-2R3TSF5L.js +1 -0
  38. package/public/{chunk-5CH326YZ.js → chunk-3NFJOKS7.js} +1 -1
  39. package/public/{chunk-E2YPWEWJ.js → chunk-4FO7LQCL.js} +16 -16
  40. package/public/{chunk-JI6HSJHF.js → chunk-4G7AL7O5.js} +1 -1
  41. package/public/{chunk-ZDFTIT3A.js → chunk-4KHML3ZA.js} +1 -1
  42. package/public/chunk-4OLU6O26.js +1 -0
  43. package/public/chunk-5LY2MQ27.js +1 -0
  44. package/public/chunk-5O4JYY7I.js +1 -0
  45. package/public/{chunk-65FUMHFL.js → chunk-5SZPKHJT.js} +1 -1
  46. package/public/{chunk-QPZRGSPK.js → chunk-6ITPGT2B.js} +1 -1
  47. package/public/{chunk-W3XYJV7L.js → chunk-7TK3SSD2.js} +1 -1
  48. package/public/{chunk-RIEIV4MJ.js → chunk-A7Q2BOQH.js} +1 -1
  49. package/public/chunk-APDFTSJS.js +1 -0
  50. package/public/{chunk-UYTJPMEB.js → chunk-B2UQOT6L.js} +1 -1
  51. package/public/chunk-B7WCXCMH.js +1 -0
  52. package/public/{chunk-JU4EVF4W.js → chunk-BJXUYVHS.js} +1 -1
  53. package/public/{chunk-4FFJROIP.js → chunk-C53ZLBUW.js} +1 -1
  54. package/public/chunk-C6IAD6Z2.js +7 -0
  55. package/public/chunk-CXYP5EVS.js +1 -0
  56. package/public/{chunk-LTBEZPLP.js → chunk-DHQATXHJ.js} +1 -1
  57. package/public/{chunk-LKTGKLIS.js → chunk-DLIMGGAD.js} +1 -1
  58. package/public/chunk-DTZAQOWH.js +1 -0
  59. package/public/chunk-E6VBERNX.js +1 -0
  60. package/public/chunk-EETCTFAQ.js +1 -0
  61. package/public/{chunk-GQS3624Y.js → chunk-EGT26ZY5.js} +1 -1
  62. package/public/chunk-EWIBW3TR.js +1 -0
  63. package/public/chunk-F42KLYK3.js +1 -0
  64. package/public/chunk-GJWJQ3Z5.js +2 -0
  65. package/public/{chunk-PTNPLGZX.js → chunk-GM4JYGDP.js} +1 -1
  66. package/public/chunk-GQ2AM7UQ.js +1 -0
  67. package/public/{chunk-7MB3DNWX.js → chunk-GSBFK4JS.js} +1 -1
  68. package/public/chunk-GXHFLHC7.js +1 -0
  69. package/public/{chunk-5VL3WFKG.js → chunk-H2AG6442.js} +1 -1
  70. package/public/{chunk-UFFY2L3W.js → chunk-H2FEGEWG.js} +1 -1
  71. package/public/chunk-H43QBACT.js +1 -0
  72. package/public/{chunk-2BBAYFXG.js → chunk-HBTN4COO.js} +1 -1
  73. package/public/{chunk-WBTQONWJ.js → chunk-HKTXPODL.js} +1 -1
  74. package/public/chunk-HVOEV7W6.js +1 -0
  75. package/public/chunk-I2437F3J.js +1 -0
  76. package/public/{chunk-XYZNUVDF.js → chunk-I7EEM2EE.js} +1 -1
  77. package/public/chunk-IA2ABLRP.js +1 -0
  78. package/public/{chunk-GOHZ4DC4.js → chunk-IANOJDSU.js} +1 -1
  79. package/public/{chunk-JZMQ5FID.js → chunk-J7OUBNKI.js} +1 -1
  80. package/public/{chunk-SM4YBIEF.js → chunk-JFXGVUSN.js} +1 -1
  81. package/public/chunk-JN65M5Z3.js +1 -0
  82. package/public/{chunk-M76MJAZW.js → chunk-KHDWLARC.js} +1 -1
  83. package/public/chunk-KPMCIYRI.js +1 -0
  84. package/public/chunk-KSY3EAGF.js +6 -0
  85. package/public/{chunk-L5QEKCUD.js → chunk-LAMTCTSO.js} +1 -1
  86. package/public/chunk-LFT7TXCS.js +1 -0
  87. package/public/{chunk-SSMNJVEP.js → chunk-MNVY4PED.js} +1 -1
  88. package/public/{chunk-MENWQGGT.js → chunk-MRBKHHLU.js} +1 -1
  89. package/public/{chunk-72OVWMW4.js → chunk-MYETMTGL.js} +1 -1
  90. package/public/chunk-NA4FVMAC.js +1 -0
  91. package/public/{chunk-TIBT4CSR.js → chunk-NSO77EJP.js} +1 -1
  92. package/public/chunk-OHB3DOWR.js +1 -0
  93. package/public/chunk-Q34V7AKX.js +1 -0
  94. package/public/chunk-QHZWTWUL.js +1 -0
  95. package/public/{chunk-N5FBRXHL.js → chunk-QOMBBDI6.js} +1 -1
  96. package/public/{chunk-53FTBKZ2.js → chunk-QVCLXIPG.js} +1 -1
  97. package/public/chunk-RH5JN2KO.js +1 -0
  98. package/public/{chunk-S4NS5C5I.js → chunk-SOAJH5N3.js} +1 -1
  99. package/public/{chunk-I63HKVR6.js → chunk-SWNVXI2O.js} +1 -1
  100. package/public/chunk-T3C3XS2R.js +1 -0
  101. package/public/{chunk-RCUTBSYA.js → chunk-TC3455K3.js} +1 -1
  102. package/public/chunk-UFE4FFID.js +1 -0
  103. package/public/{chunk-V5R6RQCC.js → chunk-URY6BMDW.js} +1 -1
  104. package/public/{chunk-Y2M2SYLN.js → chunk-VBTERB4K.js} +1 -1
  105. package/public/{chunk-ZELCXGCO.js → chunk-WNFIPZRL.js} +1 -1
  106. package/public/{chunk-T7WHHJXM.js → chunk-WTDCYIBS.js} +1 -1
  107. package/public/{chunk-4XP7GEYJ.js → chunk-XIFLDXKP.js} +1 -1
  108. package/public/chunk-XZLDELWN.js +1 -0
  109. package/public/chunk-YEYWAMLQ.js +1 -0
  110. package/public/chunk-YNHGSUQI.js +1 -0
  111. package/public/chunk-YXMANVOI.js +1 -0
  112. package/public/{chunk-B7O46BB4.js → chunk-Z7U6M7T4.js} +1 -1
  113. package/public/chunk-ZCZ2G2I7.js +1 -0
  114. package/public/{chunk-2MYACURS.js → chunk-ZHLNAXXR.js} +1 -1
  115. package/public/chunk-ZS3NNO45.js +1 -0
  116. package/public/index.html +2 -2
  117. package/public/main-IFQC7RQB.js +1 -0
  118. package/public/{styles-5ZGAUY5X.css → styles-CJ5TSDXW.css} +1 -1
  119. package/public/chunk-2ARSC6O4.js +0 -1
  120. package/public/chunk-3K3T5NSC.js +0 -1
  121. package/public/chunk-74KAIEDS.js +0 -1
  122. package/public/chunk-7J7D4RFK.js +0 -1
  123. package/public/chunk-7W7EXLYO.js +0 -1
  124. package/public/chunk-AQ54ULWK.js +0 -1
  125. package/public/chunk-BFQLKNRB.js +0 -1
  126. package/public/chunk-BQOSSBRF.js +0 -1
  127. package/public/chunk-BSEA6257.js +0 -1
  128. package/public/chunk-BZKVTAWF.js +0 -1
  129. package/public/chunk-CHM3UOOF.js +0 -1
  130. package/public/chunk-CPK4IHTN.js +0 -1
  131. package/public/chunk-D5QSEWQM.js +0 -1
  132. package/public/chunk-DVRZ3IDH.js +0 -1
  133. package/public/chunk-G6SBDRZH.js +0 -1
  134. package/public/chunk-GQXGO6WL.js +0 -1
  135. package/public/chunk-LLRJ42LL.js +0 -1
  136. package/public/chunk-MOIAA6KW.js +0 -1
  137. package/public/chunk-NZL2QIFO.js +0 -2
  138. package/public/chunk-O22A7NB6.js +0 -1
  139. package/public/chunk-OMQJPVOF.js +0 -1
  140. package/public/chunk-OU3RPA4S.js +0 -1
  141. package/public/chunk-Q7NQDFMV.js +0 -1
  142. package/public/chunk-QNGE5ZDK.js +0 -1
  143. package/public/chunk-RNVIUOVJ.js +0 -1
  144. package/public/chunk-TDPDDCIB.js +0 -1
  145. package/public/chunk-UJHX3L5V.js +0 -1
  146. package/public/chunk-VCQGYVKC.js +0 -1
  147. package/public/chunk-VRNVEPFN.js +0 -7
  148. package/public/chunk-VUKBYUPD.js +0 -1
  149. package/public/chunk-WMOLH753.js +0 -1
  150. package/public/chunk-XGZAEODA.js +0 -6
  151. package/public/chunk-XOHC7JOP.js +0 -1
  152. package/public/chunk-YGEJHVNT.js +0 -1
  153. package/public/chunk-YJO7S4AQ.js +0 -1
  154. package/public/chunk-YSMKBTTY.js +0 -1
  155. package/public/chunk-YVJ3QN4J.js +0 -1
  156. package/public/main-PGVKLAL7.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as ke}from"./chunk-A7Q2BOQH.js";import{a as we}from"./chunk-H2AG6442.js";import{v as ye}from"./chunk-4FO7LQCL.js";import{g as J,m as M,n as he}from"./chunk-HKTXPODL.js";import{b as G,c as le,e as W,f as se,g as Z,j as D,k as oe,l as q,m as pe,n as de,o as ce,p as me,q as ue,r as _e,s as ge,t as be,u as ve,v as fe,y as K,z as xe}from"./chunk-MNVY4PED.js";import{d as P,e as Ce}from"./chunk-IA2ABLRP.js";import{b as Se}from"./chunk-XIFLDXKP.js";import{h as V,k as R}from"./chunk-EETCTFAQ.js";import{a as F,b as $}from"./chunk-WTDCYIBS.js";import{$c as O,Ac as l,Bc as s,Cc as Y,Jb as f,Kb as _,M as Q,Pb as b,Rb as A,Sb as N,Tb as T,Ub as i,Vb as n,Wb as c,_b as w,bc as v,cb as X,cc as g,ed as j,gb as t,h as y,ma as C,mc as r,nc as d,oc as u,rc as ne,sb as B,sc as ae,tc as re,ua as S,va as k,w as E,wc as H,xc as I,yc as L,zb as h}from"./chunk-C6IAD6Z2.js";function Te(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),d(s(4,1,"reset.no_accessories")))}function Me(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),d(s(5,5,"reset.accessory_all.list_1")),t(3),d(s(8,7,"reset.accessory_all.list_2")),t(3),d(s(11,9,"reset.accessory_all.list_3")),t(2),_("dismissible",!1),t(2),d(s(15,11,"reset.action_is_irreversible")))}function Fe(a,m){if(a&1){let e=w();i(0,"button",19),l(1,"translate"),v("click",function(){S(e);let o=g();return k(o.$activeModal.dismiss("Dismiss"))}),r(2),l(3,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),f("aria-label",s(1,3,"form.button_close")),t(2),u(" ",s(3,5,"form.button_close")," ")}}function Ve(a,m){if(a&1){let e=w();i(0,"button",20),l(1,"translate"),v("click",function(){S(e);let o=g();return k(o.$activeModal.dismiss("Dismiss"))}),r(2),l(3,"translate"),n()}a&2&&(f("aria-label",s(1,2,"form.button_close")),t(2),u(" ",s(3,4,"form.button_close")," "))}function Re(a,m){a&1&&(r(0),l(1,"translate")),a&2&&u(" ",s(1,1,"form.button_remove")," ")}function De(a,m){a&1&&c(0,"i",22)}function Pe(a,m){if(a&1){let e=w();i(0,"button",21),v("click",function(){S(e);let o=g();return k(o.onResetCachedAccessoriesClick())}),h(1,Re,2,3)(2,De,1,0,"i",22),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),b(e.clicked?-1:1),t(),b(e.clicked?2:-1)}}var Ee=(()=>{class a{$activeModal=C(M);$api=C(R);$router=C(P);$toastr=C(V);$translate=C(F);clicked=!1;cachedAccessories=[];constructor(){}ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return y(this,null,function*(){try{this.cachedAccessories=yield E(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(p){return new(p||a)};static \u0275cmp=B({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(p,o){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return o.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),h(8,Te,5,3)(9,Me,16,13),n(),i(10,"div",5)(11,"div",6),h(12,Fe,4,7,"button",7),n(),i(13,"div",8),h(14,Ve,4,6,"button",9),n(),i(15,"div",10),h(16,Pe,3,3,"button",11),n()()()),p&2&&(t(3),d(s(4,8,"reset.accessory_all.title")),t(2),_("disabled",o.clicked),f("aria-label",s(6,10,"form.button_close")),t(3),b(o.cachedAccessories.length===0?8:-1),t(),b(o.cachedAccessories.length>0?9:-1),t(3),b(o.cachedAccessories.length>0?12:-1),t(2),b(o.cachedAccessories.length===0?14:-1),t(2),b(o.cachedAccessories.length>0?16:-1))},dependencies:[J,$],encapsulation:2})}return a})();var He=(a,m)=>({"green-text":a,"grey-text":m}),Le=(a,m)=>({"btn-danger":a,"btn-elegant":m}),Oe=(a,m,e)=>({"fa-broom":a,"fa-undo":m,"fa-spinner fa-pulse":e});function Ue(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),d(s(4,1,"reset.bridge_accessories.empty")))}function ze(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"),v("click",function(){let o=S(e).$implicit,x=g(2);return k(x.toggleList(o._id))}),c(12,"i",23),n()()}if(a&2){let e=m.$implicit,p=g(2);t(2),u(" ",e.name," "),t(3),_("ngClass",I(12,He,e._isPaired,!e._isPaired)),t(),u(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),d(e._username),t(),_("disabled",p.clicked)("ngClass",I(15,Le,!p.toDelete.includes(e._id),p.toDelete.includes(e._id))),f("aria-label",s(11,10,"form.button_delete")),t(2),_("ngClass",L(18,Oe,!p.toDelete.includes(e._id),p.toDelete.includes(e._id)&&!p.clicked,p.toDelete.includes(e._id)&&p.clicked))}}function je(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),N(13,ze,13,22,"li",18,A),n()),a&2){let e=g();t(4),d(s(5,3,"reset.bridge_accessories.list_1")),t(3),d(s(8,5,"reset.clear_cache_single.list_3")),t(3),d(s(11,7,"reset.bridge_accessories.list_2")),t(3),T(e.pairings)}}function Ge(a,m){if(a&1){let e=w();i(0,"button",24),v("click",function(){S(e);let o=g();return k(o.$activeModal.dismiss("Dismiss"))}),r(1),l(2,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),u(" ",s(2,2,"form.button_close")," ")}}function We(a,m){if(a&1){let e=w();i(0,"button",25),v("click",function(){S(e);let o=g();return k(o.$activeModal.dismiss("Dismiss"))}),r(1),l(2,"translate"),n()}a&2&&(t(),u(" ",s(2,1,"form.button_close")," "))}function qe(a,m){if(a&1&&r(0),a&2){let e=g(3);u(" (",e.toDelete.length,") ")}}function Ke(a,m){if(a&1&&(r(0),l(1,"translate"),h(2,qe,1,1)),a&2){let e=g(2);u(" ",s(1,2,"form.button_remove")," "),t(2),b(e.toDelete.length>0?2:-1)}}function Je(a,m){a&1&&c(0,"i",27)}function Qe(a,m){if(a&1){let e=w();i(0,"button",26),v("click",function(){S(e);let o=g();return k(o.cleanBridges())}),h(1,Ke,3,4)(2,Je,1,0,"i",27),n()}if(a&2){let e=g();_("disabled",!e.toDelete.length||e.clicked),t(),b(e.clicked?-1:1),t(),b(e.clicked?2:-1)}}var Be=(()=>{class a{$activeModal=C(M);$api=C(R);$router=C(P);$toastr=C(V);$translate=C(F);clicked=!1;pairings=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{this.pairings=(yield E(this.$api.get("/server/pairings"))).filter(e=>e._category==="bridge"&&!e._main).sort((e,p)=>e.name.localeCompare(p.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(p=>p!==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(p){return new(p||a)};static \u0275cmp=B({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(p,o){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return o.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),h(8,Ue,5,3)(9,je,15,9),n(),i(10,"div",5)(11,"div",6),h(12,Ge,3,4,"button",7),n(),i(13,"div",8),h(14,We,3,3,"button",9),n(),i(15,"div",10),h(16,Qe,3,3,"button",11),n()()()),p&2&&(t(3),d(s(4,8,"reset.bridge_accessories.title")),t(2),_("disabled",o.clicked),f("aria-label",s(6,10,"form.button_close")),t(3),b(o.pairings.length===0?8:-1),t(),b(o.pairings.length>0?9:-1),t(3),b(o.pairings.length>0?12:-1),t(2),b(o.pairings.length===0?14:-1),t(2),b(o.pairings.length>0?16:-1))},dependencies:[O,$],encapsulation:2})}return a})();function Xe(a,m){a&1&&(r(0),l(1,"translate")),a&2&&u(" ",s(1,1,"form.button_reset")," ")}function Ye(a,m){a&1&&c(0,"i",16)}var Ie=(()=>{class a{$activeModal=C(M);$api=C(R);$route=C(P);$toastr=C(V);$translate=C(F);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(p){return new(p||a)};static \u0275cmp=B({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(p,o){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return o.$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"),v("click",function(){return o.$activeModal.dismiss("Dismiss")}),r(31),l(32,"translate"),n()(),c(33,"div",13),i(34,"div",14)(35,"button",15),v("click",function(){return o.onResetHomebridgeAccessoryClick()}),h(36,Xe,2,3)(37,Ye,1,0,"i",16),n()()()()),p&2&&(t(3),d(s(4,15,"reset.bridge_all.title")),t(2),_("disabled",o.clicked),f("aria-label",s(6,17,"form.button_close")),t(7),d(s(13,19,"reset.bridge_all.list_1")),t(3),d(s(16,21,"reset.bridge_all.list_2")),t(3),d(s(19,23,"reset.bridge_all.list_3")),t(3),d(s(22,25,"reset.bridge_all.list_4")),t(2),_("dismissible",!1),t(2),d(s(26,27,"reset.action_is_irreversible")),t(4),_("disabled",o.clicked),f("aria-label",s(30,29,"form.button_close")),t(2),u(" ",s(32,31,"form.button_close")," "),t(4),_("disabled",o.clicked),t(),b(o.clicked?-1:36),t(),b(o.clicked?37:-1))},dependencies:[J,$],encapsulation:2})}return a})();var ee=(a,m)=>({"green-text":a,"grey-text":m}),te=(a,m)=>({"btn-danger":a,"btn-elegant":m}),$e=(a,m,e)=>({"fa-refresh":a,"fa-undo":m,"fa-spinner fa-pulse":e}),Ze=(a,m,e)=>({"fa-trash":a,"fa-undo":m,"fa-spinner fa-pulse":e});function et(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),d(s(4,1,"reset.bridges.empty")))}function tt(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"),v("click",function(){let o=S(e).$implicit,x=g(3);return k(x.toggleList(o._id,!1))}),c(14,"i",25),n()()}if(a&2){let e=m.$implicit,p=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",I(15,ee,e._isPaired,!e._isPaired)),t(),u(" ",s(7,9,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),d(e._username),t(),u(" \xB7 ",e._main?"Homebridge":s(11,11,e._category)," "),t(2),_("disabled",p.clicked)("ngClass",I(18,te,!p.isInList(e._id),p.isInList(e._id))),f("aria-label",s(13,13,"form.button_unpair")),t(2),_("ngClass",L(21,$e,!p.isInList(e._id),p.isInList(e._id)&&!p.clicked,p.isInList(e._id)&&p.clicked))}}function it(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()(),N(8,tt,15,25,"li",20,A),n()),a&2){let e=g(2);t(3),d(s(4,2,"reset.bridge_ind.head_non_child")),t(3),d(s(7,4,"reset.bridge_ind.desc_non_child")),t(2),T(e.pairingsNonChild)}}function nt(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"),v("click",function(){let o=S(e).$implicit,x=g(3);return k(x.toggleList(o._id,!0))}),c(12,"i",25),n()()}if(a&2){let e=m.$implicit,p=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",I(12,ee,e._isPaired,!e._isPaired)),t(),u(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),d(e._username),t(),_("disabled",p.clicked)("ngClass",I(15,te,!p.isInList(e._id),p.isInList(e._id))),f("aria-label",s(11,10,"form.button_unpair")),t(2),_("ngClass",L(18,$e,!p.isInList(e._id),p.isInList(e._id)&&!p.clicked,p.isInList(e._id)&&p.clicked))}}function at(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()(),N(8,nt,13,22,"li",20,A),n()),a&2){let e=g(2);t(3),d(s(4,2,"reset.bridge_ind.head_child_active")),t(3),d(s(7,4,"reset.bridge_ind.desc_child_active")),t(2),T(e.pairingsChildActive)}}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()()(),i(10,"button",24),l(11,"translate"),v("click",function(){let o=S(e).$implicit,x=g(3);return k(x.toggleList(o._id,!1))}),c(12,"i",25),n()()}if(a&2){let e=m.$implicit,p=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",I(12,ee,e._isPaired,!e._isPaired)),t(),u(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),d(e._username),t(),_("disabled",p.clicked)("ngClass",I(15,te,!p.isInList(e._id),p.isInList(e._id))),f("aria-label",s(11,10,"form.button_unpair")),t(2),_("ngClass",L(18,Ze,!p.isInList(e._id),p.isInList(e._id)&&!p.clicked,p.isInList(e._id)&&p.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()(),N(8,rt,13,22,"li",20,A),n()),a&2){let e=g(2);t(3),d(s(4,2,"reset.bridge_ind.head_child_stale")),t(3),d(s(7,4,"reset.bridge_ind.desc_child_stale")),t(2),T(e.pairingsChildStale)}}function st(a,m){if(a&1&&(i(0,"div",12),c(1,"i",15),n(),h(2,it,10,6,"ul",16)(3,at,10,6,"ul",16)(4,lt,10,6,"ul",16)),a&2){let e=g();t(2),b(e.pairingsNonChild.length>0?2:-1),t(),b(e.pairingsChildActive.length>0?3:-1),t(),b(e.pairingsChildStale.length>0?4:-1)}}function ot(a,m){if(a&1){let e=w();i(0,"button",26),v("click",function(){S(e);let o=g();return k(o.$activeModal.dismiss("Dismiss"))}),r(1),l(2,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),u(" ",s(2,2,"form.button_close")," ")}}function pt(a,m){if(a&1){let e=w();i(0,"button",27),v("click",function(){S(e);let o=g();return k(o.$activeModal.dismiss("Dismiss"))}),r(1),l(2,"translate"),n()}a&2&&(t(),u(" ",s(2,1,"form.button_close")," "))}function dt(a,m){if(a&1&&r(0),a&2){let e=g(3);u(" (",e.toDelete.length,") ")}}function ct(a,m){if(a&1&&(r(0),l(1,"translate"),h(2,dt,1,1)),a&2){let e=g(2);u(" ",s(1,2,"form.button_reset")," "),t(2),b(e.toDelete.length>0?2:-1)}}function mt(a,m){a&1&&c(0,"i",29)}function ut(a,m){if(a&1){let e=w();i(0,"button",28),v("click",function(){S(e);let o=g();return k(o.removeBridges())}),h(1,ct,3,4)(2,mt,1,0,"i",29),n()}if(a&2){let e=g();_("disabled",!e.toDelete.length||e.clicked),t(),b(e.clicked?-1:1),t(),b(e.clicked?2:-1)}}var Ae=(()=>{class a{$activeModal=C(M);$api=C(R);$router=C(P);$toastr=C(V);$translate=C(F);clicked=!1;pairingsNonChild=[];pairingsChildActive=[];pairingsChildStale=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{let e=(yield E(this.$api.get("/server/pairings"))).filter(p=>!p._main).sort((p,o)=>p.name.localeCompare(o.name));this.pairingsChildActive=e.filter(p=>p._category==="bridge"&&!p._couldBeStale),this.pairingsNonChild=e.filter(p=>p._category!=="bridge"),this.pairingsChildStale=e.filter(p=>p._category==="bridge"&&p._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,p=!1){this.toDelete.some(o=>o.id===e)?this.toDelete=this.toDelete.filter(o=>o.id!==e):this.toDelete.push({id:e,resetPairingInfo:p})}isInList(e){return this.toDelete.some(p=>p.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(p){return new(p||a)};static \u0275cmp=B({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(p,o){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return o.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),h(8,et,5,3)(9,st,5,3),n(),i(10,"div",5)(11,"div",6),h(12,ot,3,4,"button",7),n(),i(13,"div",8),h(14,pt,3,3,"button",9),n(),i(15,"div",10),h(16,ut,3,3,"button",11),n()()()),p&2&&(t(3),d(s(4,8,"reset.bridge_ind.title")),t(2),_("disabled",o.clicked),f("aria-label",s(6,10,"form.button_close")),t(3),b(o.pairingsChildActive.length===0&&o.pairingsChildStale.length===0&&o.pairingsNonChild.length===0?8:-1),t(),b(o.pairingsChildActive.length>0||o.pairingsChildStale.length>0||o.pairingsNonChild.length>0?9:-1),t(3),b(o.pairingsChildActive.length>0||o.pairingsChildStale.length>0||o.pairingsNonChild.length>0?12:-1),t(2),b(o.pairingsChildActive.length===0&&o.pairingsChildStale.length===0&&o.pairingsNonChild.length===0?14:-1),t(2),b(o.pairingsChildActive.length>0||o.pairingsChildStale.length>0||o.pairingsNonChild.length>0?16:-1))},dependencies:[O,j,$],encapsulation:2})}return a})();function gt(a,m){if(a&1){let e=w();i(0,"li",10)(1,"span")(2,"label",17)(3,"input",18),re("ngModelChange",function(o){let x=S(e).$implicit;return ae(x.selected,o)||(x.selected=o),k(o)}),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),ne("ngModel",e.selected),t(2),d(e.iface),t(3),d(e.ip4||e.ip6)}}var Ne=(()=>{class a{$activeModal=C(M);availableNetworkAdapters=[];bridgeNetworkAdapters=[];constructor(){}submit(){this.$activeModal.close(this.availableNetworkAdapters.filter(e=>e.selected).map(e=>e.iface))}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({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(p,o){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),l(4,"translate"),n(),i(5,"button",3),l(6,"translate"),v("click",function(){return o.$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()(),N(22,gt,9,5,"li",10,A),n()(),i(24,"div",11)(25,"div",12)(26,"button",13),l(27,"translate"),v("click",function(){return o.$activeModal.dismiss("Dismiss")}),r(28),l(29,"translate"),n()(),c(30,"div",14),i(31,"div",15)(32,"button",16),v("click",function(){return o.submit()}),r(33),l(34,"translate"),n()()()()),p&2&&(t(3),d(s(4,8,"settings.network.title_network_interfaces")),t(2),f("aria-label",s(6,10,"form.button_close")),t(7),d(s(13,12,"settings.network.message_network_interface")),t(5),d(s(18,14,"settings.network.label_interface_name")),t(3),d(s(21,16,"settings.network.label_ip_address")),t(2),T(o.availableNetworkAdapters),t(4),f("aria-label",s(27,18,"form.button_close")),t(2),u(" ",s(29,20,"form.button_close")," "),t(5),u(" ",s(34,22,"form.button_save")," "))},dependencies:[K,G,W,q,$],encapsulation:2})}return a})();var ie=a=>({"is-invalid":a}),bt=a=>({file:a}),vt=a=>({link:a}),ft=a=>({"fa-pulse":a}),xt=(a,m)=>({"badge-danger":a,"badge-info":m});function ht(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),d(s(3,3,"settings.changes.saved")),t(2),f("aria-label",s(5,5,"menu.tooltip_restart")),t(2),u(" ",s(7,7,"menu.tooltip_restart")," "))}function Ct(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"),v("click",function(){S(e);let o=g();return k(o.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"),v("click",function(){S(e);let o=g();return k(o.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()(),h(28,ht,8,9,"li",22),n()}if(a&2){let e=g();t(5),_("formControl",e.hbNameFormControl)("ngClass",H(24,ie,e.isInvalidHbName)),f("aria-label",s(6,10,"settings.network.port_ui")),t(4),u(" ",s(10,12,"menu.label_settings_advanced")," "),t(2),f("aria-label",s(12,14,"menu.label_settings_advanced")),t(5),u(" ",s(17,16,"backup.title_backup")," "),t(2),f("aria-label",s(19,18,"backup.title_backup")),t(5),u(" ",s(24,20,"menu.tooltip_user_accounts")," "),t(2),f("aria-label",s(26,22,"menu.tooltip_user_accounts")),t(3),b(e.hasChangedHbName&&!e.isInvalidHbName?28:-1)}}function St(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),d(s(3,3,"settings.changes.saved")),t(2),f("aria-label",s(5,5,"menu.tooltip_restart")),t(2),u(" ",s(7,7,"menu.tooltip_restart")," "))}function kt(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),v("ngModelChange",function(o){S(e);let x=g();return k(x.saveUiSettingChange("lang",o))}),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),v("ngModelChange",function(o){S(e);let x=g();return k(x.saveUiSettingChange("theme",o))}),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),v("ngModelChange",function(o){S(e);let x=g();return k(x.saveUiSettingChange("lightingMode",o))}),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),v("ngModelChange",function(o){S(e);let x=g();return k(x.saveUiSettingChange("menuMode",o))}),i(128,"option",71),r(129),l(130,"translate"),n(),i(131,"option",72),r(132),l(133,"translate"),n()()()(),i(134,"li",14)(135,"span"),r(136),l(137,"translate"),c(138,"br")(139,"small",73),l(140,"translate"),n(),i(141,"div",25)(142,"input",74),v("ngModelChange",function(o){S(e);let x=g();return k(x.saveUiSettingChange("loginWallpaper",o))}),n()()(),i(143,"li",14),r(144),l(145,"translate"),i(146,"div",25)(147,"select",26),v("ngModelChange",function(o){S(e);let x=g();return k(x.saveUiSettingChange("tempUnits",o))}),i(148,"option",75),r(149),l(150,"translate"),n(),i(151,"option",76),r(152),l(153,"translate"),n()()()(),h(154,St,8,9,"li",22),n()}if(a&2){let e=g();t(2),u(" ",s(3,35,"settings.display.lang")," "),t(3),_("ngModel",e.$settings.env.lang),t(2),d(s(8,37,"form.select.auto")),t(59),u(" ",s(67,39,"settings.display.theme")," "),t(3),_("ngModel",e.$settings.theme),t(2),d(s(72,41,"settings.display.orange")),t(3),d(s(75,43,"settings.display.red")),t(3),d(s(78,45,"settings.display.pink")),t(3),d(s(81,47,"settings.display.purple")),t(3),d(s(84,49,"settings.display.deep_purple")),t(3),d(s(87,51,"settings.display.indigo")),t(3),d(s(90,53,"settings.display.blue")),t(3),d(s(93,55,"settings.display.bluegrey")),t(3),d(s(96,57,"settings.display.cyan")),t(3),d(s(99,59,"settings.display.green")),t(3),d(s(102,61,"settings.display.teal")),t(3),d(s(105,63,"settings.display.grey")),t(3),d(s(108,65,"settings.display.brown")),t(3),u(" ",s(111,67,"settings.display.lighting_mode")," "),t(3),_("ngModel",e.$settings.lightingMode),t(2),d(s(116,69,"form.select.auto")),t(3),d(s(119,71,"settings.display.light")),t(3),d(s(122,73,"settings.display.dark")),t(3),u(" ",s(125,75,"settings.display.menu_mode")," "),t(3),_("ngModel",e.$settings.menuMode),t(2),d(s(130,77,"settings.display.menu_default")),t(3),d(s(133,79,"settings.display.menu_freeze")),t(4),u(" ",s(137,81,"settings.display.login_wallpaper"),""),t(3),_("innerHTML",Y(140,83,"settings.display.login_wallpaper_desc",H(92,bt,e.file)),X),t(3),_("ngModel",e.$settings.loginWallpaper),t(2),u(" ",s(145,86,"settings.display.temp_units")," "),t(3),_("ngModel",e.$settings.env.temperatureUnits),t(2),d(s(150,88,"settings.display.temp_units.c")),t(3),d(s(153,90,"settings.display.temp_units.f")),t(2),b(e.hasChangedLoginWallpaper?154:-1)}}function wt(a,m){a&1&&(i(0,"li",17)(1,"span"),r(2),l(3,"translate"),c(4,"br"),i(5,"small",77),r(6),l(7,"translate"),n()(),i(8,"a",87),l(9,"translate"),c(10,"i",20),n()()),a&2&&(t(2),u(" ",s(3,3,"menu.docker.startup_script"),""),t(4),d(s(7,5,"platform.docker.script_help")),t(2),f("aria-label",s(9,7,"menu.docker.startup_script")))}function yt(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),d(s(3,3,"settings.changes.saved")),t(2),f("aria-label",s(5,5,"menu.tooltip_restart")),t(2),u(" ",s(7,7,"menu.tooltip_restart")," "))}function Et(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",77),r(9),l(10,"translate"),n()(),c(11,"input",78),l(12,"translate"),c(13,"label",79),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",77),r(22),l(23,"translate"),n()(),c(24,"input",80),l(25,"translate"),c(26,"label",81),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",77),r(35),l(36,"translate"),n()(),c(37,"input",82),l(38,"translate"),c(39,"label",83),n(),i(40,"li",14)(41,"span")(42,"span",84),r(43,"DEBUG"),n(),c(44,"br")(45,"small",73),l(46,"translate"),n(),i(47,"div",25),c(48,"input",85),n()(),i(49,"li",14)(50,"span")(51,"span",84),r(52,"NODE_OPTIONS"),n(),c(53,"br"),i(54,"small",77),r(55),l(56,"translate"),n()(),i(57,"div",25),c(58,"input",86),n()(),h(59,wt,11,9,"li",17)(60,yt,8,9,"li",22),n()),a&2){let e=g();t(3),u(" ",s(4,13,"settings.startup.debug")," "),t(6),u(" ",s(10,15,e.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),t(2),f("aria-label",s(12,17,"settings.startup.debug")),t(5),u(" ",s(17,19,"settings.startup.insecure")," "),t(6),d(s(23,21,"settings.startup.insecure_desc")),t(2),f("aria-label",s(25,23,"settings.startup.insecure")),t(5),u(" ",s(30,25,"settings.startup.keep_accessories")," "),t(6),d(s(36,27,"settings.startup.keep_accessories_desc")),t(2),f("aria-label",s(38,29,"settings.startup.keep_accessories")),t(8),_("innerHTML",Y(46,31,"settings.service.debug_tooltip",H(36,vt,e.linkDebug)),X),t(10),d(s(56,34,"settings.service.node_tooltip")),t(4),b(e.$settings.env.runningInDocker?59:-1),t(),b(e.hasChangedService?60:-1)}}function Bt(a,m){a&1&&c(0,"i",99)}function It(a,m){if(a&1&&(i(0,"span",89),h(1,Bt,1,0,"i",99),r(2),i(3,"span",100),r(4),l(5,"translate"),n()()),a&2){let e=m.$implicit;_("ngClass",I(6,xt,e.missing,!e.missing)),t(),b(e.missing?1:-1),t(),u(" ",e.iface,": "),t(2),d(e.missing?s(5,4,"settings.mdns_advertiser_not_connected"):e.ip4||e.ip6)}}function $t(a,m){a&1&&(i(0,"option",93),r(1),l(2,"translate"),n()),a&2&&(t(),u("Avahi (",s(2,1,"settings.mdns_advertiser_rec"),")"))}function At(a,m){a&1&&(i(0,"option",96),r(1),l(2,"translate"),n()),a&2&&(t(),u("systemd-resolved (",s(2,1,"settings.mdns_advertiser_exp"),")"))}function Nt(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),d(s(3,3,"settings.changes.saved")),t(2),f("aria-label",s(5,5,"menu.tooltip_restart")),t(2),u(" ",s(7,7,"menu.tooltip_restart")," "))}function Tt(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",88),r(7),l(8,"translate"),n(),N(9,It,6,9,"span",89,A),n(),i(11,"button",90),l(12,"translate"),v("click",function(){S(e);let o=g();return k(o.selectNetworkInterfaces())}),c(13,"i",91),n()(),i(14,"li",14)(15,"span"),r(16),l(17,"translate"),c(18,"br"),i(19,"small",77),r(20),l(21,"translate"),n()(),i(22,"div",25)(23,"select",92),l(24,"translate"),h(25,$t,3,3,"option",93),i(26,"option",94),r(27),l(28,"translate"),n(),i(29,"option",95),r(30,"Bonjour HAP"),n(),h(31,At,3,3,"option",96),n()()(),i(32,"li",14)(33,"span"),r(34),l(35,"translate"),c(36,"br"),i(37,"small",77),r(38),l(39,"translate"),n()(),i(40,"div",25),c(41,"input",97),l(42,"translate"),n()(),i(43,"li",14)(44,"span"),r(45),l(46,"translate"),c(47,"br"),i(48,"small",77),r(49),l(50,"translate"),n()(),i(51,"div",25),c(52,"input",98),l(53,"translate"),n()(),h(54,Nt,8,9,"li",22),n()}if(a&2){let e=g();t(3),u(" ",s(4,22,"settings.network.title_network_interfaces"),""),t(4),d(s(8,24,"settings.network.message_network_interface")),t(2),T(e.bridgeNetworkAdapters),t(2),_("disabled",!e.availableNetworkAdapters.length),f("aria-label",s(12,26,"settings.network.title_network_interfaces")),t(2),_("ngClass",H(48,ft,!e.availableNetworkAdapters.length)),t(3),u(" ",s(17,28,"settings.mdns_advertiser"),""),t(4),d(s(21,30,"settings.mdns_advertiser_help")),t(3),_("formControl",e.legacyMdnsFormControl),f("aria-label",s(24,32,"settings.mdns_advertiser")),t(2),b(e.showAvahiMdnsOption?25:-1),t(2),u(" Ciao ",e.showAvahiMdnsOption?"":"("+s(28,34,"settings.mdns_advertiser_rec")+")"," "),t(4),b(e.showResolvedMdnsOption?31:-1),t(3),u(" ",s(35,36,"settings.network.port_hb"),""),t(4),d(s(39,38,"settings.network.port_hb_desc")),t(3),_("formControl",e.hbPortFormControl)("ngClass",H(50,ie,e.isInvalidHbPort)),f("aria-label",s(42,40,"settings.network.port_ui")),t(4),u(" ",s(46,42,"settings.network.port_ui"),""),t(4),d(s(50,44,"settings.network.port_ui_desc")),t(3),_("ngClass",H(52,ie,e.isInvalidHbUiPort)),f("aria-label",s(53,46,"settings.network.port_ui")),t(2),b(e.hasChangedHbPort&&!e.isInvalidHbPort||e.hasChangedUiSettings||e.hasChangedMdns||e.hasChangedBridgeNetworkAdapters?54:-1)}}function Mt(a,m){a&1&&(i(0,"p",10),r(1),l(2,"translate"),n()),a&2&&(t(),d(s(2,1,"settings.cache.desc")))}function Ft(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",77),r(7),l(8,"translate"),n()(),i(9,"button",19),l(10,"translate"),v("click",function(){S(e);let o=g();return k(o.removeSingleCachedAccessories())}),c(11,"i",20),n()(),i(12,"li",17)(13,"span",18),r(14),l(15,"translate"),c(16,"br"),i(17,"small",77),r(18),l(19,"translate"),n()(),i(20,"button",19),l(21,"translate"),v("click",function(){S(e);let o=g();return k(o.removeBridgeAccessories())}),c(22,"i",20),n()(),i(23,"li",17)(24,"span",18),r(25),l(26,"translate"),c(27,"br"),i(28,"small",77),r(29),l(30,"translate"),n()(),i(31,"button",19),l(32,"translate"),v("click",function(){S(e);let o=g();return k(o.removeAllCachedAccessories())}),c(33,"i",20),n()()()}a&2&&(t(3),u(" ",s(4,9,"reset.accessory_ind.title"),""),t(4),d(s(8,11,"reset.accessory_ind.desc")),t(2),f("aria-label",s(10,13,"reset.accessory_ind.title")),t(5),u(" ",s(15,15,"reset.bridge_accessories.title"),""),t(4),d(s(19,17,"reset.bridge_accessories.desc")),t(2),f("aria-label",s(21,19,"reset.accessory_all.title")),t(5),u(" ",s(26,21,"reset.accessory_all.title"),""),t(4),d(s(30,23,"reset.accessory_all.desc")),t(2),f("aria-label",s(32,25,"reset.accessory_all.title")))}function Vt(a,m){a&1&&(i(0,"p",10),r(1),l(2,"translate"),n()),a&2&&(t(),d(s(2,1,"reset.bridges.desc")))}function Rt(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",77),r(7),l(8,"translate"),n()(),i(9,"button",19),l(10,"translate"),v("click",function(){S(e);let o=g();return k(o.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",77),r(19),l(20,"translate"),n()(),i(21,"button",19),l(22,"translate"),v("click",function(){S(e);let o=g();return k(o.resetHomebridgeState())}),c(23,"i",20),n()()()}a&2&&(t(3),u(" ",s(4,6,"reset.bridge_ind.title"),""),t(4),d(s(8,8,"reset.bridge_ind.desc")),t(2),f("aria-label",s(10,10,"reset.bridge_ind.title")),t(5),u(" ",s(16,14,s(15,12,"reset.bridge_all.title")),""),t(5),d(s(20,16,"reset.bridge_all.desc")),t(2),f("aria-label",s(22,18,"reset.bridge_all.title")))}var Qi=(()=>{class a{$api=C(R);$modal=C(he);$plugin=C(ye);$settings=C(Se);$toastr=C(V);$translate=C(F);originalServiceForm={HOMEBRIDGE_DEBUG:!1,HOMEBRIDGE_KEEP_ORPHANS:!1,HOMEBRIDGE_INSECURE:!0,ENV_DEBUG:"",ENV_NODE_OPTIONS:""};originalUiSettingsForm={port:0};originalLoginWallpaper="";originalMdnsSetting="";originalBridgeNetworkAdapters=[];originalHbPort=0;originalHbName="";hasChangedService=!1;hasChangedUiSettings=!1;hasChangedMdns=!1;hasChangedBridgeNetworkAdapters=!1;hasChangedHbPort=!1;hasChangedHbName=!1;hasChangedLoginWallpaper=!1;isInvalidHbPort=!1;isInvalidHbName=!1;isInvalidHbUiPort=!1;serviceForm=new Z({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 Z({port:new D(0)});loginWallpaper="";legacyMdnsFormControl=new oe(!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};file='<span class="font-monospace">ui-wallpaper.jpg</span>';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.initDisplaySettingsForm(),this.initNetworkingOptions(),this.initStartupSettingsForm()}initUiSettingsForm(){this.originalUiSettingsForm={port:this.$settings.env.port},this.uiSettingsForm.patchValue({port:this.$settings.env.port}),this.uiSettingsForm.valueChanges.pipe(Q(500)).subscribe(e=>{let p=!1;Object.keys(e).forEach(o=>{this.originalUiSettingsForm[o]!==e[o]&&(this.saveUiSettingChange(o,e[o]),p=!0)}),this.hasChangedUiSettings=p})}initStartupSettingsForm(){this.$api.get("/platform-tools/hb-service/homebridge-startup-settings").subscribe({next:e=>{Object.keys(e).forEach(p=>{this.originalServiceForm[p]=e[p]}),this.serviceForm.patchValue(e),this.serviceForm.valueChanges.pipe(Q(500)).subscribe(this.saveStartupSettingsSettings.bind(this))},error:e=>{console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}initDisplaySettingsForm(){this.originalLoginWallpaper=this.$settings.loginWallpaper,this.loginWallpaper=this.$settings.loginWallpaper}saveUiSettingChange(e,p){switch(e){case"lang":this.$settings.setLang(p);break;case"lightingMode":this.$settings.setLightingMode(p,"user");break;case"menuMode":this.$settings.setMenuMode(p),window.location.reload();break;case"theme":this.$settings.setTheme(p);break;case"tempUnits":this.$settings.setEnvItem("temperatureUnits",p);break;case"loginWallpaper":this.$settings.setEnvItem("loginWallpaper",p),this.hasChangedLoginWallpaper=p!==this.originalLoginWallpaper;break;case"port":if(!p||typeof p!="number"||p<1025||p>65533||Number.isInteger(p)===!1||p===this.hbPortFormControl.value){this.isInvalidHbUiPort=!0;return}this.$settings.setEnvItem("port",p),this.isInvalidHbUiPort=!1;break}E(this.$api.put("/config-editor/ui",{key:e,value:p})).catch(o=>{console.error(o),this.$toastr.error(o.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(ke,{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:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}resetHomebridgeState(){this.$modal.open(Ie,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(Ae,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open(Ee,{size:"lg",backdrop:"static"})}removeSingleCachedAccessories(){this.$modal.open(we,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open(Be,{size:"lg",backdrop:"static"})}initNetworkingOptions(){return y(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 y(this,null,function*(){return Promise.all([E(this.$api.get("/server/network-interfaces/system")),E(this.$api.get("/server/network-interfaces/bridge")),E(this.$api.get("/server/mdns-advertiser")),E(this.$api.get("/server/port"))]).then(([e,p,o,x])=>{this.availableNetworkAdapters=e,this.buildBridgeNetworkAdapterList(p),this.legacyMdnsFormControl.patchValue(o.advertiser),this.originalMdnsSetting=o.advertiser,this.originalBridgeNetworkAdapters=this.bridgeNetworkAdapters.map(U=>U.iface),this.legacyMdnsFormControl.valueChanges.subscribe(U=>{this.setHomebridgeMdnsSetting(U)}),this.hbPortFormControl.patchValue(x.port),this.hbPortFormControl.valueChanges.subscribe(U=>this.setHomebridgePort(U)),this.originalHbPort=x.port})})}setHomebridgeMdnsSetting(e){return y(this,null,function*(){this.$api.put("/server/mdns-advertiser",{advertiser:e}).subscribe({next:()=>{this.hasChangedMdns=e!==this.originalMdnsSetting},error:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})})}setNetworkInterfaces(e){return y(this,null,function*(){this.$api.put("/server/network-interfaces/bridge",{adapters:e}).subscribe({next:()=>{this.hasChangedBridgeNetworkAdapters=this.originalBridgeNetworkAdapters.join(",")!==e.join(",")},error:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})})}setHomebridgeName(e){return y(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 y(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(p=>{let o=this.availableNetworkAdapters.find(x=>x.iface===p);return o?(o.selected=!0,o.missing=!1,o):{iface:p,missing:!0}})}selectNetworkInterfaces(){let e=this.$modal.open(Ne,{size:"lg",backdrop:"static"});e.componentInstance.availableNetworkAdapters=this.availableNetworkAdapters,e.componentInstance.bridgeNetworkAdapters=this.bridgeNetworkAdapters,e.result.then(p=>{this.buildBridgeNetworkAdapterList(p),this.setNetworkInterfaces(p)}).catch(()=>{})}toggleSection(e){this.showFields[e]=!this.showFields[e]}static \u0275fac=function(p){return new(p||a)};static \u0275cmp=B({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"],[1,"grey-text","pe-2",3,"innerHTML"],["name","search_wallpaper","autocomplete","off","type","text","placeholder","/path-to/image.png",1,"form-control","custom-input","resp-input",3,"ngModelChange","ngModel"],["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"],["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(p,o){p&1&&(i(0,"h3",0),r(1),l(2,"translate"),n(),i(3,"div",1)(4,"div",2),v("click",function(){return o.toggleSection("general")}),i(5,"h5",3),c(6,"i",4),r(7),l(8,"translate"),n()(),h(9,Ct,29,26,"ul",5),n(),i(10,"div",1)(11,"div",2),v("click",function(){return o.toggleSection("display")}),i(12,"h5",3),c(13,"i",4),r(14),l(15,"translate"),n()(),h(16,kt,155,94,"ul",6),n(),i(17,"form",7)(18,"div",2),v("click",function(){return o.toggleSection("startup")}),i(19,"h5",3),c(20,"i",4),r(21),l(22,"translate"),n()(),h(23,Et,61,38,"ul",8),n(),i(24,"form",7)(25,"div",2),v("click",function(){return o.toggleSection("network")}),i(26,"h5",3),c(27,"i",4),r(28),l(29,"translate"),n()(),h(30,Tt,55,54,"ul",9),n(),i(31,"div",1)(32,"div",2),v("click",function(){return o.toggleSection("cache")}),i(33,"h5",3),c(34,"i",4),r(35),l(36,"translate"),n()(),h(37,Mt,3,3,"p",10)(38,Ft,34,27,"ul",11),n(),i(39,"div",1)(40,"div",2),v("click",function(){return o.toggleSection("reset")}),i(41,"h5",3),c(42,"i",4),r(43),l(44,"translate"),n()(),h(45,Vt,3,3,"p",10)(46,Rt,24,20,"ul",12),n(),c(47,"div",13)),p&2&&(t(),d(s(2,35,"menu.settings.title")),t(3),f("aria-expanded",o.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),t(2),_("ngClass",o.showFields.general?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",s(8,37,"settings.general.title_general")," "),t(2),b(o.showFields.general?9:-1),t(2),f("aria-expanded",o.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),t(2),_("ngClass",o.showFields.display?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",s(15,39,"settings.general.title_display")," "),t(2),b(o.showFields.display?16:-1),t(),_("formGroup",o.serviceForm),t(),f("aria-expanded",o.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),t(2),_("ngClass",o.showFields.startup?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",s(22,41,"settings.title_startup_options")," "),t(2),b(o.showFields.startup?23:-1),t(),_("formGroup",o.uiSettingsForm),t(),f("aria-expanded",o.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),t(2),_("ngClass",o.showFields.network?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",s(29,43,"settings.network.title_network")," "),t(2),b(o.showFields.network?30:-1),t(2),f("aria-expanded",o.showFields.cache?"true":"false")("aria-controls","fieldsCache"),t(2),_("ngClass",o.showFields.cache?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",s(36,45,"settings.cache.title")," "),t(2),b(o.showFields.cache?37:-1),t(),b(o.showFields.cache?38:-1),t(2),f("aria-expanded",o.showFields.reset?"true":"false")("aria-controls","fieldsReset"),t(2),_("ngClass",o.showFields.reset?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",s(44,47,"reset.bridges.title")," "),t(2),b(o.showFields.reset?45:-1),t(),b(o.showFields.reset?46:-1))},dependencies:[O,Ce,K,pe,ge,be,le,de,G,_e,W,se,fe,ve,q,xe,ce,me,ue,j,$],encapsulation:2})}return a})();export{Ee as a,Ie as b,Ne as c,Qi as d};
@@ -1 +1 @@
1
- import{a as j}from"./chunk-JI6HSJHF.js";import"./chunk-GQS3624Y.js";import"./chunk-N5FBRXHL.js";import{c as M}from"./chunk-UFFY2L3W.js";import"./chunk-5CH326YZ.js";import{q as u}from"./chunk-WBTQONWJ.js";import{y as l,z as d}from"./chunk-SSMNJVEP.js";import{d as h,g as a}from"./chunk-O22A7NB6.js";import"./chunk-4XP7GEYJ.js";import{h as v,k as y}from"./chunk-7W7EXLYO.js";import"./chunk-NZL2QIFO.js";import{a as g,c as C}from"./chunk-T7WHHJXM.js";import{ga as c,h as s,ha as i,id as p,ma as e,tb as n,w as f}from"./chunk-VRNVEPFN.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-XOHC7JOP.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-4G7AL7O5.js";import"./chunk-EGT26ZY5.js";import"./chunk-QOMBBDI6.js";import{c as M}from"./chunk-H2FEGEWG.js";import"./chunk-3NFJOKS7.js";import{q as u}from"./chunk-HKTXPODL.js";import{y as l,z as d}from"./chunk-MNVY4PED.js";import{d as h,g as a}from"./chunk-IA2ABLRP.js";import"./chunk-XIFLDXKP.js";import{h as v,k as y}from"./chunk-EETCTFAQ.js";import"./chunk-GJWJQ3Z5.js";import{a as g,c as C}from"./chunk-WTDCYIBS.js";import{ga as c,h as s,ha as i,id as p,ma as e,tb as n,w as f}from"./chunk-C6IAD6Z2.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-GQ2AM7UQ.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 +1 @@
1
- import{a as _,b as D}from"./chunk-4XP7GEYJ.js";import{j as c,k as S}from"./chunk-7W7EXLYO.js";import{f as x}from"./chunk-NZL2QIFO.js";import{C as v,Rc as I,g as O,ga as h,h as a,ha as E,ja as y,la as l,ma as f,r as p,tb as j,w as d,x as T,z as w}from"./chunk-VRNVEPFN.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(I))},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=j({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-XIFLDXKP.js";import{j as c,k as S}from"./chunk-EETCTFAQ.js";import{f as x}from"./chunk-GJWJQ3Z5.js";import{C as v,Rc as I,g as O,ga as h,h as a,ha as E,ja as y,la as l,ma as f,r as p,tb as j,w as d,x as T,z as w}from"./chunk-C6IAD6Z2.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(I))},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=j({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};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-BJXUYVHS.js";import"./chunk-TC3455K3.js";import"./chunk-IA2ABLRP.js";import"./chunk-DLIMGGAD.js";import"./chunk-XIFLDXKP.js";import"./chunk-EETCTFAQ.js";import"./chunk-GJWJQ3Z5.js";import"./chunk-WTDCYIBS.js";import"./chunk-C6IAD6Z2.js";export{a as ContainerRestartComponent};
@@ -0,0 +1 @@
1
+ import{S as ie,a as U,b as X,c as Y,f as te}from"./chunk-T3C3XS2R.js";import{a as ne}from"./chunk-3NFJOKS7.js";import{m as $,n as K,o as Q}from"./chunk-HKTXPODL.js";import{c as W,e as R,f as j,i as z,l as q,m as G,y as J}from"./chunk-MNVY4PED.js";import{c as ee}from"./chunk-DLIMGGAD.js";import{b as Z}from"./chunk-XIFLDXKP.js";import{b as M}from"./chunk-WTDCYIBS.js";import{$c as O,Ac as s,Bc as l,Cc as H,Jb as v,Kb as _,Pb as h,Rb as I,Sb as V,Tb as F,Ub as a,Vb as r,Wb as p,_b as B,bc as b,cb as N,cc as m,gb as o,ma as f,mc as d,nc as u,oc as w,rc as k,sb as y,sc as T,tc as A,ua as x,va as C,vc as L,wc as E,zb as S}from"./chunk-C6IAD6Z2.js";var oe=(()=>{class t{$activeModal=f($);constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],decls:31,vars:21,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,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),d(4),s(5,"translate"),r(),a(6,"button",3),s(7,"translate"),b("click",function(){return n.$activeModal.dismiss("Dismiss")}),r()(),a(8,"div",4)(9,"div",5),p(10,"i",6),r(),a(11,"ul",7)(12,"li"),d(13),s(14,"translate"),r(),a(15,"li"),d(16),s(17,"translate"),r(),a(18,"li"),d(19),s(20,"translate"),r(),a(21,"li"),d(22),s(23,"translate"),r()()(),a(24,"div",8),p(25,"div",9),a(26,"div",10)(27,"button",11),b("click",function(){return n.$activeModal.dismiss("Dismiss")}),d(28),s(29,"translate"),r()(),p(30,"div",12),r()()()),i&2&&(o(4),u(l(5,7,"support.title")),o(2),v("aria-label",l(7,9,"form.button_close")),o(7),u(l(14,11,"accessories.support.list_1")),o(3),u(l(17,13,"accessories.support.list_2")),o(3),u(l(20,15,"accessories.support.list_3")),o(3),u(l(23,17,"accessories.support.list_4")),o(6),w(" ",l(29,19,"form.button_close")," "))},dependencies:[M],encapsulation:2})}return t})();var se=()=>({standalone:!0}),ae=(()=>{class t{$activeModal=f($);roomName;constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:28,vars:19,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-folder-plus","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["autocomplete","off","type","text","id","form-name","autofocus","",1,"form-control","custom-input",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],[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","disabled"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),d(4),s(5,"translate"),r(),a(6,"button",3),s(7,"translate"),b("click",function(){return n.$activeModal.dismiss("Dismiss")}),r()(),a(8,"div",4)(9,"div",5),p(10,"i",6),r(),a(11,"ul",7)(12,"li",8)(13,"label",9),d(14),s(15,"translate"),r(),a(16,"div",10)(17,"input",11),A("ngModelChange",function(D){return T(n.roomName,D)||(n.roomName=D),D}),b("keyup.enter",function(){return n.$activeModal.close(n.roomName)}),r()()()()(),a(18,"div",12)(19,"div",13)(20,"button",14),b("click",function(){return n.$activeModal.dismiss("Dismiss")}),d(21),s(22,"translate"),r()(),p(23,"div",15),a(24,"div",16)(25,"button",17),b("click",function(){return n.$activeModal.close(n.roomName)}),d(26),s(27,"translate"),r()()()()()),i&2&&(o(4),u(l(5,8,"accessories.button_add_room")),o(2),v("aria-label",l(7,10,"form.button_close")),o(8),u(l(15,12,"accessories.room_name")),o(3),k("ngModel",n.roomName),_("ngModelOptions",L(18,se)),o(4),w(" ",l(22,14,"form.button_close")," "),o(4),_("disabled",!n.roomName),o(),w(" ",l(27,16,"form.button_save")," "))},dependencies:[J,G,W,R,j,q,z,M],encapsulation:2})}return t})();var re=(()=>{class t{constructor(){}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-drag-here-placeholder"]],decls:5,vars:3,consts:[[1,"accessory-box"],[1,"fas","fa-fw","fa-arrow-alt-circle-down","accessory-icon"],[1,"accessory-label"]],template:function(i,n){i&1&&(a(0,"div",0),p(1,"i",1),a(2,"div",2),d(3),s(4,"translate"),r()()),i&2&&(o(3),u(l(4,1,"accessories.control.drag_here")))},dependencies:[M],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var le=t=>({"cursor-move":t}),ce=t=>({"justify-content-between":t}),de=t=>({link:t});function pe(t,g){if(t&1&&(a(0,"div",0)(1,"div",18)(2,"h5",19),d(3),s(4,"translate"),r()()()),t&2){let e=m().$implicit,i=m(2);o(2),_("ngClass",E(4,le,!i.isMobile)),o(),w(" ",e.name==="Default Room"?l(4,2,"accessories.control.default_room"):e.name," ")}}function me(t,g){if(t&1&&(a(0,"div",22),p(1,"app-accessory-tile",23),r()),t&2){let e=m().$implicit;o(),_("service",e)}}function ue(t,g){if(t&1&&S(0,me,2,1,"div",22),t&2){let e=g.$implicit,i=m(4);h(!i.hideHidden||!e.hidden?0:-1)}}function _e(t,g){if(t&1){let e=B();a(0,"div",20),A("dragulaModelChange",function(n){x(e);let c=m().$implicit;return T(c.services,n)||(c.services=n),C(n)}),V(1,ue,1,1,null,null,I),p(3,"div",21)(4,"div",21)(5,"div",21)(6,"div",21)(7,"div",21)(8,"div",21)(9,"div",21)(10,"div",21)(11,"div",21)(12,"div",21),r()}if(t&2){let e=m().$implicit,i=m(2);_("ngClass",E(3,ce,i.isMobile))("dragula","services-bag"),k("dragulaModel",e.services),o(),F(e.services)}}function be(t,g){if(t&1){let e=B();a(0,"div",24),A("dragulaModelChange",function(n){x(e);let c=m().$implicit;return T(c.services,n)||(c.services=n),C(n)}),p(1,"app-drag-here-placeholder",25),r()}if(t&2){let e=m().$implicit;_("dragula","services-bag"),k("dragulaModel",e.services)}}function fe(t,g){if(t&1&&(a(0,"div"),S(1,pe,5,6,"div",0),a(2,"div",15),S(3,_e,13,5,"div",16)(4,be,2,2,"div",17),r()()),t&2){let e=g.$implicit,i=m(2);o(),h(!i.isMobile||e.services.length?1:-1),o(2),h(e.services.length?3:-1),o(),h(!e.services.length&&!i.isMobile?4:-1)}}function ge(t,g){if(t&1){let e=B();a(0,"div",1)(1,"div",2)(2,"h3",3),d(3),s(4,"translate"),r()(),a(5,"div",4)(6,"button",5),s(7,"translate"),s(8,"translate"),b("click",function(){x(e);let n=m();return C(n.addRoom())}),p(9,"i",6),r(),a(10,"button",5),s(11,"translate"),s(12,"translate"),s(13,"translate"),s(14,"translate"),b("click",function(){x(e);let n=m();return C(n.hideHidden=!n.hideHidden)}),p(15,"i",7),r(),a(16,"div",8)(17,"button",9),s(18,"translate"),s(19,"translate"),b("click",function(){x(e);let n=m();return C(n.toggleLayoutLock())}),p(20,"i",10),r(),a(21,"button",9),s(22,"translate"),s(23,"translate"),b("click",function(){x(e);let n=m();return C(n.toggleLayoutLock())}),p(24,"i",11),r()(),a(25,"button",12),s(26,"translate"),b("click",function(){x(e);let n=m();return C(n.openSupport())}),p(27,"i",13),r()()(),a(28,"div",14),A("dragulaModelChange",function(n){x(e);let c=m();return T(c.$accessories.rooms,n)||(c.$accessories.rooms=n),C(n)}),V(29,fe,5,3,"div",null,I),r()}if(t&2){let e=m();o(3),u(l(4,17,"accessories.title_accessories")),o(3),_("hidden",e.isMobile)("ngbTooltip",l(7,19,"accessories.button_add_room")),v("aria-label",l(8,21,"accessories.button_add_room")),o(4),_("hidden",e.isMobile)("ngbTooltip",e.hideHidden?l(11,23,"accessories.button_hidden_show"):l(12,25,"accessories.button_hidden_hide")),v("aria-label",e.hideHidden?l(13,27,"accessories.button_hidden_show"):l(14,29,"accessories.button_hidden_hide")),o(5),_("ngClass",e.hideHidden?"fa-eye-slash":"fa-eye"),o(2),_("disabled",!e.isMobile)("ngbTooltip",l(18,31,"form.button_unlock")),v("aria-label",l(19,33,"form.button_unlock")),o(4),_("disabled",e.isMobile)("ngbTooltip",l(22,35,"form.button_lock")),v("aria-label",l(23,37,"form.button_lock")),o(4),v("aria-label",l(26,39,"support.title")),o(3),_("dragula","rooms-bag"),k("dragulaModel",e.$accessories.rooms),o(),F(e.$accessories.rooms)}}function ve(t,g){t&1&&(a(0,"p",32),d(1),s(2,"translate"),r()),t&2&&(o(),u(l(2,1,"accessories.settings_link")))}function xe(t,g){if(t&1&&(a(0,"div",0)(1,"div",26)(2,"h3",27),d(3),s(4,"translate"),r()(),a(5,"div",28)(6,"div",29)(7,"h5",30),d(8),s(9,"translate"),r(),p(10,"p",31),s(11,"translate"),S(12,ve,3,3,"p",32),r()()()),t&2){let e=m();o(3),u(l(4,4,"accessories.title_accessories")),o(5),u(l(9,6,"accessories.control_disabled")),o(2),_("innerHTML",H(11,8,"accessories.message_must_use_insecure_mode",E(11,de,e.linkInsecure)),N),o(2),h(e.$auth.user.admin?12:-1)}}var Ue=(()=>{class t{$auth=f(ee);dragulaService=f(U);$modal=f(K);$settings=f(Z);$md=f(ne);$accessories=f(te);isMobile=!1;hideHidden=!0;orderSubscription;linkInsecure='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(i,n,c)=>!this.isMobile&&c.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:i=>!this.isMobile&&!i.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),this.isMobile=!0}ngOnInit(){this.$accessories.start()}addRoom(){this.$modal.open(ae,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(i=>i.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?document.querySelectorAll(".services-bag").forEach(i=>{for(let n=0;n<10;n++){let c=document.createElement("div");c.className="accessory-box invisible py-0 my-0",c.style.height="0",i.appendChild(c)}}):document.querySelectorAll(".invisible").forEach(i=>i.remove())}openSupport(){this.$modal.open(oe,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-accessories"]],decls:2,vars:2,consts:[[1,"row"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end","d-none","d-sm-inline-block"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","hidden","ngbTooltip"],[1,"fas","fa-fw","fa-folder-plus"],[1,"fas","fa-fw",3,"ngClass"],["role","group",1,"btn-group","me-2"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-unlock"],[1,"fas","fa-fw","fa-lock"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[3,"dragulaModelChange","dragula","dragulaModel"],[1,"row","mb-4"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"ngClass","dragula","dragulaModel"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragula","dragulaModel"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0","mb-1","mb-sm-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"dragulaModelChange","ngClass","dragula","dragulaModel"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0"],[1,"accessory-item","accessory-tab"],[3,"service"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragulaModelChange","dragula","dragulaModel"],[1,"no-drag"],[1,"col-12"],[1,"primary-text","m-0","mb-3"],[1,"col-12","text-center"],["role","alert",1,"alert","alert-warning","p-4"],[1,"mb-3","mt-0"],[1,"mb-0",3,"innerHTML"],[1,"mt-3","mb-0"]],template:function(i,n){i&1&&S(0,ge,31,41)(1,xe,13,13,"div",0),i&2&&(h(n.$settings.env.enableAccessories?0:-1),o(),h(n.$settings.env.enableAccessories?-1:1))},dependencies:[Q,O,Y,X,ie,re,M],styles:[".room-title[_ngcontent-%COMP%]{margin-left:10px}@media (max-width: 575px){.room-title[_ngcontent-%COMP%]{margin-left:7px}}.services-bag[_ngcontent-%COMP%]{min-height:170px}@media (max-width: 575px){.services-bag[_ngcontent-%COMP%]{min-height:initial}}.cursor-move[_ngcontent-%COMP%]{cursor:move}.gu-transit[_ngcontent-%COMP%] .manage-accessory-button[_ngcontent-%COMP%]{display:none}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return t})();export{ae as a,Ue as b};
@@ -0,0 +1 @@
1
+ import{e as dt,m as pt}from"./chunk-GJWJQ3Z5.js";import{Da as z,Ib as k,Ja as O,Jb as E,Kb as l,Lb as F,Nb as p,Rc as K,Ub as h,Vb as m,Wb as j,Xb as q,Yb as G,_b as U,a as u,ac as ht,b as T,bb as lt,bc as R,bd as Q,cb as L,cc as c,e as It,ga as C,gb as r,ha as ot,hb as v,ja as rt,la as w,lb as ct,ma as _,mc as f,n as g,na as at,oc as y,sb as Z,tb as ut,ua as $,va as V,za as H,zb as S}from"./chunk-C6IAD6Z2.js";var Tt=It((fe,qt)=>{qt.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.0.0-beta.43",description:"A web based management, configuration and control platform for Homebridge.",author:"oznu <dev@oz.nu>",license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/oznu"},{type:"paypal",url:"https://paypal.me/oznu"}],repository:{type:"git",url:"git+https://github.com/homebridge/homebridge-config-ui-x.git"},bugs:{url:"https://github.com/homebridge/homebridge-config-ui-x/issues"},keywords:["homebridge-plugin","ui","gui","web","homebridge","homebridge-config-ui-x","ui-x","config-ui-x","homebridge-x","homebridge server","homebridge ui","homebridge-ui","homebridge gui","homebridge-gui","web interface","config ui","management","config editor","linux","macOS","osx","windows","raspberry pi","accessory control","smart home","hb-service"],main:"./dist/index.js",bin:{"homebridge-config-ui-x":"dist/bin/standalone.js","hb-service":"dist/bin/hb-service.js"},engines:{node:"^20 || ^22",homebridge:"^1.8.0 || ^2.0.0-beta.0"},scripts:{build:"npm run build:server && npm run build:ui","build:server":"rimraf dist && tsc -p tsconfig.build.json","build:ui":"npm run build --prefix ui",check:"npm run check:server && npm run check:ui","check:server":"npm install && npm outdated","check:ui":"npm install --prefix ui && npm outdated --prefix ui","lang-sync":"ts-node scripts/lang-sync.ts",lint:"eslint . --max-warnings=0","lint:fix":"npm run lint -- --fix",prepublishOnly:"npm i --package-lock-only && npm run lint && npm run build",start:"ts-node -r tsconfig-paths/register src/main.ts",test:"vitest run","test-coverage":"npm run test -- --coverage","upgrade-install":"./scripts/upgrade-install.sh",watch:'concurrently "npm run watch:ui" "npm run watch:server"',"watch:server":"nodemon","watch:ui":"npm run start --prefix ui"},dependencies:{"@fastify/helmet":"13.0.1","@fastify/multipart":"9.0.3","@fastify/static":"8.0.4","@homebridge/hap-client":"2.0.5","@homebridge/node-pty-prebuilt-multiarch":"0.12.0-beta.5","@nestjs/axios":"4.0.0","@nestjs/common":"11.0.7","@nestjs/core":"11.0.7","@nestjs/jwt":"11.0.0","@nestjs/passport":"11.0.5","@nestjs/platform-fastify":"11.0.7","@nestjs/platform-socket.io":"11.0.7","@nestjs/swagger":"11.0.3","@nestjs/websockets":"11.0.7",axios:"1.7.9","bash-color":"0.0.4","class-transformer":"0.5.1","class-validator":"0.14.1",commander:"13.1.0",dayjs:"1.11.13",fastify:"5.2.1","fs-extra":"11.3.0",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"5.4.1",otplib:"12.0.1","p-limit":"3.1.0",passport:"0.7.0","passport-jwt":"4.0.1",rxjs:"7.8.1",semver:"7.7.0",systeminformation:"5.25.11",tail:"2.2.6",tar:"7.4.3","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^4.1.1","@nestjs/testing":"^11.0.5","@prettier/plugin-xml":"^3.4.1","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.15","@types/node":"^22.13.0","@types/node-schedule":"^2.1.7","@types/passport-jwt":"^4.0.1","@types/semver":"^7.5.8","@types/tail":"^2.2.3","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.10","@vitest/coverage-v8":"^3.0.4",concurrently:"^9.1.2","eslint-plugin-format":"^1.0.1","form-data":"^4.0.1",nodemon:"^3.1.9",rimraf:"^6.0.1","ts-loader":"^9.5.2","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.7.3","unplugin-swc":"^1.5.1",vitest:"^3.0.4"},maintainers:[{email:"bwp91@icloud.com",name:"bwp91"},{email:"dev@oz.nu",name:"oznu"},{email:"northern.man1@gmail.com",name:"northernman"},{email:"mail@anderl-bauer.de",name:"supereg"},{email:"khaos.tian@gmail.com",name:"khaost"},{email:"erik.baauw@xs4all.nl",name:"ebaauw"},{email:"donavan.becker@icloud.com",name:"donavanbecker"},{email:"dustin.greif@gmail.com",name:"dustin.greif"},{email:"nfarina@gmail.com",name:"nfarina"}],scarfSettings:{enabled:!1}}});var b=function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i}(b||{}),Gt="*";function gt(i,s){return{type:b.Trigger,name:i,definitions:s,options:{}}}function Y(i,s=null){return{type:b.Animate,styles:s,timings:i}}function Ut(i,s=null){return{type:b.Sequence,steps:i,options:s}}function N(i){return{type:b.Style,styles:i,offset:null}}function M(i,s,t){return{type:b.State,name:i,styles:s,options:t}}function J(i,s,t=null){return{type:b.Transition,expr:i,animation:s,options:t}}var mt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(s=0,t=0){this.totalTime=s+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}onStart(s){this._originalOnStartFns.push(s),this._onStartFns.push(s)}onDone(s){this._originalOnDoneFns.push(s),this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(s=>s()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(s){this._position=this.totalTime?s*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},ft=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(s){this.players=s;let t=0,e=0,n=0,o=this.players.length;o==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++t==o&&this._onFinish()}),a.onDestroy(()=>{++e==o&&this._onDestroy()}),a.onStart(()=>{++n==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,d)=>Math.max(a,d.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}init(){this.players.forEach(s=>s.init())}onStart(s){this._onStartFns.push(s)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(s=>s()),this._onStartFns=[])}onDone(s){this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(s=>s.play())}pause(){this.players.forEach(s=>s.pause())}restart(){this.players.forEach(s=>s.restart())}finish(){this._onFinish(),this.players.forEach(s=>s.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(s=>s.destroy()),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this.players.forEach(s=>s.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(s){let t=s*this.totalTime;this.players.forEach(e=>{let n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}getPosition(){let s=this.players.reduce((t,e)=>t===null||e.totalTime>t.totalTime?e:t,null);return s!=null?s.getPosition():0}beforeDestroy(){this.players.forEach(s=>{s.beforeDestroy&&s.beforeDestroy()})}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},Kt="!";var _t=["toast-component",""];function Ot(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function St(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Et(i,s){if(i&1&&(h(0,"div"),f(1),S(2,St,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function Ft(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function jt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function Rt(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}function At(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function Ht(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function kt(i,s){if(i&1&&(h(0,"div"),f(1),S(2,Ht,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function Nt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Mt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function Pt(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}var W=class{_attachedHost;component;viewContainerRef;injector;constructor(s,t){this.component=s,this.injector=t}attach(s,t){return this._attachedHost=s,s.attach(this,t)}detach(){let s=this._attachedHost;if(s)return this._attachedHost=void 0,s.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(s){this._attachedHost=s}},X=class{_attachedPortal;_disposeFn;attach(s,t){return this._attachedPortal=s,this.attachComponentPortal(s,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(s){this._disposeFn=s}},tt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new g;_activate=new g;_manualClose=new g;_resetTimeout=new g;_countDuplicate=new g;constructor(s){this._overlayRef=s}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(s,t){s&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},D=class{toastId;config;message;title;toastType;toastRef;_onTap=new g;_onAction=new g;constructor(s,t,e,n,o,a){this.toastId=s,this.config=t,this.message=e,this.title=n,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(s){this._onAction.next(s)}onAction(){return this._onAction.asObservable()}},vt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},yt=new rt("ToastConfig"),et=class extends X{_hostDomElement;_componentFactoryResolver;_appRef;constructor(s,t,e){super(),this._hostDomElement=s,this._componentFactoryResolver=t,this._appRef=e}attachComponentPortal(s,t){let e=this._componentFactoryResolver.resolveComponentFactory(s.component),n;return n=e.create(s.injector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(n),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(n)),n}_getComponentRootNode(s){return s.hostView.rootNodes[0]}},Bt=(()=>{class i{_document=_(K);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),it=class{_portalHost;constructor(s){this._portalHost=s}attach(s,t=!0){return this._portalHost.attach(s,t)}detach(){return this._portalHost.detach()}},$t=(()=>{class i{_overlayContainer=_(Bt);_componentFactoryResolver=_(ct);_appRef=_(k);_document=_(K);_paneElements=new Map;create(t,e){return this._createOverlayRef(this.getPaneElement(t,e))}getPaneElement(t="",e){return this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]}_createPaneElement(t,e){let n=this._document.createElement("div");return n.id="toast-container",n.classList.add(t),n.classList.add("toast-container"),e?e.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(t){return new et(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new it(this._createPortalHost(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),bt=(()=>{class i{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,e,n,o,a){this.overlay=e,this._injector=n,this.sanitizer=o,this.ngZone=a,this.toastrConfig=u(u({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},t.default.iconClasses),t.config.iconClasses))}show(t,e,n={},o=""){return this._preBuildNotification(o,t,e,this.applyConfig(n))}success(t,e,n={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}error(t,e,n={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}info(t,e,n={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}warning(t,e,n={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}clear(t){for(let e of this.toasts)if(t!==void 0){if(e.toastId===t){e.toastRef.manualClose();return}}else e.toastRef.manualClose()}remove(t){let e=this._findToast(t);if(!e||(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let n=this.toasts[this.currentlyActive].toastRef;n.isInactive()||(this.currentlyActive=this.currentlyActive+1,n.activate())}return!0}findDuplicate(t="",e="",n,o){let{includeTitleDuplicates:a}=this.toastrConfig;for(let d of this.toasts){let A=a&&d.title===t;if((!a||A)&&d.message===e)return d.toastRef.onDuplicate(n,o),d}return null}applyConfig(t={}){return u(u({},this.toastrConfig),t)}_findToast(t){for(let e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null}_preBuildNotification(t,e,n,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,e,n,o)):this._buildNotification(t,e,n,o)}_buildNotification(t,e,n,o){if(!o.toastComponent)throw new Error("toastComponent required");let a=this.findDuplicate(n,e,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||e)&&this.toastrConfig.preventDuplicates&&a!==null)return a;this.previousToastMessage=e;let d=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(d=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let A=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let st=e;e&&o.enableHtml&&(st=this.sanitizer.sanitize(lt.HTML,e));let x=new tt(A),P=new D(this.index,o,st,n,t,x),Ct=[{provide:D,useValue:P}],wt=H.create({providers:Ct,parent:this._injector}),Dt=new W(o.toastComponent,wt),nt=A.attach(Dt,o.newestOnTop);x.componentInstance=nt.instance;let B={toastId:this.index,title:n||"",message:e||"",toastRef:x,onShown:x.afterActivate(),onHidden:x.afterClosed(),onTap:P.onTap(),onAction:P.onAction(),portal:nt};return d||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{B.toastRef.activate()})),this.toasts.push(B),B}static \u0275fac=function(e){return new(e||i)(w(yt),w($t),w(H),w(pt),w(z))};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Vt=(()=>{class i{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.ngZone=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=O({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>T(u({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>T(u({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>T(u({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),e)):this.timeout=setTimeout(()=>t(),e)}outsideInterval(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),e)):this.intervalId=setInterval(()=>t(),e)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(e){return new(e||i)(v(bt),v(D),v(z))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(ht("@flyInOut",n._state),p(n.toastClasses),F("display",n.displayStyle))},attrs:_t,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,Ot,3,0,"button",0)(1,Et,3,5,"div",1)(2,Ft,1,3,"div",2)(3,jt,2,4,"div",3)(4,Rt,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,data:{animation:[gt("flyInOut",[M("inactive",N({opacity:0})),M("active",N({opacity:1})),M("removed",N({opacity:0})),J("inactive => active",Y("{{ easeTime }}ms {{ easing }}")),J("active => removed",Y("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return i})(),zt=T(u({},vt),{toastComponent:Vt}),Lt=(i={})=>at([{provide:yt,useValue:{default:zt,config:i}}]),he=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[Lt(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=ut({type:i});static \u0275inj=ot({})}return i})();var Zt=(()=>{class i{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=O("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.appRef=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(e){return new(e||i)(v(bt),v(D),v(k))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(p(n.toastClasses),F("display",n.displayStyle))},attrs:_t,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,At,3,0,"button",0)(1,kt,3,5,"div",1)(2,Nt,1,3,"div",2)(3,Mt,2,4,"div",3)(4,Pt,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,changeDetection:0})}return i})(),de=T(u({},vt),{toastComponent:Zt});var I={serverTarget:Tt().version,production:!0,socket:"",api:{base:"/api",socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[`${window.location.protocol}//${document.location.host}/api/auth/login`]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Te=(()=>{class i{$http=_(dt);constructor(){}get(t,e){return this.$http.get(`${I.api.base}${t}`,e)}post(t,e,n){return this.$http.post(`${I.api.base}${t}`,e,n)}put(t,e,n){return this.$http.put(`${I.api.base}${t}`,e,n)}patch(t,e,n){return this.$http.patch(`${I.api.base}${t}`,e,n)}delete(t,e){return this.$http.delete(`${I.api.base}${t}`,e)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{b as a,Gt as b,Ut as c,N as d,mt as e,ft as f,Kt as g,bt as h,he as i,I as j,Te as k};
@@ -1 +1 @@
1
- import{ga as o,n as e}from"./chunk-VRNVEPFN.js";var n=new e,f=(()=>{class t{readyEvent;constructor(){this.readyEvent=n}static \u0275fac=function(r){return new(r||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function d(){n.next(void 0)}export{f as a,d as b};
1
+ import{ga as o,n as e}from"./chunk-C6IAD6Z2.js";var n=new e,f=(()=>{class t{readyEvent;constructor(){this.readyEvent=n}static \u0275fac=function(r){return new(r||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function d(){n.next(void 0)}export{f as a,d as b};
@@ -0,0 +1 @@
1
+ import"./chunk-SWNVXI2O.js";import"./chunk-B2UQOT6L.js";import"./chunk-4KHML3ZA.js";import"./chunk-IANOJDSU.js";import"./chunk-TC3455K3.js";import{g as i}from"./chunk-IA2ABLRP.js";import"./chunk-DLIMGGAD.js";import"./chunk-XIFLDXKP.js";import"./chunk-EETCTFAQ.js";import"./chunk-GJWJQ3Z5.js";import{c as m}from"./chunk-WTDCYIBS.js";import{ha as t,id as n,tb as r}from"./chunk-C6IAD6Z2.js";var u=[{path:"",loadComponent:()=>import("./chunk-QHZWTWUL.js").then(o=>o.TerminalComponent)}],a=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(u),i]})}return o})();var T=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,a,m.forChild()]})}return o})();export{T as TerminalModule};
@@ -0,0 +1 @@
1
+ import{A as N,B as x,C as D,D as W,E as I,F as j,G as O,H as q,I as B,J as G,K as R,L as U,M as V,N as z,O as E,P as J,Q as K,R as P,S as Q,e as f,f as a,g as s,h as C,i as d,j as c,k as u,l,m as g,n as M,o as y,p as h,q as v,r as S,s as b,t as w,u as A,v as F,w as k,x as T,y as H,z as L}from"./chunk-T3C3XS2R.js";import{b as X}from"./chunk-HBTN4COO.js";import{q as i}from"./chunk-HKTXPODL.js";import{y as n,z as t}from"./chunk-MNVY4PED.js";import{c as p}from"./chunk-WTDCYIBS.js";import{ha as m,id as e,tb as r}from"./chunk-C6IAD6Z2.js";var fm=(()=>{class o{static \u0275fac=function(Y){return new(Y||o)};static \u0275mod=r({type:o});static \u0275inj=m({providers:[a],imports:[e,n,t,p.forChild(),s,i,X,Q,f,G,B,U,D,h,v,V,T,k,H,L,S,N,x,c,P,K,J,E,y,M,R,g,q,O,I,W,F,j,z,A,d,C,b,w,l,u]})}return o})();export{fm as a};
@@ -0,0 +1,2 @@
1
+ import{$ as ke,$a as Je,Ba as ce,Bb as Ye,Cb as X,Da as A,Db as G,Ea as le,Eb as fe,H as _e,Hc as Ke,Ic as qe,Ka as je,L as Le,La as de,Ma as Fe,Na as P,Oc as J,Pa as ue,Pc as He,Qa as Be,Qc as Qe,Rc as R,S as oe,Ta as C,Ua as N,Va as _,Wa as ze,Xa as Ve,Ya as $e,Za as Xe,_a as Ge,_c as W,a as $,ab as We,b as Se,bb as S,da as g,ea as D,ga as m,ha as ie,id as et,ja as v,jb as x,jd as tt,k as Ie,la as u,ld as pe,ma as w,mb as Ze,na as ae,nd as Z,pa as Ce,q as Ne,qa as xe,r as se,ra as Ue,tb as he,x as k}from"./chunk-C6IAD6Z2.js";var j=class{},K=class{},I=class r{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(t){t?typeof t=="string"?this.lazyInit=()=>{this.headers=new Map,t.split(`
2
+ `).forEach(e=>{let n=e.indexOf(":");if(n>0){let s=e.slice(0,n),o=e.slice(n+1).trim();this.addHeaderEntry(s,o)}})}:typeof Headers<"u"&&t instanceof Headers?(this.headers=new Map,t.forEach((e,n)=>{this.addHeaderEntry(n,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(t).forEach(([e,n])=>{this.setHeaderEntries(e,n)})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();let e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof r?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){let e=new r;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof r?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){let e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(t.name,e);let s=(t.op==="a"?this.headers.get(e):void 0)||[];s.push(...n),this.headers.set(e,s);break;case"d":let o=t.value;if(!o)this.headers.delete(e),this.normalizedNames.delete(e);else{let i=this.headers.get(e);if(!i)return;i=i.filter(c=>o.indexOf(c)===-1),i.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,i)}break}}addHeaderEntry(t,e){let n=t.toLowerCase();this.maybeSetNormalizedName(t,n),this.headers.has(n)?this.headers.get(n).push(e):this.headers.set(n,[e])}setHeaderEntries(t,e){let n=(Array.isArray(e)?e:[e]).map(o=>o.toString()),s=t.toLowerCase();this.headers.set(s,n),this.maybeSetNormalizedName(t,s)}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}};var ye=class{encodeKey(t){return nt(t)}encodeValue(t){return nt(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}};function Lt(r,t){let e=new Map;return r.length>0&&r.replace(/^\?/,"").split("&").forEach(s=>{let o=s.indexOf("="),[i,c]=o==-1?[t.decodeKey(s),""]:[t.decodeKey(s.slice(0,o)),t.decodeValue(s.slice(o+1))],a=e.get(i)||[];a.push(c),e.set(i,a)}),e}var kt=/%(\d[a-f0-9])/gi,Ct={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function nt(r){return encodeURIComponent(r).replace(kt,(t,e)=>{var n;return(n=Ct[e])!=null?n:t})}function Y(r){return`${r}`}var O=class r{map;encoder;updates=null;cloneFrom=null;constructor(t={}){if(this.encoder=t.encoder||new ye,t.fromString){if(t.fromObject)throw new g(2805,!1);this.map=Lt(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{let n=t.fromObject[e],s=Array.isArray(n)?n.map(Y):[Y(n)];this.map.set(e,s)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();let e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){let e=[];return Object.keys(t).forEach(n=>{let s=t[n];Array.isArray(s)?s.forEach(o=>{e.push({param:n,value:o,op:"a"})}):e.push({param:n,value:s,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{let e=this.encoder.encodeKey(t);return this.map.get(t).map(n=>e+"="+this.encoder.encodeValue(n)).join("&")}).filter(t=>t!=="").join("&")}clone(t){let e=new r({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":let e=(t.op==="a"?this.map.get(t.param):void 0)||[];e.push(Y(t.value)),this.map.set(t.param,e);break;case"d":if(t.value!==void 0){let n=this.map.get(t.param)||[],s=n.indexOf(Y(t.value));s!==-1&&n.splice(s,1),n.length>0?this.map.set(t.param,n):this.map.delete(t.param)}else{this.map.delete(t.param);break}}}),this.cloneFrom=this.updates=null)}};var ge=class{map=new Map;set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}};function xt(r){switch(r){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function rt(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer}function st(r){return typeof Blob<"u"&&r instanceof Blob}function ot(r){return typeof FormData<"u"&&r instanceof FormData}function Ut(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}var it="Content-Type",at="Accept",ut="X-Request-URL",ht="text/plain",ft="application/json",jt=`${ft}, ${ht}, */*`,U=class r{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(t,e,n,s){var i,c;this.url=e,this.method=t.toUpperCase();let o;if(xt(this.method)||s?(this.body=n!==void 0?n:null,o=s):o=n,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params),this.transferCache=o.transferCache),(i=this.headers)!=null||(this.headers=new I),(c=this.context)!=null||(this.context=new ge),!this.params)this.params=new O,this.urlWithParams=e;else{let a=this.params.toString();if(a.length===0)this.urlWithParams=e;else{let d=e.indexOf("?"),h=d===-1?"?":d<e.length-1?"&":"";this.urlWithParams=e+h+a}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||rt(this.body)||st(this.body)||ot(this.body)||Ut(this.body)?this.body:this.body instanceof O?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||ot(this.body)?null:st(this.body)?this.body.type||null:rt(this.body)?null:typeof this.body=="string"?ht:this.body instanceof O?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?ft:null}clone(t={}){var E,b,M,l;let e=t.method||this.method,n=t.url||this.url,s=t.responseType||this.responseType,o=(E=t.transferCache)!=null?E:this.transferCache,i=t.body!==void 0?t.body:this.body,c=(b=t.withCredentials)!=null?b:this.withCredentials,a=(M=t.reportProgress)!=null?M:this.reportProgress,d=t.headers||this.headers,h=t.params||this.params,p=(l=t.context)!=null?l:this.context;return t.setHeaders!==void 0&&(d=Object.keys(t.setHeaders).reduce((f,T)=>f.set(T,t.setHeaders[T]),d)),t.setParams&&(h=Object.keys(t.setParams).reduce((f,T)=>f.set(T,t.setParams[T]),h)),new r(e,n,i,{params:h,headers:d,context:p,reportProgress:a,responseType:s,withCredentials:c,transferCache:o})}},L=function(r){return r[r.Sent=0]="Sent",r[r.UploadProgress=1]="UploadProgress",r[r.ResponseHeader=2]="ResponseHeader",r[r.DownloadProgress=3]="DownloadProgress",r[r.Response=4]="Response",r[r.User=5]="User",r}(L||{}),F=class{headers;status;statusText;url;ok;type;constructor(t,e=200,n="OK"){this.headers=t.headers||new I,this.status=t.status!==void 0?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}},ve=class r extends F{constructor(t={}){super(t)}type=L.ResponseHeader;clone(t={}){return new r({headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},q=class r extends F{body;constructor(t={}){super(t),this.body=t.body!==void 0?t.body:null}type=L.Response;clone(t={}){return new r({body:t.body!==void 0?t.body:this.body,headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},H=class extends F{name="HttpErrorResponse";message;error;ok=!1;constructor(t){super(t,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${t.url||"(unknown url)"}`:this.message=`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}},Ft=200,Bt=204;function me(r,t){return{body:t,headers:r.headers,context:r.context,observe:r.observe,params:r.params,reportProgress:r.reportProgress,responseType:r.responseType,withCredentials:r.withCredentials,transferCache:r.transferCache}}var zt=(()=>{class r{handler;constructor(e){this.handler=e}request(e,n,s={}){let o;if(e instanceof U)o=e;else{let a;s.headers instanceof I?a=s.headers:a=new I(s.headers);let d;s.params&&(s.params instanceof O?d=s.params:d=new O({fromObject:s.params})),o=new U(e,n,s.body!==void 0?s.body:null,{headers:a,context:s.context,params:d,reportProgress:s.reportProgress,responseType:s.responseType||"json",withCredentials:s.withCredentials,transferCache:s.transferCache})}let i=se(o).pipe(Le(a=>this.handler.handle(a)));if(e instanceof U||s.observe==="events")return i;let c=i.pipe(_e(a=>a instanceof q));switch(s.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return c.pipe(k(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new g(2806,!1);return a.body}));case"blob":return c.pipe(k(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new g(2807,!1);return a.body}));case"text":return c.pipe(k(a=>{if(a.body!==null&&typeof a.body!="string")throw new g(2808,!1);return a.body}));case"json":default:return c.pipe(k(a=>a.body))}case"response":return c;default:throw new g(2809,!1)}}delete(e,n={}){return this.request("DELETE",e,n)}get(e,n={}){return this.request("GET",e,n)}head(e,n={}){return this.request("HEAD",e,n)}jsonp(e,n){return this.request("JSONP",e,{params:new O().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,n={}){return this.request("OPTIONS",e,n)}patch(e,n,s={}){return this.request("PATCH",e,me(s,n))}post(e,n,s={}){return this.request("POST",e,me(s,n))}put(e,n,s={}){return this.request("PUT",e,me(s,n))}static \u0275fac=function(n){return new(n||r)(u(j))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();var Vt=new v("");function pt(r,t){return t(r)}function $t(r,t){return(e,n)=>t.intercept(e,{handle:s=>r(s,n)})}function Xt(r,t,e){return(n,s)=>Ue(e,()=>t(n,o=>r(o,s)))}var Gt=new v(""),Ee=new v(""),Jt=new v(""),mt=new v("",{providedIn:"root",factory:()=>!0});function Wt(){let r=null;return(t,e)=>{var o;r===null&&(r=((o=w(Gt,{optional:!0}))!=null?o:[]).reduceRight($t,pt));let n=w(ce);if(w(mt)){let i=n.add();return r(t,e).pipe(oe(()=>n.remove(i)))}else return r(t,e)}}var ct=(()=>{class r extends j{backend;injector;chain=null;pendingTasks=w(ce);contributeToStability=w(mt);constructor(e,n){super(),this.backend=e,this.injector=n}handle(e){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(Ee),...this.injector.get(Jt,[])]));this.chain=n.reduceRight((s,o)=>Xt(s,o,this.injector),pt)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(e,s=>this.backend.handle(s)).pipe(oe(()=>this.pendingTasks.remove(n)))}else return this.chain(e,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||r)(u(K),u(xe))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();var Zt=/^\)\]\}',?\n/,Yt=RegExp(`^${ut}:`,"m");function Kt(r){return"responseURL"in r&&r.responseURL?r.responseURL:Yt.test(r.getAllResponseHeaders())?r.getResponseHeader(ut):null}var lt=(()=>{class r{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if(e.method==="JSONP")throw new g(-2800,!1);let n=this.xhrFactory;return(n.\u0275loadImpl?Ne(n.\u0275loadImpl()):se(null)).pipe(ke(()=>new Ie(o=>{let i=n.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach((l,f)=>i.setRequestHeader(l,f.join(","))),e.headers.has(at)||i.setRequestHeader(at,jt),!e.headers.has(it)){let l=e.detectContentTypeHeader();l!==null&&i.setRequestHeader(it,l)}if(e.responseType){let l=e.responseType.toLowerCase();i.responseType=l!=="json"?l:"text"}let c=e.serializeBody(),a=null,d=()=>{if(a!==null)return a;let l=i.statusText||"OK",f=new I(i.getAllResponseHeaders()),T=Kt(i)||e.url;return a=new ve({headers:f,status:i.status,statusText:l,url:T}),a},h=()=>{let{headers:l,status:f,statusText:T,url:Pe}=d(),y=null;f!==Bt&&(y=typeof i.response>"u"?i.responseText:i.response),f===0&&(f=y?Ft:0);let re=f>=200&&f<300;if(e.responseType==="json"&&typeof y=="string"){let Pt=y;y=y.replace(Zt,"");try{y=y!==""?JSON.parse(y):null}catch(St){y=Pt,re&&(re=!1,y={error:St,text:y})}}re?(o.next(new q({body:y,headers:l,status:f,statusText:T,url:Pe||void 0})),o.complete()):o.error(new H({error:y,headers:l,status:f,statusText:T,url:Pe||void 0}))},p=l=>{let{url:f}=d(),T=new H({error:l,status:i.status||0,statusText:i.statusText||"Unknown Error",url:f||void 0});o.error(T)},E=!1,b=l=>{E||(o.next(d()),E=!0);let f={type:L.DownloadProgress,loaded:l.loaded};l.lengthComputable&&(f.total=l.total),e.responseType==="text"&&i.responseText&&(f.partialText=i.responseText),o.next(f)},M=l=>{let f={type:L.UploadProgress,loaded:l.loaded};l.lengthComputable&&(f.total=l.total),o.next(f)};return i.addEventListener("load",h),i.addEventListener("error",p),i.addEventListener("timeout",p),i.addEventListener("abort",p),e.reportProgress&&(i.addEventListener("progress",b),c!==null&&i.upload&&i.upload.addEventListener("progress",M)),i.send(c),o.next({type:L.Sent}),()=>{i.removeEventListener("error",p),i.removeEventListener("abort",p),i.removeEventListener("load",h),i.removeEventListener("timeout",p),e.reportProgress&&(i.removeEventListener("progress",b),c!==null&&i.upload&&i.upload.removeEventListener("progress",M)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||r)(u(Z))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),yt=new v(""),qt="XSRF-TOKEN",Ht=new v("",{providedIn:"root",factory:()=>qt}),Qt="X-XSRF-TOKEN",en=new v("",{providedIn:"root",factory:()=>Qt}),Q=class{},tn=(()=>{class r{doc;platform;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,n,s){this.doc=e,this.platform=n,this.cookieName=s}getToken(){if(this.platform==="server")return null;let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=W(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(n){return new(n||r)(u(R),u(P),u(Ht))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();function nn(r,t){let e=r.url.toLowerCase();if(!w(yt)||r.method==="GET"||r.method==="HEAD"||e.startsWith("http://")||e.startsWith("https://"))return t(r);let n=w(Q).getToken(),s=w(en);return n!=null&&!r.headers.has(s)&&(r=r.clone({headers:r.headers.set(s,n)})),t(r)}var gt=function(r){return r[r.Interceptors=0]="Interceptors",r[r.LegacyInterceptors=1]="LegacyInterceptors",r[r.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",r[r.NoXsrfProtection=3]="NoXsrfProtection",r[r.JsonpSupport=4]="JsonpSupport",r[r.RequestsMadeViaParent=5]="RequestsMadeViaParent",r[r.Fetch=6]="Fetch",r}(gt||{});function rn(r,t){return{\u0275kind:r,\u0275providers:t}}function Jn(...r){let t=[zt,lt,ct,{provide:j,useExisting:ct},{provide:K,useFactory:()=>{var e;return(e=w(Vt,{optional:!0}))!=null?e:w(lt)}},{provide:Ee,useValue:nn,multi:!0},{provide:yt,useValue:!0},{provide:Q,useClass:tn}];for(let e of r)t.push(...e.\u0275providers);return ae(t)}var dt=new v("");function Wn(){return rn(gt.LegacyInterceptors,[{provide:dt,useFactory:Wt},{provide:Ee,useExisting:dt,multi:!0}])}var we=class extends Qe{supportsDOMEvents=!0},Re=class r extends we{static makeCurrent(){He(new r)}onAndCancel(t,e,n,s){return t.addEventListener(e,n,s),()=>{t.removeEventListener(e,n,s)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.remove()}createElement(t,e){return e=e||this.getDefaultDocument(),e.createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return e==="window"?window:e==="document"?t:e==="body"?t.body:null}getBaseHref(t){let e=on();return e==null?null:an(e)}resetBaseElement(){B=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return W(document.cookie,t)}},B=null;function on(){return B=B||document.querySelector("base"),B?B.getAttribute("href"):null}function an(r){return new URL(r,document.baseURI).pathname}var Me=class{addToWindow(t){D.getAngularTestability=(n,s=!0)=>{let o=t.findTestabilityInTree(n,s);if(o==null)throw new g(5103,!1);return o},D.getAllAngularTestabilities=()=>t.getAllTestabilities(),D.getAllAngularRootElements=()=>t.getAllRootElements();let e=n=>{let s=D.getAllAngularTestabilities(),o=s.length,i=function(){o--,o==0&&n()};s.forEach(c=>{c.whenStable(i)})};D.frameworkStabilizers||(D.frameworkStabilizers=[]),D.frameworkStabilizers.push(e)}findTestabilityInTree(t,e,n){if(e==null)return null;let s=t.getTestability(e);return s!=null?s:n?J().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}},cn=(()=>{class r{build(){return new XMLHttpRequest}static \u0275fac=function(n){return new(n||r)};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),be=new v(""),Mt=(()=>{class r{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,n){this._zone=n,e.forEach(s=>{s.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,n,s,o){return this._findPluginFor(n).addEventListener(e,n,s,o)}getZone(){return this._zone}_findPluginFor(e){let n=this._eventNameToPlugin.get(e);if(n)return n;if(n=this._plugins.find(o=>o.supports(e)),!n)throw new g(5101,!1);return this._eventNameToPlugin.set(e,n),n}static \u0275fac=function(n){return new(n||r)(u(be),u(A))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),te=class{_doc;constructor(t){this._doc=t}manager},ee="ng-app-id";function vt(r){for(let t of r)t.remove()}function Et(r,t){let e=t.createElement("style");return e.textContent=r,e}function ln(r,t,e,n){var o;let s=(o=r.head)==null?void 0:o.querySelectorAll(`style[${ee}="${t}"],link[${ee}="${t}"]`);if(s)for(let i of s)i.removeAttribute(ee),i instanceof HTMLLinkElement?n.set(i.href.slice(i.href.lastIndexOf("/")+1),{usage:0,elements:[i]}):i.textContent&&e.set(i.textContent,{usage:0,elements:[i]})}function De(r,t){let e=t.createElement("link");return e.setAttribute("rel","stylesheet"),e.setAttribute("href",r),e}var bt=(()=>{class r{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(e,n,s,o={}){this.doc=e,this.appId=n,this.nonce=s,this.isServer=pe(o),ln(e,n,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,n){for(let s of e)this.addUsage(s,this.inline,Et);n==null||n.forEach(s=>this.addUsage(s,this.external,De))}removeStyles(e,n){for(let s of e)this.removeUsage(s,this.inline);n==null||n.forEach(s=>this.removeUsage(s,this.external))}addUsage(e,n,s){let o=n.get(e);o?o.usage++:n.set(e,{usage:1,elements:[...this.hosts].map(i=>this.addElement(i,s(e,this.doc)))})}removeUsage(e,n){let s=n.get(e);s&&(s.usage--,s.usage<=0&&(vt(s.elements),n.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])vt(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[n,{elements:s}]of this.inline)s.push(this.addElement(e,Et(n,this.doc)));for(let[n,{elements:s}]of this.external)s.push(this.addElement(e,De(n,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,n){return this.nonce&&n.setAttribute("nonce",this.nonce),this.isServer&&n.setAttribute(ee,this.appId),e.appendChild(n)}static \u0275fac=function(n){return new(n||r)(u(R),u(de),u(ue,8),u(P))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),Te={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},Oe=/%COMP%/g;var Dt="%COMP%",dn=`_nghost-${Dt}`,un=`_ngcontent-${Dt}`,hn=!0,fn=new v("",{providedIn:"root",factory:()=>hn});function pn(r){return un.replace(Oe,r)}function mn(r){return dn.replace(Oe,r)}function At(r,t){return t.map(e=>e.replace(Oe,r))}var Tt=(()=>{class r{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(e,n,s,o,i,c,a,d=null,h=null){this.eventManager=e,this.sharedStylesHost=n,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=i,this.platformId=c,this.ngZone=a,this.nonce=d,this.tracingService=h,this.platformIsServer=pe(c),this.defaultRenderer=new z(e,i,a,this.platformIsServer,this.tracingService)}createRenderer(e,n){if(!e||!n)return this.defaultRenderer;this.platformIsServer&&n.encapsulation===C.ShadowDom&&(n=Se($({},n),{encapsulation:C.Emulated}));let s=this.getOrCreateRenderer(e,n);return s instanceof ne?s.applyToHost(e):s instanceof V&&s.applyStyles(),s}getOrCreateRenderer(e,n){let s=this.rendererByCompId,o=s.get(n.id);if(!o){let i=this.doc,c=this.ngZone,a=this.eventManager,d=this.sharedStylesHost,h=this.removeStylesOnCompDestroy,p=this.platformIsServer,E=this.tracingService;switch(n.encapsulation){case C.Emulated:o=new ne(a,d,n,this.appId,h,i,c,p,E);break;case C.ShadowDom:return new Ae(a,d,e,n,i,c,this.nonce,p,E);default:o=new V(a,d,n,h,i,c,p,E);break}s.set(n.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=function(n){return new(n||r)(u(Mt),u(bt),u(de),u(fn),u(R),u(P),u(A),u(ue),u(Be,8))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),z=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(t,e,n,s,o){this.eventManager=t,this.doc=e,this.ngZone=n,this.platformIsServer=s,this.tracingService=o}destroy(){}destroyNode=null;createElement(t,e){return e?this.doc.createElementNS(Te[e]||e,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,e){(wt(t)?t.content:t).appendChild(e)}insertBefore(t,e,n){t&&(wt(t)?t.content:t).insertBefore(e,n)}removeChild(t,e){e.remove()}selectRootElement(t,e){let n=typeof t=="string"?this.doc.querySelector(t):t;if(!n)throw new g(-5104,!1);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,s){if(s){e=s+":"+e;let o=Te[s];o?t.setAttributeNS(o,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){let s=Te[n];s?t.removeAttributeNS(s,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,s){s&(x.DashCase|x.Important)?t.style.setProperty(e,n,s&x.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&x.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t!=null&&(t[e]=n)}setValue(t,e){t.nodeValue=e}listen(t,e,n,s){if(typeof t=="string"&&(t=J().getGlobalEventTarget(this.doc,t),!t))throw new Error(`Unsupported event target ${t} for event ${e}`);let o=this.decoratePreventDefault(n);return this.tracingService!==null&&this.tracingService.wrapEventListener&&(o=this.tracingService.wrapEventListener(t,e,o)),this.eventManager.addEventListener(t,e,o,s)}decoratePreventDefault(t){return e=>{if(e==="__ngUnwrap__")return t;(this.platformIsServer?this.ngZone.runGuarded(()=>t(e)):t(e))===!1&&e.preventDefault()}}};function wt(r){return r.tagName==="TEMPLATE"&&r.content!==void 0}var Ae=class extends z{sharedStylesHost;hostEl;shadowRoot;constructor(t,e,n,s,o,i,c,a,d){var b;super(t,o,i,a,d),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let h=s.styles;h=At(s.id,h);for(let M of h){let l=document.createElement("style");c&&l.setAttribute("nonce",c),l.textContent=M,this.shadowRoot.appendChild(l)}let p=(b=s.getExternalStyles)==null?void 0:b.call(s);if(p)for(let M of p){let l=De(M,o);c&&l.setAttribute("nonce",c),this.shadowRoot.appendChild(l)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,n){return super.insertBefore(this.nodeOrShadowRoot(t),e,n)}removeChild(t,e){return super.removeChild(null,e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},V=class extends z{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(t,e,n,s,o,i,c,a,d){var E;super(t,o,i,c,a),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=s;let h=n.styles;this.styles=d?At(d,h):h,this.styleUrls=(E=n.getExternalStyles)==null?void 0:E.call(n,d)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},ne=class extends V{contentAttr;hostAttr;constructor(t,e,n,s,o,i,c,a,d){let h=s+"-"+n.id;super(t,e,n,o,i,c,a,d,h),this.contentAttr=pn(h),this.hostAttr=mn(h)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,e){let n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}},yn=(()=>{class r extends te{constructor(e){super(e)}supports(e){return!0}addEventListener(e,n,s,o){return e.addEventListener(n,s,o),()=>this.removeEventListener(e,n,s,o)}removeEventListener(e,n,s,o){return e.removeEventListener(n,s,o)}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),Rt=["alt","control","meta","shift"],gn={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},vn={alt:r=>r.altKey,control:r=>r.ctrlKey,meta:r=>r.metaKey,shift:r=>r.shiftKey},En=(()=>{class r extends te{constructor(e){super(e)}supports(e){return r.parseEventName(e)!=null}addEventListener(e,n,s,o){let i=r.parseEventName(n),c=r.eventCallback(i.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>J().onAndCancel(e,i.domEventName,c,o))}static parseEventName(e){let n=e.toLowerCase().split("."),s=n.shift();if(n.length===0||!(s==="keydown"||s==="keyup"))return null;let o=r._normalizeKey(n.pop()),i="",c=n.indexOf("code");if(c>-1&&(n.splice(c,1),i="code."),Rt.forEach(d=>{let h=n.indexOf(d);h>-1&&(n.splice(h,1),i+=d+".")}),i+=o,n.length!=0||o.length===0)return null;let a={};return a.domEventName=s,a.fullKey=i,a}static matchEventFullKeyCode(e,n){let s=gn[e.key]||e.key,o="";return n.indexOf("code.")>-1&&(s=e.code,o="code."),s==null||!s?!1:(s=s.toLowerCase(),s===" "?s="space":s==="."&&(s="dot"),Rt.forEach(i=>{if(i!==s){let c=vn[i];c(e)&&(o+=i+".")}}),o+=s,o===n)}static eventCallback(e,n,s){return o=>{r.matchEventFullKeyCode(o,e)&&s.runGuarded(()=>n(o))}}static _normalizeKey(e){return e==="esc"?"escape":e}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();function pr(r,t){return qe($({rootComponent:r},Tn(t)))}function Tn(r){var t;return{appProviders:[...Ot,...(t=r==null?void 0:r.providers)!=null?t:[]],platformProviders:bn}}function wn(){Re.makeCurrent()}function Rn(){return new le}function Mn(){return je(document),document}var bn=[{provide:P,useValue:tt},{provide:Fe,useValue:wn,multi:!0},{provide:R,useFactory:Mn,deps:[]}];var Dn=[{provide:X,useClass:Me,deps:[]},{provide:Ye,useClass:G,deps:[A,fe,X]},{provide:G,useClass:G,deps:[A,fe,X]}],Ot=[{provide:Ce,useValue:"root"},{provide:le,useFactory:Rn,deps:[]},{provide:be,useClass:yn,multi:!0,deps:[R,A,P]},{provide:be,useClass:En,multi:!0,deps:[R]},Tt,bt,Mt,{provide:Ze,useExisting:Tt},{provide:Z,useClass:cn,deps:[]},[]],mr=(()=>{class r{constructor(){}static \u0275fac=function(n){return new(n||r)};static \u0275mod=he({type:r});static \u0275inj=ie({providers:[...Ot,...Dn],imports:[et,Ke]})}return r})();var yr=(()=>{class r{_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=m({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var An=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275prov=m({token:r,factory:function(n){let s=null;return n?s=new(n||r):s=u(On),s},providedIn:"root"})}return r})(),On=(()=>{class r extends An{_doc;constructor(e){super(),this._doc=e}sanitize(e,n){if(n==null)return null;switch(e){case S.NONE:return n;case S.HTML:return _(n,"HTML")?N(n):We(this._doc,String(n)).toString();case S.STYLE:return _(n,"Style")?N(n):n;case S.SCRIPT:if(_(n,"Script"))return N(n);throw new g(5200,!1);case S.URL:return _(n,"URL")?N(n):Je(String(n));case S.RESOURCE_URL:if(_(n,"ResourceURL"))return N(n);throw new g(5201,!1);default:throw new g(5202,!1)}}bypassSecurityTrustHtml(e){return ze(e)}bypassSecurityTrustStyle(e){return Ve(e)}bypassSecurityTrustScript(e){return $e(e)}bypassSecurityTrustUrl(e){return Xe(e)}bypassSecurityTrustResourceUrl(e){return Ge(e)}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=m({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{K as a,O as b,L as c,q as d,zt as e,Gt as f,Jn as g,Wn as h,Tt as i,pr as j,mr as k,yr as l,An as m};
@@ -1 +1 @@
1
- import{a as V}from"./chunk-M76MJAZW.js";import{a as q}from"./chunk-PYUYYML6.js";import{a as _}from"./chunk-JZMQ5FID.js";import{n as B,o as k}from"./chunk-WBTQONWJ.js";import{h as D,k as F}from"./chunk-7W7EXLYO.js";import{a as z,b as E}from"./chunk-T7WHHJXM.js";import{Ac as i,Bc as r,Jb as b,Kb as h,Ub as s,Vb as l,Wb as p,_b as T,bc as d,fb as y,g as j,gb as m,h as w,jc as C,kc as x,ma as o,mc as I,n as v,nc as S,pb as $,sb as L,ua as u,va as f}from"./chunk-VRNVEPFN.js";var H=j(q(),1);var A=["logoutput"],X=(()=>{class c{$api=o(F);$log=o(V);$modal=o(B);$toastr=o(D);$translate=o(z);termTarget=$("logoutput");resizeEvent=new v;constructor(){}onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget(),{},this.resizeEvent)}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-fw fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,H.saveAs)(e.body,"homebridge.log.txt")},error:e=>w(this,null,function*(){let n;try{n=JSON.parse(yield e.error.text()).message}catch(a){console.error(a)}this.$toastr.error(n||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-fw fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||c)};static \u0275cmp=L({type:c,selectors:[["ng-component"]],viewQuery:function(e,n){e&1&&C(n.termTarget,A,5),e&2&&x()},hostBindings:function(e,n){e&1&&d("resize",function(g){return n.onWindowResize(g)},!1,y)},decls:17,vars:15,consts:[["logoutput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-trash-alt"],[1,"flex-column","d-flex","align-items-stretch","adjust-for-mobile"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"]],template:function(e,n){if(e&1){let a=T();s(0,"div",1)(1,"div",2)(2,"h3",3),I(3),i(4,"translate"),l()(),s(5,"div",4)(6,"button",5),i(7,"translate"),i(8,"translate"),d("click",function(){return u(a),f(n.downloadLogFile())}),p(9,"i",6),l(),s(10,"button",7),i(11,"translate"),i(12,"translate"),d("click",function(){return u(a),f(n.truncateLogFile())}),p(13,"i",8),l()()(),s(14,"div",9),p(15,"div",10,0),l()}e&2&&(m(3),S(r(4,5,"menu.linux.label_logs")),m(3),h("ngbTooltip",r(7,7,"form.button_download")),b("aria-label",r(8,9,"form.button_download")),m(4),h("ngbTooltip",r(11,11,"form.button_delete")),b("aria-label",r(12,13,"form.button_delete")))},dependencies:[k,E],encapsulation:2})}return c})();export{X as a};
1
+ import{a as V}from"./chunk-KHDWLARC.js";import{a as q}from"./chunk-2MK7AEG4.js";import{a as _}from"./chunk-J7OUBNKI.js";import{n as B,o as k}from"./chunk-HKTXPODL.js";import{h as D,k as F}from"./chunk-EETCTFAQ.js";import{a as z,b as E}from"./chunk-WTDCYIBS.js";import{Ac as i,Bc as r,Jb as b,Kb as h,Ub as s,Vb as l,Wb as p,_b as T,bc as d,fb as y,g as j,gb as m,h as w,jc as C,kc as x,ma as o,mc as I,n as v,nc as S,pb as $,sb as L,ua as u,va as f}from"./chunk-C6IAD6Z2.js";var H=j(q(),1);var A=["logoutput"],X=(()=>{class c{$api=o(F);$log=o(V);$modal=o(B);$toastr=o(D);$translate=o(z);termTarget=$("logoutput");resizeEvent=new v;constructor(){}onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget(),{},this.resizeEvent)}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-fw fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,H.saveAs)(e.body,"homebridge.log.txt")},error:e=>w(this,null,function*(){let n;try{n=JSON.parse(yield e.error.text()).message}catch(a){console.error(a)}this.$toastr.error(n||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-fw fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||c)};static \u0275cmp=L({type:c,selectors:[["ng-component"]],viewQuery:function(e,n){e&1&&C(n.termTarget,A,5),e&2&&x()},hostBindings:function(e,n){e&1&&d("resize",function(g){return n.onWindowResize(g)},!1,y)},decls:17,vars:15,consts:[["logoutput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-trash-alt"],[1,"flex-column","d-flex","align-items-stretch","adjust-for-mobile"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"]],template:function(e,n){if(e&1){let a=T();s(0,"div",1)(1,"div",2)(2,"h3",3),I(3),i(4,"translate"),l()(),s(5,"div",4)(6,"button",5),i(7,"translate"),i(8,"translate"),d("click",function(){return u(a),f(n.downloadLogFile())}),p(9,"i",6),l(),s(10,"button",7),i(11,"translate"),i(12,"translate"),d("click",function(){return u(a),f(n.truncateLogFile())}),p(13,"i",8),l()()(),s(14,"div",9),p(15,"div",10,0),l()}e&2&&(m(3),S(r(4,5,"menu.linux.label_logs")),m(3),h("ngbTooltip",r(7,7,"form.button_download")),b("aria-label",r(8,9,"form.button_download")),m(4),h("ngbTooltip",r(11,11,"form.button_delete")),b("aria-label",r(12,13,"form.button_delete")))},dependencies:[k,E],encapsulation:2})}return c})();export{X as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-4G7AL7O5.js";import"./chunk-EGT26ZY5.js";import"./chunk-QOMBBDI6.js";import"./chunk-H2FEGEWG.js";import"./chunk-3NFJOKS7.js";import"./chunk-HKTXPODL.js";import"./chunk-MNVY4PED.js";import"./chunk-IA2ABLRP.js";import"./chunk-XIFLDXKP.js";import"./chunk-EETCTFAQ.js";import"./chunk-GJWJQ3Z5.js";import"./chunk-WTDCYIBS.js";import"./chunk-C6IAD6Z2.js";export{a as ConfigEditorComponent};
@@ -1 +1 @@
1
- import{o as k}from"./chunk-WBTQONWJ.js";import{d as P}from"./chunk-O22A7NB6.js";import{b as V}from"./chunk-4XP7GEYJ.js";import{h as T,k as O}from"./chunk-7W7EXLYO.js";import{a as y,b as $}from"./chunk-T7WHHJXM.js";import{Ac as a,Bc as s,Kb as C,Pb as f,Ub as o,Vb as r,Wb as h,_b as v,bc as m,cc as b,gb as i,ma as c,mc as l,nc as S,oc as d,sb as w,ua as u,va as _,zb as g}from"./chunk-VRNVEPFN.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(O);$router=c(P);$settings=c(V);$toastr=c(T);$translate=c(y);constructor(){}restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,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,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[k,$],encapsulation:2})}return t})();export{G as a};
1
+ import{o as k}from"./chunk-HKTXPODL.js";import{d as P}from"./chunk-IA2ABLRP.js";import{b as V}from"./chunk-XIFLDXKP.js";import{h as T,k as O}from"./chunk-EETCTFAQ.js";import{a as y,b as $}from"./chunk-WTDCYIBS.js";import{Ac as a,Bc as s,Kb as C,Pb as f,Ub as o,Vb as r,Wb as h,_b as v,bc as m,cc as b,gb as i,ma as c,mc as l,nc as S,oc as d,sb as w,ua as u,va as _,zb as g}from"./chunk-C6IAD6Z2.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(O);$router=c(P);$settings=c(V);$toastr=c(T);$translate=c(y);constructor(){}restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,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,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[k,$],encapsulation:2})}return t})();export{G as a};
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk-I7EEM2EE.js";import{a as s}from"./chunk-HVOEV7W6.js";import"./chunk-JFXGVUSN.js";import"./chunk-URY6BMDW.js";import"./chunk-4FO7LQCL.js";import"./chunk-QOMBBDI6.js";import"./chunk-H2FEGEWG.js";import"./chunk-HBTN4COO.js";import"./chunk-3NFJOKS7.js";import"./chunk-KHDWLARC.js";import"./chunk-4KHML3ZA.js";import"./chunk-2GU2VOTQ.js";import"./chunk-2MK7AEG4.js";import"./chunk-IANOJDSU.js";import"./chunk-QVCLXIPG.js";import"./chunk-2R3TSF5L.js";import"./chunk-J7OUBNKI.js";import{q as l}from"./chunk-HKTXPODL.js";import{y as m,z as u}from"./chunk-MNVY4PED.js";import"./chunk-TC3455K3.js";import{g as e}from"./chunk-IA2ABLRP.js";import"./chunk-DLIMGGAD.js";import"./chunk-XIFLDXKP.js";import"./chunk-EETCTFAQ.js";import"./chunk-GJWJQ3Z5.js";import{c as p}from"./chunk-WTDCYIBS.js";import{ha as t,id as n,tb as r}from"./chunk-C6IAD6Z2.js";var g=[{path:"",loadComponent:()=>import("./chunk-B7WCXCMH.js").then(o=>o.PluginsComponent)}],d=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[e.forChild(g),e]})}return o})();var v=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,m,u,p.forChild(),l,f,d,s]})}return o})();export{v as PluginsModule};
@@ -1 +1 @@
1
- import{m as X}from"./chunk-WBTQONWJ.js";import{e as q,l as G,r as H,s as J,t as K,y as Q}from"./chunk-SSMNJVEP.js";import{d as te}from"./chunk-O22A7NB6.js";import{h as ee,k as ie}from"./chunk-7W7EXLYO.js";import{a as Y,b as Z}from"./chunk-T7WHHJXM.js";import{$c as z,Ac as d,Bc as m,Jb as $,Kb as b,Pb as u,Rb as k,Sb as E,Tb as T,Ub as a,Vb as o,Wb as B,_b as S,a as M,b as V,bc as h,cc as c,gb as s,h as F,ma as w,mc as l,nc as g,oc as I,pc as L,rc as N,sb as U,sc as P,tc as j,ua as f,va as C,w as A,xc as O,yc as W,zb as x}from"./chunk-VRNVEPFN.js";var se=(t,r)=>({"btn-danger":t,"btn-elegant":r}),ae=(t,r,e)=>({"fa-trash":t,"fa-undo":r,"fa-spinner fa-pulse":e});function oe(t,r){t&1&&(a(0,"div",12),B(1,"i",13),o(),a(2,"p",14),l(3),d(4,"translate"),o()),t&2&&(s(3),g(m(4,1,"reset.no_accessories")))}function re(t,r){if(t&1&&(a(0,"option",24),l(1),o()),t&2){let e=r.$implicit;b("value",e._id),s(),L("",e.name," (",e._username,")")}}function le(t,r){if(t&1){let e=S();a(0,"li",20),l(1),d(2,"translate"),o(),a(3,"li",18)(4,"label",21),l(5),d(6,"translate"),o(),a(7,"div",22)(8,"select",23),j("ngModelChange",function(i){f(e);let _=c(2);return P(_.selectedBridge,i)||(_.selectedBridge=i),C(i)}),h("change",function(i){f(e);let _=c(2);return C(_.onBridgeChange(i.target.value))}),E(9,re,2,3,"option",24,k),o()()()}if(t&2){let e=c(2);s(),g(m(2,3,"form.label.changes_kept")),s(4),g(m(6,5,"reset.accessory_ind.bridge")),s(3),N("ngModel",e.selectedBridge),s(),T(e.pairings)}}function ce(t,r){if(t&1&&(a(0,"li",18)(1,"label",25),l(2),d(3,"translate"),o(),a(4,"div",26),l(5),o()()),t&2){let e=c(2);s(2),g(m(3,2,"reset.accessory_ind.bridge")),s(3),I(" ",e.getCurrentlySelectedBridge()," ")}}function de(t,r){if(t&1){let e=S();a(0,"li",19)(1,"span"),l(2),B(3,"br"),a(4,"small")(5,"span",27),l(6),o()()(),a(7,"button",28),d(8,"translate"),h("click",function(){let i=f(e).$implicit,_=c(2);return C(_.toggleList(i.UUID,i.$cacheFile))}),B(9,"i",29),o()()}if(t&2){let e=r.$implicit,n=c(2);s(2),I(" ",e.displayName,""),s(4),g(e.UUID),s(),b("disabled",n.clicked)("ngClass",O(8,se,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile))),$("aria-label",m(8,6,"form.button_delete")),s(2),b("ngClass",W(11,ae,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile)&&!n.clicked,n.isInList(e.UUID,e.$cacheFile)&&n.clicked))}}function me(t,r){if(t&1&&(a(0,"div",12),B(1,"i",15),o(),a(2,"ul",16)(3,"li"),l(4),d(5,"translate"),o(),a(6,"li"),l(7),d(8,"translate"),o(),a(9,"li"),l(10),d(11,"translate"),o()(),a(12,"ul",17),x(13,le,11,7)(14,ce,6,4,"li",18),E(15,de,10,15,"li",19,k),o()),t&2){let e=c();s(4),g(m(5,5,"reset.accessory_ind.list_1")),s(3),g(m(8,7,"reset.accessory_ind.list_2")),s(3),g(m(11,9,"reset.accessory_ind.list_3")),s(3),u(e.pairings.length>1?13:-1),s(),u(e.pairings.length===1?14:-1),s(),T(e.selectedBridgeAccessories)}}function pe(t,r){if(t&1){let e=S();a(0,"button",30),h("click",function(){f(e);let i=c();return C(i.$activeModal.dismiss("Dismiss"))}),l(1),d(2,"translate"),o()}if(t&2){let e=c();b("disabled",e.clicked),s(),I(" ",m(2,2,"form.button_close")," ")}}function _e(t,r){if(t&1){let e=S();a(0,"button",31),h("click",function(){f(e);let i=c();return C(i.$activeModal.dismiss("Dismiss"))}),l(1),d(2,"translate"),o()}t&2&&(s(),I(" ",m(2,1,"form.button_close")," "))}function ue(t,r){if(t&1&&l(0),t&2){let e=c(3);I(" (",e.toDelete.length,") ")}}function ge(t,r){if(t&1&&(l(0),d(1,"translate"),x(2,ue,1,1)),t&2){let e=c(2);I(" ",m(1,2,"form.button_remove")," "),s(2),u(e.toDelete.length>0?2:-1)}}function xe(t,r){t&1&&B(0,"i",33)}function ve(t,r){if(t&1){let e=S();a(0,"button",32),h("click",function(){f(e);let i=c();return C(i.removeAccessories())}),x(1,ge,3,4)(2,xe,1,0,"i",33),o()}if(t&2){let e=c();b("disabled",!e.toDelete.length||e.clicked),s(),u(e.clicked?-1:1),s(),u(e.clicked?2:-1)}}var Te=(()=>{class t{$activeModal=w(X);$api=w(ie);$router=w(te);$toastr=w(ee);$translate=w(Y);pairings=[];selectedBridge="";clicked=!1;selectedBridgeAccessories=[];accessoriesExist=!1;toDelete=[];constructor(){}ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return F(this,null,function*(){var e;try{let[n,i]=yield Promise.all([A(this.$api.get("/server/cached-accessories")),A(this.$api.get("/server/pairings"))]),_=new Map(i.map(p=>[p._id,V(M({},p),{accessories:[]})]));n.sort((p,v)=>p.displayName.localeCompare(v.displayName)).forEach(p=>{var D,R;let v=i.find(ne=>ne._main),y=((R=(D=p.$cacheFile)==null?void 0:D.split("."))==null?void 0:R[1])||v._id;(!this.selectedBridge||this.selectedBridge===y)&&(_.has(y)||_.set(y,{_id:y,_username:y.match(/.{1,2}/g).join(":"),name:this.$translate.instant("reset.accessory_ind.unknown"),accessories:[]}),_.get(y).accessories.push(p))}),this.pairings=Array.from(_.values()).filter(p=>p.accessories.length>0).sort((p,v)=>p._main&&!v._main?-1:!p._main&&v._main?1:p.name.localeCompare(v.name)),this.selectedBridge=this.selectedBridge||((e=this.pairings[0])==null?void 0:e._id),this.selectedBridge&&(this.accessoriesExist=!0,this.selectedBridgeAccessories=this.pairings[0].accessories)}catch(n){console.error(n),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}onBridgeChange(e){var n;this.selectedBridge=e,this.selectedBridgeAccessories=(n=this.pairings.find(i=>i._id===this.selectedBridge))==null?void 0:n.accessories}getCurrentlySelectedBridge(){let e=this.pairings.find(n=>n._id===this.selectedBridge);return`${e.name} - ${e._username}`}toggleList(e,n){this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)?this.toDelete=this.toDelete.filter(i=>i.uuid!==e&&i.cacheFile!==n):this.toDelete.push({cacheFile:n,uuid:e})}isInList(e,n){return this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)}removeAccessories(){return this.clicked=!0,this.$api.delete("/server/cached-accessories",{body:this.toDelete}).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(n){return new(n||t)};static \u0275cmp=U({type:t,selectors:[["ng-component"]],inputs:{selectedBridge:"selectedBridge"},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"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"list-group-item","text-center","grey-text","small"],["for","bridgeSelect",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["id","bridgeSelect",1,"custom-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50","grey-text","font-monospace"],[1,"font-monospace","grey-text"],[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(n,i){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),d(4,"translate"),o(),a(5,"button",3),d(6,"translate"),h("click",function(){return i.$activeModal.dismiss("Dismiss")}),o()(),a(7,"div",4),x(8,oe,5,3)(9,me,17,11),o(),a(10,"div",5)(11,"div",6),x(12,pe,3,4,"button",7),o(),a(13,"div",8),x(14,_e,3,3,"button",9),o(),a(15,"div",10),x(16,ve,3,3,"button",11),o()()()),n&2&&(s(3),g(m(4,8,"reset.accessory_ind.title")),s(2),b("disabled",i.clicked),$("aria-label",m(6,10,"form.button_close")),s(3),u(i.accessoriesExist?-1:8),s(),u(i.accessoriesExist?9:-1),s(3),u(i.accessoriesExist?12:-1),s(2),u(i.accessoriesExist?-1:14),s(2),u(i.accessoriesExist?16:-1))},dependencies:[z,Z,Q,J,K,H,q,G],encapsulation:2})}return t})();export{Te as a};
1
+ import{m as X}from"./chunk-HKTXPODL.js";import{e as q,l as G,r as H,s as J,t as K,y as Q}from"./chunk-MNVY4PED.js";import{d as te}from"./chunk-IA2ABLRP.js";import{h as ee,k as ie}from"./chunk-EETCTFAQ.js";import{a as Y,b as Z}from"./chunk-WTDCYIBS.js";import{$c as z,Ac as d,Bc as m,Jb as $,Kb as b,Pb as u,Rb as k,Sb as E,Tb as T,Ub as a,Vb as o,Wb as B,_b as S,a as M,b as V,bc as h,cc as c,gb as s,h as F,ma as w,mc as l,nc as g,oc as I,pc as L,rc as N,sb as U,sc as P,tc as j,ua as f,va as C,w as A,xc as O,yc as W,zb as x}from"./chunk-C6IAD6Z2.js";var se=(t,r)=>({"btn-danger":t,"btn-elegant":r}),ae=(t,r,e)=>({"fa-trash":t,"fa-undo":r,"fa-spinner fa-pulse":e});function oe(t,r){t&1&&(a(0,"div",12),B(1,"i",13),o(),a(2,"p",14),l(3),d(4,"translate"),o()),t&2&&(s(3),g(m(4,1,"reset.no_accessories")))}function re(t,r){if(t&1&&(a(0,"option",24),l(1),o()),t&2){let e=r.$implicit;b("value",e._id),s(),L("",e.name," (",e._username,")")}}function le(t,r){if(t&1){let e=S();a(0,"li",20),l(1),d(2,"translate"),o(),a(3,"li",18)(4,"label",21),l(5),d(6,"translate"),o(),a(7,"div",22)(8,"select",23),j("ngModelChange",function(i){f(e);let _=c(2);return P(_.selectedBridge,i)||(_.selectedBridge=i),C(i)}),h("change",function(i){f(e);let _=c(2);return C(_.onBridgeChange(i.target.value))}),E(9,re,2,3,"option",24,k),o()()()}if(t&2){let e=c(2);s(),g(m(2,3,"form.label.changes_kept")),s(4),g(m(6,5,"reset.accessory_ind.bridge")),s(3),N("ngModel",e.selectedBridge),s(),T(e.pairings)}}function ce(t,r){if(t&1&&(a(0,"li",18)(1,"label",25),l(2),d(3,"translate"),o(),a(4,"div",26),l(5),o()()),t&2){let e=c(2);s(2),g(m(3,2,"reset.accessory_ind.bridge")),s(3),I(" ",e.getCurrentlySelectedBridge()," ")}}function de(t,r){if(t&1){let e=S();a(0,"li",19)(1,"span"),l(2),B(3,"br"),a(4,"small")(5,"span",27),l(6),o()()(),a(7,"button",28),d(8,"translate"),h("click",function(){let i=f(e).$implicit,_=c(2);return C(_.toggleList(i.UUID,i.$cacheFile))}),B(9,"i",29),o()()}if(t&2){let e=r.$implicit,n=c(2);s(2),I(" ",e.displayName,""),s(4),g(e.UUID),s(),b("disabled",n.clicked)("ngClass",O(8,se,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile))),$("aria-label",m(8,6,"form.button_delete")),s(2),b("ngClass",W(11,ae,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile)&&!n.clicked,n.isInList(e.UUID,e.$cacheFile)&&n.clicked))}}function me(t,r){if(t&1&&(a(0,"div",12),B(1,"i",15),o(),a(2,"ul",16)(3,"li"),l(4),d(5,"translate"),o(),a(6,"li"),l(7),d(8,"translate"),o(),a(9,"li"),l(10),d(11,"translate"),o()(),a(12,"ul",17),x(13,le,11,7)(14,ce,6,4,"li",18),E(15,de,10,15,"li",19,k),o()),t&2){let e=c();s(4),g(m(5,5,"reset.accessory_ind.list_1")),s(3),g(m(8,7,"reset.accessory_ind.list_2")),s(3),g(m(11,9,"reset.accessory_ind.list_3")),s(3),u(e.pairings.length>1?13:-1),s(),u(e.pairings.length===1?14:-1),s(),T(e.selectedBridgeAccessories)}}function pe(t,r){if(t&1){let e=S();a(0,"button",30),h("click",function(){f(e);let i=c();return C(i.$activeModal.dismiss("Dismiss"))}),l(1),d(2,"translate"),o()}if(t&2){let e=c();b("disabled",e.clicked),s(),I(" ",m(2,2,"form.button_close")," ")}}function _e(t,r){if(t&1){let e=S();a(0,"button",31),h("click",function(){f(e);let i=c();return C(i.$activeModal.dismiss("Dismiss"))}),l(1),d(2,"translate"),o()}t&2&&(s(),I(" ",m(2,1,"form.button_close")," "))}function ue(t,r){if(t&1&&l(0),t&2){let e=c(3);I(" (",e.toDelete.length,") ")}}function ge(t,r){if(t&1&&(l(0),d(1,"translate"),x(2,ue,1,1)),t&2){let e=c(2);I(" ",m(1,2,"form.button_remove")," "),s(2),u(e.toDelete.length>0?2:-1)}}function xe(t,r){t&1&&B(0,"i",33)}function ve(t,r){if(t&1){let e=S();a(0,"button",32),h("click",function(){f(e);let i=c();return C(i.removeAccessories())}),x(1,ge,3,4)(2,xe,1,0,"i",33),o()}if(t&2){let e=c();b("disabled",!e.toDelete.length||e.clicked),s(),u(e.clicked?-1:1),s(),u(e.clicked?2:-1)}}var Te=(()=>{class t{$activeModal=w(X);$api=w(ie);$router=w(te);$toastr=w(ee);$translate=w(Y);pairings=[];selectedBridge="";clicked=!1;selectedBridgeAccessories=[];accessoriesExist=!1;toDelete=[];constructor(){}ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return F(this,null,function*(){var e;try{let[n,i]=yield Promise.all([A(this.$api.get("/server/cached-accessories")),A(this.$api.get("/server/pairings"))]),_=new Map(i.map(p=>[p._id,V(M({},p),{accessories:[]})]));n.sort((p,v)=>p.displayName.localeCompare(v.displayName)).forEach(p=>{var D,R;let v=i.find(ne=>ne._main),y=((R=(D=p.$cacheFile)==null?void 0:D.split("."))==null?void 0:R[1])||v._id;(!this.selectedBridge||this.selectedBridge===y)&&(_.has(y)||_.set(y,{_id:y,_username:y.match(/.{1,2}/g).join(":"),name:this.$translate.instant("reset.accessory_ind.unknown"),accessories:[]}),_.get(y).accessories.push(p))}),this.pairings=Array.from(_.values()).filter(p=>p.accessories.length>0).sort((p,v)=>p._main&&!v._main?-1:!p._main&&v._main?1:p.name.localeCompare(v.name)),this.selectedBridge=this.selectedBridge||((e=this.pairings[0])==null?void 0:e._id),this.selectedBridge&&(this.accessoriesExist=!0,this.selectedBridgeAccessories=this.pairings[0].accessories)}catch(n){console.error(n),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}onBridgeChange(e){var n;this.selectedBridge=e,this.selectedBridgeAccessories=(n=this.pairings.find(i=>i._id===this.selectedBridge))==null?void 0:n.accessories}getCurrentlySelectedBridge(){let e=this.pairings.find(n=>n._id===this.selectedBridge);return`${e.name} - ${e._username}`}toggleList(e,n){this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)?this.toDelete=this.toDelete.filter(i=>i.uuid!==e&&i.cacheFile!==n):this.toDelete.push({cacheFile:n,uuid:e})}isInList(e,n){return this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)}removeAccessories(){return this.clicked=!0,this.$api.delete("/server/cached-accessories",{body:this.toDelete}).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(n){return new(n||t)};static \u0275cmp=U({type:t,selectors:[["ng-component"]],inputs:{selectedBridge:"selectedBridge"},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"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"list-group-item","text-center","grey-text","small"],["for","bridgeSelect",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["id","bridgeSelect",1,"custom-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50","grey-text","font-monospace"],[1,"font-monospace","grey-text"],[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(n,i){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),d(4,"translate"),o(),a(5,"button",3),d(6,"translate"),h("click",function(){return i.$activeModal.dismiss("Dismiss")}),o()(),a(7,"div",4),x(8,oe,5,3)(9,me,17,11),o(),a(10,"div",5)(11,"div",6),x(12,pe,3,4,"button",7),o(),a(13,"div",8),x(14,_e,3,3,"button",9),o(),a(15,"div",10),x(16,ve,3,3,"button",11),o()()()),n&2&&(s(3),g(m(4,8,"reset.accessory_ind.title")),s(2),b("disabled",i.clicked),$("aria-label",m(6,10,"form.button_close")),s(3),u(i.accessoriesExist?-1:8),s(),u(i.accessoriesExist?9:-1),s(3),u(i.accessoriesExist?12:-1),s(2),u(i.accessoriesExist?-1:14),s(2),u(i.accessoriesExist?16:-1))},dependencies:[z,Z,Q,J,K,H,q,G],encapsulation:2})}return t})();export{Te as a};