homebridge-config-ui-x 5.0.0-beta.92 → 5.0.0-beta.94

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 (109) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/config.schema.json +1 -39
  3. package/dist/core/auth/auth.controller.d.ts +6 -0
  4. package/dist/core/config/config.service.d.ts +6 -0
  5. package/dist/core/config/config.service.js +6 -0
  6. package/dist/core/config/config.service.js.map +1 -1
  7. package/dist/modules/config-editor/config-editor.controller.d.ts +1 -0
  8. package/dist/modules/config-editor/config-editor.controller.js +14 -0
  9. package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
  10. package/dist/modules/config-editor/config-editor.service.d.ts +1 -0
  11. package/dist/modules/config-editor/config-editor.service.js +21 -0
  12. package/dist/modules/config-editor/config-editor.service.js.map +1 -1
  13. package/package.json +1 -1
  14. package/public/3rdpartylicenses.txt +24 -24
  15. package/public/{chunk-X4SELLPV.js → chunk-22PNLYM6.js} +1 -1
  16. package/public/chunk-2FQQ3LQB.js +1 -0
  17. package/public/chunk-2QRMAYMU.js +1 -0
  18. package/public/chunk-2Y6WD2MK.js +1 -0
  19. package/public/{chunk-CTSSD2EZ.js → chunk-3AXWOGOH.js} +1 -1
  20. package/public/chunk-45GMHWPO.js +8 -0
  21. package/public/chunk-4CZ77ONA.js +1 -0
  22. package/public/{chunk-53367L4B.js → chunk-4FUTEHLT.js} +2 -2
  23. package/public/chunk-5EA5EBCL.js +1 -0
  24. package/public/{chunk-6PWEY66K.js → chunk-5LDKHTNS.js} +1 -1
  25. package/public/{chunk-CJFTYWNR.js → chunk-5T2WJQPT.js} +1 -1
  26. package/public/{chunk-HY4VKKSI.js → chunk-5TKN53YR.js} +1 -1
  27. package/public/{chunk-7X3XMTAN.js → chunk-5VRO7UND.js} +1 -1
  28. package/public/{chunk-4T23HW6C.js → chunk-6QBSPCB5.js} +1 -1
  29. package/public/{chunk-MHT5EWEJ.js → chunk-7DL5ROXP.js} +16 -16
  30. package/public/chunk-7P2M7EOL.js +1 -0
  31. package/public/{chunk-QARZCKVI.js → chunk-7WL5AKLN.js} +1 -1
  32. package/public/{chunk-DMZKSOE6.js → chunk-7Y2TEA4F.js} +1 -1
  33. package/public/{chunk-KL2VWGZB.js → chunk-AUC5ZCGG.js} +1 -1
  34. package/public/{chunk-FYPMMNJH.js → chunk-BBEM62ZJ.js} +1 -1
  35. package/public/chunk-CHVYDLEO.js +1 -0
  36. package/public/{chunk-ZVEQJMUN.js → chunk-DHDQRCOJ.js} +1 -1
  37. package/public/{chunk-XV3L5UW5.js → chunk-FIABPQU3.js} +1 -1
  38. package/public/chunk-GPMWD6WO.js +1 -0
  39. package/public/{chunk-RMRL4WBE.js → chunk-GV7FWHGD.js} +1 -1
  40. package/public/chunk-HHVA3LPZ.js +1 -0
  41. package/public/chunk-HZLDP6PC.js +1 -0
  42. package/public/chunk-IJR3FBJT.js +1 -0
  43. package/public/{chunk-LVDRJVNM.js → chunk-J5ELJCW5.js} +1 -1
  44. package/public/chunk-K5WUATR5.js +1 -0
  45. package/public/{chunk-WA55SQES.js → chunk-KMNIM7MI.js} +1 -1
  46. package/public/{chunk-EWFACBTA.js → chunk-KVNSPC46.js} +1 -1
  47. package/public/chunk-LETCXEZB.js +1 -0
  48. package/public/{chunk-O7HG4PDK.js → chunk-LWIO7IH5.js} +1 -1
  49. package/public/{chunk-45Y2FG24.js → chunk-MWRIIEBA.js} +1 -1
  50. package/public/{chunk-HSQMH5MK.js → chunk-MX767QWK.js} +1 -1
  51. package/public/{chunk-OXYS5VG3.js → chunk-NEBRRWBX.js} +1 -1
  52. package/public/chunk-NQEP67W2.js +1 -0
  53. package/public/{chunk-2KD2XOYC.js → chunk-O63KPU64.js} +1 -1
  54. package/public/chunk-OSIUDIJM.js +1 -0
  55. package/public/chunk-PACISHIL.js +1 -0
  56. package/public/chunk-PERLTTA4.js +1 -0
  57. package/public/chunk-PN2GLNQY.js +1 -0
  58. package/public/{chunk-BNGLNG3U.js → chunk-QPGONHRG.js} +1 -1
  59. package/public/chunk-RBIOAISR.js +1 -0
  60. package/public/{chunk-SSI3OSA4.js → chunk-RQ6TPADX.js} +1 -1
  61. package/public/{chunk-WPJYEGTG.js → chunk-RYPWBEXG.js} +1 -1
  62. package/public/{chunk-6KUFRRJO.js → chunk-S2WVL2GX.js} +1 -1
  63. package/public/{chunk-5GQ5LHPJ.js → chunk-SLK7BIMW.js} +1 -1
  64. package/public/{chunk-7FVSDABO.js → chunk-SVHDRQLT.js} +1 -1
  65. package/public/chunk-SVRCLNMT.js +1 -0
  66. package/public/chunk-T3PFGZVS.js +1 -0
  67. package/public/chunk-TAZVIDMI.js +5 -0
  68. package/public/{chunk-HOC3JRUW.js → chunk-TPEU4PI7.js} +1 -1
  69. package/public/chunk-U566L526.js +1 -0
  70. package/public/{chunk-VKY76476.js → chunk-UMZH66PK.js} +1 -1
  71. package/public/chunk-UT2PAJ7X.js +1 -0
  72. package/public/chunk-V5UYMON4.js +6 -0
  73. package/public/{chunk-Y6TXYIFY.js → chunk-VBT67TSB.js} +6 -6
  74. package/public/{chunk-DP47RFFX.js → chunk-VMJGW2YJ.js} +1 -1
  75. package/public/chunk-WWHM6Z3P.js +1 -0
  76. package/public/chunk-XD6FULOO.js +1 -0
  77. package/public/{chunk-FHAEPFX4.js → chunk-XEDAF2V3.js} +1 -1
  78. package/public/chunk-XSBRIJ5R.js +1 -0
  79. package/public/index.html +1 -1
  80. package/public/main-DJVAQ5XU.js +1 -0
  81. package/public/chunk-2CW327CY.js +0 -1
  82. package/public/chunk-2WPK56PX.js +0 -1
  83. package/public/chunk-44RHSCAB.js +0 -1
  84. package/public/chunk-4RSII4FO.js +0 -6
  85. package/public/chunk-4VQO4ZTU.js +0 -1
  86. package/public/chunk-56VIVSJU.js +0 -1
  87. package/public/chunk-6RF3TDAU.js +0 -8
  88. package/public/chunk-7AYYKL3I.js +0 -1
  89. package/public/chunk-AIOIWKCY.js +0 -1
  90. package/public/chunk-B55JVEWT.js +0 -1
  91. package/public/chunk-BU76M3H5.js +0 -5
  92. package/public/chunk-DM5V4JFC.js +0 -1
  93. package/public/chunk-DYOKFUUF.js +0 -1
  94. package/public/chunk-EEBYUVQY.js +0 -1
  95. package/public/chunk-EFHLJTQ3.js +0 -1
  96. package/public/chunk-EWUBHGYD.js +0 -1
  97. package/public/chunk-F2KSAULE.js +0 -1
  98. package/public/chunk-FB6SIZJB.js +0 -1
  99. package/public/chunk-GTUHXK3Q.js +0 -1
  100. package/public/chunk-IARRIMKK.js +0 -1
  101. package/public/chunk-JYF4U2K3.js +0 -1
  102. package/public/chunk-LPGZUTF3.js +0 -1
  103. package/public/chunk-N5Z6Q3PB.js +0 -1
  104. package/public/chunk-TS2FX75D.js +0 -1
  105. package/public/chunk-ULEGYJKD.js +0 -1
  106. package/public/chunk-ULOQNFLF.js +0 -1
  107. package/public/chunk-WFC2KZ5X.js +0 -1
  108. package/public/chunk-ZKD2IJFD.js +0 -1
  109. package/public/main-JYGJYOC2.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as Ne}from"./chunk-KVNSPC46.js";import{a as tt}from"./chunk-GPMWD6WO.js";import{a as Ze,b as et}from"./chunk-VBT67TSB.js";import{g as ae,m as R,n as K,o as Pe}from"./chunk-2EMPNH2X.js";import{A as Y,b as Q,c as ie,e as J,j as E,k as Ie,l as we,n as Ee,o as ne,r as Be,s as Te,t as $e,u as Fe,v as Re,x as Ae,z as X}from"./chunk-EJ3RNOUF.js";import{d as O,e as De}from"./chunk-ZOLUFCSO.js";import{a as Ve}from"./chunk-UMZH66PK.js";import{b as Z}from"./chunk-5VRO7UND.js";import{c as ke,d as le,f as te,g as pe,k as P,m as Me,n as D}from"./chunk-AUC5ZCGG.js";import{c as Se,d as ye}from"./chunk-FDPTBVVC.js";import{a as A,b as F}from"./chunk-GOW5VSYJ.js";import{$a as t,Ac as o,Bc as s,Cc as z,Gb as v,Hb as h,Ib as _,Kb as M,Lb as V,M as w,Mb as N,Nb as m,Ob as n,Pb as r,Qb as d,Ub as I,Xa as se,Xb as f,Ya as ue,Yb as b,ac as he,bc as _e,bd as U,cc as ge,g as oe,gd as q,h as S,hd as Ce,id as xe,jc as l,kc as u,la as x,lb as $,lc as g,qc as be,ra as y,rc as ve,sa as k,sc as fe,w as B,wc as L,xc as T,yc as G}from"./chunk-NR37MAXW.js";var Le=(i,c)=>({"green-text":i,"grey-text":c}),it=(i,c)=>({"btn-danger":i,"btn-success":c});function nt(i,c){if(i&1){let e=I();n(0,"li",9)(1,"span"),l(2),d(3,"br"),n(4,"small",10),d(5,"i",11),l(6),o(7,"translate"),n(8,"span",12),l(9),r(),l(10),o(11,"titlecase"),r()(),n(12,"button",21),o(13,"translate"),f("click",function(){let p=y(e).$implicit,C=b();return k(C.toggleList(p._username))}),l(14),o(15,"translate"),o(16,"uppercase"),r()()}if(i&2){let e=c.$implicit,a=b();t(2),g(" ",e.name," "),t(3),m("ngClass",T(19,Le,e._isPaired,!e._isPaired)),t(),g(" ",s(7,9,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),g(" \xB7 ",s(11,11,e._category)," "),t(2),m("disabled",a.clicked)("ngClass",T(22,it,a.isInList(e._username),!a.isInList(e._username))),v("aria-label",s(13,13,"form.button_unpair")),t(2),g(" ",s(16,17,s(15,15,a.isInList(e._username)?"form.button_blocked":"form.button_allowed"))," ")}}function at(i,c){i&1&&(l(0),o(1,"translate")),i&2&&g(" ",s(1,1,"form.button_save")," ")}function rt(i,c){i&1&&d(0,"i",20)}var Oe=(()=>{class i{$activeModal=x(R);$api=x(D);$toastr=x(P);$translate=x(A);originalBlacklist=[];updatedBlacklist=[];existingBlacklist=[];clicked=!1;mainPairing={};pairings=[];constructor(){}get blacklistHasUpdated(){return this.updatedBlacklist.join(",")!==this.originalBlacklist.join(",")}ngOnInit(){return S(this,null,function*(){this.updatedBlacklist=this.existingBlacklist.map(e=>e.trim().toUpperCase()).sort((e,a)=>e.localeCompare(a)),this.originalBlacklist=[...this.updatedBlacklist];try{let e=yield B(this.$api.get("/server/pairings"));this.mainPairing=e.find(a=>a._main),this.pairings=e.filter(a=>!a._main).sort((a,p)=>a.name.localeCompare(p.name))}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e){this.updatedBlacklist.includes(e)?this.updatedBlacklist=this.updatedBlacklist.filter(a=>a!==e):(this.updatedBlacklist.push(e),this.updatedBlacklist.sort((a,p)=>a.localeCompare(p)))}isInList(e){return this.updatedBlacklist.includes(e)}updateBlacklist(){return S(this,null,function*(){this.clicked=!0;try{yield B(this.$api.put("/config-editor/ui/accessory-blacklist",{body:this.updatedBlacklist})),this.$activeModal.close()}catch(e){this.clicked=!1,console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=$({type:i,selectors:[["ng-component"]],inputs:{existingBlacklist:"existingBlacklist"},decls:40,vars:26,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-list-check","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mt-3","mb-0"],[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"],["disabled","",1,"btn","btn-success","m-0","ms-3"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"]],template:function(a,p){a&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),l(3),o(4,"translate"),r(),n(5,"button",3),o(6,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),r()(),n(7,"div",4)(8,"div",5),d(9,"i",6),r(),n(10,"ul",7)(11,"li"),l(12),o(13,"translate"),r()(),n(14,"ul",8)(15,"li",9)(16,"span"),l(17),d(18,"br"),n(19,"small",10),d(20,"i",11),l(21),o(22,"translate"),n(23,"span",12),l(24),r(),l(25," \xB7 Homebridge "),r()(),n(26,"button",13),l(27,"ALLOWED"),r()(),V(28,nt,17,25,"li",9,M),r()(),n(30,"div",14)(31,"div",15)(32,"button",16),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),l(33),o(34,"translate"),r()(),d(35,"div",17),n(36,"div",18)(37,"button",19),f("click",function(){return p.updateBlacklist()}),h(38,at,2,3),h(39,rt,1,0,"i",20),r()()()()),a&2&&(t(3),u(s(4,13,"settings.security.ui_control")),t(2),m("disabled",p.clicked),v("aria-label",s(6,15,"form.button_close")),t(7),u(s(13,17,"settings.security.ui_control_desc")),t(5),g(" ",p.mainPairing.name," "),t(3),m("ngClass",T(23,Le,p.mainPairing._isPaired,!p.mainPairing._isPaired)),t(),g(" ",s(22,19,p.mainPairing._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(p.mainPairing._username),t(4),N(p.pairings),t(4),m("disabled",p.clicked),t(),g(" ",s(34,21,"form.button_close")," "),t(4),m("disabled",!p.blacklistHasUpdated||p.clicked),t(),_(p.clicked?-1:38),t(),_(p.clicked?39:-1))},dependencies:[U,F,X,q,Ce],encapsulation:2})}return i})();var de=oe(tt(),1);var ze=oe(Ze(),1),Ue=oe(et(),1);var ot=i=>({maxBackupSizeText:i});function st(i,c){if(i&1&&d(0,"input",10),i&2){let e=b(2);m("value",e.selectedBackup.fileName)}}function lt(i,c){if(i&1){let e=I();n(0,"input",12),f("change",function(p){y(e);let C=b(2);return k(C.handleRestoreFileInput(p.target.files))}),r()}}function pt(i,c){if(i&1&&(n(0,"div",4)(1,"div",7),d(2,"i",8),r(),n(3,"ul",9)(4,"li"),l(5),o(6,"translate"),r(),n(7,"li"),l(8),o(9,"translate"),r(),n(10,"li"),l(11),o(12,"translate"),r(),n(13,"li"),l(14),o(15,"translate"),r()(),h(16,st,1,1,"input",10),h(17,lt,1,0,"input",11),r()),i&2){let e=b();t(5),u(s(6,6,"backup.restore_help_one")),t(3),u(s(9,8,"backup.restore_help_two")),t(3),u(z(12,10,"backup.restore_max_size",L(15,ot,e.maxFileSizeText))),t(3),u(s(15,13,"backup.restore_warning")),t(2),_(e.selectedBackup?16:-1),t(),_(e.selectedBackup?-1:17)}}function dt(i,c){if(i&1){let e=I();n(0,"button",18),o(1,"translate"),f("click",function(){y(e);let p=b(2);return k(p.$activeModal.dismiss("Dismiss"))}),l(2),o(3,"translate"),r()}if(i&2){let e=b(2);m("disabled",e.clicked),v("aria-label",s(1,3,"form.button_close")),t(2),g(" ",s(3,5,"form.button_close")," ")}}function ct(i,c){if(i&1){let e=I();n(0,"button",18),o(1,"translate"),f("click",function(){y(e);let p=b(2);return k(p.reopenBackupModal())}),l(2),o(3,"translate"),r()}if(i&2){let e=b(2);m("disabled",e.clicked),v("aria-label",s(1,3,"form.button_back")),t(2),g(" ",s(3,5,"form.button_back")," ")}}function mt(i,c){i&1&&d(0,"i",19)}function ut(i,c){if(i&1&&(n(0,"span"),l(1),r()),i&2){let e=b(3);t(),g("",e.uploadPercent,"% - ")}}function ht(i,c){i&1&&(n(0,"span"),l(1," Extracting Archive"),r())}function _t(i,c){i&1&&(n(0,"span"),l(1),o(2,"translate"),r()),i&2&&(t(),g(" ",s(2,1,"backup.label_uploading")))}function gt(i,c){if(i&1&&(n(0,"span"),h(1,mt,1,0,"i",19),h(2,ut,2,1,"span"),h(3,ht,2,0,"span"),h(4,_t,3,3,"span"),r()),i&2){let e=b(2);t(),_(!e.uploadPercent||e.uploadPercent===100?1:-1),t(),_(e.uploadPercent&&e.uploadPercent!==100?2:-1),t(),_(e.uploadPercent===100?3:-1),t(),_(e.uploadPercent!==100?4:-1)}}function bt(i,c){i&1&&(l(0),o(1,"translate")),i&2&&g(" ",s(1,1,"form.button_restore")," ")}function vt(i,c){if(i&1){let e=I();n(0,"div",6)(1,"div",13),h(2,dt,4,7,"button",14),h(3,ct,4,7,"button",14),r(),d(4,"div",15),n(5,"div",16)(6,"button",17),f("click",function(){y(e);let p=b();return k(p.onRestoreBackupClick())}),h(7,gt,5,4,"span"),h(8,bt,2,3),r()()()}if(i&2){let e=b();t(2),_(e.setupWizardRestore?2:-1),t(),_(e.setupWizardRestore?-1:3),t(3),m("disabled",!e.selectedBackup&&!e.selectedFile||e.clicked),t(),_(e.clicked?7:-1),t(),_(e.clicked?-1:8)}}function ft(i,c){if(i&1){let e=I();n(0,"div",6),d(1,"div",13),n(2,"div",15)(3,"button",20),f("click",function(){y(e);let p=b();return k(p.postBackupRestart())}),l(4),o(5,"translate"),r()(),d(6,"div",16),r()}i&2&&(t(4),g(" ",s(5,1,"menu.hbrestart.title")," "))}var He=(()=>{class i{$activeModal=x(R);$api=x(D);$modal=x(K);$route=x(O);$toastr=x(P);$translate=x(A);$ws=x(Ve);setupWizardRestore=!1;selectedBackup=null;clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;restoreArchiveType="homebridge";uploadPercent=0;term=new ze.Terminal;termTarget;fitAddon=new Ue.FitAddon;io;constructor(){}ngOnInit(){return S(this,null,function*(){this.io=this.$ws.connectToNamespace("backup"),this.termTarget=document.getElementById("plugin-log-output"),this.term.open(this.termTarget),this.fitAddon.fit(),this.io.socket.on("stdout",e=>{this.term.write(e)}),this.setupWizardRestore&&(this.restoreStarted=!0,this.restoreInProgress=!0,this.startRestore())})}onRestoreBackupClick(){this.selectedBackup?this.restoreScheduledBackup():this.restoreArchiveType==="homebridge"?this.uploadHomebridgeArchive():this.restoreArchiveType==="hbfx"&&this.uploadHbfxArchive()}uploadHomebridgeArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore",e).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:a=>{console.error(a),this.$toastr.error(a.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})}restoreScheduledBackup(){return S(this,null,function*(){this.term.reset(),this.clicked=!0,this.$api.post(`/backup/scheduled-backups/${this.selectedBackup.id}/restore`,{}).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})})}startRestore(){return S(this,null,function*(){this.io.request("do-restore").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success")),this.setupWizardRestore&&this.postBackupRestart()},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}uploadHbfxArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore/hbfx",e,{reportProgress:!0,observe:"events"}).subscribe({next:a=>{a.type===Se.UploadProgress?this.uploadPercent=Math.round(100*a.loaded/a.total):a instanceof ye&&(this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startHbfxRestore()},500),this.clicked=!1)},error:a=>{this.clicked=!1,console.error(a),this.$toastr.error(a.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})}startHbfxRestore(){return S(this,null,function*(){this.io.request("do-restore-hbfx").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success"))},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.selectedFile.name.endsWith(".hbfx")?this.restoreArchiveType="hbfx":this.restoreArchiveType="homebridge"):delete this.selectedFile}postBackupRestart(){this.$api.put("/backup/restart",{}).subscribe({next:()=>{this.$activeModal.close(!0),this.$route.navigate(["/"])},error:()=>{}})}reopenBackupModal(){this.$activeModal.dismiss(),this.$modal.open(re,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.io.end()}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=$({type:i,selectors:[["ng-component"]],inputs:{setupWizardRestore:"setupWizardRestore",selectedBackup:"selectedBackup"},decls:11,vars:11,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"],["id","plugin-log-output",1,"modal-body",3,"hidden"],[1,"modal-footer","justify-content-between"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","text","disabled","",1,"form-control","custom-input",3,"value"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"form-control"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"form-control",3,"change"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"fa","fa-fw","fa-circle-notch","fa-spin"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"]],template:function(a,p){a&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),l(3),o(4,"translate"),r(),n(5,"button",3),o(6,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),r()(),h(7,pt,18,17,"div",4),d(8,"div",5),h(9,vt,9,5,"div",6),h(10,ft,7,3,"div",6),r()),a&2&&(t(3),u(s(4,7,"backup.title_backup")),t(2),m("disabled",p.restoreInProgress),v("aria-label",s(6,9,"form.button_close")),t(2),_(!p.restoreStarted&&!p.setupWizardRestore?7:-1),t(),m("hidden",!p.restoreStarted),t(),_(!p.restoreStarted||p.restoreFailed===!0?9:-1),t(),_(!p.restoreInProgress&&p.restoreStarted?10:-1))},dependencies:[F],encapsulation:2})}return i})();var Ct=(i,c)=>({"fa-arrow-right":i,"fa-cog fa-spin":c}),xt=i=>({backupTime:i,dayCount:7}),St=(i,c)=>({"fa-trash":i,"fa-cog fa-spin":c}),yt=(i,c)=>({backupSize:i,maxBackupSizeText:c});function kt(i,c){if(i&1&&(n(0,"li",23)(1,"label",28),l(2),o(3,"translate"),r(),n(4,"div",29),d(5,"input",30),o(6,"translate"),r()()),i&2){let e=b();t(2),u(s(3,3,"backup.settings_path")),t(3),m("formControl",e.pathFormControl),v("aria-label",s(6,5,"backup.settings_path"))}}function It(i,c){if(i&1&&(l(0),o(1,"date"),o(2,"translate")),i&2){let e=b(2);g(" ",z(2,4,"backup.scheduled_backup_time",L(7,xt,z(1,1,e.backupTime,"shortTime")))," ")}}function wt(i,c){i&1&&(l(0),o(1,"translate")),i&2&&g(" ",s(1,1,"backup.scheduled_backup_disabled")," ")}function Et(i,c){if(i&1&&(n(0,"span",33),o(1,"translate"),d(2,"i",40),l(3),r()),i&2){let e=b().$implicit;m("ngbTooltip",z(1,2,"backup.backup_exceeds_max_size",T(5,yt,e.size+"MB",e.maxBackupSizeText))),t(3),g(" ",e.size,"MB ")}}function Bt(i,c){if(i&1&&(n(0,"span"),l(1),r()),i&2){let e=b().$implicit;t(),g(" ",e.size,"MB ")}}function Tt(i,c){if(i&1){let e=I();n(0,"li",9)(1,"span")(2,"span",32),l(3),o(4,"date"),r(),d(5,"br"),n(6,"small",10),l(7),o(8,"date"),h(9,Et,4,8,"span",33),h(10,Bt,2,1,"span"),r()(),n(11,"span",34)(12,"button",35),o(13,"translate"),o(14,"translate"),f("click",function(){let p=y(e).$implicit,C=b(2);return k(C.restore(p))}),d(15,"i",36),r(),n(16,"button",37),o(17,"translate"),o(18,"translate"),f("click",function(){let p=y(e).$implicit,C=b(2);return k(C.download(p))}),d(19,"i",38),r(),n(20,"button",39),o(21,"translate"),o(22,"translate"),f("click",function(){let p=y(e).$implicit,C=b(2);return k(C.delete(p))}),d(23,"i",12),r()()()}if(i&2){let e=c.$implicit,a=b(2);t(2),m("ngbTooltip",e.fileName),t(),g(" ",z(4,15,e.timestamp,"mediumDate")," "),t(4),g(" ",z(8,18,e.timestamp,"shortTime")," \xB7 "),t(2),_(e.size>e.maxBackupSize?9:-1),t(),_(e.size<=e.maxBackupSize?10:-1),t(2),m("disabled",a.clicked||a.deleting||e.size>e.maxBackupSize)("ngbTooltip",s(13,21,"form.button_restore")),v("aria-label",s(14,23,"form.button_restore")),t(4),m("disabled",a.clicked||a.deleting)("ngbTooltip",s(17,25,"form.button_download")),v("aria-label",s(18,27,"form.button_download")),t(4),m("disabled",a.clicked||a.deleting)("ngbTooltip",s(21,29,"form.button_delete")),v("aria-label",s(22,31,"form.button_delete")),t(3),m("ngClass",T(33,St,e.id!==a.deleting,e.id===a.deleting))}}function $t(i,c){if(i&1&&(n(0,"ul",14)(1,"li",15)(2,"h6",16),l(3),o(4,"translate"),r(),n(5,"p",31),h(6,It,3,9),h(7,wt,2,3),r()(),V(8,Tt,24,36,"li",9,M),r()),i&2){let e=b();t(3),u(s(4,3,"backup.files_auto")),t(3),_(e.currentSettingEnabled&&e.backupTime?6:-1),t(),_(!e.currentSettingEnabled||!e.backupTime?7:-1),t(),N(e.scheduledBackups)}}var re=(()=>{class i{$activeModal=x(R);$api=x(D);$modal=x(K);$router=x(O);$settings=x(Z);$toastr=x(P);$translate=x(A);restartToastIsShown=!1;clicked=!1;scheduledBackups=[];backupTime;deleting=null;currentSettingEnabled=!1;currentSettingPath="";enabledFormControl=new E(!1);pathFormControl=new E("");constructor(){}ngOnInit(){this.getScheduledBackups(),this.getNextBackup(),this.currentSettingEnabled=!this.$settings.env.scheduledBackupDisable,this.currentSettingPath=this.$settings.env.scheduledBackupPath,this.enabledFormControl.patchValue(this.currentSettingEnabled),this.pathFormControl.patchValue(this.currentSettingPath),this.enabledFormControl.valueChanges.pipe(w(750)).subscribe(e=>S(this,null,function*(){this.currentSettingEnabled=e,yield this.saveUiSettingChange("scheduledBackupDisable",!this.currentSettingEnabled)})),this.pathFormControl.valueChanges.pipe(w(1500)).subscribe(e=>S(this,null,function*(){this.currentSettingPath=e,yield this.saveUiSettingChange("scheduledBackupPath",this.currentSettingPath)}))}saveUiSettingChange(e,a){return S(this,null,function*(){try{yield B(this.$api.put("/config-editor/ui",{key:e,value:a})),this.showRestartToast()}catch(p){console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}getScheduledBackups(){this.$api.get("/backup/scheduled-backups").subscribe({next:e=>{this.scheduledBackups=e},error:e=>console.error(e)})}getNextBackup(){this.$api.get("/backup/scheduled-backups/next").subscribe({next:e=>{this.backupTime=e.next},error:e=>{console.error(e)}})}download(e){this.$api.get(`/backup/scheduled-backups/${e.id}`,{observe:"response",responseType:"blob"}).subscribe({next:a=>{let p=e.fileName||"homebridge-backup.tar.gz",C=a.body.size;if(C>globalThis.backup.maxBackupSize){let H=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(C/1048576).toFixed(1)}MB`});this.$toastr.warning(H,this.$translate.instant("toast.title_warning"))}(0,de.saveAs)(a.body,p)},error:a=>{console.error(a),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})}restore(e){this.$activeModal.close();let a=this.$modal.open(He,{size:"lg",backdrop:"static"});a.componentInstance.selectedBackup=e}delete(e){this.deleting=e.id,this.$api.delete(`/backup/scheduled-backups/${e.id}`).subscribe({next:()=>{this.getScheduledBackups(),this.deleting=null},error:a=>{this.deleting=null,console.error(a),this.$toastr.error(this.$translate.instant("backup.backup_delete_failed"),this.$translate.instant("toast.title_error"))}})}onDownloadBackupClick(){return S(this,null,function*(){this.clicked=!0,this.$api.get("/backup/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{let a=e.headers.get("File-Name")||"homebridge-backup.tar.gz";this.clicked=!1;let p=e.body.size;if(p>globalThis.backup.maxBackupSize){let C=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(p/1048576).toFixed(1)}MB`});this.$toastr.warning(C,this.$translate.instant("toast.title_warning"))}(0,de.saveAs)(e.body,a)},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})})}showRestartToast(){if(!this.restartToastIsShown){this.restartToastIsShown=!0;let e=this.$toastr.info(this.$translate.instant("settings.changes.saved"),this.$translate.instant("menu.hbrestart.title"),{timeOut:0,closeButton:!1,tapToDismiss:!0,disableTimeOut:!0,positionClass:"toast-bottom-right",enableHtml:!0});e&&e.onTap&&e.onTap.subscribe(()=>{this.$router.navigate(["/restart"])})}}Date=Date;static \u0275fac=function(a){return new(a||i)};static \u0275cmp=$({type:i,selectors:[["ng-component"]],decls:70,vars:59,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-hard-drive","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-fw",3,"ngClass"],[1,"fas","fa-fw","fa-arrow-right"],[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","flex-row","pb-2"],[1,"text-start"],[1,"text-end","grey-text","d-flex","align-items-center"],["type","checkbox","id","disableScheduledBackups",1,"rendux-input",3,"formControl"],["for","disableScheduledBackups",1,"rendux-label"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"modal-footer","justify-content-between"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["type","text","placeholder","/home/pi/homebridge-backups",1,"form-control","custom-input",3,"formControl"],[1,"small","grey-text","mb-0","text-center"],["container","modal","openDelay","150","triggers","hover",3,"ngbTooltip"],["container","modal","openDelay","150","triggers","hover",1,"red-text",3,"ngbTooltip"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-exclamation-circle"]],template:function(a,p){a&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),l(3),o(4,"translate"),r(),n(5,"button",3),o(6,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),r()(),n(7,"div",4)(8,"div",5),d(9,"i",6),r(),n(10,"ul",7)(11,"li"),l(12),o(13,"translate"),r(),n(14,"li"),l(15),o(16,"translate"),r(),n(17,"li"),l(18),o(19,"translate"),r()(),n(20,"ul",8)(21,"li",9)(22,"div")(23,"span"),l(24),o(25,"translate"),r(),d(26,"br"),n(27,"small",10),l(28),o(29,"translate"),r()(),n(30,"button",11),o(31,"translate"),f("click",function(){return p.onDownloadBackupClick()}),d(32,"i",12),r()(),n(33,"li",9)(34,"div")(35,"span"),l(36),o(37,"translate"),r(),d(38,"br"),n(39,"small",10),l(40),o(41,"translate"),r()(),n(42,"button",11),o(43,"translate"),f("click",function(){return p.restore(null)}),d(44,"i",13),r()()(),n(45,"ul",14)(46,"li",15)(47,"h6",16),l(48),o(49,"translate"),r(),n(50,"p",17),l(51),o(52,"translate"),r()(),n(53,"li",18)(54,"span",19),l(55),o(56,"translate"),r(),n(57,"div",20),d(58,"input",21),o(59,"translate"),d(60,"label",22),r()(),h(61,kt,7,7,"li",23),r(),h(62,$t,10,5,"ul",14),r(),n(63,"div",24),d(64,"div",19),n(65,"div",25)(66,"button",26),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),l(67),o(68,"translate"),r()(),d(69,"div",27),r()()),a&2&&(t(3),u(s(4,24,"backup.title_backup")),t(2),m("disabled",p.clicked||p.deleting),v("aria-label",s(6,26,"form.button_close")),t(7),u(s(13,28,"backup.backup_help_one")),t(3),u(s(16,30,"backup.backup_help_two")),t(3),u(s(19,32,"backup.backup_warning")),t(6),u(s(25,34,"backup.backup_now")),t(4),u(s(29,36,"backup.backup_now_desc")),t(2),m("disabled",p.clicked),v("aria-label",s(31,38,"backup.backup_now")),t(2),m("ngClass",T(56,Ct,!p.clicked,p.clicked)),t(4),u(s(37,40,"backup.restore_now")),t(4),u(s(41,42,"backup.restore_now_desc")),t(2),m("disabled",p.clicked),v("aria-label",s(43,44,"backup.restore_now")),t(6),u(s(49,46,"backup.settings_title")),t(3),u(s(52,48,"form.auto_save")),t(4),u(s(56,50,"backup.settings_enable")),t(3),m("formControl",p.enabledFormControl),v("aria-label",s(59,52,"backup.settings_enable")),t(3),_(p.currentSettingEnabled?61:-1),t(),_(p.scheduledBackups.length?62:-1),t(4),m("disabled",p.clicked||p.deleting),t(),g(" ",s(68,54,"form.button_close")," "))},dependencies:[Pe,U,xe,F,Y,ie,Q,J,ne],encapsulation:2})}return i})();function Ft(i,c){i&1&&(n(0,"div",12),d(1,"i",13),r(),n(2,"p",14),l(3),o(4,"translate"),r()),i&2&&(t(3),u(s(4,1,"reset.no_accessories")))}function Rt(i,c){i&1&&(n(0,"div",12),d(1,"i",15),r(),n(2,"ul",16)(3,"li"),l(4),o(5,"translate"),r(),n(6,"li"),l(7),o(8,"translate"),r(),n(9,"li"),l(10),o(11,"translate"),r()(),n(12,"ngb-alert",17)(13,"p",18),l(14),o(15,"translate"),r()()),i&2&&(t(4),u(s(5,5,"reset.accessory_all.list_1")),t(3),u(s(8,7,"reset.accessory_all.list_2")),t(3),u(s(11,9,"reset.accessory_all.list_3")),t(2),m("dismissible",!1),t(2),u(s(15,11,"reset.action_is_irreversible")))}function At(i,c){if(i&1){let e=I();n(0,"button",19),o(1,"translate"),f("click",function(){y(e);let p=b();return k(p.$activeModal.dismiss("Dismiss"))}),l(2),o(3,"translate"),r()}if(i&2){let e=b();m("disabled",e.clicked),v("aria-label",s(1,3,"form.button_close")),t(2),g(" ",s(3,5,"form.button_close")," ")}}function Pt(i,c){if(i&1){let e=I();n(0,"button",20),o(1,"translate"),f("click",function(){y(e);let p=b();return k(p.$activeModal.dismiss("Dismiss"))}),l(2),o(3,"translate"),r()}i&2&&(v("aria-label",s(1,2,"form.button_close")),t(2),g(" ",s(3,4,"form.button_close")," "))}function Dt(i,c){i&1&&(l(0),o(1,"translate")),i&2&&g(" ",s(1,1,"form.button_remove")," ")}function Mt(i,c){i&1&&d(0,"i",22)}function Vt(i,c){if(i&1){let e=I();n(0,"button",21),f("click",function(){y(e);let p=b();return k(p.onResetCachedAccessoriesClick())}),h(1,Dt,2,3),h(2,Mt,1,0,"i",22),r()}if(i&2){let e=b();m("disabled",e.clicked),t(),_(e.clicked?-1:1),t(),_(e.clicked?2:-1)}}var Ke=(()=>{class i{$activeModal=x(R);$api=x(D);$router=x(O);$toastr=x(P);$translate=x(A);clicked=!1;cachedAccessories=[];constructor(){}ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return S(this,null,function*(){try{this.cachedAccessories=yield B(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(a){return new(a||i)};static \u0275cmp=$({type:i,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(a,p){a&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),l(3),o(4,"translate"),r(),n(5,"button",3),o(6,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),r()(),n(7,"div",4),h(8,Ft,5,3),h(9,Rt,16,13),r(),n(10,"div",5)(11,"div",6),h(12,At,4,7,"button",7),r(),n(13,"div",8),h(14,Pt,4,6,"button",9),r(),n(15,"div",10),h(16,Vt,3,3,"button",11),r()()()),a&2&&(t(3),u(s(4,8,"reset.accessory_all.title")),t(2),m("disabled",p.clicked),v("aria-label",s(6,10,"form.button_close")),t(3),_(p.cachedAccessories.length===0?8:-1),t(),_(p.cachedAccessories.length>0?9:-1),t(3),_(p.cachedAccessories.length>0?12:-1),t(2),_(p.cachedAccessories.length===0?14:-1),t(2),_(p.cachedAccessories.length>0?16:-1))},dependencies:[ae,F],encapsulation:2})}return i})();var Nt=(i,c)=>({"green-text":i,"grey-text":c}),Lt=(i,c)=>({"btn-danger":i,"btn-elegant":c}),Ot=(i,c,e)=>({"fa-broom":i,"fa-undo":c,"fa-spinner fa-pulse":e});function zt(i,c){i&1&&(n(0,"div",12),d(1,"i",13),r(),n(2,"p",14),l(3),o(4,"translate"),r()),i&2&&(t(3),u(s(4,1,"reset.bridge_accessories.empty")))}function Ut(i,c){if(i&1){let e=I();n(0,"li",18)(1,"span"),l(2),d(3,"br"),n(4,"small",19),d(5,"i",20),l(6),o(7,"translate"),n(8,"span",21),l(9),r()()(),n(10,"button",22),o(11,"translate"),f("click",function(){let p=y(e).$implicit,C=b(2);return k(C.toggleList(p._id))}),d(12,"i",23),r()()}if(i&2){let e=c.$implicit,a=b(2);t(2),g(" ",e.name," "),t(3),m("ngClass",T(12,Nt,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",a.clicked)("ngClass",T(15,Lt,!a.toDelete.includes(e._id),a.toDelete.includes(e._id))),v("aria-label",s(11,10,"form.button_delete")),t(2),m("ngClass",G(18,Ot,!a.toDelete.includes(e._id),a.toDelete.includes(e._id)&&!a.clicked,a.toDelete.includes(e._id)&&a.clicked))}}function Ht(i,c){if(i&1&&(n(0,"div",12),d(1,"i",15),r(),n(2,"ul",16)(3,"li"),l(4),o(5,"translate"),r(),n(6,"li"),l(7),o(8,"translate"),r(),n(9,"li"),l(10),o(11,"translate"),r()(),n(12,"ul",17),V(13,Ut,13,22,"li",18,M),r()),i&2){let e=b();t(4),u(s(5,3,"reset.bridge_accessories.list_1")),t(3),u(s(8,5,"reset.clear_cache_single.list_3")),t(3),u(s(11,7,"reset.bridge_accessories.list_2")),t(3),N(e.pairings)}}function Wt(i,c){if(i&1){let e=I();n(0,"button",24),f("click",function(){y(e);let p=b();return k(p.$activeModal.dismiss("Dismiss"))}),l(1),o(2,"translate"),r()}if(i&2){let e=b();m("disabled",e.clicked),t(),g(" ",s(2,2,"form.button_close")," ")}}function Kt(i,c){if(i&1){let e=I();n(0,"button",25),f("click",function(){y(e);let p=b();return k(p.$activeModal.dismiss("Dismiss"))}),l(1),o(2,"translate"),r()}i&2&&(t(),g(" ",s(2,1,"form.button_close")," "))}function jt(i,c){if(i&1&&l(0),i&2){let e=b(3);g(" (",e.toDelete.length,") ")}}function Gt(i,c){if(i&1&&(l(0),o(1,"translate"),h(2,jt,1,1)),i&2){let e=b(2);g(" ",s(1,2,"form.button_remove")," "),t(2),_(e.toDelete.length>0?2:-1)}}function qt(i,c){i&1&&d(0,"i",27)}function Qt(i,c){if(i&1){let e=I();n(0,"button",26),f("click",function(){y(e);let p=b();return k(p.cleanBridges())}),h(1,Gt,3,4),h(2,qt,1,0,"i",27),r()}if(i&2){let e=b();m("disabled",!e.toDelete.length||e.clicked),t(),_(e.clicked?-1:1),t(),_(e.clicked?2:-1)}}var je=(()=>{class i{$activeModal=x(R);$api=x(D);$router=x(O);$toastr=x(P);$translate=x(A);clicked=!1;pairings=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return S(this,null,function*(){try{this.pairings=(yield B(this.$api.get("/server/pairings"))).filter(e=>e._category==="bridge"&&!e._main).sort((e,a)=>e.name.localeCompare(a.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(a=>a!==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(a){return new(a||i)};static \u0275cmp=$({type:i,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(a,p){a&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),l(3),o(4,"translate"),r(),n(5,"button",3),o(6,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),r()(),n(7,"div",4),h(8,zt,5,3),h(9,Ht,15,9),r(),n(10,"div",5)(11,"div",6),h(12,Wt,3,4,"button",7),r(),n(13,"div",8),h(14,Kt,3,3,"button",9),r(),n(15,"div",10),h(16,Qt,3,3,"button",11),r()()()),a&2&&(t(3),u(s(4,8,"reset.bridge_accessories.title")),t(2),m("disabled",p.clicked),v("aria-label",s(6,10,"form.button_close")),t(3),_(p.pairings.length===0?8:-1),t(),_(p.pairings.length>0?9:-1),t(3),_(p.pairings.length>0?12:-1),t(2),_(p.pairings.length===0?14:-1),t(2),_(p.pairings.length>0?16:-1))},dependencies:[U,F],encapsulation:2})}return i})();function Jt(i,c){i&1&&(l(0),o(1,"translate")),i&2&&g(" ",s(1,1,"form.button_reset")," ")}function Xt(i,c){i&1&&d(0,"i",16)}var Ge=(()=>{class i{$activeModal=x(R);$api=x(D);$route=x(O);$toastr=x(P);$translate=x(A);clicked;constructor(){}onResetHomebridgeAccessoryClick(){return this.clicked=!0,this.$api.put("/server/reset-homebridge-accessory",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_reset"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$route.navigate(["/restart"])},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=$({type:i,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(a,p){a&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),l(3),o(4,"translate"),r(),n(5,"button",3),o(6,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),r()(),n(7,"div",4)(8,"div",5),d(9,"i",6),r(),n(10,"ul",7)(11,"li"),l(12),o(13,"translate"),r(),n(14,"li"),l(15),o(16,"translate"),r(),n(17,"li"),l(18),o(19,"translate"),r(),n(20,"li"),l(21),o(22,"translate"),r()(),n(23,"ngb-alert",8)(24,"p",9),l(25),o(26,"translate"),r()()(),n(27,"div",10)(28,"div",11)(29,"button",12),o(30,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),l(31),o(32,"translate"),r()(),d(33,"div",13),n(34,"div",14)(35,"button",15),f("click",function(){return p.onResetHomebridgeAccessoryClick()}),h(36,Jt,2,3),h(37,Xt,1,0,"i",16),r()()()()),a&2&&(t(3),u(s(4,15,"reset.bridge_all.title")),t(2),m("disabled",p.clicked),v("aria-label",s(6,17,"form.button_close")),t(7),u(s(13,19,"reset.bridge_all.list_1")),t(3),u(s(16,21,"reset.bridge_all.list_2")),t(3),u(s(19,23,"reset.bridge_all.list_3")),t(3),u(s(22,25,"reset.bridge_all.list_4")),t(2),m("dismissible",!1),t(2),u(s(26,27,"reset.action_is_irreversible")),t(4),m("disabled",p.clicked),v("aria-label",s(30,29,"form.button_close")),t(2),g(" ",s(32,31,"form.button_close")," "),t(4),m("disabled",p.clicked),t(),_(p.clicked?-1:36),t(),_(p.clicked?37:-1))},dependencies:[ae,F],encapsulation:2})}return i})();var ce=(i,c)=>({"green-text":i,"grey-text":c}),me=(i,c)=>({"btn-danger":i,"btn-elegant":c}),qe=(i,c,e)=>({"fa-refresh":i,"fa-undo":c,"fa-spinner fa-pulse":e}),Yt=(i,c,e)=>({"fa-trash":i,"fa-undo":c,"fa-spinner fa-pulse":e});function Zt(i,c){i&1&&(n(0,"div",12),d(1,"i",13),r(),n(2,"p",14),l(3),o(4,"translate"),r()),i&2&&(t(3),u(s(4,1,"reset.bridges.empty")))}function ei(i,c){if(i&1){let e=I();n(0,"li",20)(1,"span"),l(2),d(3,"br"),n(4,"small",21),d(5,"i",22),l(6),o(7,"translate"),n(8,"span",23),l(9),r(),l(10),o(11,"titlecase"),r()(),n(12,"button",24),o(13,"translate"),f("click",function(){let p=y(e).$implicit,C=b(3);return k(C.toggleList(p._id,!1))}),d(14,"i",25),r()()}if(i&2){let e=c.$implicit,a=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",T(15,ce,e._isPaired,!e._isPaired)),t(),g(" ",s(7,9,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),g(" \xB7 ",e._main?"Homebridge":s(11,11,e._category)," "),t(2),m("disabled",a.clicked)("ngClass",T(18,me,!a.isInList(e._id),a.isInList(e._id))),v("aria-label",s(13,13,"form.button_unpair")),t(2),m("ngClass",G(21,qe,!a.isInList(e._id),a.isInList(e._id)&&!a.clicked,a.isInList(e._id)&&a.clicked))}}function ti(i,c){if(i&1&&(n(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),o(4,"translate"),r(),n(5,"p",19),l(6),o(7,"translate"),r()(),V(8,ei,15,25,"li",20,M),r()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_non_child")),t(3),u(s(7,4,"reset.bridge_ind.desc_non_child")),t(2),N(e.pairingsNonChild)}}function ii(i,c){if(i&1){let e=I();n(0,"li",20)(1,"span"),l(2),d(3,"br"),n(4,"small",21),d(5,"i",22),l(6),o(7,"translate"),n(8,"span",23),l(9),r()()(),n(10,"button",24),o(11,"translate"),f("click",function(){let p=y(e).$implicit,C=b(3);return k(C.toggleList(p._id,!0))}),d(12,"i",25),r()()}if(i&2){let e=c.$implicit,a=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",T(12,ce,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",a.clicked)("ngClass",T(15,me,!a.isInList(e._id),a.isInList(e._id))),v("aria-label",s(11,10,"form.button_unpair")),t(2),m("ngClass",G(18,qe,!a.isInList(e._id),a.isInList(e._id)&&!a.clicked,a.isInList(e._id)&&a.clicked))}}function ni(i,c){if(i&1&&(n(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),o(4,"translate"),r(),n(5,"p",19),l(6),o(7,"translate"),r()(),V(8,ii,13,22,"li",20,M),r()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_child_active")),t(3),u(s(7,4,"reset.bridge_ind.desc_child_active")),t(2),N(e.pairingsChildActive)}}function ai(i,c){if(i&1){let e=I();n(0,"li",20)(1,"span"),l(2),d(3,"br"),n(4,"small",21),d(5,"i",22),l(6),o(7,"translate"),n(8,"span",23),l(9),r()()(),n(10,"button",24),o(11,"translate"),f("click",function(){let p=y(e).$implicit,C=b(3);return k(C.toggleList(p._id,!1))}),d(12,"i",25),r()()}if(i&2){let e=c.$implicit,a=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",T(12,ce,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",a.clicked)("ngClass",T(15,me,!a.isInList(e._id),a.isInList(e._id))),v("aria-label",s(11,10,"form.button_unpair")),t(2),m("ngClass",G(18,Yt,!a.isInList(e._id),a.isInList(e._id)&&!a.clicked,a.isInList(e._id)&&a.clicked))}}function ri(i,c){if(i&1&&(n(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),o(4,"translate"),r(),n(5,"p",19),l(6),o(7,"translate"),r()(),V(8,ai,13,22,"li",20,M),r()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_child_stale")),t(3),u(s(7,4,"reset.bridge_ind.desc_child_stale")),t(2),N(e.pairingsChildStale)}}function oi(i,c){if(i&1&&(n(0,"div",12),d(1,"i",15),r(),h(2,ti,10,6,"ul",16),h(3,ni,10,6,"ul",16),h(4,ri,10,6,"ul",16)),i&2){let e=b();t(2),_(e.pairingsNonChild.length>0?2:-1),t(),_(e.pairingsChildActive.length>0?3:-1),t(),_(e.pairingsChildStale.length>0?4:-1)}}function si(i,c){if(i&1){let e=I();n(0,"button",26),f("click",function(){y(e);let p=b();return k(p.$activeModal.dismiss("Dismiss"))}),l(1),o(2,"translate"),r()}if(i&2){let e=b();m("disabled",e.clicked),t(),g(" ",s(2,2,"form.button_close")," ")}}function li(i,c){if(i&1){let e=I();n(0,"button",27),f("click",function(){y(e);let p=b();return k(p.$activeModal.dismiss("Dismiss"))}),l(1),o(2,"translate"),r()}i&2&&(t(),g(" ",s(2,1,"form.button_close")," "))}function pi(i,c){if(i&1&&l(0),i&2){let e=b(3);g(" (",e.toDelete.length,") ")}}function di(i,c){if(i&1&&(l(0),o(1,"translate"),h(2,pi,1,1)),i&2){let e=b(2);g(" ",s(1,2,"form.button_reset")," "),t(2),_(e.toDelete.length>0?2:-1)}}function ci(i,c){i&1&&d(0,"i",29)}function mi(i,c){if(i&1){let e=I();n(0,"button",28),f("click",function(){y(e);let p=b();return k(p.removeBridges())}),h(1,di,3,4),h(2,ci,1,0,"i",29),r()}if(i&2){let e=b();m("disabled",!e.toDelete.length||e.clicked),t(),_(e.clicked?-1:1),t(),_(e.clicked?2:-1)}}var Qe=(()=>{class i{$activeModal=x(R);$api=x(D);$router=x(O);$toastr=x(P);$translate=x(A);clicked=!1;pairingsNonChild=[];pairingsChildActive=[];pairingsChildStale=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return S(this,null,function*(){try{let e=(yield B(this.$api.get("/server/pairings"))).filter(a=>!a._main).sort((a,p)=>a.name.localeCompare(p.name));this.pairingsChildActive=e.filter(a=>a._category==="bridge"&&!a._couldBeStale),this.pairingsNonChild=e.filter(a=>a._category!=="bridge"),this.pairingsChildStale=e.filter(a=>a._category==="bridge"&&a._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,a=!1){this.toDelete.some(p=>p.id===e)?this.toDelete=this.toDelete.filter(p=>p.id!==e):this.toDelete.push({id:e,resetPairingInfo:a})}isInList(e){return this.toDelete.some(a=>a.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(a){return new(a||i)};static \u0275cmp=$({type:i,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(a,p){a&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),l(3),o(4,"translate"),r(),n(5,"button",3),o(6,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),r()(),n(7,"div",4),h(8,Zt,5,3),h(9,oi,5,3),r(),n(10,"div",5)(11,"div",6),h(12,si,3,4,"button",7),r(),n(13,"div",8),h(14,li,3,3,"button",9),r(),n(15,"div",10),h(16,mi,3,3,"button",11),r()()()),a&2&&(t(3),u(s(4,8,"reset.bridge_ind.title")),t(2),m("disabled",p.clicked),v("aria-label",s(6,10,"form.button_close")),t(3),_(p.pairingsChildActive.length===0&&p.pairingsChildStale.length===0&&p.pairingsNonChild.length===0?8:-1),t(),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?9:-1),t(3),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?12:-1),t(2),_(p.pairingsChildActive.length===0&&p.pairingsChildStale.length===0&&p.pairingsNonChild.length===0?14:-1),t(2),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?16:-1))},dependencies:[U,q,F],encapsulation:2})}return i})();function ui(i,c){if(i&1){let e=I();n(0,"li",10)(1,"span")(2,"label",17)(3,"input",18),fe("ngModelChange",function(p){let C=y(e).$implicit;return ve(C.selected,p)||(C.selected=p),k(p)}),f("ngModelChange",function(){y(e);let p=b();return k(p.onAdapterSelectionChange())}),r(),n(4,"span"),l(5),r(),d(6,"span",19),r()(),n(7,"span",20),l(8),r()()}if(i&2){let e=c.$implicit;t(2),m("for","adapter"+e.iface),t(),m("id","adapter"+e.iface),be("ngModel",e.selected),t(2),u(e.iface),t(3),u(e.ip4||e.ip6)}}var Je=(()=>{class i{$activeModal=x(R);adaptersAvailable=[];adaptersOriginal=[];isUnchanged=!0;constructor(){}ngOnInit(){this.adaptersOriginal=this.adaptersAvailable.filter(e=>e.selected).map(e=>e.iface)}onAdapterSelectionChange(){this.isUnchanged=this.adaptersOriginal.length===this.adaptersAvailable.filter(e=>e.selected).length&&this.adaptersOriginal.every(e=>this.adaptersAvailable.some(a=>a.iface===e&&a.selected))}submit(){this.$activeModal.close(this.adaptersAvailable.filter(e=>e.selected).map(e=>e.iface))}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=$({type:i,selectors:[["ng-component"]],inputs:{adaptersAvailable:"adaptersAvailable"},decls:35,vars:25,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","disabled"],[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(a,p){a&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),l(3),o(4,"translate"),r(),n(5,"button",3),o(6,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),r()(),n(7,"div",4)(8,"div",5),d(9,"i",6),r(),n(10,"ul",7)(11,"li"),l(12),o(13,"translate"),r()(),n(14,"ul",8)(15,"li",9)(16,"strong"),l(17),o(18,"translate"),r(),n(19,"strong"),l(20),o(21,"translate"),r()(),V(22,ui,9,5,"li",10,M),r()(),n(24,"div",11)(25,"div",12)(26,"button",13),o(27,"translate"),f("click",function(){return p.$activeModal.dismiss("Dismiss")}),l(28),o(29,"translate"),r()(),d(30,"div",14),n(31,"div",15)(32,"button",16),f("click",function(){return p.submit()}),l(33),o(34,"translate"),r()()()()),a&2&&(t(3),u(s(4,9,"settings.network.title_network_interfaces")),t(2),v("aria-label",s(6,11,"form.button_close")),t(7),u(s(13,13,"settings.network.message_network_interface")),t(5),u(s(18,15,"settings.network.label_interface_name")),t(3),u(s(21,17,"settings.network.label_ip_address")),t(2),N(p.adaptersAvailable),t(4),v("aria-label",s(27,19,"form.button_close")),t(2),g(" ",s(29,21,"form.button_close")," "),t(4),m("disabled",p.isUnchanged),t(),g(" ",s(34,23,"form.button_save")," "))},dependencies:[X,Q,J,we,F],encapsulation:2})}return i})();var hi=["wallpaperInput"],_i=i=>({maxFileSizeText:i});function gi(i,c){if(i&1){let e=I();n(0,"div",10),d(1,"img",20),n(2,"button",21),o(3,"translate"),f("click",function(){y(e);let p=b();return k(p.clearWallpaper())}),d(4,"i",22),r()()}if(i&2){let e=b();t(),m("src",e.wallpaperUrl,ue),t(),v("aria-label",s(3,2,"form.button_delete"))}}function bi(i,c){i&1&&d(0,"div",11)}var Xe=(()=>{class i{$activeModal=x(R);$api=x(D);$modal=x(K);$settings=x(Z);$toastr=x(P);$translate=x(A);clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;wallpaperUrl=null;originalWallpaperUrl=null;wallpaperInput;constructor(){}ngOnInit(){this.$settings.env.customWallpaperHash&&(this.wallpaperUrl=`${Me.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`,this.originalWallpaperUrl=this.wallpaperUrl)}onFileChange(e){if(e.length){this.selectedFile=e[0];let a=new FileReader;a.onload=p=>{this.wallpaperUrl=p.target.result},a.readAsDataURL(this.selectedFile)}else delete this.selectedFile,this.wallpaperUrl=this.originalWallpaperUrl}saveWallpaper(){if(this.clicked=!0,this.selectedFile){let e=new FormData;e.append("wallpaper",this.selectedFile,this.selectedFile.name),this.$api.post("/server/wallpaper",e).subscribe({next:()=>{this.$settings.setItem("wallpaper",`ui-wallpaper.${this.selectedFile.name.split(".").pop()}`),this.$activeModal.close(),this.$toastr.success(this.$translate.instant("settings.display.wallpaper_success"),this.$translate.instant("toast.title_success"))},error:a=>{console.error(a),this.$toastr.error(a.error?.message,this.$translate.instant("toast.title_error")),this.clicked=!1}})}else this.$api.delete("/server/wallpaper").subscribe({next:()=>{this.$activeModal.close()},error:e=>{console.error(e),this.$toastr.error(e.error?.message,this.$translate.instant("toast.title_error")),this.clicked=!1}})}clearWallpaper(){this.selectedFile=null,this.wallpaperUrl=this.wallpaperUrl===this.originalWallpaperUrl?null:this.originalWallpaperUrl,this.wallpaperInput.nativeElement.value=""}cancel(){this.$activeModal.dismiss()}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=$({type:i,selectors:[["ng-component"]],viewQuery:function(a,p){if(a&1&&he(hi,5),a&2){let C;_e(C=ge())&&(p.wallpaperInput=C.first)}},decls:36,vars:28,consts:[["wallpaperInput",""],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-image","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"mb-3","text-center"],[1,"position-relative","d-inline-block"],[1,"gradient","anim","rounded",2,"height","200px","width","350px","margin","0 auto"],[1,"mb-0"],["type","file","id","wallpaper","accept","image/*",1,"form-control",3,"change"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],["alt","Current Wallpaper",1,"img-fluid","rounded","mx-auto","d-block",2,"height","200px",3,"src"],[1,"btn","btn-danger","position-absolute",2,"top","10px","right","10px",3,"click"],[1,"fas","fa-fw","fa-trash"]],template:function(a,p){if(a&1){let C=I();n(0,"div",1)(1,"div",2)(2,"h5",3),l(3),o(4,"translate"),r(),n(5,"button",4),o(6,"translate"),f("click",function(){return y(C),k(p.$activeModal.dismiss("Dismiss"))}),r()(),n(7,"div",5)(8,"div",6),d(9,"i",7),r(),n(10,"ul",8)(11,"li"),l(12),o(13,"translate"),r(),n(14,"li"),l(15),o(16,"translate"),r(),n(17,"li"),l(18),o(19,"translate"),r()(),n(20,"div",9),h(21,gi,5,4,"div",10)(22,bi,1,0,"div",11),r(),n(23,"div",12)(24,"input",13,0),f("change",function(Ye){return y(C),k(p.onFileChange(Ye.target.files))}),r()()(),n(26,"div",14)(27,"div",15)(28,"button",16),f("click",function(){return y(C),k(p.cancel())}),l(29),o(30,"translate"),r()(),d(31,"div",17),n(32,"div",18)(33,"button",19),f("click",function(){return y(C),k(p.saveWallpaper())}),l(34),o(35,"translate"),r()()()()}a&2&&(t(3),u(s(4,11,"settings.display.wallpaper")),t(2),m("disabled",p.clicked),v("aria-label",s(6,13,"form.button_close")),t(7),u(s(13,15,"settings.display.wallpaper_intro")),t(3),u(z(16,17,"settings.display.wallpaper_rule",L(26,_i,p.maxFileSizeText))),t(3),u(s(19,20,"settings.display.wallpaper_rule2")),t(3),_(p.wallpaperUrl?21:22),t(7),m("disabled",p.clicked),t(),g(" ",s(30,22,"form.button_close")," "),t(4),m("disabled",p.wallpaperUrl===p.originalWallpaperUrl||p.clicked),t(),g(" ",s(35,24,"form.button_save")," "))},dependencies:[Y,F],styles:[".anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}"]})}return i})();var j=(i,c)=>({"fa-chevron-down":i,"fa-chevron-right":c}),ee=i=>({"is-invalid":i}),vi=i=>({link:i}),fi=(i,c)=>({"badge-danger":i,"badge-info":c});function Ci(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function xi(i,c){if(i&1){let e=I();n(0,"ul",5)(1,"li",14)(2,"span"),l(3),o(4,"translate"),r(),n(5,"div",15),d(6,"input",16),o(7,"translate"),h(8,Ci,1,1,"i",17),r()(),n(9,"li",18)(10,"span",19),l(11),o(12,"translate"),r(),n(13,"button",20),o(14,"translate"),f("click",function(){y(e);let p=b();return k(p.openBackupModal())}),d(15,"i",21),r()(),n(16,"li",18)(17,"span",19),l(18),o(19,"translate"),r(),n(20,"a",22),o(21,"translate"),d(22,"i",21),r()()()}if(i&2){let e=b();t(3),u(s(4,9,"settings.name")),t(3),m("formControl",e.hbNameFormControl)("ngClass",L(21,ee,e.hbNameIsInvalid)),v("aria-label",s(7,11,"settings.name")),t(2),_(e.hbNameIsSaving?8:-1),t(3),g(" ",s(12,13,"backup.title_backup")," "),t(2),v("aria-label",s(14,15,"backup.title_backup")),t(5),g(" ",s(19,17,"menu.tooltip_user_accounts")," "),t(2),v("aria-label",s(21,19,"menu.tooltip_user_accounts"))}}function Si(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function yi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function ki(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Ii(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function wi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Ei(i,c){if(i&1){let e=I();n(0,"ul",6)(1,"li",14),l(2),o(3,"translate"),n(4,"div",23)(5,"select",24)(6,"option",25),l(7),o(8,"translate"),r(),n(9,"option",26),l(10,"Bulgarian (bg)"),r(),n(11,"option",27),l(12,"Catalan (ca)"),r(),n(13,"option",28),l(14,"Chinese - Simplified (zh-CN)"),r(),n(15,"option",29),l(16,"Chinese - Traditional (zh-TW)"),r(),n(17,"option",30),l(18,"Czech (cs)"),r(),n(19,"option",31),l(20,"Dutch (nl)"),r(),n(21,"option",32),l(22,"English (en)"),r(),n(23,"option",33),l(24,"Finnish (fi)"),r(),n(25,"option",34),l(26,"French (fr)"),r(),n(27,"option",35),l(28,"German (de)"),r(),n(29,"option",36),l(30,"Hebrew (he)"),r(),n(31,"option",37),l(32,"Hungarian (hu)"),r(),n(33,"option",38),l(34,"Indonesian (id)"),r(),n(35,"option",39),l(36,"Italian (it)"),r(),n(37,"option",40),l(38,"Japanese (ja)"),r(),n(39,"option",41),l(40,"Korean (ko)"),r(),n(41,"option",42),l(42,"Macedonian (mk)"),r(),n(43,"option",43),l(44,"Norwegian (no)"),r(),n(45,"option",44),l(46,"Polish (pl)"),r(),n(47,"option",45),l(48,"Portuguese (Brazil)"),r(),n(49,"option",46),l(50,"Portuguese (Portugal)"),r(),n(51,"option",47),l(52,"Russian (ru)"),r(),n(53,"option",48),l(54,"Slovenian (sl)"),r(),n(55,"option",49),l(56,"Spanish (es)"),r(),n(57,"option",50),l(58,"Swedish (sv)"),r(),n(59,"option",51),l(60,"Thai (th)"),r(),n(61,"option",52),l(62,"Turkish (tr)"),r(),n(63,"option",53),l(64,"Ukrainian (uk)"),r()(),h(65,Si,1,1,"i",17),r()(),n(66,"li",14),l(67),o(68,"translate"),n(69,"div",23)(70,"select",24)(71,"option",54),l(72),o(73,"translate"),r(),n(74,"option",55),l(75),o(76,"translate"),r(),n(77,"option",56),l(78),o(79,"translate"),r(),n(80,"option",57),l(81),o(82,"translate"),r(),n(83,"option",58),l(84),o(85,"translate"),r(),n(86,"option",59),l(87),o(88,"translate"),r(),n(89,"option",60),l(90),o(91,"translate"),r(),n(92,"option",61),l(93),o(94,"translate"),r(),n(95,"option",62),l(96),o(97,"translate"),r(),n(98,"option",63),l(99),o(100,"translate"),r(),n(101,"option",64),l(102),o(103,"translate"),r(),n(104,"option",65),l(105),o(106,"translate"),r(),n(107,"option",66),l(108),o(109,"translate"),r()(),h(110,yi,1,1,"i",17),r()(),n(111,"li",14),l(112),o(113,"translate"),n(114,"div",23)(115,"select",24)(116,"option",25),l(117),o(118,"translate"),r(),n(119,"option",67),l(120),o(121,"translate"),r(),n(122,"option",68),l(123),o(124,"translate"),r()(),h(125,ki,1,1,"i",17),r()(),n(126,"li",14),l(127),o(128,"translate"),n(129,"div",23)(130,"select",24)(131,"option",69),l(132),o(133,"translate"),r(),n(134,"option",70),l(135),o(136,"translate"),r()(),h(137,Ii,1,1,"i",17),r()(),n(138,"li",14),l(139),o(140,"translate"),n(141,"div",23)(142,"select",24)(143,"option",71),l(144),o(145,"translate"),r(),n(146,"option",72),l(147),o(148,"translate"),r()(),h(149,wi,1,1,"i",17),r()(),n(150,"li",18)(151,"span",19),l(152),o(153,"translate"),r(),n(154,"button",20),o(155,"translate"),f("click",function(){y(e);let p=b();return k(p.openWallpaperModal())}),d(156,"i",21),r()()()}if(i&2){let e=b();t(2),g(" ",s(3,38,"settings.display.lang")," "),t(3),m("formControl",e.uiLangFormControl),t(2),u(s(8,40,"form.select.auto")),t(58),_(e.uiLangIsSaving?65:-1),t(2),g(" ",s(68,42,"settings.display.theme")," "),t(3),m("formControl",e.uiThemeFormControl),t(2),u(s(73,44,"settings.display.orange")),t(3),u(s(76,46,"settings.display.red")),t(3),u(s(79,48,"settings.display.pink")),t(3),u(s(82,50,"settings.display.purple")),t(3),u(s(85,52,"settings.display.deep_purple")),t(3),u(s(88,54,"settings.display.indigo")),t(3),u(s(91,56,"settings.display.blue")),t(3),u(s(94,58,"settings.display.bluegrey")),t(3),u(s(97,60,"settings.display.cyan")),t(3),u(s(100,62,"settings.display.green")),t(3),u(s(103,64,"settings.display.teal")),t(3),u(s(106,66,"settings.display.grey")),t(3),u(s(109,68,"settings.display.brown")),t(2),_(e.uiThemeIsSaving?110:-1),t(2),g(" ",s(113,70,"settings.display.lighting_mode")," "),t(3),m("formControl",e.uiLightFormControl),t(2),u(s(118,72,"form.select.auto")),t(3),u(s(121,74,"settings.display.light")),t(3),u(s(124,76,"settings.display.dark")),t(2),_(e.uiLightIsSaving?125:-1),t(2),g(" ",s(128,78,"settings.display.menu_mode")," "),t(3),m("formControl",e.uiMenuFormControl),t(2),u(s(133,80,"settings.display.menu_default")),t(3),u(s(136,82,"settings.display.menu_freeze")),t(2),_(e.uiMenuIsSaving?137:-1),t(2),g(" ",s(140,84,"settings.display.temp_units")," "),t(3),m("formControl",e.uiTempFormControl),t(2),u(s(145,86,"settings.display.temp_units.c")),t(3),u(s(148,88,"settings.display.temp_units.f")),t(2),_(e.uiTempIsSaving?149:-1),t(3),u(s(153,90,"settings.display.wallpaper")),t(2),v("aria-label",s(155,92,"settings.display.wallpaper"))}}function Bi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Ti(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function $i(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Fi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Ri(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Ai(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Pi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Di(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Mi(i,c){if(i&1&&(n(0,"li",14)(1,"span"),l(2),o(3,"translate"),d(4,"br"),n(5,"small",73),l(6),o(7,"translate"),r()(),n(8,"div",23),d(9,"input",92),o(10,"translate"),h(11,Di,1,1,"i",17),r()()),i&2){let e=b(3);t(2),g(" ",s(3,5,"settings.linux.temp")),t(4),u(s(7,7,"settings.linux.temp_desc")),t(3),m("formControl",e.uiTempFileFormControl),v("aria-label",s(10,9,"settings.linux.temp")),t(2),_(e.uiTempFileIsSaving?11:-1)}}function Vi(i,c){if(i&1&&(n(0,"li",14)(1,"span"),l(2),o(3,"translate"),d(4,"br"),n(5,"small",73),l(6),o(7,"translate"),r()(),n(8,"div",23),d(9,"input",90),o(10,"translate"),h(11,Ai,1,1,"i",17),r()(),n(12,"li",14)(13,"span"),l(14),o(15,"translate"),d(16,"br"),n(17,"small",73),l(18),o(19,"translate"),r()(),n(20,"div",23),d(21,"input",91),o(22,"translate"),h(23,Pi,1,1,"i",17),r()(),h(24,Mi,12,11,"li",14)),i&2){let e=b(2);t(2),g(" ",s(3,11,"settings.linux.shutdown")),t(4),u(s(7,13,"settings.linux.shutdown_desc")),t(3),m("formControl",e.hbLinuxShutdownFormControl),v("aria-label",s(10,15,"settings.linux.shutdown")),t(2),_(e.hbLinuxShutdownIsSaving?11:-1),t(3),g(" ",s(15,17,"settings.linux.restart")),t(4),u(s(19,19,"settings.linux.restart_desc")),t(3),m("formControl",e.hbLinuxRestartFormControl),v("aria-label",s(22,21,"settings.linux.restart")),t(2),_(e.hbLinuxRestartIsSaving?23:-1),t(),_(e.$settings.env.runningOnRaspberryPi?24:-1)}}function Ni(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Li(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Oi(i,c){i&1&&(n(0,"li",18)(1,"span"),l(2),o(3,"translate"),d(4,"br"),n(5,"small",73),l(6),o(7,"translate"),r()(),n(8,"a",93),o(9,"translate"),d(10,"i",21),r()()),i&2&&(t(2),g(" ",s(3,3,"menu.docker.startup_script")),t(4),u(s(7,5,"platform.docker.script_help")),t(2),v("aria-label",s(9,7,"menu.docker.startup_script")))}function zi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Ui(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Hi(i,c){if(i&1&&(n(0,"li",14)(1,"span"),l(2),o(3,"translate"),d(4,"br"),n(5,"small",73),l(6),o(7,"translate"),r()(),n(8,"div",23),d(9,"input",94),o(10,"translate"),h(11,Ui,1,1,"i",17),r()()),i&2){let e=b(2);t(2),g(" ",s(3,6,"settings.startup.log_truncate")),t(4),u(s(7,8,"settings.startup.log_truncate_desc")),t(3),m("formControl",e.hbLogTruncateFormControl)("ngClass",L(12,ee,e.hbLogTruncateIsInvalid)),v("aria-label",s(10,10,"settings.startup.log_truncate")),t(2),_(e.hbLogTruncateIsSaving?11:-1)}}function Wi(i,c){if(i&1&&(n(0,"ul",7)(1,"li",18)(2,"span"),l(3),o(4,"translate"),n(5,"code"),l(6,"-D"),r(),d(7,"br"),n(8,"small",73),l(9),o(10,"translate"),r()(),n(11,"div",74)(12,"div",75),d(13,"input",76),o(14,"translate"),d(15,"label",77),r(),h(16,Bi,1,1,"i",17),r()(),n(17,"li",18)(18,"span"),l(19),o(20,"translate"),n(21,"code"),l(22,"-I"),r(),d(23,"br"),n(24,"small",73),l(25),o(26,"translate"),r()(),n(27,"div",74)(28,"div",75),d(29,"input",78),o(30,"translate"),d(31,"label",79),r(),h(32,Ti,1,1,"i",17),r()(),n(33,"li",18)(34,"span"),l(35),o(36,"translate"),n(37,"code"),l(38,"-K"),r(),d(39,"br"),n(40,"small",73),l(41),o(42,"translate"),r()(),n(43,"div",74)(44,"div",75),d(45,"input",80),o(46,"translate"),d(47,"label",81),r(),h(48,$i,1,1,"i",17),r()(),n(49,"li",18)(50,"span"),l(51),o(52,"translate"),d(53,"br"),n(54,"small",73),l(55),o(56,"translate"),r()(),n(57,"div",74)(58,"div",75),d(59,"input",82),o(60,"translate"),d(61,"label",83),r(),h(62,Fi,1,1,"i",17),r()(),n(63,"li",14)(64,"span"),l(65),o(66,"translate"),d(67,"br"),n(68,"small",73),l(69),o(70,"translate"),r()(),n(71,"div",23),d(72,"input",84),o(73,"translate"),h(74,Ri,1,1,"i",17),r()(),h(75,Vi,25,23),n(76,"li",14)(77,"span")(78,"span",85),l(79,"DEBUG"),r(),d(80,"br")(81,"small",86),o(82,"translate"),r(),n(83,"div",23),d(84,"input",87),h(85,Ni,1,1,"i",17),r()(),n(86,"li",14)(87,"span")(88,"span",85),l(89,"NODE_OPTIONS"),r(),d(90,"br"),n(91,"small",73),l(92),o(93,"translate"),r()(),n(94,"div",23),d(95,"input",88),h(96,Li,1,1,"i",17),r()(),h(97,Oi,11,9,"li",18),n(98,"li",14)(99,"span"),l(100),o(101,"translate"),d(102,"br"),n(103,"small",73),l(104),o(105,"translate"),r()(),n(106,"div",23),d(107,"input",89),o(108,"translate"),h(109,zi,1,1,"i",17),r()(),h(110,Hi,12,14,"li",14),r()),i&2){let e=b();t(3),g(" ",s(4,40,"settings.startup.debug")," "),t(6),g(" ",s(10,42,e.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),t(4),m("formControl",e.hbDebugFormControl),v("aria-label",s(14,44,"settings.startup.debug")),t(3),_(e.hbDebugIsSaving?16:-1),t(3),g(" ",s(20,46,"settings.startup.insecure")," "),t(6),u(s(26,48,"settings.startup.insecure_desc")),t(4),m("formControl",e.hbInsecureFormControl),v("aria-label",s(30,50,"settings.startup.insecure")),t(3),_(e.hbInsecureIsSaving?32:-1),t(3),g(" ",s(36,52,"settings.startup.keep_accessories")," "),t(6),u(s(42,54,"settings.startup.keep_accessories_desc")),t(4),m("formControl",e.hbKeepFormControl),v("aria-label",s(46,56,"settings.startup.keep_accessories")),t(3),_(e.hbKeepIsSaving?48:-1),t(3),g(" ",s(52,58,"settings.startup.metrics")),t(4),u(s(56,60,"settings.startup.metrics_desc")),t(4),m("formControl",e.uiMetricsFormControl),v("aria-label",s(60,62,"settings.startup.metrics")),t(3),_(e.uiMetricsIsSaving?62:-1),t(3),g(" ",s(66,64,"settings.network.hb_package")),t(4),u(s(70,66,"settings.network.hb_package_desc")),t(3),m("formControl",e.hbPackageFormControl),v("aria-label",s(73,68,"settings.network.hb_package")),t(2),_(e.hbPackageIsSaving?74:-1),t(),_(e.$settings.env.platform==="linux"?75:-1),t(6),m("innerHTML",z(82,70,"settings.service.debug_tooltip",L(81,vi,e.linkDebug)),se),t(3),m("formControl",e.hbEnvDebugFormControl),t(),_(e.hbEnvDebugIsSaving?85:-1),t(7),u(s(93,73,"settings.service.node_tooltip")),t(3),m("formControl",e.hbEnvNodeFormControl),t(),_(e.hbEnvNodeIsSaving?96:-1),t(),_(e.$settings.env.runningInDocker?97:-1),t(3),g(" ",s(101,75,"settings.startup.log_max")),t(4),u(s(105,77,"settings.startup.log_max_desc")),t(3),m("formControl",e.hbLogSizeFormControl)("ngClass",L(83,ee,e.hbLogSizeIsInvalid)),v("aria-label",s(108,79,"settings.startup.log_max")),t(2),_(e.hbLogSizeIsSaving?109:-1),t(),_(e.hbLogSizeFormControl.value>0?110:-1)}}function Ki(i,c){i&1&&d(0,"i",107)}function ji(i,c){if(i&1&&(n(0,"span",96),h(1,Ki,1,0,"i",107),l(2),n(3,"span",108),l(4),o(5,"translate"),r()()),i&2){let e=c.$implicit;m("ngClass",T(6,fi,e.missing,!e.missing)),t(),_(e.missing?1:-1),t(),g(" ",e.iface,": "),t(2),u(e.missing?s(5,4,"settings.mdns_advertiser_not_connected"):e.ip4||e.ip6)}}function Gi(i,c){i&1&&(n(0,"option",98),l(1),o(2,"translate"),r()),i&2&&(t(),g("Avahi (",s(2,1,"settings.mdns_advertiser_rec"),")"))}function qi(i,c){i&1&&(n(0,"option",101),l(1),o(2,"translate"),r()),i&2&&(t(),g("systemd-resolved (",s(2,1,"settings.mdns_advertiser_exp"),")"))}function Qi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Ji(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Xi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Yi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function Zi(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function en(i,c){if(i&1){let e=I();n(0,"ul",8)(1,"li",18)(2,"span",19),l(3),o(4,"translate"),d(5,"br"),n(6,"div",95),l(7),o(8,"translate"),r(),V(9,ji,6,9,"span",96,M),r(),n(11,"button",97),o(12,"translate"),f("click",function(){y(e);let p=b();return k(p.selectNetworkInterfaces())}),d(13,"i",21),r()(),n(14,"li",14)(15,"span"),l(16),o(17,"translate"),d(18,"br"),n(19,"small",73),l(20),o(21,"translate"),r()(),n(22,"div",23)(23,"select",24),o(24,"translate"),h(25,Gi,3,3,"option",98),n(26,"option",99),l(27),o(28,"translate"),r(),n(29,"option",100),l(30,"Bonjour HAP"),r(),h(31,qi,3,3,"option",101),r(),h(32,Qi,1,1,"i",17),r()(),n(33,"li",14)(34,"span"),l(35),o(36,"translate"),d(37,"br"),n(38,"small",73),l(39),o(40,"translate"),r()(),n(41,"div",23),d(42,"input",102),o(43,"translate"),h(44,Ji,1,1,"i",17),r()(),n(45,"li",14)(46,"span"),l(47),o(48,"translate"),d(49,"br"),n(50,"small",73),l(51),o(52,"translate"),r()(),n(53,"div",23),d(54,"input",103),o(55,"translate"),h(56,Xi,1,1,"i",17),r()(),n(57,"li",14)(58,"span"),l(59),o(60,"translate"),d(61,"br")(62,"small",104),o(63,"translate"),r(),n(64,"div",23),d(65,"input",105),o(66,"translate"),h(67,Yi,1,1,"i",17),r()(),n(68,"li",14)(69,"span"),l(70),o(71,"translate"),d(72,"br"),n(73,"small",73),l(74),o(75,"translate"),r()(),n(76,"div",23),d(77,"input",106),o(78,"translate"),h(79,Zi,1,1,"i",17),r()()()}if(i&2){let e=b();t(3),g(" ",s(4,34,"settings.network.title_network_interfaces")),t(4),u(s(8,36,"settings.network.message_network_interface")),t(2),N(e.adaptersSelected),t(2),m("disabled",!e.adaptersAvailable.length),v("aria-label",s(12,38,"settings.network.title_network_interfaces")),t(5),g(" ",s(17,40,"settings.mdns_advertiser")),t(4),u(s(21,42,"settings.mdns_advertiser_help")),t(3),m("formControl",e.hbMDnsFormControl),v("aria-label",s(24,44,"settings.mdns_advertiser")),t(2),_(e.showAvahiMdnsOption?25:-1),t(2),g(" Ciao ",e.showAvahiMdnsOption?"":"("+s(28,46,"settings.mdns_advertiser_rec")+")"," "),t(4),_(e.showResolvedMdnsOption?31:-1),t(),_(e.hbMDnsIsSaving?32:-1),t(3),g(" ",s(36,48,"settings.network.port_hb")),t(4),u(s(40,50,"settings.network.port_hb_desc")),t(3),m("formControl",e.hbPortFormControl)("ngClass",L(72,ee,e.hbPortIsInvalid)),v("aria-label",s(43,52,"settings.network.port")),t(2),_(e.hbPortIsSaving?44:-1),t(3),g(" ",s(48,54,"settings.network.port_ui")),t(4),u(s(52,56,"settings.network.port_ui_desc")),t(3),m("formControl",e.uiPortFormControl)("ngClass",L(74,ee,e.uiPortIsInvalid)),v("aria-label",s(55,58,"settings.network.port_ui")),t(2),_(e.uiPortIsSaving?56:-1),t(3),g(" ",s(60,60,"settings.network.host")),t(3),m("innerHtml",s(63,62,"settings.network.host_desc"),se),t(3),m("formControl",e.uiHostFormControl),v("aria-label",s(66,64,"settings.network.host")),t(2),_(e.uiHostIsSaving?67:-1),t(3),g(" ",s(71,66,"settings.network.proxy")),t(4),u(s(75,68,"settings.network.proxy_desc")),t(3),m("formControl",e.uiProxyHostFormControl),v("aria-label",s(78,70,"settings.network.proxy")),t(2),_(e.uiProxyHostIsSaving?79:-1)}}function tn(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function nn(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function an(i,c){if(i&1&&(n(0,"li",14)(1,"span"),l(2),o(3,"translate"),d(4,"br"),n(5,"small",73),l(6),o(7,"translate"),r()(),n(8,"div",23),d(9,"input",114),o(10,"translate"),h(11,nn,1,1,"i",17),r()()),i&2){let e=b(2);t(2),g(" ",s(3,6,"settings.startup.session")),t(4),u(s(7,8,"settings.startup.session_desc")),t(3),m("formControl",e.uiSessionTimeoutFormControl)("ngClass",L(12,ee,e.uiSessionTimeoutIsInvalid)),v("aria-label",s(10,10,"settings.startup.session")),t(2),_(e.uiSessionTimeoutIsSaving?11:-1)}}function rn(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function on(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function sn(i,c){if(i&1&&(n(0,"li",14)(1,"span"),l(2),o(3,"translate"),r(),n(4,"div",23),d(5,"input",115),o(6,"translate"),h(7,rn,1,1,"i",17),r()(),n(8,"li",14)(9,"span"),l(10),o(11,"translate"),r(),n(12,"div",23),d(13,"input",116),o(14,"translate"),h(15,on,1,1,"i",17),r()()),i&2){let e=b(2);t(2),u(s(3,8,"settings.security.key")),t(3),m("formControl",e.uiSslKeyFormControl),v("aria-label",s(6,10,"settings.security.key")),t(2),_(e.uiSslKeyIsSaving?7:-1),t(3),u(s(11,12,"settings.security.cert")),t(3),m("formControl",e.uiSslCertFormControl),v("aria-label",s(14,14,"settings.security.cert")),t(2),_(e.uiSslCertIsSaving?15:-1)}}function ln(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function pn(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function dn(i,c){if(i&1){let e=I();n(0,"li",14)(1,"span"),l(2),o(3,"translate"),r(),n(4,"div",23),d(5,"input",117),o(6,"translate"),h(7,ln,1,1,"i",17),r()(),n(8,"li",14)(9,"span"),l(10),o(11,"translate"),r(),n(12,"div",23)(13,"input",118),o(14,"translate"),f("focus",function(){y(e);let p=b(2);return k(p.showPfxPassphrase=!0)})("blur",function(){y(e);let p=b(2);return k(p.showPfxPassphrase=!1)}),r(),h(15,pn,1,1,"i",17),r()()}if(i&2){let e=b(2);t(2),u(s(3,9,"settings.security.pfx")),t(3),m("formControl",e.uiSslPfxFormControl),v("aria-label",s(6,11,"settings.security.pfx")),t(2),_(e.uiSslPfxIsSaving?7:-1),t(3),u(s(11,13,"settings.security.pass")),t(3),m("type",e.showPfxPassphrase?"text":"password")("formControl",e.uiSslPassphraseFormControl),v("aria-label",s(14,15,"settings.security.pass")),t(2),_(e.uiSslPassphraseIsSaving?15:-1)}}function cn(i,c){if(i&1){let e=I();n(0,"ul",9)(1,"li",18)(2,"span"),l(3),o(4,"translate"),d(5,"br"),n(6,"small",73),l(7),o(8,"translate"),r()(),n(9,"div",74)(10,"div",75),d(11,"input",109),o(12,"translate"),d(13,"label",110),r(),h(14,tn,1,1,"i",17),r()(),h(15,an,12,14,"li",14),n(16,"li",14)(17,"span"),l(18),o(19,"translate"),d(20,"br"),n(21,"small",73),l(22),o(23,"translate"),r()(),n(24,"div",23)(25,"select",24),o(26,"translate"),n(27,"option",111),l(28),o(29,"translate"),r(),n(30,"option",112),l(31),o(32,"translate"),r(),n(33,"option",113),l(34),o(35,"translate"),r()()()(),h(36,sn,16,16),h(37,dn,16,17),n(38,"li",18)(39,"span",19),l(40),o(41,"translate"),d(42,"br"),n(43,"small",73),l(44),o(45,"translate"),r()(),n(46,"button",20),o(47,"translate"),f("click",function(){y(e);let p=b();return k(p.accessoryUiControl())}),d(48,"i",21),r()()()}if(i&2){let e=b();t(3),g(" ",s(4,18,"settings.security.auth")),t(4),g(" ",s(8,20,"settings.security.auth_desc")," "),t(4),m("formControl",e.uiAuthFormControl),v("aria-label",s(12,22,"settings.security.auth")),t(3),_(e.uiAuthIsSaving?14:-1),t(),_(e.uiAuthFormControl.value?15:-1),t(3),g(" ",s(19,24,"settings.security.https")),t(4),u(s(23,26,"settings.security.https_desc")),t(3),m("formControl",e.uiSslTypeFormControl),v("aria-label",s(26,28,"settings.security.https")),t(3),u(s(29,30,"accessories.control.off")),t(3),u(s(32,32,"settings.security.https_keycert")),t(3),u(s(35,34,"settings.security.https_pfx")),t(2),_(e.uiSslTypeFormControl.value==="keycert"?36:-1),t(),_(e.uiSslTypeFormControl.value==="pfx"?37:-1),t(3),g(" ",s(41,36,"settings.security.ui_control")),t(4),u(s(45,38,"settings.security.ui_control_desc")),t(2),v("aria-label",s(47,40,"settings.security.ui_control"))}}function mn(i,c){i&1&&(n(0,"p",10),l(1),o(2,"translate"),r()),i&2&&(t(),u(s(2,1,"settings.cache.desc")))}function un(i,c){i&1&&d(0,"i",17),i&2&&m("@fadeInOut",void 0)}function hn(i,c){if(i&1){let e=I();n(0,"ul",11)(1,"li",18)(2,"span"),l(3),o(4,"translate"),d(5,"br"),n(6,"small",73),l(7),o(8,"translate"),r()(),n(9,"div",74)(10,"div",75),d(11,"input",119),o(12,"translate"),d(13,"label",120),r(),h(14,un,1,1,"i",17),r()(),n(15,"li",18)(16,"span",19),l(17),o(18,"translate"),d(19,"br"),n(20,"small",73),l(21),o(22,"translate"),r()(),n(23,"button",20),o(24,"translate"),f("click",function(){y(e);let p=b();return k(p.removeSingleCachedAccessories())}),d(25,"i",21),r()(),n(26,"li",18)(27,"span",19),l(28),o(29,"translate"),d(30,"br"),n(31,"small",73),l(32),o(33,"translate"),r()(),n(34,"button",20),o(35,"translate"),f("click",function(){y(e);let p=b();return k(p.removeBridgeAccessories())}),d(36,"i",21),r()(),n(37,"li",18)(38,"span",19),l(39),o(40,"translate"),d(41,"br"),n(42,"small",73),l(43),o(44,"translate"),r()(),n(45,"button",20),o(46,"translate"),f("click",function(){y(e);let p=b();return k(p.removeAllCachedAccessories())}),d(47,"i",21),r()()()}if(i&2){let e=b();t(3),g(" ",s(4,14,"settings.accessory.debug")),t(4),u(s(8,16,"settings.accessory.debug_desc")),t(4),m("formControl",e.uiAccDebugFormControl),v("aria-label",s(12,18,"settings.accessory.debug")),t(3),_(e.uiAccDebugIsSaving?14:-1),t(3),g(" ",s(18,20,"reset.accessory_ind.title")),t(4),u(s(22,22,"reset.accessory_ind.desc")),t(2),v("aria-label",s(24,24,"reset.accessory_ind.title")),t(5),g(" ",s(29,26,"reset.bridge_accessories.title")),t(4),u(s(33,28,"reset.bridge_accessories.desc")),t(2),v("aria-label",s(35,30,"reset.accessory_all.title")),t(5),g(" ",s(40,32,"reset.accessory_all.title")),t(4),u(s(44,34,"reset.accessory_all.desc")),t(2),v("aria-label",s(46,36,"reset.accessory_all.title"))}}function _n(i,c){i&1&&(n(0,"p",10),l(1),o(2,"translate"),r()),i&2&&(t(),u(s(2,1,"reset.bridges.desc")))}function gn(i,c){if(i&1){let e=I();n(0,"ul",12)(1,"li",18)(2,"span",19),l(3),o(4,"translate"),d(5,"br"),n(6,"small",73),l(7),o(8,"translate"),r()(),n(9,"button",20),o(10,"translate"),f("click",function(){y(e);let p=b();return k(p.unpairAccessory())}),d(11,"i",21),r()(),n(12,"li",18)(13,"span",19),l(14),o(15,"translate"),o(16,"titlecase"),d(17,"br"),n(18,"small",73),l(19),o(20,"translate"),r()(),n(21,"button",20),o(22,"translate"),f("click",function(){y(e);let p=b();return k(p.resetHomebridgeState())}),d(23,"i",21),r()()()}i&2&&(t(3),g(" ",s(4,6,"reset.bridge_ind.title")),t(4),u(s(8,8,"reset.bridge_ind.desc")),t(2),v("aria-label",s(10,10,"reset.bridge_ind.title")),t(5),g(" ",s(16,14,s(15,12,"reset.bridge_all.title"))),t(5),u(s(20,16,"reset.bridge_all.desc")),t(2),v("aria-label",s(22,18,"reset.bridge_all.title")))}var Tr=(()=>{class i{$api=x(D);$modal=x(K);$router=x(O);$settings=x(Z);$toastr=x(P);$translate=x(A);restartToastIsShown=!1;showFields={general:!0,display:!0,startup:!0,network:!0,security:!0,reset:!0,cache:!0};isHbV2=!1;showAvahiMdnsOption=!1;showResolvedMdnsOption=!1;adaptersAvailable=[];adaptersSelected=[];showPfxPassphrase=!1;hbNameIsInvalid=!1;hbNameIsSaving=!1;hbNameFormControl=new E("");uiLangIsSaving=!1;uiLangFormControl=new E("");uiThemeIsSaving=!1;uiThemeFormControl=new E("");uiLightIsSaving=!1;uiLightFormControl=new E("");uiMenuIsSaving=!1;uiMenuFormControl=new E("");uiTempIsSaving=!1;uiTempFormControl=new E("");hbDebugIsSaving=!1;hbDebugFormControl=new E(!1);hbInsecureIsSaving=!1;hbInsecureFormControl=new E(!1);hbKeepIsSaving=!1;hbKeepFormControl=new E(!1);hbEnvDebugIsSaving=!1;hbEnvDebugFormControl=new E("");hbEnvNodeIsSaving=!1;hbEnvNodeFormControl=new E("");hbLogSizeIsInvalid=!1;hbLogSizeIsSaving=!1;hbLogSizeFormControl=new E(-1);hbLogTruncateIsInvalid=!1;hbLogTruncateIsSaving=!1;hbLogTruncateFormControl=new E(0);hbMDnsIsSaving=!1;hbMDnsFormControl=new E("");hbPortIsInvalid=!1;hbPortIsSaving=!1;hbPortFormControl=new E(0);uiPortIsInvalid=!1;uiPortIsSaving=!1;uiPortFormControl=new E(0);uiAuthIsSaving=!1;uiAuthFormControl=new Ie(!0);uiSessionTimeoutIsInvalid=!1;uiSessionTimeoutIsSaving=!1;uiSessionTimeoutFormControl=new E(0);uiSslTypeFormControl=new E("off");uiSslKeyIsSaving=!1;uiSslKeyFormControl=new E("");uiSslCertIsSaving=!1;uiSslCertFormControl=new E("");uiSslPfxIsSaving=!1;uiSslPfxFormControl=new E("");uiSslPassphraseIsSaving=!1;uiSslPassphraseFormControl=new E("");uiHostIsSaving=!1;uiHostFormControl=new E("");uiProxyHostIsSaving=!1;uiProxyHostFormControl=new E("");hbPackageIsSaving=!1;hbPackageFormControl=new E("");uiMetricsIsSaving=!1;uiMetricsFormControl=new E(!0);uiAccDebugIsSaving=!1;uiAccDebugFormControl=new E(!1);uiTempFileIsSaving=!1;uiTempFileFormControl=new E("");hbLinuxShutdownIsSaving=!1;hbLinuxShutdownFormControl=new E("");hbLinuxRestartIsSaving=!1;hbLinuxRestartFormControl=new E("");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(){return S(this,null,function*(){this.isHbV2=this.$settings.env.homebridgeVersion.startsWith("2"),yield this.initNetworkingOptions(),yield this.initStartupSettings(),this.hbNameFormControl.patchValue(this.$settings.env.homebridgeInstanceName),this.hbNameFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.hbNameSave(e)),this.uiLangFormControl.patchValue(this.$settings.env.lang),this.uiLangFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiLangSave(e)),this.uiThemeFormControl.patchValue(this.$settings.theme),this.uiThemeFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiThemeSave(e)),this.uiLightFormControl.patchValue(this.$settings.lightingMode),this.uiLightFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiLightSave(e)),this.uiMenuFormControl.patchValue(this.$settings.menuMode),this.uiMenuFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiMenuSave(e)),this.uiTempFormControl.patchValue(this.$settings.env.temperatureUnits),this.uiTempFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiTempSave(e)),this.hbLogSizeFormControl.patchValue(this.$settings.env.log?.maxSize),this.hbLogSizeFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.hbLogSizeSave(e)),this.hbLogTruncateFormControl.patchValue(this.$settings.env.log?.truncateSize),this.hbLogTruncateFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.hbLogTruncateSave(e)),this.uiPortFormControl.patchValue(this.$settings.env.port),this.uiPortFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.uiPortSave(e)),this.uiAuthFormControl.patchValue(this.$settings.formAuth),this.uiAuthFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiAuthSave(e)),this.uiSessionTimeoutFormControl.patchValue(this.$settings.sessionTimeout),this.uiSessionTimeoutFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiSessionTimeoutSave(e)),this.uiSslKeyFormControl.patchValue(this.$settings.env.ssl?.key||""),this.uiSslKeyFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.uiSslKeySave(e)),this.uiSslCertFormControl.patchValue(this.$settings.env.ssl?.cert||""),this.uiSslCertFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.uiSslCertSave(e)),this.uiSslPfxFormControl.patchValue(this.$settings.env.ssl?.pfx||""),this.uiSslPfxFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.uiSslPfxSave(e)),this.uiSslPassphraseFormControl.patchValue(this.$settings.env.ssl?.passphrase||""),this.uiSslPassphraseFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.uiSslPassphraseSave(e)),this.uiSslTypeFormControl.patchValue(this.uiSslKeyFormControl.value||this.uiSslCertFormControl.value?"keycert":this.uiSslPfxFormControl.value||this.uiSslPassphraseFormControl.value?"pfx":"off"),this.uiSslTypeFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiSslTypeSave(e)),this.uiHostFormControl.patchValue(this.$settings.env.host||""),this.uiHostFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.uiHostSave(e)),this.uiProxyHostFormControl.patchValue(this.$settings.env.proxyHost||""),this.uiProxyHostFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.uiProxyHostSave(e)),this.hbPackageFormControl.patchValue(this.$settings.env.homebridgePackagePath||""),this.hbPackageFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.hbPackageSave(e)),this.uiMetricsFormControl.patchValue(!this.$settings.env.disableServerMetricsMonitoring),this.uiMetricsFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiMetricsSave(e)),this.uiAccDebugFormControl.patchValue(this.$settings.env.accessoryControl?.debug),this.uiAccDebugFormControl.valueChanges.pipe(w(750)).subscribe(e=>this.uiAccDebugSave(e)),this.uiTempFileFormControl.patchValue(this.$settings.env.temp),this.uiTempFileFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.uiTempFileSave(e)),this.hbLinuxShutdownFormControl.patchValue(this.$settings.env.linux?.shutdown),this.hbLinuxShutdownFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.hbLinuxShutdownSave(e)),this.hbLinuxRestartFormControl.patchValue(this.$settings.env.linux?.restart),this.hbLinuxRestartFormControl.valueChanges.pipe(w(1500)).subscribe(e=>this.hbLinuxRestartSave(e))})}initStartupSettings(){return S(this,null,function*(){try{let e=yield B(this.$api.get("/platform-tools/hb-service/homebridge-startup-settings"));this.hbDebugFormControl.patchValue(e.HOMEBRIDGE_DEBUG),this.hbDebugFormControl.valueChanges.pipe(w(750)).subscribe(a=>this.hbDebugSave(a)),this.hbInsecureFormControl.patchValue(e.HOMEBRIDGE_INSECURE),this.hbInsecureFormControl.valueChanges.pipe(w(750)).subscribe(a=>this.hbInsecureSave(a)),this.hbKeepFormControl.patchValue(e.HOMEBRIDGE_KEEP_ORPHANS),this.hbKeepFormControl.valueChanges.pipe(w(750)).subscribe(a=>this.hbKeepSave(a)),this.hbEnvDebugFormControl.patchValue(e.ENV_DEBUG),this.hbEnvDebugFormControl.valueChanges.pipe(w(1500)).subscribe(a=>this.hbEnvDebugSave(a)),this.hbEnvNodeFormControl.patchValue(e.ENV_NODE_OPTIONS),this.hbEnvNodeFormControl.valueChanges.pipe(w(1500)).subscribe(a=>this.hbEnvNodeSave(a))}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}initNetworkingOptions(){return S(this,null,function*(){try{yield 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(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}getNetworkSettings(){return S(this,null,function*(){return Promise.all([B(this.$api.get("/server/network-interfaces/system")),B(this.$api.get("/server/network-interfaces/bridge")),B(this.$api.get("/server/mdns-advertiser")),B(this.$api.get("/server/port"))]).then(([e,a,p,C])=>{this.adaptersAvailable=e,this.buildBridgeNetworkAdapterList(a),this.hbMDnsFormControl.patchValue(p.advertiser),this.hbMDnsFormControl.valueChanges.pipe(w(750)).subscribe(H=>this.hbMDnsSave(H)),this.hbPortFormControl.patchValue(C.port),this.hbPortFormControl.valueChanges.pipe(w(1500)).subscribe(H=>this.hbPortSave(H))})})}saveUiSettingChange(e,a){return S(this,null,function*(){try{yield B(this.$api.put("/config-editor/ui",{key:e,value:a}))}catch(p){console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}hbNameSave(e){return S(this,null,function*(){if(!e||!/^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u.test(e)){this.hbNameIsInvalid=!0;return}try{this.hbNameIsSaving=!0,yield B(this.$api.put("/server/name",{value:e})),this.$settings.setEnvItem("homebridgeInstanceName",e),this.hbNameIsInvalid=!1}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbNameIsSaving=!1},1e3)}})}uiLangSave(e){return S(this,null,function*(){try{this.uiLangIsSaving=!0,this.$settings.setLang(e),yield this.saveUiSettingChange("lang",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiLangIsSaving=!1},1e3)}})}uiThemeSave(e){return S(this,null,function*(){try{this.uiThemeIsSaving=!0,this.$settings.setTheme(e),yield this.saveUiSettingChange("theme",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiThemeIsSaving=!1},1e3)}})}uiLightSave(e){return S(this,null,function*(){try{this.uiLightIsSaving=!0,this.$settings.setLightingMode(e,"user"),yield this.saveUiSettingChange("lightingMode",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiLightIsSaving=!1},1e3)}})}uiMenuSave(e){return S(this,null,function*(){try{this.uiMenuIsSaving=!0,this.$settings.setMenuMode(e),yield this.saveUiSettingChange("menuMode",e),window.location.reload()}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiMenuIsSaving=!1},1e3)}})}uiTempSave(e){return S(this,null,function*(){try{this.uiTempIsSaving=!0,this.$settings.setEnvItem("temperatureUnits",e),yield this.saveUiSettingChange("tempUnits",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiTempIsSaving=!1},1e3)}})}hbDebugSave(e){return S(this,null,function*(){try{this.hbDebugIsSaving=!0,yield B(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:e,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value}))}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbDebugIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}hbInsecureSave(e){return S(this,null,function*(){try{this.hbInsecureIsSaving=!0,yield B(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:e,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value}))}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbInsecureIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}hbKeepSave(e){return S(this,null,function*(){try{this.hbKeepIsSaving=!0,yield B(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:e,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value}))}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbKeepIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}hbEnvDebugSave(e){return S(this,null,function*(){try{this.hbEnvDebugIsSaving=!0,yield B(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:e,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value}))}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbEnvDebugIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}hbEnvNodeSave(e){return S(this,null,function*(){try{this.hbEnvNodeIsSaving=!0,yield B(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:e}))}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbEnvNodeIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}hbLogSizeSave(e){return S(this,null,function*(){if(e&&(typeof e!="number"||e<-1||Number.isInteger(e)===!1)){this.hbLogSizeIsInvalid=!0;return}try{this.hbLogSizeIsSaving=!0,this.$settings.setEnvItem("log.maxSize",e),(!e||e===-1)&&(yield this.saveUiSettingChange("log.truncateSize",null),this.hbLogTruncateIsInvalid=!1),yield this.saveUiSettingChange("log.maxSize",e),this.hbLogSizeIsInvalid=!1}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbLogSizeIsSaving=!1,this.showRestartToast()},1e3)}})}hbLogTruncateSave(e){return S(this,null,function*(){if(e&&(typeof e!="number"||e<0||Number.isInteger(e)===!1)){this.hbLogTruncateIsInvalid=!0;return}try{this.hbLogTruncateIsSaving=!0,this.$settings.setEnvItem("log.truncateSize",e),yield this.saveUiSettingChange("log.truncateSize",e),this.hbLogTruncateIsInvalid=!1}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbLogTruncateIsSaving=!1,this.showRestartToast()},1e3)}})}hbMDnsSave(e){return S(this,null,function*(){try{this.hbMDnsIsSaving=!0,yield B(this.$api.put("/server/mdns-advertiser",{advertiser:e}))}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbMDnsIsSaving=!1,this.showRestartToast()},1e3)}})}hbPortSave(e){return S(this,null,function*(){if(e===this.uiPortFormControl.value){this.hbPortIsInvalid=!0;return}try{this.hbPortIsSaving=!0,yield B(this.$api.put("/server/port",{port:e})),this.hbPortIsInvalid=!1}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbPortIsSaving=!1,this.showRestartToast()},1e3)}})}uiPortSave(e){return S(this,null,function*(){if(!e||typeof e!="number"||e<1025||e>65533||Number.isInteger(e)===!1||e===this.hbPortFormControl.value){this.uiPortIsInvalid=!0;return}try{this.uiPortIsSaving=!0,this.$settings.setEnvItem("port",e),yield this.saveUiSettingChange("port",e),this.uiPortIsInvalid=!1}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiPortIsSaving=!1,this.showRestartToast()},1e3)}})}uiAuthSave(e){return S(this,null,function*(){try{this.uiAuthIsSaving=!0,this.$settings.setItem("formAuth",e),yield this.saveUiSettingChange("auth",e?"form":"none")}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiAuthIsSaving=!1,this.showRestartToast()},1e3)}})}uiSessionTimeoutSave(e){return S(this,null,function*(){if(e&&(typeof e!="number"||e<600||e>864e5||Number.isInteger(e)===!1)){this.uiSessionTimeoutIsInvalid=!0;return}try{this.uiSessionTimeoutIsSaving=!0,this.$settings.setItem("sessionTimeout",e),yield this.saveUiSettingChange("sessionTimeout",e),this.uiSessionTimeoutIsInvalid=!1}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiSessionTimeoutIsSaving=!1,this.showRestartToast()},1e3)}})}uiSslKeySave(e){return S(this,null,function*(){try{this.uiSslKeyIsSaving=!0,this.$settings.setEnvItem("ssl.key",e),yield this.saveUiSettingChange("ssl.key",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiSslKeyIsSaving=!1,this.showRestartToast()},1e3)}})}uiSslCertSave(e){return S(this,null,function*(){try{this.uiSslCertIsSaving=!0,this.$settings.setEnvItem("ssl.cert",e),yield this.saveUiSettingChange("ssl.cert",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiSslCertIsSaving=!1,this.showRestartToast()},1e3)}})}uiSslPfxSave(e){return S(this,null,function*(){try{this.uiSslPfxIsSaving=!0,this.$settings.setEnvItem("ssl.pfx",e),yield this.saveUiSettingChange("ssl.pfx",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiSslPfxIsSaving=!1,this.showRestartToast()},1e3)}})}uiSslPassphraseSave(e){return S(this,null,function*(){try{this.uiSslPassphraseIsSaving=!0,this.$settings.setEnvItem("ssl.passphrase",e),yield this.saveUiSettingChange("ssl.passphrase",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiSslPassphraseIsSaving=!1,this.showRestartToast()},1e3)}})}uiSslTypeSave(e){return S(this,null,function*(){switch(e){case"keycert":this.uiSslPfxFormControl.patchValue("",{emitEvent:!1}),this.uiSslPassphraseFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.pfx",""),this.$settings.setEnvItem("ssl.passphrase","");break;case"pfx":this.uiSslKeyFormControl.patchValue("",{emitEvent:!1}),this.uiSslCertFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.key",""),this.$settings.setEnvItem("ssl.cert","");break;default:this.uiSslKeyFormControl.patchValue("",{emitEvent:!1}),this.uiSslCertFormControl.patchValue("",{emitEvent:!1}),this.uiSslPfxFormControl.patchValue("",{emitEvent:!1}),this.uiSslPassphraseFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.key",""),this.$settings.setEnvItem("ssl.cert",""),this.$settings.setEnvItem("ssl.pfx",""),this.$settings.setEnvItem("ssl.passphrase",""),yield this.saveUiSettingChange("ssl",""),this.showRestartToast()}})}uiHostSave(e){return S(this,null,function*(){try{this.uiHostIsSaving=!0,this.$settings.setEnvItem("host",e),yield this.saveUiSettingChange("host",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiHostIsSaving=!1,this.showRestartToast()},1e3)}})}uiProxyHostSave(e){return S(this,null,function*(){try{this.uiProxyHostIsSaving=!0,this.$settings.setEnvItem("proxyHost",e),yield this.saveUiSettingChange("proxyHost",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiProxyHostIsSaving=!1,this.showRestartToast()},1e3)}})}hbPackageSave(e){return S(this,null,function*(){try{this.hbPackageIsSaving=!0,this.$settings.setEnvItem("homebridgePackagePath",e),yield this.saveUiSettingChange("homebridgePackagePath",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbPackageIsSaving=!1,this.showRestartToast()},1e3)}})}uiMetricsSave(e){return S(this,null,function*(){try{this.uiMetricsIsSaving=!0,this.$settings.setEnvItem("disableServerMetricsMonitoring",!e),yield this.saveUiSettingChange("disableServerMetricsMonitoring",!e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiMetricsIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}uiAccDebugSave(e){return S(this,null,function*(){try{this.uiAccDebugIsSaving=!0,this.$settings.setEnvItem("accessoryControl.debug",e),yield this.saveUiSettingChange("accessoryControl.debug",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiAccDebugIsSaving=!1,this.showRestartToast()},1e3)}})}uiTempFileSave(e){return S(this,null,function*(){try{this.uiTempFileIsSaving=!0,this.$settings.setEnvItem("temp",e),yield this.saveUiSettingChange("temp",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.uiTempFileIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}hbLinuxShutdownSave(e){return S(this,null,function*(){try{this.hbLinuxShutdownIsSaving=!0,this.$settings.setEnvItem("linux.shutdown",e),yield this.saveUiSettingChange("linux.shutdown",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbLinuxShutdownIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}hbLinuxRestartSave(e){return S(this,null,function*(){try{this.hbLinuxRestartIsSaving=!0,this.$settings.setEnvItem("linux.restart",e),yield this.saveUiSettingChange("linux.restart",e)}catch(a){console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error"))}finally{setTimeout(()=>{this.hbLinuxRestartIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:a=>{console.error(a),this.showRestartToast()}})},1e3)}})}openBackupModal(){this.$modal.open(re,{size:"lg",backdrop:"static"})}openWallpaperModal(){this.$modal.open(Xe,{size:"lg",backdrop:"static"})}resetHomebridgeState(){this.$modal.open(Ge,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(Qe,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open(Ke,{size:"lg",backdrop:"static"})}accessoryUiControl(){return S(this,null,function*(){try{let e=this.$modal.open(Oe,{size:"lg",backdrop:"static"});e.componentInstance.existingBlacklist=this.$settings.env.accessoryControl?.instanceBlacklist||[],yield e.result,this.showRestartToast()}catch(e){e!=="Dismiss"&&(console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error")))}})}removeSingleCachedAccessories(){this.$modal.open(Ne,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open(je,{size:"lg",backdrop:"static"})}selectNetworkInterfaces(){return S(this,null,function*(){let e=this.$modal.open(Je,{size:"lg",backdrop:"static"});e.componentInstance.adaptersAvailable=this.adaptersAvailable;try{let a=yield e.result;this.buildBridgeNetworkAdapterList(a),yield B(this.$api.put("/server/network-interfaces/bridge",{adapters:a})),this.showRestartToast()}catch(a){a!=="Dismiss"&&(console.error(a),this.$toastr.error(a.message,this.$translate.instant("toast.title_error")))}})}buildBridgeNetworkAdapterList(e){if(!e.length){this.adaptersSelected=[];return}this.adaptersSelected=e.map(a=>{let p=this.adaptersAvailable.find(C=>C.iface===a);return p?{iface:p.iface,selected:!0,missing:!1,ip4:p.ip4,ip6:p.ip6}:{iface:a,selected:!0,missing:!0}})}toggleSection(e){this.showFields[e]=!this.showFields[e]}showRestartToast(){if(!this.restartToastIsShown){this.restartToastIsShown=!0;let e=this.$toastr.info(this.$translate.instant("settings.changes.saved"),this.$translate.instant("menu.hbrestart.title"),{timeOut:0,closeButton:!1,tapToDismiss:!0,disableTimeOut:!0,positionClass:"toast-bottom-right",enableHtml:!0});e&&e.onTap&&e.onTap.subscribe(()=>{this.$router.navigate(["/restart"])})}}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=$({type:i,selectors:[["ng-component"]],decls:52,vars:75,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"],["id","fieldsStartup",1,"list-group","list-group-box","mb-4","mx-0"],["id","fieldsNetwork",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsSecurity",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","d-flex","align-items-center"],["type","text",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[1,"fas","fa-fw","fa-floppy-disk","primary-text","fa-xl","me-0","me-md-2","ms-2","ms-md-0","order-2","order-md-1"],[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,"my-3","my-md-0","ps-0","ps-md-5","w-auto","d-flex","align-items-center"],[1,"custom-select","resp-select","order-1","order-md-2",3,"formControl"],["value","auto"],["value","bg"],["value","ca"],["value","zh-CN"],["value","zh-TW"],["value","cs"],["value","nl"],["value","en"],["value","fi"],["value","fr"],["value","de"],["value","he"],["value","hu"],["value","id"],["value","it"],["value","ja"],["value","ko"],["value","mk"],["value","no"],["value","pl"],["value","pt-BR"],["value","pt"],["value","ru"],["value","sl"],["value","es"],["value","sv"],["value","th"],["value","tr"],["value","uk"],["value","orange"],["value","red"],["value","pink"],["value","purple"],["value","deep-purple"],["value","indigo"],["value","blue"],["value","blue-grey"],["value","cyan"],["value","green"],["value","teal"],["value","grey"],["value","brown"],["value","light"],["value","dark"],["value","default"],["value","freeze"],["value","c"],["value","f"],[1,"grey-text","pe-2"],[1,"d-flex","align-items-center"],[1,"order-1","order-md-2"],["type","checkbox","id","homebridgeDebugMode",1,"rendux-input",3,"formControl"],["for","homebridgeDebugMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeInsecureMode",1,"rendux-input",3,"formControl"],["for","homebridgeInsecureMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeKeepOrphans",1,"rendux-input",3,"formControl"],["for","homebridgeKeepOrphans",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeMetrics",1,"rendux-input",3,"formControl"],["for","homebridgeMetrics",1,"rendux-label","ms-3",2,"min-width","50px"],["type","text","placeholder","/usr/local/lib/node_modules/homebridge",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],[1,"font-monospace"],[1,"grey-text","pe-2",3,"innerHTML"],["type","text","placeholder","HAP-NodeJS:Advertiser,HAP-NodeJS:Service",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","--max-old-space-size=512 --max-http-header-size=8192",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","number","min","-1","placeholder","1000000",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","text","placeholder","shutdown",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","reboot",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/sys/class/thermal/thermal_zone0/temp",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["routerLink","/platform-tools/docker/startup-script",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],["type","number","min","0","placeholder","200000",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[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"],["value","avahi"],["value","ciao"],["value","bonjour-hap"],["value","resolved"],["type","number","min","1025","max","65533",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","number","min","1025","max","65533","placeholder","8581",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[1,"grey-text","pe-2",3,"innerHtml"],["type","text","pattern","^[^{}/ :\\\\]+(?::\\d+)?$","placeholder","0.0.0.0",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","pattern","^[^{}/ :\\\\]+(?::\\d+)?$","placeholder","example.com:8443",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],[1,"fas","fa-fw","fa-exclamation-triangle"],[1,"fw-normal"],["type","checkbox","id","uiAuthForm",1,"rendux-input",3,"formControl"],["for","uiAuthForm",1,"rendux-label","ms-3",2,"min-width","50px"],["value","off"],["value","keycert"],["value","pfx"],["type","number","min","600","max","86400000","placeholder","28800",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","text","placeholder","/Users/.../certs/server.key",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/Users/.../certs/server.crt",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/Users/.../certs/server.pfx",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["placeholder","mypassphrase",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"focus","blur","type","formControl"],["type","checkbox","id","accessoryDebug",1,"rendux-input",3,"formControl"],["for","accessoryDebug",1,"rendux-label","ms-3",2,"min-width","50px"]],template:function(a,p){a&1&&(n(0,"h3",0),l(1),o(2,"translate"),r(),n(3,"div",1)(4,"div",2),f("click",function(){return p.toggleSection("general")}),n(5,"h5",3),d(6,"i",4),l(7),o(8,"translate"),r()(),h(9,xi,23,23,"ul",5),r(),n(10,"div",1)(11,"div",2),f("click",function(){return p.toggleSection("display")}),n(12,"h5",3),d(13,"i",4),l(14),o(15,"translate"),r()(),h(16,Ei,157,94,"ul",6),r(),n(17,"div",2),f("click",function(){return p.toggleSection("startup")}),n(18,"h5",3),d(19,"i",4),l(20),o(21,"translate"),r()(),h(22,Wi,111,85,"ul",7),n(23,"div",2),f("click",function(){return p.toggleSection("network")}),n(24,"h5",3),d(25,"i",4),l(26),o(27,"translate"),r()(),h(28,en,80,76,"ul",8),n(29,"div",2),f("click",function(){return p.toggleSection("security")}),n(30,"h5",3),d(31,"i",4),l(32),o(33,"translate"),r()(),h(34,cn,49,42,"ul",9),n(35,"div",1)(36,"div",2),f("click",function(){return p.toggleSection("cache")}),n(37,"h5",3),d(38,"i",4),l(39),o(40,"translate"),r()(),h(41,mn,3,3,"p",10),h(42,hn,48,38,"ul",11),r(),n(43,"div",1)(44,"div",2),f("click",function(){return p.toggleSection("reset")}),n(45,"h5",3),d(46,"i",4),l(47),o(48,"translate"),r()(),h(49,_n,3,3,"p",10),h(50,gn,24,20,"ul",12),r(),d(51,"div",13)),a&2&&(t(),u(s(2,38,"menu.settings.title")),t(3),v("aria-expanded",p.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),t(2),m("ngClass",T(54,j,p.showFields.general,!p.showFields.general)),t(),g(" ",s(8,40,"settings.general.title_general")," "),t(2),_(p.showFields.general?9:-1),t(2),v("aria-expanded",p.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),t(2),m("ngClass",T(57,j,p.showFields.display,!p.showFields.display)),t(),g(" ",s(15,42,"settings.general.title_display")," "),t(2),_(p.showFields.display?16:-1),t(),v("aria-expanded",p.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),t(2),m("ngClass",T(60,j,p.showFields.startup,!p.showFields.startup)),t(),g(" ",s(21,44,"settings.title_startup_options")," "),t(2),_(p.showFields.startup?22:-1),t(),v("aria-expanded",p.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),t(2),m("ngClass",T(63,j,p.showFields.network,!p.showFields.network)),t(),g(" ",s(27,46,"settings.network.title_network")," "),t(2),_(p.showFields.network?28:-1),t(),v("aria-expanded",p.showFields.security?"true":"false")("aria-controls","fieldsSecurity"),t(2),m("ngClass",T(66,j,p.showFields.security,!p.showFields.security)),t(),g(" ",s(33,48,"settings.network.title_security")," "),t(2),_(p.showFields.security?34:-1),t(2),v("aria-expanded",p.showFields.cache?"true":"false")("aria-controls","fieldsCache"),t(2),m("ngClass",T(69,j,p.showFields.cache,!p.showFields.cache)),t(),g(" ",s(40,50,"settings.cache.title")," "),t(2),_(p.showFields.cache?41:-1),t(),_(p.showFields.cache?42:-1),t(2),v("aria-expanded",p.showFields.reset?"true":"false")("aria-controls","fieldsReset"),t(2),m("ngClass",T(72,j,p.showFields.reset,!p.showFields.reset)),t(),g(" ",s(48,52,"reset.bridges.title")," "),t(2),_(p.showFields.reset?49:-1),t(),_(p.showFields.reset?50:-1))},dependencies:[U,De,X,Te,$e,ie,Ee,Q,Be,J,Ae,Re,Fe,Y,ne,q,F],encapsulation:2,data:{animation:[ke("fadeInOut",[pe(":enter",[te({opacity:0}),le("750ms",te({opacity:1}))]),pe(":leave",[le("750ms",te({opacity:0}))])])]}})}return i})();export{Oe as a,re as b,Ke as c,Ge as d,Je as e,Xe as f,Tr as g};
@@ -1 +1 @@
1
- import"./chunk-CJFTYWNR.js";import{q as p}from"./chunk-2EMPNH2X.js";import{A as m}from"./chunk-EJ3RNOUF.js";import{g as i}from"./chunk-ZOLUFCSO.js";import"./chunk-7X3XMTAN.js";import"./chunk-KL2VWGZB.js";import"./chunk-FDPTBVVC.js";import{c as s}from"./chunk-GOW5VSYJ.js";import{ha as t,kd as n,mb as r}from"./chunk-NR37MAXW.js";var a=[{path:"",loadComponent:()=>import("./chunk-RMRL4WBE.js").then(o=>o.PowerOptionsComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(a),i]})}return o})();var j=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,u,p,m,s]})}return o})();export{j as PowerOptionsModule};
1
+ import"./chunk-5T2WJQPT.js";import{q as p}from"./chunk-2EMPNH2X.js";import{A as m}from"./chunk-EJ3RNOUF.js";import{g as i}from"./chunk-ZOLUFCSO.js";import"./chunk-5VRO7UND.js";import"./chunk-AUC5ZCGG.js";import"./chunk-FDPTBVVC.js";import{c as s}from"./chunk-GOW5VSYJ.js";import{ha as t,kd as n,mb as r}from"./chunk-NR37MAXW.js";var a=[{path:"",loadComponent:()=>import("./chunk-GV7FWHGD.js").then(o=>o.PowerOptionsComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(a),i]})}return o})();var j=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,u,p,m,s]})}return o})();export{j as PowerOptionsModule};
@@ -1 +1 @@
1
- import"./chunk-7FVSDABO.js";import"./chunk-6PWEY66K.js";import{g as n}from"./chunk-ZOLUFCSO.js";import"./chunk-VKY76476.js";import"./chunk-BNGLNG3U.js";import"./chunk-7X3XMTAN.js";import"./chunk-KL2VWGZB.js";import"./chunk-FDPTBVVC.js";import{c as m}from"./chunk-GOW5VSYJ.js";import{ha as t,kd as i,mb as r}from"./chunk-NR37MAXW.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"restart-server",loadComponent:()=>import("./chunk-IARRIMKK.js").then(o=>o.RestartLinuxComponent)},{path:"shutdown-server",loadComponent:()=>import("./chunk-XV3L5UW5.js").then(o=>o.ShutdownLinuxComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n.forChild(d),n]})}return o})();var g=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i,m.forChild(),u]})}return o})();export{g as LinuxModule};
1
+ import"./chunk-SVHDRQLT.js";import"./chunk-5LDKHTNS.js";import{g as n}from"./chunk-ZOLUFCSO.js";import"./chunk-UMZH66PK.js";import"./chunk-QPGONHRG.js";import"./chunk-5VRO7UND.js";import"./chunk-AUC5ZCGG.js";import"./chunk-FDPTBVVC.js";import{c as m}from"./chunk-GOW5VSYJ.js";import{ha as t,kd as i,mb as r}from"./chunk-NR37MAXW.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"restart-server",loadComponent:()=>import("./chunk-PACISHIL.js").then(o=>o.RestartLinuxComponent)},{path:"shutdown-server",loadComponent:()=>import("./chunk-FIABPQU3.js").then(o=>o.ShutdownLinuxComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n.forChild(d),n]})}return o})();var g=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i,m.forChild(),u]})}return o})();export{g as LinuxModule};
@@ -1,4 +1,4 @@
1
- import{a as P}from"./chunk-FIDKTTX5.js";import{a as O}from"./chunk-DQBVZWYJ.js";import{c as y,e as E,l as k,z as $}from"./chunk-EJ3RNOUF.js";import{b as D}from"./chunk-ZOLUFCSO.js";import{b as L}from"./chunk-7X3XMTAN.js";import{k as I,n as H}from"./chunk-KL2VWGZB.js";import{a as T}from"./chunk-GOW5VSYJ.js";import{$a as s,Hb as d,Ib as m,Nb as f,Ob as u,Pb as l,Qb as w,Ub as g,Xb as _,Yb as a,h as S,jc as v,la as r,lb as x,qc as b,ra as c,rc as M,sa as p,sc as V,w as C}from"./chunk-NR37MAXW.js";function z(i,h){i&1&&w(0,"i",6)}function A(i,h){i&1&&w(0,"i",7)}function F(i,h){if(i&1){let t=g();u(0,"ngx-monaco-editor",10),_("onInit",function(e){c(t);let o=a();return p(o.onEditorInit(e))})("keydown.control.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())})("keydown.meta.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())}),l()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,h){if(i&1){let t=g();u(0,"textarea",11),V("ngModelChange",function(e){c(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),p(e)}),v(1," "),l()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(H);$md=r(O);$route=r(D);$settings=r(L);$toastr=r(I);$translate=r(T);startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0},this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
1
+ import{a as P}from"./chunk-FIDKTTX5.js";import{a as O}from"./chunk-DQBVZWYJ.js";import{c as y,e as E,l as k,z as $}from"./chunk-EJ3RNOUF.js";import{b as D}from"./chunk-ZOLUFCSO.js";import{b as L}from"./chunk-5VRO7UND.js";import{k as I,n as H}from"./chunk-AUC5ZCGG.js";import{a as T}from"./chunk-GOW5VSYJ.js";import{$a as s,Hb as d,Ib as m,Nb as f,Ob as u,Pb as l,Qb as w,Ub as g,Xb as _,Yb as a,h as S,jc as v,la as r,lb as x,qc as b,ra as c,rc as M,sa as p,sc as V,w as C}from"./chunk-NR37MAXW.js";function z(i,h){i&1&&w(0,"i",6)}function A(i,h){i&1&&w(0,"i",7)}function F(i,h){if(i&1){let t=g();u(0,"ngx-monaco-editor",10),_("onInit",function(e){c(t);let o=a();return p(o.onEditorInit(e))})("keydown.control.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())})("keydown.meta.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())}),l()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,h){if(i&1){let t=g();u(0,"textarea",11),V("ngModelChange",function(e){c(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),p(e)}),v(1," "),l()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(H);$md=r(O);$route=r(D);$settings=r(L);$toastr=r(I);$translate=r(T);startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0},this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
2
2
  `)[0].trim())){this.$toastr.error(this.$translate.instant("platform.docker.must_use_hashbang"),this.$translate.instant("toast.title_error")),this.startupScript=`#!/bin/sh
3
3
 
4
4
  ${this.startupScript}`,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),this.saveInProgress=!1;return}try{yield C(this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript})),this.$toastr.success(this.$translate.instant("platform.docker.restart_required"),this.$translate.instant("platform.docker.script_saved"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:5,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","font-monospace"],[1,"col-6","text-end"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-fw","fa-floppy-disk"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","my-2",3,"options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModel"],[1,"flex-grow-1","h-100","w-100","my-2",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModelChange","ngModel"]],template:function(n,e){n&1&&(u(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),l()(),u(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),d(7,z,1,0,"i",6),d(8,A,1,0,"i",7),l()()(),d(9,F,1,2,"ngx-monaco-editor",8),d(10,W,2,1,"textarea",9),l()),n&2&&(s(6),f("disabled",e.saveInProgress),s(),m(e.saveInProgress?-1:7),s(),m(e.saveInProgress?8:-1),s(),m(e.isMobile?-1:9),s(),m(e.isMobile?10:-1))},dependencies:[P,$,y,E,k],encapsulation:2})}return i})();export{tt as a};
@@ -1 +1 @@
1
- import{a as H,b as X}from"./chunk-IF56BKOM.js";import{a as Z}from"./chunk-YWKZ3P6I.js";import{a as R}from"./chunk-FMIYWTUO.js";import{n as L}from"./chunk-2EMPNH2X.js";import"./chunk-EJ3RNOUF.js";import{a as W,c as q,d as V,e as N,f as D}from"./chunk-ZOLUFCSO.js";import{a as j}from"./chunk-VKY76476.js";import{c as B}from"./chunk-BNGLNG3U.js";import{b as $}from"./chunk-7X3XMTAN.js";import{m as T}from"./chunk-KL2VWGZB.js";import"./chunk-FDPTBVVC.js";import{a as P,b as U}from"./chunk-GOW5VSYJ.js";import{$a as o,Ac as d,Bc as l,Gb as u,Hb as x,Ib as y,Nb as c,Ob as n,Pb as a,Qb as p,Ub as S,Xb as _,Yb as w,bd as E,eb as F,g as Y,h as z,jc as f,kc as g,la as m,lb as O,ra as h,sa as b,sd as K,vc as v,w as A,wc as M}from"./chunk-NR37MAXW.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 I=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/accessories"],re=()=>["/support"],ae=()=>["/power-options"],se=()=>["/plugins"],de=()=>["/logs"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"];function me(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),d(3,"translate"),_("click",function(){h(e);let t=w();return b(t.openUnderVoltageModal())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",20),a(),n(6,"div",14),f(7),d(8,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),o(6),g(l(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",21),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,se))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_plugins")),o(5),g(l(7,6,"menu.label_plugins")))}function _e(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,de))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_logs")),o(5),g(l(7,6,"menu.linux.label_logs")))}function fe(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,le))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),o(5),g(l(7,6,"menu.linux.label_terminal")))}function ge(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),o(5),g(l(7,6,"menu.config_json_editor")))}function ve(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),o(5),g(l(7,6,"menu.label_settings")))}function he(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){h(e);let t=w();return b(t.reloadPage())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.reload")),o(5),g(l(7,4,"menu.reload")))}function be(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){h(e);let t=w();return b(t.$auth.logout())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",27),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.tooltip_logout")),o(5),g(l(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{router=m(V);translate=m(P);$auth=m(B);$settings=m($);$modal=m(L);$notification=m(X);$translate=m(P);renderer=m(F);isExpanded=!1;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();constructor(){let e=this.router;this.isMobile=window.innerWidth<768;let s;window.addEventListener("resize",()=>{clearTimeout(s),s=setTimeout(()=>{this.updateListeners()},500)}),e.events.subscribe(t=>{t 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)});let e=document.querySelector(".sidebar"),s=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)&&!s.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),s.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),s.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,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"))}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 s=e.target;["menuitem","button"].includes(s.getAttribute("role"))&&s.click()}}reloadPage(){window.location.reload()}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}))}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:61,vars:67,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-lightbulb"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"fa","fa-fw","fa-power-off"],["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-plug"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-refresh"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(s,t){s&1&&(n(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(C){return t.handleKeydown(C)}),p(2,"span",1),n(3,"a",2),d(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(C){return t.handleKeydown(C)}),n(15,"a",2),d(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),d(28,"translate"),a()()(),x(29,me,9,8,"div",10),x(30,ue,8,9,"div",10),n(31,"div",10)(32,"div",15),d(33,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(34,"div",12),p(35,"i",16),a(),n(36,"div",14),f(37),d(38,"translate"),a()()(),x(39,_e,8,9,"div",10),x(40,fe,8,9,"div",10),x(41,ge,8,9,"div",10),x(42,ve,8,9,"div",10),n(43,"div",10)(44,"div",15),d(45,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(46,"div",12),p(47,"i",17),a(),n(48,"div",14),f(49),d(50,"translate"),a()()(),n(51,"div",10)(52,"div",15),d(53,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(54,"div",12),p(55,"i",18),a(),n(56,"div",14),f(57),d(58,"translate"),a()()(),x(59,he,8,6,"div",10),x(60,be,8,6,"div",10),a()()),s&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,34,"menu.sidebar.aria_menu")),o(3),c("routerLink",v(56,I)),u("aria-label",l(4,36,"menu.label_status")),o(5),c("ngClass",M(57,te,t.isExpanded)),o(5),c("ngClass",M(59,ne,t.isExpanded)),o(2),c("routerLink",v(61,I)),u("aria-label",l(16,38,"menu.label_status")),o(7),c("routerLink",v(62,I))("routerLinkActive","active")("routerLinkActiveOptions",v(63,ie)),u("aria-label",l(23,40,"menu.label_status")),o(5),g(l(28,42,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(),y(t.$auth.user.admin?30:-1),o(2),c("routerLink",v(64,oe))("routerLinkActive","active"),u("aria-label",l(33,44,"menu.label_accessories")),o(5),g(l(38,46,"menu.label_accessories")),o(2),y(t.$auth.user.admin?39:-1),o(),y(t.$settings.env.enableTerminalAccess&&t.$auth.user.admin?40:-1),o(),y(t.$auth.user.admin?41:-1),o(),y(t.$auth.user.admin?42:-1),o(2),c("routerLink",v(65,re))("routerLinkActive","active"),u("aria-label",l(45,48,"support.title")),o(5),g(l(50,50,"support.title")),o(3),c("routerLink",v(66,ae))("routerLinkActive","active"),u("aria-label",l(53,52,"menu.restart.title")),o(5),g(l(58,54,"menu.restart.title")),o(2),y(t.isPwa?59:-1),o(),y(t.$settings.formAuth?60:-1))},dependencies:[N,K,E,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 we=i=>({sidebarExpanded:i}),Xe=(()=>{class i{$auth=m(B);$modal=m(L);$router=m(V);$settings=m($);$translate=m(P);$ws=m(j);sidebarExpanded=!1;io;constructor(){}ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return z(this,null,function*(){if(this.$settings.settingsLoaded||(yield A(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Q.lt)(this.$settings.uiVersion,T.serverTarget)){console.log(`Server restart required. UI Version: ${T.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:T.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(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(s,t){s&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),s&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,we,t.sidebarExpanded)))},dependencies:[J,E,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{Xe as LayoutComponent};
1
+ import{a as H,b as X}from"./chunk-IF56BKOM.js";import{a as Z}from"./chunk-YWKZ3P6I.js";import{a as R}from"./chunk-FMIYWTUO.js";import{n as L}from"./chunk-2EMPNH2X.js";import"./chunk-EJ3RNOUF.js";import{a as W,c as q,d as V,e as N,f as D}from"./chunk-ZOLUFCSO.js";import{a as j}from"./chunk-UMZH66PK.js";import{c as B}from"./chunk-QPGONHRG.js";import{b as $}from"./chunk-5VRO7UND.js";import{m as T}from"./chunk-AUC5ZCGG.js";import"./chunk-FDPTBVVC.js";import{a as P,b as U}from"./chunk-GOW5VSYJ.js";import{$a as o,Ac as d,Bc as l,Gb as u,Hb as x,Ib as y,Nb as c,Ob as n,Pb as a,Qb as p,Ub as S,Xb as _,Yb as w,bd as E,eb as F,g as Y,h as z,jc as f,kc as g,la as m,lb as O,ra as h,sa as b,sd as K,vc as v,w as A,wc as M}from"./chunk-NR37MAXW.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 I=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/accessories"],re=()=>["/support"],ae=()=>["/power-options"],se=()=>["/plugins"],de=()=>["/logs"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"];function me(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),d(3,"translate"),_("click",function(){h(e);let t=w();return b(t.openUnderVoltageModal())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",20),a(),n(6,"div",14),f(7),d(8,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),o(6),g(l(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",21),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,se))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_plugins")),o(5),g(l(7,6,"menu.label_plugins")))}function _e(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,de))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_logs")),o(5),g(l(7,6,"menu.linux.label_logs")))}function fe(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,le))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),o(5),g(l(7,6,"menu.linux.label_terminal")))}function ge(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),o(5),g(l(7,6,"menu.config_json_editor")))}function ve(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),c("routerLink",v(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),o(5),g(l(7,6,"menu.label_settings")))}function he(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){h(e);let t=w();return b(t.reloadPage())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.reload")),o(5),g(l(7,4,"menu.reload")))}function be(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){h(e);let t=w();return b(t.$auth.logout())})("keydown",function(t){h(e);let r=w();return b(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",27),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.tooltip_logout")),o(5),g(l(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{router=m(V);translate=m(P);$auth=m(B);$settings=m($);$modal=m(L);$notification=m(X);$translate=m(P);renderer=m(F);isExpanded=!1;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();constructor(){let e=this.router;this.isMobile=window.innerWidth<768;let s;window.addEventListener("resize",()=>{clearTimeout(s),s=setTimeout(()=>{this.updateListeners()},500)}),e.events.subscribe(t=>{t 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)});let e=document.querySelector(".sidebar"),s=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)&&!s.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),s.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),s.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,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"))}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 s=e.target;["menuitem","button"].includes(s.getAttribute("role"))&&s.click()}}reloadPage(){window.location.reload()}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}))}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:61,vars:67,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-lightbulb"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"fa","fa-fw","fa-power-off"],["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-plug"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-refresh"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(s,t){s&1&&(n(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(C){return t.handleKeydown(C)}),p(2,"span",1),n(3,"a",2),d(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(C){return t.handleKeydown(C)}),n(15,"a",2),d(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),d(28,"translate"),a()()(),x(29,me,9,8,"div",10),x(30,ue,8,9,"div",10),n(31,"div",10)(32,"div",15),d(33,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(34,"div",12),p(35,"i",16),a(),n(36,"div",14),f(37),d(38,"translate"),a()()(),x(39,_e,8,9,"div",10),x(40,fe,8,9,"div",10),x(41,ge,8,9,"div",10),x(42,ve,8,9,"div",10),n(43,"div",10)(44,"div",15),d(45,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(46,"div",12),p(47,"i",17),a(),n(48,"div",14),f(49),d(50,"translate"),a()()(),n(51,"div",10)(52,"div",15),d(53,"translate"),_("keydown",function(C){return t.handleKeydown(C)}),n(54,"div",12),p(55,"i",18),a(),n(56,"div",14),f(57),d(58,"translate"),a()()(),x(59,he,8,6,"div",10),x(60,be,8,6,"div",10),a()()),s&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,34,"menu.sidebar.aria_menu")),o(3),c("routerLink",v(56,I)),u("aria-label",l(4,36,"menu.label_status")),o(5),c("ngClass",M(57,te,t.isExpanded)),o(5),c("ngClass",M(59,ne,t.isExpanded)),o(2),c("routerLink",v(61,I)),u("aria-label",l(16,38,"menu.label_status")),o(7),c("routerLink",v(62,I))("routerLinkActive","active")("routerLinkActiveOptions",v(63,ie)),u("aria-label",l(23,40,"menu.label_status")),o(5),g(l(28,42,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(),y(t.$auth.user.admin?30:-1),o(2),c("routerLink",v(64,oe))("routerLinkActive","active"),u("aria-label",l(33,44,"menu.label_accessories")),o(5),g(l(38,46,"menu.label_accessories")),o(2),y(t.$auth.user.admin?39:-1),o(),y(t.$settings.env.enableTerminalAccess&&t.$auth.user.admin?40:-1),o(),y(t.$auth.user.admin?41:-1),o(),y(t.$auth.user.admin?42:-1),o(2),c("routerLink",v(65,re))("routerLinkActive","active"),u("aria-label",l(45,48,"support.title")),o(5),g(l(50,50,"support.title")),o(3),c("routerLink",v(66,ae))("routerLinkActive","active"),u("aria-label",l(53,52,"menu.restart.title")),o(5),g(l(58,54,"menu.restart.title")),o(2),y(t.isPwa?59:-1),o(),y(t.$settings.formAuth?60:-1))},dependencies:[N,K,E,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 we=i=>({sidebarExpanded:i}),Xe=(()=>{class i{$auth=m(B);$modal=m(L);$router=m(V);$settings=m($);$translate=m(P);$ws=m(j);sidebarExpanded=!1;io;constructor(){}ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return z(this,null,function*(){if(this.$settings.settingsLoaded||(yield A(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Q.lt)(this.$settings.uiVersion,T.serverTarget)){console.log(`Server restart required. UI Version: ${T.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:T.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(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(s,t){s&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),s&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,we,t.sidebarExpanded)))},dependencies:[J,E,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{Xe as LayoutComponent};
@@ -0,0 +1 @@
1
+ import{e as I}from"./chunk-NR37MAXW.js";var j=I((k,m)=>{(function(g,l){typeof k=="object"&&typeof m=="object"?m.exports=l():typeof define=="function"&&define.amd?define([],l):typeof k=="object"?k.WebLinksAddon=l():g.WebLinksAddon=l()})(self,function(){return(()=>{"use strict";var g={6:(a,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkComputer=r.WebLinkProvider=void 0;var s=function(){function o(n,i,e,t){t===void 0&&(t={}),this._terminal=n,this._regex=i,this._handler=e,this._options=t}return o.prototype.provideLinks=function(n,i){var e=p.computeLink(n,this._regex,this._terminal,this._handler);i(this._addCallbacks(e))},o.prototype._addCallbacks=function(n){var i=this;return n.map(function(e){return e.leave=i._options.leave,e.hover=function(t,u){if(i._options.hover){var c=e.range;i._options.hover(t,u,c)}},e})},o}();r.WebLinkProvider=s;var p=function(){function o(){}return o.computeLink=function(n,i,e,t){for(var u,c=new RegExp(i.source,(i.flags||"")+"g"),_=o._translateBufferLineToStringWithWrap(n-1,!1,e),d=_[0],f=_[1],v=-1,w=[];(u=c.exec(d))!==null;){var h=u[1];if(!h){console.log("match found without corresponding matchIndex");break}if(v=d.indexOf(h,v+1),c.lastIndex=v+h.length,v<0)break;for(var b=v+h.length,y=f+1;b>e.cols;)b-=e.cols,y++;for(var L=v+1,P=f+1;L>e.cols;)L-=e.cols,P++;var M={start:{x:L,y:P},end:{x:b,y}};w.push({range:M,text:h,activate:t})}return w},o._translateBufferLineToStringWithWrap=function(n,i,e){var t,u,c="";do{if(!(d=e.buffer.active.getLine(n)))break;d.isWrapped&&n--,u=d.isWrapped}while(u);var _=n;do{var d,f=e.buffer.active.getLine(n+1);if(t=!!f&&f.isWrapped,!(d=e.buffer.active.getLine(n)))break;c+=d.translateToString(!t&&i).substring(0,e.cols),n++}while(t);return[c,_]},o}();r.LinkComputer=p}},l={};function x(a){var r=l[a];if(r!==void 0)return r.exports;var s=l[a]={exports:{}};return g[a](s,s.exports,x),s.exports}var W={};return(()=>{var a=W;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;var r=x(6),s=new RegExp(`(?:^|[^\\da-z\\.-]+)((https?:\\/\\/)((([\\da-z\\.-]+)\\.([a-z\\.]{2,18}))|((\\d{1,3}\\.){3}\\d{1,3})|(localhost))(:\\d{1,5})?((\\/[\\/\\w\\.\\-%~:+@]*)*([^:"'\\s]))?(\\?[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?(#[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?)($|[^\\/\\w\\.\\-%]+)`);function p(n,i){var e=window.open();if(e){try{e.opener=null}catch{}e.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}var o=function(){function n(i,e,t){i===void 0&&(i=p),e===void 0&&(e={}),t===void 0&&(t=!1),this._handler=i,this._options=e,this._useLinkProvider=t}return n.prototype.activate=function(i){if(this._terminal=i,this._useLinkProvider&&"registerLinkProvider"in this._terminal){var e=(t=this._options).urlRegex||s;this._linkProvider=this._terminal.registerLinkProvider(new r.WebLinkProvider(this._terminal,e,this._handler,t))}else{var t;(t=this._options).matchIndex=1,this._linkMatcherId=this._terminal.registerLinkMatcher(s,this._handler,t)}},n.prototype.dispose=function(){var i;this._linkMatcherId!==void 0&&this._terminal!==void 0&&this._terminal.deregisterLinkMatcher(this._linkMatcherId),(i=this._linkProvider)===null||i===void 0||i.dispose()},n}();a.WebLinksAddon=o})(),W})()})});export{j as a};