homebridge-config-ui-x 5.2.1-beta.7 → 5.2.1-beta.8

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 (62) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/modules/config-editor/config-editor.controller.d.ts +1 -0
  3. package/dist/modules/config-editor/config-editor.controller.js +13 -0
  4. package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
  5. package/dist/modules/config-editor/config-editor.service.d.ts +1 -0
  6. package/dist/modules/config-editor/config-editor.service.js +7 -0
  7. package/dist/modules/config-editor/config-editor.service.js.map +1 -1
  8. package/package.json +1 -1
  9. package/public/3rdpartylicenses.txt +16 -16
  10. package/public/{chunk-EB3KFEZV.js → chunk-2LSH3KMC.js} +1 -1
  11. package/public/{chunk-SMBUQB5S.js → chunk-2PP2VDL6.js} +1 -1
  12. package/public/{chunk-WSQEHKU3.js → chunk-42RLCU53.js} +1 -1
  13. package/public/{chunk-3YREOL2T.js → chunk-5MLTGVMM.js} +1 -1
  14. package/public/{chunk-ADOOROVR.js → chunk-6BFSUFRQ.js} +1 -1
  15. package/public/{chunk-UX5UNMYG.js → chunk-6BLWRML2.js} +1 -1
  16. package/public/{chunk-ZKBQLUW3.js → chunk-6LWEFB5T.js} +1 -1
  17. package/public/{chunk-RVYLKXPZ.js → chunk-7TWHYDPQ.js} +1 -1
  18. package/public/{chunk-QR2FZ3FN.js → chunk-A2NEEDZO.js} +1 -1
  19. package/public/{chunk-HMHCCCTK.js → chunk-A5MWQCGQ.js} +1 -1
  20. package/public/{chunk-FN4K5HWT.js → chunk-A7SXZCLG.js} +1 -1
  21. package/public/{chunk-DH37RX4H.js → chunk-CQAWPDW3.js} +1 -1
  22. package/public/{chunk-AQFHKZAO.js → chunk-D7PVXFSB.js} +1 -1
  23. package/public/{chunk-62VDTL5K.js → chunk-DUY46UE5.js} +1 -1
  24. package/public/{chunk-OJOA5OFG.js → chunk-EBQHWKQC.js} +1 -1
  25. package/public/{chunk-E32HKJ6X.js → chunk-EXI6FL7A.js} +1 -1
  26. package/public/{chunk-VT5RDZJX.js → chunk-GBJM2RI4.js} +1 -1
  27. package/public/{chunk-LLGBNHYD.js → chunk-GPMC6ZMO.js} +1 -1
  28. package/public/{chunk-GONDXWWH.js → chunk-GRCWZ7OU.js} +1 -1
  29. package/public/{chunk-S2H3WG4X.js → chunk-HHU6FT77.js} +1 -1
  30. package/public/{chunk-MPZHIXD7.js → chunk-IKNF2DEX.js} +1 -1
  31. package/public/{chunk-BF6APQQN.js → chunk-IU5EKYXQ.js} +1 -1
  32. package/public/{chunk-HQPD7F5O.js → chunk-IZBB7SRV.js} +1 -1
  33. package/public/{chunk-WPNQ7LE6.js → chunk-JBKS3BI7.js} +4 -4
  34. package/public/{chunk-JZJ2ZMSH.js → chunk-LGEE7SWW.js} +1 -1
  35. package/public/{chunk-SVOCUQXR.js → chunk-LKEDVYVC.js} +1 -1
  36. package/public/{chunk-GMLS4QWN.js → chunk-NCB3IL32.js} +1 -1
  37. package/public/{chunk-W7MI6OYY.js → chunk-NEMQW5FW.js} +1 -1
  38. package/public/chunk-NGBI2CLV.js +20 -0
  39. package/public/{chunk-4NTMXN5W.js → chunk-NSTN7R3D.js} +1 -1
  40. package/public/{chunk-GBCHQYME.js → chunk-P2X74Q5E.js} +1 -1
  41. package/public/chunk-PKUXB6QF.js +1 -0
  42. package/public/{chunk-TTZW4NLU.js → chunk-Q2SY7ITC.js} +1 -1
  43. package/public/{chunk-XKH4OBAY.js → chunk-QJZIEGHX.js} +1 -1
  44. package/public/{chunk-BYL6XNAO.js → chunk-RABTAB22.js} +1 -1
  45. package/public/{chunk-UZVDP7AR.js → chunk-RZG4H7FG.js} +1 -1
  46. package/public/{chunk-EALKMUCN.js → chunk-S3TEEEYY.js} +1 -1
  47. package/public/chunk-SH42QPYC.js +1 -0
  48. package/public/{chunk-BP4AY6SL.js → chunk-SUJJIFP4.js} +1 -1
  49. package/public/{chunk-AKYVNWGX.js → chunk-TFTVFLPX.js} +1 -1
  50. package/public/{chunk-M7SDPVS7.js → chunk-UCRZ7BF5.js} +1 -1
  51. package/public/{chunk-HP7D6TY5.js → chunk-VCWRZM6U.js} +1 -1
  52. package/public/{chunk-2TT2EL5C.js → chunk-XTDDD6WY.js} +1 -1
  53. package/public/{chunk-B5F2RJ4U.js → chunk-XWQ7NZSB.js} +1 -1
  54. package/public/{chunk-CDF6XR5P.js → chunk-YFZSQHUV.js} +1 -1
  55. package/public/{chunk-G5IU36OR.js → chunk-Z43SQI6H.js} +1 -1
  56. package/public/{chunk-BC2NJBDJ.js → chunk-ZXXBIF5D.js} +1 -1
  57. package/public/index.html +1 -1
  58. package/public/main-76WAOLPU.js +1 -0
  59. package/public/chunk-A5TJVETN.js +0 -20
  60. package/public/chunk-IBMR32UU.js +0 -1
  61. package/public/chunk-KLCAKS67.js +0 -1
  62. package/public/main-BP655MJZ.js +0 -1
@@ -1 +1 @@
1
- import{a as H}from"./chunk-ERUJZRID.js";import{a as X}from"./chunk-B3QDBZSW.js";import{a as Z}from"./chunk-7FO4RGTF.js";import"./chunk-2KOR6LRK.js";import{a as R}from"./chunk-W6RS6NBX.js";import{n as E}from"./chunk-PSSVCFFV.js";import"./chunk-K2NEWUWG.js";import{a as j}from"./chunk-FN4K5HWT.js";import{b as A}from"./chunk-AQFHKZAO.js";import{a as W,c as q,d as V,e as N,f as D}from"./chunk-QRQBCPWO.js";import{b as T}from"./chunk-VT5RDZJX.js";import{m as $}from"./chunk-GBCHQYME.js";import{a as L,b as U}from"./chunk-ZG3HINDJ.js";import"./chunk-K7QEGT3E.js";import{Cc as h,Dc as M,Hb as m,Hc as s,Ib as x,Ic as d,Jb as y,Ob as c,Pb as n,Qb as a,Rb as p,_b as S,ab as o,bc as _,dc as C,fb as F,g as Y,h as I,id as O,la as u,mb as P,qc as f,ra as b,rc as v,sa as w,w as z,zd as K}from"./chunk-V7SOQAC5.js";var Q=Y(Z(),1);function G(){var i;return typeof window<"u"&&(window?.matchMedia("(display-mode: standalone)").matches||((i=window.navigator)===null||i===void 0?void 0:i.standalone)||document.referrer.startsWith("android-app://")||window?.Windows||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var B=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/plugins"],re=()=>["/accessories"],ae=()=>["/logs"],se=()=>["/support"],de=()=>["/platform-tools/terminal"],le=()=>["/config"],pe=()=>["/settings"],ce=()=>["/power-options"];function me(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),s(3,"translate"),_("click",function(){b(e);let t=C();return w(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",21),a(),n(6,"div",14),f(7),s(8,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"rpi.throttled.undervoltage_title")+" - "+d(3,4,"rpi.throttled.undervoltage_description")),o(6),v(d(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,de))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.linux.label_terminal")),o(5),v(d(7,6,"menu.linux.label_terminal")))}function _e(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,le))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.config_json_editor")),o(5),v(d(7,6,"menu.config_json_editor")))}function fe(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,pe))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.label_settings")),o(5),v(d(7,6,"menu.label_settings")))}function ge(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,ce))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.restart.title")),o(5),v(d(7,6,"menu.restart.title")))}function ve(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),_("click",function(){b(e);let t=C();return w(t.reloadPage())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"menu.reload")),o(5),v(d(7,4,"menu.reload")))}function he(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),_("click",function(){b(e);let t=C();return w(t.logout())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",27),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"menu.tooltip_logout")),o(5),v(d(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{$auth=u(A);$settings=u(T);$modal=u(E);$notification=u(X);$renderer=u(F);$router=u(V);$translate=u(L);isExpanded=!1;formAuth=this.$settings.formAuth;isAdmin=this.$auth.user.admin;enableTerminalAccess=this.$settings.env.enableTerminalAccess;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();constructor(){this.isMobile=window.innerWidth<768;let e;window.addEventListener("resize",()=>{clearTimeout(e),e=setTimeout(()=>{this.updateListeners()},500)}),this.$router.events.subscribe(l=>{l instanceof W&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)}),this.$notification.formAuthEnabled.subscribe(r=>{this.formAuth=r});let e=document.querySelector(".sidebar"),l=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!l.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),l.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),l.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}openUnderVoltageModal(){let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let l=e.target;["menuitem","button"].includes(l.getAttribute("role"))&&l.click()}}reloadPage(){window.location.reload()}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}logout(){this.$auth.logout()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.$renderer.setStyle(e,"opacity","20%"),this.$renderer.setStyle(e,"pointer-events","none"),this.$renderer.setStyle(e,"overflow","hidden")):(this.$renderer.removeStyle(e,"opacity"),this.$renderer.removeStyle(e,"pointer-events"),this.$renderer.removeStyle(e,"overflow"))}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeAllListeners(),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}))}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=P({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:68,vars:75,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-question-circle-o"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-power-off"],[1,"fa","fa-fw","fa-refresh"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(l,t){l&1&&(n(0,"div",0),s(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(g){return t.handleKeydown(g)}),p(2,"span",1),n(3,"a",2),s(4,"translate"),p(5,"img",3),n(6,"div",4),f(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(g){return t.handleKeydown(g)}),n(15,"a",2),s(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),s(23,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),s(28,"translate"),a()()(),x(29,me,9,8,"div",10),n(30,"div",10)(31,"div",15),s(32,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(33,"div",12),p(34,"i",16),a(),n(35,"div",14),f(36),s(37,"translate"),a()()(),n(38,"div",10)(39,"div",15),s(40,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(41,"div",12),p(42,"i",17),a(),n(43,"div",14),f(44),s(45,"translate"),a()()(),n(46,"div",10)(47,"div",15),s(48,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(49,"div",12),p(50,"i",18),a(),n(51,"div",14),f(52),s(53,"translate"),a()()(),x(54,ue,8,9,"div",10),x(55,_e,8,9,"div",10),x(56,fe,8,9,"div",10),n(57,"div",10)(58,"div",15),s(59,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(60,"div",12),p(61,"i",19),a(),n(62,"div",14),f(63),s(64,"translate"),a()()(),x(65,ge,8,9,"div",10),x(66,ve,8,6,"div",10),x(67,he,8,6,"div",10),a()()),l&2&&(m("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",d(1,37,"menu.sidebar.aria_menu")),o(3),c("routerLink",h(63,B)),m("aria-label",d(4,39,"menu.label_status")),o(5),c("ngClass",M(64,te,t.isExpanded)),o(5),c("ngClass",M(66,ne,t.isExpanded)),o(2),c("routerLink",h(68,B)),m("aria-label",d(16,41,"menu.label_status")),o(7),c("routerLink",h(69,B))("routerLinkActive","active")("routerLinkActiveOptions",h(70,ie)),m("aria-label",d(23,43,"menu.label_status")),o(5),v(d(28,45,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(2),c("routerLink",h(71,oe))("routerLinkActive","active"),m("aria-label",d(32,47,"menu.label_plugins")),o(5),v(d(37,49,"menu.label_plugins")),o(3),c("routerLink",h(72,re))("routerLinkActive","active"),m("aria-label",d(40,51,"menu.label_accessories")),o(5),v(d(45,53,"menu.label_accessories")),o(3),c("routerLink",h(73,ae))("routerLinkActive","active"),m("aria-label",d(48,55,"menu.linux.label_logs")),o(5),v(d(53,57,"menu.linux.label_logs")),o(2),y(t.enableTerminalAccess&&t.isAdmin?54:-1),o(),y(t.isAdmin?55:-1),o(),y(t.isAdmin?56:-1),o(2),c("routerLink",h(74,se))("routerLinkActive","active"),m("aria-label",d(59,59,"support.title")),o(5),v(d(64,61,"support.title")),o(2),y(t.isAdmin?65:-1),o(),y(t.isPwa?66:-1),o(),y(t.formAuth?67:-1))},dependencies:[N,K,O,D,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var be=i=>({sidebarExpanded:i}),He=(()=>{class i{$auth=u(A);$modal=u(E);$router=u(V);$settings=u(T);$translate=u(L);$ws=u(j);io;sidebarExpanded=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return I(this,null,function*(){if(this.$settings.settingsLoaded||(yield z(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Q.lt)(this.$settings.uiVersion,$.serverTarget)){console.log(`Server restart required. UI Version: ${$.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(R,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:$.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"])).catch(()=>{})}})}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=P({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(l,t){l&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),l&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,be,t.sidebarExpanded)))},dependencies:[J,O,q],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{He as LayoutComponent};
1
+ import{a as H}from"./chunk-ERUJZRID.js";import{a as X}from"./chunk-B3QDBZSW.js";import{a as Z}from"./chunk-7FO4RGTF.js";import"./chunk-2KOR6LRK.js";import{a as R}from"./chunk-W6RS6NBX.js";import{n as E}from"./chunk-PSSVCFFV.js";import"./chunk-K2NEWUWG.js";import{a as j}from"./chunk-A7SXZCLG.js";import{b as A}from"./chunk-D7PVXFSB.js";import{a as W,c as q,d as V,e as N,f as D}from"./chunk-QRQBCPWO.js";import{b as T}from"./chunk-GBJM2RI4.js";import{m as $}from"./chunk-P2X74Q5E.js";import{a as L,b as U}from"./chunk-ZG3HINDJ.js";import"./chunk-K7QEGT3E.js";import{Cc as h,Dc as M,Hb as m,Hc as s,Ib as x,Ic as d,Jb as y,Ob as c,Pb as n,Qb as a,Rb as p,_b as S,ab as o,bc as _,dc as C,fb as F,g as Y,h as I,id as O,la as u,mb as P,qc as f,ra as b,rc as v,sa as w,w as z,zd as K}from"./chunk-V7SOQAC5.js";var Q=Y(Z(),1);function G(){var i;return typeof window<"u"&&(window?.matchMedia("(display-mode: standalone)").matches||((i=window.navigator)===null||i===void 0?void 0:i.standalone)||document.referrer.startsWith("android-app://")||window?.Windows||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var B=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/plugins"],re=()=>["/accessories"],ae=()=>["/logs"],se=()=>["/support"],de=()=>["/platform-tools/terminal"],le=()=>["/config"],pe=()=>["/settings"],ce=()=>["/power-options"];function me(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),s(3,"translate"),_("click",function(){b(e);let t=C();return w(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",21),a(),n(6,"div",14),f(7),s(8,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"rpi.throttled.undervoltage_title")+" - "+d(3,4,"rpi.throttled.undervoltage_description")),o(6),v(d(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,de))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.linux.label_terminal")),o(5),v(d(7,6,"menu.linux.label_terminal")))}function _e(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,le))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.config_json_editor")),o(5),v(d(7,6,"menu.config_json_editor")))}function fe(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,pe))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.label_settings")),o(5),v(d(7,6,"menu.label_settings")))}function ge(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,ce))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.restart.title")),o(5),v(d(7,6,"menu.restart.title")))}function ve(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),_("click",function(){b(e);let t=C();return w(t.reloadPage())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"menu.reload")),o(5),v(d(7,4,"menu.reload")))}function he(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),_("click",function(){b(e);let t=C();return w(t.logout())})("keydown",function(t){b(e);let r=C();return w(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",27),a(),n(5,"div",14),f(6),s(7,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"menu.tooltip_logout")),o(5),v(d(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{$auth=u(A);$settings=u(T);$modal=u(E);$notification=u(X);$renderer=u(F);$router=u(V);$translate=u(L);isExpanded=!1;formAuth=this.$settings.formAuth;isAdmin=this.$auth.user.admin;enableTerminalAccess=this.$settings.env.enableTerminalAccess;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();constructor(){this.isMobile=window.innerWidth<768;let e;window.addEventListener("resize",()=>{clearTimeout(e),e=setTimeout(()=>{this.updateListeners()},500)}),this.$router.events.subscribe(l=>{l instanceof W&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)}),this.$notification.formAuthEnabled.subscribe(r=>{this.formAuth=r});let e=document.querySelector(".sidebar"),l=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!l.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),l.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),l.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}openUnderVoltageModal(){let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let l=e.target;["menuitem","button"].includes(l.getAttribute("role"))&&l.click()}}reloadPage(){window.location.reload()}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}logout(){this.$auth.logout()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.$renderer.setStyle(e,"opacity","20%"),this.$renderer.setStyle(e,"pointer-events","none"),this.$renderer.setStyle(e,"overflow","hidden")):(this.$renderer.removeStyle(e,"opacity"),this.$renderer.removeStyle(e,"pointer-events"),this.$renderer.removeStyle(e,"overflow"))}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeAllListeners(),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}))}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=P({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:68,vars:75,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-question-circle-o"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-power-off"],[1,"fa","fa-fw","fa-refresh"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(l,t){l&1&&(n(0,"div",0),s(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(g){return t.handleKeydown(g)}),p(2,"span",1),n(3,"a",2),s(4,"translate"),p(5,"img",3),n(6,"div",4),f(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(g){return t.handleKeydown(g)}),n(15,"a",2),s(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),s(23,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),s(28,"translate"),a()()(),x(29,me,9,8,"div",10),n(30,"div",10)(31,"div",15),s(32,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(33,"div",12),p(34,"i",16),a(),n(35,"div",14),f(36),s(37,"translate"),a()()(),n(38,"div",10)(39,"div",15),s(40,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(41,"div",12),p(42,"i",17),a(),n(43,"div",14),f(44),s(45,"translate"),a()()(),n(46,"div",10)(47,"div",15),s(48,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(49,"div",12),p(50,"i",18),a(),n(51,"div",14),f(52),s(53,"translate"),a()()(),x(54,ue,8,9,"div",10),x(55,_e,8,9,"div",10),x(56,fe,8,9,"div",10),n(57,"div",10)(58,"div",15),s(59,"translate"),_("keydown",function(g){return t.handleKeydown(g)}),n(60,"div",12),p(61,"i",19),a(),n(62,"div",14),f(63),s(64,"translate"),a()()(),x(65,ge,8,9,"div",10),x(66,ve,8,6,"div",10),x(67,he,8,6,"div",10),a()()),l&2&&(m("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",d(1,37,"menu.sidebar.aria_menu")),o(3),c("routerLink",h(63,B)),m("aria-label",d(4,39,"menu.label_status")),o(5),c("ngClass",M(64,te,t.isExpanded)),o(5),c("ngClass",M(66,ne,t.isExpanded)),o(2),c("routerLink",h(68,B)),m("aria-label",d(16,41,"menu.label_status")),o(7),c("routerLink",h(69,B))("routerLinkActive","active")("routerLinkActiveOptions",h(70,ie)),m("aria-label",d(23,43,"menu.label_status")),o(5),v(d(28,45,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(2),c("routerLink",h(71,oe))("routerLinkActive","active"),m("aria-label",d(32,47,"menu.label_plugins")),o(5),v(d(37,49,"menu.label_plugins")),o(3),c("routerLink",h(72,re))("routerLinkActive","active"),m("aria-label",d(40,51,"menu.label_accessories")),o(5),v(d(45,53,"menu.label_accessories")),o(3),c("routerLink",h(73,ae))("routerLinkActive","active"),m("aria-label",d(48,55,"menu.linux.label_logs")),o(5),v(d(53,57,"menu.linux.label_logs")),o(2),y(t.enableTerminalAccess&&t.isAdmin?54:-1),o(),y(t.isAdmin?55:-1),o(),y(t.isAdmin?56:-1),o(2),c("routerLink",h(74,se))("routerLinkActive","active"),m("aria-label",d(59,59,"support.title")),o(5),v(d(64,61,"support.title")),o(2),y(t.isAdmin?65:-1),o(),y(t.isPwa?66:-1),o(),y(t.formAuth?67:-1))},dependencies:[N,K,O,D,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var be=i=>({sidebarExpanded:i}),He=(()=>{class i{$auth=u(A);$modal=u(E);$router=u(V);$settings=u(T);$translate=u(L);$ws=u(j);io;sidebarExpanded=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return I(this,null,function*(){if(this.$settings.settingsLoaded||(yield z(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Q.lt)(this.$settings.uiVersion,$.serverTarget)){console.log(`Server restart required. UI Version: ${$.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(R,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:$.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"])).catch(()=>{})}})}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=P({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(l,t){l&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),l&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,be,t.sidebarExpanded)))},dependencies:[J,O,q],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{He as LayoutComponent};
@@ -1 +1 @@
1
- import{k as et,n as it}from"./chunk-GBCHQYME.js";import{a as tt}from"./chunk-ZG3HINDJ.js";import{m as X}from"./chunk-K7QEGT3E.js";import{T as G,e as ut,g as ct,ga as R,h as P,la as Y,n as Q,w as N}from"./chunk-V7SOQAC5.js";var st=ut((J,q)=>{(function(L,T){typeof J=="object"&&typeof q<"u"?q.exports=T():typeof define=="function"&&define.amd?define(T):(L=typeof globalThis<"u"?globalThis:L||self).dayjs=T()})(J,function(){"use strict";var L=1e3,T=6e4,n=36e5,h="millisecond",d="second",l="minute",p="hour",v="day",y="week",S="month",Z="quarter",b="year",x="date",z="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,S),o=t-e<0,a=i.clone().add(s+(o?-1:1),S);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:S,y:b,w:y,d:v,D:x,h:p,m:l,s:d,ms:h,Q:Z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",k={};k[A]=ot;var B="$isDayjsObject",U=function(r){return r instanceof W||!(!r||!r[B])},V=function r(i,t,s){var e;if(!i)return A;if(typeof i=="string"){var o=i.toLowerCase();k[o]&&(e=o),t&&(k[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;k[c]=i,e=c}return!s&&e&&(A=e),e||!s&&A},m=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new W(t)},u=at;u.l=V,u.i=U,u.w=function(r,i){return m(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var W=function(){function r(t){this.$L=V(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[B]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,f=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,f)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,f)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==z},i.isSame=function(t,s){var e=m(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return m(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<m(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(_,M){var D=u.w(e.$u?Date.UTC(e.$y,M,_):new Date(e.$y,M,_),e);return o?D:D.endOf(v)},f=function(_,M){return u.w(e.toDate()[_].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(M)),e)},g=this.$W,$=this.$M,w=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case b:return o?c(1,0):c(31,11);case S:return o?c(1,$):c(0,$+1);case y:var O=this.$locale().weekStart||0,H=(g<O?g+7:g)-O;return c(o?w-H:w+(6-H),$);case v:case x:return f(j+"Hours",0);case p:return f(j+"Minutes",1);case l:return f(j+"Seconds",2);case d:return f(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[v]=a+"Date",e[x]=a+"Date",e[S]=a+"Month",e[b]=a+"FullYear",e[p]=a+"Hours",e[l]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],f=o===v?this.$D+(s-this.$W):s;if(o===S||o===b){var g=this.clone().set(x,1);g.$d[c](f),g.init(),this.$d=g.set(x,Math.min(this.$D,g.daysInMonth())).$d}else c&&this.$d[c](f);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function($){var w=m(o);return u.w(w.date(w.date()+Math.round($*t)),o)};if(a===S)return this.set(S,this.$M+t);if(a===b)return this.set(b,this.$y+t);if(a===v)return c(1);if(a===y)return c(7);var f=(e={},e[l]=T,e[p]=n,e[d]=L,e)[a]||1,g=this.$d.getTime()+t*f;return u.w(g,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||z;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,f=this.$m,g=this.$M,$=e.weekdays,w=e.months,j=e.meridiem,O=function(M,D,I,C){return M&&(M[D]||M(s,o))||I[D].slice(0,C)},H=function(M){return u.s(c%12||12,M,"0")},_=j||function(M,D,I){var C=M<12?"AM":"PM";return I?C.toLowerCase():C};return o.replace(rt,function(M,D){return D||function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return g+1;case"MM":return u.s(g+1,2,"0");case"MMM":return O(e.monthsShort,g,w,3);case"MMMM":return O(w,g);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,$,2);case"ddd":return O(e.weekdaysShort,s.$W,$,3);case"dddd":return $[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return _(c,f,!0);case"A":return _(c,f,!1);case"m":return String(f);case"mm":return u.s(f,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null}(M)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),f=m(t),g=(f.utcOffset()-this.utcOffset())*T,$=this-f,w=function(){return u.m(a,f)};switch(c){case b:o=w()/12;break;case S:o=w();break;case Z:o=w()/3;break;case y:o=($-g)/6048e5;break;case v:o=($-g)/864e5;break;case p:o=$/n;break;case l:o=$/T;break;case d:o=$/L;break;default:o=$}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(S).$D},i.$locale=function(){return k[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=V(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r}(),K=W.prototype;return m.prototype=K,[["$ms",h],["$s",d],["$m",l],["$H",p],["$W",v],["$M",S],["$y",b],["$D",x]].forEach(function(r){K[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),m.extend=function(r,i){return r.$i||(r(i,W,m),r.$i=!0),m},m.locale=V,m.isDayjs=U,m.unix=function(r){return m(1e3*r)},m.en=k[A],m.Ls=k,m.p={},m})});var E=ct(st(),1);var vt=(()=>{class L{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;wallpaper;serverTimeOffset=0;rtl=!1;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(l=>console.error("Error saving setTheme:",l)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((l,p)=>{try{let v=l.contentDocument;if(v){let y=v.body;y.classList.remove(`config-ui-x-${this.theme}`),y.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.actualLightingMode==="dark"?(y.classList.add(`config-ui-x-dark-mode-${this.theme}`),y.classList.contains("dark-mode")||y.classList.add("dark-mode")):(y.classList.add(`config-ui-x-${this.theme}`),y.classList.contains("dark-mode")&&y.classList.remove("dark-mode")),l.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${p}: Access denied (cross-origin?)`,{error:v,src:l.src})}})}setMenuMode(n){this.menuMode=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),l=this.env;for(let p=0;p<d.length-1;p++){if(this.forbiddenKeys.includes(d[p]))return;l[d[p]]||(l[d[p]]={}),l=l[d[p]]}this.forbiddenKeys.includes(d[d.length-1])||(l[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,E.default)(n).diff((0,E.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||L)};static \u0275prov=R({token:L,factory:L.\u0275fac,providedIn:"root"})}return L})();export{st as a,vt as b};
1
+ import{k as et,n as it}from"./chunk-P2X74Q5E.js";import{a as tt}from"./chunk-ZG3HINDJ.js";import{m as X}from"./chunk-K7QEGT3E.js";import{T as G,e as ut,g as ct,ga as R,h as P,la as Y,n as Q,w as N}from"./chunk-V7SOQAC5.js";var st=ut((J,q)=>{(function(L,T){typeof J=="object"&&typeof q<"u"?q.exports=T():typeof define=="function"&&define.amd?define(T):(L=typeof globalThis<"u"?globalThis:L||self).dayjs=T()})(J,function(){"use strict";var L=1e3,T=6e4,n=36e5,h="millisecond",d="second",l="minute",p="hour",v="day",y="week",S="month",Z="quarter",b="year",x="date",z="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,S),o=t-e<0,a=i.clone().add(s+(o?-1:1),S);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:S,y:b,w:y,d:v,D:x,h:p,m:l,s:d,ms:h,Q:Z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",k={};k[A]=ot;var B="$isDayjsObject",U=function(r){return r instanceof W||!(!r||!r[B])},V=function r(i,t,s){var e;if(!i)return A;if(typeof i=="string"){var o=i.toLowerCase();k[o]&&(e=o),t&&(k[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;k[c]=i,e=c}return!s&&e&&(A=e),e||!s&&A},m=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new W(t)},u=at;u.l=V,u.i=U,u.w=function(r,i){return m(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var W=function(){function r(t){this.$L=V(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[B]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,f=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,f)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,f)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==z},i.isSame=function(t,s){var e=m(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return m(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<m(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(_,M){var D=u.w(e.$u?Date.UTC(e.$y,M,_):new Date(e.$y,M,_),e);return o?D:D.endOf(v)},f=function(_,M){return u.w(e.toDate()[_].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(M)),e)},g=this.$W,$=this.$M,w=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case b:return o?c(1,0):c(31,11);case S:return o?c(1,$):c(0,$+1);case y:var O=this.$locale().weekStart||0,H=(g<O?g+7:g)-O;return c(o?w-H:w+(6-H),$);case v:case x:return f(j+"Hours",0);case p:return f(j+"Minutes",1);case l:return f(j+"Seconds",2);case d:return f(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[v]=a+"Date",e[x]=a+"Date",e[S]=a+"Month",e[b]=a+"FullYear",e[p]=a+"Hours",e[l]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],f=o===v?this.$D+(s-this.$W):s;if(o===S||o===b){var g=this.clone().set(x,1);g.$d[c](f),g.init(),this.$d=g.set(x,Math.min(this.$D,g.daysInMonth())).$d}else c&&this.$d[c](f);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function($){var w=m(o);return u.w(w.date(w.date()+Math.round($*t)),o)};if(a===S)return this.set(S,this.$M+t);if(a===b)return this.set(b,this.$y+t);if(a===v)return c(1);if(a===y)return c(7);var f=(e={},e[l]=T,e[p]=n,e[d]=L,e)[a]||1,g=this.$d.getTime()+t*f;return u.w(g,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||z;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,f=this.$m,g=this.$M,$=e.weekdays,w=e.months,j=e.meridiem,O=function(M,D,I,C){return M&&(M[D]||M(s,o))||I[D].slice(0,C)},H=function(M){return u.s(c%12||12,M,"0")},_=j||function(M,D,I){var C=M<12?"AM":"PM";return I?C.toLowerCase():C};return o.replace(rt,function(M,D){return D||function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return g+1;case"MM":return u.s(g+1,2,"0");case"MMM":return O(e.monthsShort,g,w,3);case"MMMM":return O(w,g);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,$,2);case"ddd":return O(e.weekdaysShort,s.$W,$,3);case"dddd":return $[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return _(c,f,!0);case"A":return _(c,f,!1);case"m":return String(f);case"mm":return u.s(f,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null}(M)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),f=m(t),g=(f.utcOffset()-this.utcOffset())*T,$=this-f,w=function(){return u.m(a,f)};switch(c){case b:o=w()/12;break;case S:o=w();break;case Z:o=w()/3;break;case y:o=($-g)/6048e5;break;case v:o=($-g)/864e5;break;case p:o=$/n;break;case l:o=$/T;break;case d:o=$/L;break;default:o=$}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(S).$D},i.$locale=function(){return k[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=V(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r}(),K=W.prototype;return m.prototype=K,[["$ms",h],["$s",d],["$m",l],["$H",p],["$W",v],["$M",S],["$y",b],["$D",x]].forEach(function(r){K[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),m.extend=function(r,i){return r.$i||(r(i,W,m),r.$i=!0),m},m.locale=V,m.isDayjs=U,m.unix=function(r){return m(1e3*r)},m.en=k[A],m.Ls=k,m.p={},m})});var E=ct(st(),1);var vt=(()=>{class L{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;wallpaper;serverTimeOffset=0;rtl=!1;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(l=>console.error("Error saving setTheme:",l)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((l,p)=>{try{let v=l.contentDocument;if(v){let y=v.body;y.classList.remove(`config-ui-x-${this.theme}`),y.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.actualLightingMode==="dark"?(y.classList.add(`config-ui-x-dark-mode-${this.theme}`),y.classList.contains("dark-mode")||y.classList.add("dark-mode")):(y.classList.add(`config-ui-x-${this.theme}`),y.classList.contains("dark-mode")&&y.classList.remove("dark-mode")),l.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${p}: Access denied (cross-origin?)`,{error:v,src:l.src})}})}setMenuMode(n){this.menuMode=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),l=this.env;for(let p=0;p<d.length-1;p++){if(this.forbiddenKeys.includes(d[p]))return;l[d[p]]||(l[d[p]]={}),l=l[d[p]]}this.forbiddenKeys.includes(d[d.length-1])||(l[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,E.default)(n).diff((0,E.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||L)};static \u0275prov=R({token:L,factory:L.\u0275fac,providedIn:"root"})}return L})();export{st as a,vt as b};
@@ -1 +1 @@
1
- import{a as w}from"./chunk-FN4K5HWT.js";import"./chunk-AQFHKZAO.js";import{d as $}from"./chunk-QRQBCPWO.js";import{b as S}from"./chunk-VT5RDZJX.js";import{k as E,n as y}from"./chunk-GBCHQYME.js";import{a as g,b as _}from"./chunk-ZG3HINDJ.js";import"./chunk-K7QEGT3E.js";import{Hc as m,Ib as c,Ic as l,Jb as d,Sb as r,Tb as i,Ub as f,ab as n,dc as v,la as o,mb as h,qc as a,rc as s}from"./chunk-V7SOQAC5.js";function T(t,u){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=v();n(),s(e.error)}}function C(t,u){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),f(5,"i",12),i()()),t&2&&(n(),s(l(2,1,"restart.please_wait_while_server_restarts")))}function k(t,u){t&1&&(r(0,"div",8),a(1),m(2,"translate"),i()),t&2&&(n(),s(l(2,1,"platform.linux.long_time")))}var z=(()=>{class t{$api=o(y);$router=o($);$settings=o(S);$toastr=o(E);$translate=o(g);$ws=o(w);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/linux/restart-host",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{console.error(e),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.linux.server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},3e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("platform.linux.server_taking_long_time"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},12e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=h({type:t,selectors:[["ng-component"]],decls:14,vars:8,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,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"]],template:function(p,x){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),f(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),c(11,T,2,1,"div",7)(12,C,6,3),c(13,k,3,3,"div",8),i()()),p&2&&(n(2),s(l(3,4,"menu.restart.title")),n(7),s(l(10,6,"platform.linux.restarting_server")),n(2),d(x.error?11:12),n(2),d(x.timeout?13:-1))},dependencies:[_],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{z as RestartLinuxComponent};
1
+ import{a as w}from"./chunk-A7SXZCLG.js";import"./chunk-D7PVXFSB.js";import{d as $}from"./chunk-QRQBCPWO.js";import{b as S}from"./chunk-GBJM2RI4.js";import{k as E,n as y}from"./chunk-P2X74Q5E.js";import{a as g,b as _}from"./chunk-ZG3HINDJ.js";import"./chunk-K7QEGT3E.js";import{Hc as m,Ib as c,Ic as l,Jb as d,Sb as r,Tb as i,Ub as f,ab as n,dc as v,la as o,mb as h,qc as a,rc as s}from"./chunk-V7SOQAC5.js";function T(t,u){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=v();n(),s(e.error)}}function C(t,u){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),f(5,"i",12),i()()),t&2&&(n(),s(l(2,1,"restart.please_wait_while_server_restarts")))}function k(t,u){t&1&&(r(0,"div",8),a(1),m(2,"translate"),i()),t&2&&(n(),s(l(2,1,"platform.linux.long_time")))}var z=(()=>{class t{$api=o(y);$router=o($);$settings=o(S);$toastr=o(E);$translate=o(g);$ws=o(w);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/linux/restart-host",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{console.error(e),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.linux.server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},3e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("platform.linux.server_taking_long_time"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},12e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=h({type:t,selectors:[["ng-component"]],decls:14,vars:8,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,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"]],template:function(p,x){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),f(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),c(11,T,2,1,"div",7)(12,C,6,3),c(13,k,3,3,"div",8),i()()),p&2&&(n(2),s(l(3,4,"menu.restart.title")),n(7),s(l(10,6,"platform.linux.restarting_server")),n(2),d(x.error?11:12),n(2),d(x.timeout?13:-1))},dependencies:[_],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{z as RestartLinuxComponent};