homebridge-config-ui-x 5.0.0-beta.26 → 5.0.0-beta.28

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 (180) hide show
  1. package/CHANGELOG.md +62 -17
  2. package/LICENSE +1 -1
  3. package/config.schema.json +38 -18
  4. package/dist/bin/hb-service.js +48 -47
  5. package/dist/bin/hb-service.js.map +1 -1
  6. package/dist/bin/platforms/win32.js +4 -2
  7. package/dist/bin/platforms/win32.js.map +1 -1
  8. package/dist/bin/standalone.js +1 -0
  9. package/dist/bin/standalone.js.map +1 -1
  10. package/dist/core/auth/auth.controller.d.ts +2 -0
  11. package/dist/core/auth/auth.service.js +10 -10
  12. package/dist/core/auth/auth.service.js.map +1 -1
  13. package/dist/core/config/config.service.d.ts +3 -0
  14. package/dist/core/config/config.service.js +1 -0
  15. package/dist/core/config/config.service.js.map +1 -1
  16. package/dist/core/config/config.startup.js +2 -2
  17. package/dist/core/config/config.startup.js.map +1 -1
  18. package/dist/core/homebridge-ipc/homebridge-ipc.service.js +3 -3
  19. package/dist/core/homebridge-ipc/homebridge-ipc.service.js.map +1 -1
  20. package/dist/index.js +8 -7
  21. package/dist/index.js.map +1 -1
  22. package/dist/main.js +1 -1
  23. package/dist/main.js.map +1 -1
  24. package/dist/modules/accessories/accessories.controller.js +4 -4
  25. package/dist/modules/accessories/accessories.controller.js.map +1 -1
  26. package/dist/modules/accessories/accessories.service.js +7 -6
  27. package/dist/modules/accessories/accessories.service.js.map +1 -1
  28. package/dist/modules/backup/backup.controller.js +7 -7
  29. package/dist/modules/backup/backup.controller.js.map +1 -1
  30. package/dist/modules/backup/backup.service.js +14 -14
  31. package/dist/modules/backup/backup.service.js.map +1 -1
  32. package/dist/modules/child-bridges/child-bridges.service.js +3 -3
  33. package/dist/modules/child-bridges/child-bridges.service.js.map +1 -1
  34. package/dist/modules/config-editor/config-editor.controller.js +7 -7
  35. package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
  36. package/dist/modules/config-editor/config-editor.service.js +6 -6
  37. package/dist/modules/config-editor/config-editor.service.js.map +1 -1
  38. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +11 -9
  39. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
  40. package/dist/modules/log/log.service.js +3 -3
  41. package/dist/modules/log/log.service.js.map +1 -1
  42. package/dist/modules/platform-tools/docker/docker.controller.js +3 -3
  43. package/dist/modules/platform-tools/docker/docker.controller.js.map +1 -1
  44. package/dist/modules/platform-tools/docker/docker.service.js +1 -1
  45. package/dist/modules/platform-tools/docker/docker.service.js.map +1 -1
  46. package/dist/modules/platform-tools/hb-service/hb-service.controller.js +1 -1
  47. package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
  48. package/dist/modules/platform-tools/hb-service/hb-service.service.js +6 -6
  49. package/dist/modules/platform-tools/hb-service/hb-service.service.js.map +1 -1
  50. package/dist/modules/platform-tools/linux/linux.controller.js +2 -2
  51. package/dist/modules/platform-tools/linux/linux.controller.js.map +1 -1
  52. package/dist/modules/platform-tools/linux/linux.service.js +2 -2
  53. package/dist/modules/platform-tools/linux/linux.service.js.map +1 -1
  54. package/dist/modules/platform-tools/terminal/terminal.service.js +2 -2
  55. package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
  56. package/dist/modules/plugins/plugins.controller.js +4 -4
  57. package/dist/modules/plugins/plugins.controller.js.map +1 -1
  58. package/dist/modules/plugins/plugins.service.d.ts +1 -0
  59. package/dist/modules/plugins/plugins.service.js +61 -35
  60. package/dist/modules/plugins/plugins.service.js.map +1 -1
  61. package/dist/modules/server/server.controller.d.ts +19 -2
  62. package/dist/modules/server/server.controller.js +84 -18
  63. package/dist/modules/server/server.controller.js.map +1 -1
  64. package/dist/modules/server/server.service.d.ts +23 -6
  65. package/dist/modules/server/server.service.js +171 -56
  66. package/dist/modules/server/server.service.js.map +1 -1
  67. package/dist/modules/status/status.controller.js +3 -3
  68. package/dist/modules/status/status.controller.js.map +1 -1
  69. package/dist/modules/status/status.service.js +4 -4
  70. package/dist/modules/status/status.service.js.map +1 -1
  71. package/dist/modules/users/users.controller.js +1 -1
  72. package/dist/modules/users/users.controller.js.map +1 -1
  73. package/dist/self-check.js +6 -6
  74. package/dist/self-check.js.map +1 -1
  75. package/package.json +6 -6
  76. package/public/3rdpartylicenses.txt +25 -25
  77. package/public/chunk-2NFCPXAU.js +1 -0
  78. package/public/chunk-2NVHMNG5.js +1 -0
  79. package/public/{chunk-IPIDD3HC.js → chunk-2TOAVTFL.js} +1 -1
  80. package/public/chunk-3RXSS7UO.js +1 -0
  81. package/public/chunk-3Y2DGAWS.js +1 -0
  82. package/public/chunk-4JBDAK6H.js +1 -0
  83. package/public/{chunk-B753ANRE.js → chunk-4KPISZW4.js} +1 -1
  84. package/public/chunk-56KXI7R5.js +1 -0
  85. package/public/{chunk-U7623GKH.js → chunk-6EVHGB4P.js} +1 -1
  86. package/public/chunk-6YUXY73A.js +1 -0
  87. package/public/chunk-77AXHBP3.js +32 -0
  88. package/public/chunk-7EH23OME.js +1 -0
  89. package/public/{chunk-2OJNON6V.js → chunk-7EKKX4HT.js} +1 -1
  90. package/public/{chunk-KFOQEXZZ.js → chunk-7JAZ6D7D.js} +1 -1
  91. package/public/chunk-7O7AR4AM.js +6 -0
  92. package/public/{chunk-35ZEUC3N.js → chunk-A7RV5JVQ.js} +1 -1
  93. package/public/chunk-CKS4OOJF.js +1 -0
  94. package/public/{chunk-E4B7DNVE.js → chunk-DKV2C6JN.js} +4 -4
  95. package/public/chunk-DTBDAENF.js +1 -0
  96. package/public/{chunk-2VNUUJGQ.js → chunk-DY4CFYGO.js} +1 -1
  97. package/public/chunk-EEDUUZ6J.js +1 -0
  98. package/public/{chunk-T7Y7UGKU.js → chunk-EQHMVJZQ.js} +1 -1
  99. package/public/chunk-FCNYMCDH.js +1 -0
  100. package/public/{chunk-UIOHAIYB.js → chunk-FSQPG6HA.js} +1 -1
  101. package/public/chunk-GHT3N6F5.js +1 -0
  102. package/public/{chunk-P6NTJCU3.js → chunk-IAME6HRQ.js} +1 -1
  103. package/public/chunk-IQOW7DIL.js +1 -0
  104. package/public/{chunk-OC7KX4QS.js → chunk-IW6SKATB.js} +1 -1
  105. package/public/chunk-J3RKUN7D.js +1 -0
  106. package/public/chunk-JFJTXO7W.js +1 -0
  107. package/public/{chunk-V7MSRFYG.js → chunk-JH3TEYUN.js} +1 -1
  108. package/public/chunk-LEFLOPGL.js +1 -0
  109. package/public/chunk-LRA5QZUF.js +1 -0
  110. package/public/chunk-MOYAUTWQ.js +1 -0
  111. package/public/{chunk-NF2LWORY.js → chunk-NMDGMKTC.js} +1 -1
  112. package/public/chunk-NSSJTB6U.js +1 -0
  113. package/public/chunk-O2T3H55F.js +20 -0
  114. package/public/chunk-OBQHFSUL.js +1 -0
  115. package/public/{chunk-EMNTAE5G.js → chunk-OGMGPP6F.js} +1 -1
  116. package/public/{chunk-BBIB7OOE.js → chunk-OQ6Q5ACW.js} +1 -1
  117. package/public/chunk-P6QZTG6X.js +1 -0
  118. package/public/{chunk-4HJ4QRHU.js → chunk-PALAGBX5.js} +1 -1
  119. package/public/chunk-Q23I6M54.js +1 -0
  120. package/public/{chunk-B46KABOE.js → chunk-QOCGTZFM.js} +1 -1
  121. package/public/chunk-SHOUY6NT.js +1 -0
  122. package/public/chunk-SJK6QB4P.js +1 -0
  123. package/public/{chunk-TQEO2WY5.js → chunk-SK6P7SRA.js} +1 -1
  124. package/public/chunk-SPZTKLLI.js +1 -0
  125. package/public/chunk-T7V32PLS.js +1 -0
  126. package/public/chunk-UAYX5MW3.js +1 -0
  127. package/public/{chunk-OJ45QGCH.js → chunk-VRKZRZ3K.js} +1 -1
  128. package/public/chunk-WB62D2DL.js +1 -0
  129. package/public/chunk-WQOH45IS.js +1 -0
  130. package/public/{chunk-JXNMTC4S.js → chunk-WZBWQOWX.js} +1 -1
  131. package/public/chunk-X5YRTZFZ.js +1 -0
  132. package/public/chunk-Y3G4O36G.js +1 -0
  133. package/public/{chunk-N4GLNFOT.js → chunk-Y3M46CD2.js} +1 -1
  134. package/public/{chunk-H3RI2X3J.js → chunk-Y7ZULLZS.js} +2 -2
  135. package/public/{chunk-OQEKVBVC.js → chunk-YSFKEXNC.js} +1 -1
  136. package/public/chunk-YUK7YC5O.js +1 -0
  137. package/public/{chunk-L2733SOJ.js → chunk-YWEEDHFM.js} +1 -1
  138. package/public/chunk-ZNWGO4JM.js +1 -0
  139. package/public/chunk-ZYVX5TJ4.js +1 -0
  140. package/public/index.html +2 -2
  141. package/public/main-ZKH4BRWO.js +1 -0
  142. package/public/{styles-LM2DJG4C.css → styles-LO2KB5IY.css} +1 -1
  143. package/public/chunk-2N2FIQZE.js +0 -1
  144. package/public/chunk-35GQ3F7V.js +0 -1
  145. package/public/chunk-36GSB6KM.js +0 -1
  146. package/public/chunk-3G2INPN4.js +0 -6
  147. package/public/chunk-3VNR3PA7.js +0 -1
  148. package/public/chunk-56Z7AYJ5.js +0 -1
  149. package/public/chunk-6J7CM2LU.js +0 -1
  150. package/public/chunk-7ZMNAUG3.js +0 -1
  151. package/public/chunk-AHQEC5XD.js +0 -1
  152. package/public/chunk-BO2Q6JEC.js +0 -1
  153. package/public/chunk-BVU3XBKZ.js +0 -1
  154. package/public/chunk-D73G6FHU.js +0 -1
  155. package/public/chunk-EFJQDZWX.js +0 -1
  156. package/public/chunk-F6IIUWOY.js +0 -1
  157. package/public/chunk-FAWZXXFU.js +0 -1
  158. package/public/chunk-H4TSN4GX.js +0 -20
  159. package/public/chunk-J5YJPEOP.js +0 -1
  160. package/public/chunk-MA2NAED5.js +0 -1
  161. package/public/chunk-NEHFSTZG.js +0 -1
  162. package/public/chunk-OD3LAPR5.js +0 -1
  163. package/public/chunk-ONUDLIEE.js +0 -1
  164. package/public/chunk-QXIVYED3.js +0 -1
  165. package/public/chunk-SNISLJD4.js +0 -1
  166. package/public/chunk-SRN6APE2.js +0 -1
  167. package/public/chunk-SWSVESSY.js +0 -1
  168. package/public/chunk-T5M25JEJ.js +0 -1
  169. package/public/chunk-TILEZFVJ.js +0 -1
  170. package/public/chunk-TLJ5IZVT.js +0 -32
  171. package/public/chunk-UPOTR3TI.js +0 -1
  172. package/public/chunk-VM7WUBIT.js +0 -1
  173. package/public/chunk-W5T6GB3H.js +0 -1
  174. package/public/chunk-WRDAYUQ7.js +0 -1
  175. package/public/chunk-XLT7LNOY.js +0 -1
  176. package/public/chunk-XROHACBE.js +0 -1
  177. package/public/chunk-XSAIQ7YY.js +0 -1
  178. package/public/chunk-YIXOCUUM.js +0 -1
  179. package/public/chunk-YMEQWVLZ.js +0 -1
  180. package/public/main-HHNIKZ37.js +0 -1
@@ -1 +1 @@
1
- import{c as pe}from"./chunk-TQEO2WY5.js";import{j as le}from"./chunk-YIXOCUUM.js";import{f as We,ha as fe,k as he,n as X,na as ue}from"./chunk-CKNHTRCL.js";var d=Object.create(null);d.open="0";d.close="1";d.ping="2";d.pong="3";d.message="4";d.upgrade="5";d.noop="6";var S=Object.create(null);Object.keys(d).forEach(r=>{S[d[r]]=r});var O={type:"error",data:"parser error"};var ye=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ge=typeof ArrayBuffer=="function",_e=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,B=({type:r,data:e},t,s)=>ye&&e instanceof Blob?t?s(e):de(e,s):ge&&(e instanceof ArrayBuffer||_e(e))?t?s(e):de(new Blob([e]),s):s(d[r]+(e||"")),de=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)};function me(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var $;function be(r,e){if(ye&&r.data instanceof Blob)return r.data.arrayBuffer().then(me).then(e);if(ge&&(r.data instanceof ArrayBuffer||_e(r.data)))return e(me(r.data));B(r,!1,t=>{$||($=new TextEncoder),e($.encode(t))})}var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<we.length;r++)N[we.charCodeAt(r)]=r;var ke=r=>{let e=r.length*.75,t=r.length,s,i=0,n,o,c,a;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),p=new Uint8Array(m);for(s=0;s<t;s+=4)n=N[r.charCodeAt(s)],o=N[r.charCodeAt(s+1)],c=N[r.charCodeAt(s+2)],a=N[r.charCodeAt(s+3)],p[i++]=n<<2|o>>4,p[i++]=(o&15)<<4|c>>2,p[i++]=(c&3)<<6|a&63;return m};var Ke=typeof ArrayBuffer=="function",L=(r,e)=>{if(typeof r!="string")return{type:"message",data:Ee(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:Ye(r.substring(1),e)}:S[t]?r.length>1?{type:S[t],data:r.substring(1)}:{type:S[t]}:O},Ye=(r,e)=>{if(Ke){let t=ke(r);return Ee(t,e)}else return{base64:!0,data:r}},Ee=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var ve="",xe=(r,e)=>{let t=r.length,s=new Array(t),i=0;r.forEach((n,o)=>{B(n,!1,c=>{s[o]=c,++i===t&&e(s.join(ve))})})},Te=(r,e)=>{let t=r.split(ve),s=[];for(let i=0;i<t.length;i++){let n=L(t[i],e);if(s.push(n),n.type==="error")break}return s};function Ae(){return new TransformStream({transform(r,e){be(r,t=>{let s=t.length,i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);let n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,s)}else{i=new Uint8Array(9);let n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(s))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Q;function U(r){return r.reduce((e,t)=>e+t.length,0)}function V(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),s=0;for(let i=0;i<e;i++)t[i]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),t}function Re(r,e){Q||(Q=new TextDecoder);let t=[],s=0,i=-1,n=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(U(t)<1)break;let a=V(t,1);n=(a[0]&128)===128,i=a[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(U(t)<2)break;let a=V(t,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(U(t)<8)break;let a=V(t,8),m=new DataView(a.buffer,a.byteOffset,a.length),p=m.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(O);break}i=p*Math.pow(2,32)+m.getUint32(4),s=3}else{if(U(t)<i)break;let a=V(t,i);c.enqueue(L(n?a:Q.decode(a),e)),s=0}if(i===0||i>r){c.enqueue(O);break}}}})}var j=4;function f(r){if(r)return Je(r)}function Je(r){for(var e in f.prototype)r[e]=f.prototype[e];return r}f.prototype.on=f.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};f.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};f.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};f.prototype.emitReserved=f.prototype.emit;f.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};f.prototype.hasListeners=function(r){return!!this.listeners(r).length};var y=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),u=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ce="arraybuffer";function M(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var ze=u.setTimeout,Xe=u.clearTimeout;function g(r,e){e.useNativeTimers?(r.setTimeoutFn=ze.bind(u),r.clearTimeoutFn=Xe.bind(u)):(r.setTimeoutFn=u.setTimeout.bind(u),r.clearTimeoutFn=u.clearTimeout.bind(u))}var $e=1.33;function Se(r){return typeof r=="string"?Qe(r):Math.ceil((r.byteLength||r.size)*$e)}function Qe(r){let e=0,t=0;for(let s=0,i=r.length;s<i;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Oe(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Be(r){let e={},t=r.split("&");for(let s=0,i=t.length;s<i;s++){let n=t[s].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var W=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},_=class extends f{constructor(e){super(),this.writable=!1,g(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new W(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=L(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Oe(e);return t.length?"?"+t:""}};var P=class extends _{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Te(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,xe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=H()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var Ne=!1;try{Ne=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Le=Ne;function je(){}var G=class extends P{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},K=(()=>{class r extends f{constructor(t,s,i){super(),this.createRequest=t,g(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;let s=M(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=je,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Pe);else if(typeof addEventListener=="function"){let r="onpagehide"in u?"pagehide":"unload";addEventListener(r,Pe,!1)}}function Pe(){for(let r in K.requests)K.requests.hasOwnProperty(r)&&K.requests[r].abort()}var Ge=function(){let r=qe({xdomain:!1});return r&&r.responseType!==null}(),w=class extends G{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ge&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K(qe,this.uri(),e)}};function qe(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Le))return new XMLHttpRequest}catch{}if(!e)try{return new u[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var De=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ee=class extends _{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=De?{}:M(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;B(s,this.supportsBinary,n=>{try{this.doWrite(s,n)}catch{}i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Z=u.WebSocket||u.MozWebSocket,k=class extends ee{createSocket(e,t,s){return De?new Z(e,t,s):t?new Z(e,t):new Z(e)}doWrite(e,t){this.ws.send(t)}};var v=class extends _{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Re(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ae();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();let n=()=>{s.read().then(({done:c,value:a})=>{c||(this.onPacket(a),n())}).catch(c=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var te={websocket:k,webtransport:v,polling:w};var Ze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,et=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function x(r){if(r.length>8e3)throw"URI too long";let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let i=Ze.exec(r||""),n={},o=14;for(;o--;)n[et[o]]=i[o]||"";return t!=-1&&s!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=tt(n,n.path),n.queryKey=st(n,n.query),n}function tt(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function st(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,n){i&&(t[i]=n)}),t}var se=typeof addEventListener=="function"&&typeof removeEventListener=="function",Y=[];se&&addEventListener("offline",()=>{Y.forEach(r=>r())},!1);var J=(()=>{class r extends f{constructor(t,s){if(super(),this.binaryType=Ce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){let i=x(t);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=x(s.host).host);g(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Be(this.opts.query)),se&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Y.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let s=Object.assign({},this.opts.query);s.EIO=j,s.transport=t,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Se(n)),i>0&&s>this._maxPayload)return this.writeBuffer.slice(0,i);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,y(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,i){return this._sendPacket("message",t,s,i),this}send(t,s,i){return this._sendPacket("message",t,s,i),this}_sendPacket(t,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let o={type:t,data:s,options:i};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),se&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Y.indexOf(this._offlineEventListener);i!==-1&&Y.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=j,r})(),z=class extends J{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;J.priorWebsocketSuccess=!1;let i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let C=new Error("probe error");C.transport=t.name,this.emitReserved("upgradeError",C)}}))};function n(){s||(s=!0,p(),t.close(),t=null)}let o=b=>{let C=new Error("probe error: "+b);C.transport=t.name,n(),this.emitReserved("upgradeError",C)};function c(){o("transport closed")}function a(){o("socket closed")}function m(b){t&&b.name!==t.name&&n()}let p=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",a),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",a),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}},T=class extends z{constructor(e,t={}){let s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>te[i]).filter(i=>!!i)),super(e,s)}};var ds=T.protocol;function Fe(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=x(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(t&&t.port===s.port?"":":"+s.port),s}var ae={};We(ae,{Decoder:()=>oe,Encoder:()=>ne,PacketType:()=>h,protocol:()=>He});var it=typeof ArrayBuffer=="function",nt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ie=Object.prototype.toString,ot=typeof Blob=="function"||typeof Blob<"u"&&Ie.call(Blob)==="[object BlobConstructor]",ct=typeof File=="function"||typeof File<"u"&&Ie.call(File)==="[object FileConstructor]";function D(r){return it&&(r instanceof ArrayBuffer||nt(r))||ot&&r instanceof Blob||ct&&r instanceof File}function q(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(q(r[t]))return!0;return!1}if(D(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return q(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&q(r[t]))return!0;return!1}function Ue(r){let e=[],t=r.data,s=r;return s.data=re(t,e),s.attachments=e.length,{packet:s,buffers:e}}function re(r,e){if(!r)return r;if(D(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=re(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=re(r[s],e));return t}return r}function Ve(r,e){return r.data=ie(r.data,e),delete r.attachments,r}function ie(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ie(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ie(r[t],e));return r}var at=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],He=5,h=function(r){return r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK",r}(h||{}),ne=class{constructor(e){this.replacer=e}encode(e){return(e.type===h.EVENT||e.type===h.ACK)&&q(e)?this.encodeAsBinary({type:e.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Ue(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}};function Me(r){return Object.prototype.toString.call(r)==="[object Object]"}var oe=class r extends f{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===h.BINARY_EVENT;s||t.type===h.BINARY_ACK?(t.type=s?h.EVENT:h.ACK,this.reconstructor=new ce(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(D(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(h[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===h.BINARY_EVENT||s.type===h.BINARY_ACK){let n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(n,t)}else s.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(r.isPayloadValid(s.type,n))s.data=n;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case h.CONNECT:return Me(t);case h.DISCONNECT:return t===void 0;case h.CONNECT_ERROR:return typeof t=="string"||Me(t);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&at.indexOf(t[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ce=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=Ve(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function l(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var ht=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),A=class extends f{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[l(e,"open",this.onopen.bind(this)),l(e,"packet",this.onpacket.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,n;if(ht.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:h.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let p=this.ids++,b=t.pop();this._registerAckCallback(p,b),o.id=p}let c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;let i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(n),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{let n=(o,c)=>o?i(o):s(c);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case h.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(e);break;case h.ACK:case h.BINARY_ACK:this.onack(e);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...i){s||(s=!0,t.packet({type:h.ACK,id:e,data:i}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function E(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}E.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=Math.floor(e*10)&1?r+t:r-t}return Math.min(r,this.max)|0};E.prototype.reset=function(){this.attempts=0};E.prototype.setMin=function(r){this.ms=r};E.prototype.setMax=function(r){this.max=r};E.prototype.setJitter=function(r){this.jitter=r};var R=class extends f{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,g(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new E({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let i=t.parser||ae;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new T(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let i=l(t,"open",function(){s.onopen(),e&&e()}),n=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=l(t,"error",n);if(this._timeout!==!1){let c=this._timeout,a=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},c);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(l(e,"ping",this.onping.bind(this)),l(e,"data",this.ondata.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this)),l(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){y(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new A(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var F={};function I(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Fe(r,e.path||"/socket.io"),s=t.source,i=t.id,n=t.path,o=F[i]&&n in F[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,a;return c?a=new R(s,e):(F[i]||(F[i]=new R(s,e)),a=F[i]),t.query&&!e.query&&(e.query=t.queryKey),a.socket(t.path,e)}Object.assign(I,{Manager:R,Socket:A,io:I,connect:I});var cr=(()=>{class r{$auth=ue(pe);namespaceConnectionCache={};constructor(){}connectToNamespace(t){if(this.namespaceConnectionCache[t]){let s=this.namespaceConnectionCache[t];return s.connected=new X,setTimeout(()=>{s.socket.connected&&s.connected.next(void 0)}),s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]}else{let s=this.establishConnectionToNamespace(t);return s.connected=new X,s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]=s,s}}getExistingNamespace(t){return this.namespaceConnectionCache[t]}establishConnectionToNamespace(t){let s=I(`${le.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new he(c=>{s.emit(n,o,a=>{typeof a=="object"&&a.error?c.error(a):c.next(a),c.complete()})})}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=fe({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{cr as a};
1
+ import{c as pe}from"./chunk-SK6P7SRA.js";import{j as le}from"./chunk-WQOH45IS.js";import{f as We,ha as fe,k as he,n as X,na as ue}from"./chunk-CKNHTRCL.js";var d=Object.create(null);d.open="0";d.close="1";d.ping="2";d.pong="3";d.message="4";d.upgrade="5";d.noop="6";var S=Object.create(null);Object.keys(d).forEach(r=>{S[d[r]]=r});var O={type:"error",data:"parser error"};var ye=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ge=typeof ArrayBuffer=="function",_e=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,B=({type:r,data:e},t,s)=>ye&&e instanceof Blob?t?s(e):de(e,s):ge&&(e instanceof ArrayBuffer||_e(e))?t?s(e):de(new Blob([e]),s):s(d[r]+(e||"")),de=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)};function me(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var $;function be(r,e){if(ye&&r.data instanceof Blob)return r.data.arrayBuffer().then(me).then(e);if(ge&&(r.data instanceof ArrayBuffer||_e(r.data)))return e(me(r.data));B(r,!1,t=>{$||($=new TextEncoder),e($.encode(t))})}var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<we.length;r++)N[we.charCodeAt(r)]=r;var ke=r=>{let e=r.length*.75,t=r.length,s,i=0,n,o,c,a;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),p=new Uint8Array(m);for(s=0;s<t;s+=4)n=N[r.charCodeAt(s)],o=N[r.charCodeAt(s+1)],c=N[r.charCodeAt(s+2)],a=N[r.charCodeAt(s+3)],p[i++]=n<<2|o>>4,p[i++]=(o&15)<<4|c>>2,p[i++]=(c&3)<<6|a&63;return m};var Ke=typeof ArrayBuffer=="function",L=(r,e)=>{if(typeof r!="string")return{type:"message",data:Ee(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:Ye(r.substring(1),e)}:S[t]?r.length>1?{type:S[t],data:r.substring(1)}:{type:S[t]}:O},Ye=(r,e)=>{if(Ke){let t=ke(r);return Ee(t,e)}else return{base64:!0,data:r}},Ee=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var ve="",xe=(r,e)=>{let t=r.length,s=new Array(t),i=0;r.forEach((n,o)=>{B(n,!1,c=>{s[o]=c,++i===t&&e(s.join(ve))})})},Te=(r,e)=>{let t=r.split(ve),s=[];for(let i=0;i<t.length;i++){let n=L(t[i],e);if(s.push(n),n.type==="error")break}return s};function Ae(){return new TransformStream({transform(r,e){be(r,t=>{let s=t.length,i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);let n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,s)}else{i=new Uint8Array(9);let n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(s))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Q;function U(r){return r.reduce((e,t)=>e+t.length,0)}function V(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),s=0;for(let i=0;i<e;i++)t[i]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),t}function Re(r,e){Q||(Q=new TextDecoder);let t=[],s=0,i=-1,n=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(U(t)<1)break;let a=V(t,1);n=(a[0]&128)===128,i=a[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(U(t)<2)break;let a=V(t,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(U(t)<8)break;let a=V(t,8),m=new DataView(a.buffer,a.byteOffset,a.length),p=m.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(O);break}i=p*Math.pow(2,32)+m.getUint32(4),s=3}else{if(U(t)<i)break;let a=V(t,i);c.enqueue(L(n?a:Q.decode(a),e)),s=0}if(i===0||i>r){c.enqueue(O);break}}}})}var j=4;function f(r){if(r)return Je(r)}function Je(r){for(var e in f.prototype)r[e]=f.prototype[e];return r}f.prototype.on=f.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};f.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};f.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};f.prototype.emitReserved=f.prototype.emit;f.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};f.prototype.hasListeners=function(r){return!!this.listeners(r).length};var y=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),u=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ce="arraybuffer";function M(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var ze=u.setTimeout,Xe=u.clearTimeout;function g(r,e){e.useNativeTimers?(r.setTimeoutFn=ze.bind(u),r.clearTimeoutFn=Xe.bind(u)):(r.setTimeoutFn=u.setTimeout.bind(u),r.clearTimeoutFn=u.clearTimeout.bind(u))}var $e=1.33;function Se(r){return typeof r=="string"?Qe(r):Math.ceil((r.byteLength||r.size)*$e)}function Qe(r){let e=0,t=0;for(let s=0,i=r.length;s<i;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Oe(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Be(r){let e={},t=r.split("&");for(let s=0,i=t.length;s<i;s++){let n=t[s].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var W=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},_=class extends f{constructor(e){super(),this.writable=!1,g(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new W(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=L(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Oe(e);return t.length?"?"+t:""}};var P=class extends _{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Te(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,xe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=H()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var Ne=!1;try{Ne=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Le=Ne;function je(){}var G=class extends P{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},K=(()=>{class r extends f{constructor(t,s,i){super(),this.createRequest=t,g(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;let s=M(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=je,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Pe);else if(typeof addEventListener=="function"){let r="onpagehide"in u?"pagehide":"unload";addEventListener(r,Pe,!1)}}function Pe(){for(let r in K.requests)K.requests.hasOwnProperty(r)&&K.requests[r].abort()}var Ge=function(){let r=qe({xdomain:!1});return r&&r.responseType!==null}(),w=class extends G{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ge&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K(qe,this.uri(),e)}};function qe(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Le))return new XMLHttpRequest}catch{}if(!e)try{return new u[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var De=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ee=class extends _{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=De?{}:M(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;B(s,this.supportsBinary,n=>{try{this.doWrite(s,n)}catch{}i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Z=u.WebSocket||u.MozWebSocket,k=class extends ee{createSocket(e,t,s){return De?new Z(e,t,s):t?new Z(e,t):new Z(e)}doWrite(e,t){this.ws.send(t)}};var v=class extends _{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Re(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ae();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();let n=()=>{s.read().then(({done:c,value:a})=>{c||(this.onPacket(a),n())}).catch(c=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var te={websocket:k,webtransport:v,polling:w};var Ze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,et=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function x(r){if(r.length>8e3)throw"URI too long";let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let i=Ze.exec(r||""),n={},o=14;for(;o--;)n[et[o]]=i[o]||"";return t!=-1&&s!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=tt(n,n.path),n.queryKey=st(n,n.query),n}function tt(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function st(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,n){i&&(t[i]=n)}),t}var se=typeof addEventListener=="function"&&typeof removeEventListener=="function",Y=[];se&&addEventListener("offline",()=>{Y.forEach(r=>r())},!1);var J=(()=>{class r extends f{constructor(t,s){if(super(),this.binaryType=Ce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){let i=x(t);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=x(s.host).host);g(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Be(this.opts.query)),se&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Y.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let s=Object.assign({},this.opts.query);s.EIO=j,s.transport=t,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Se(n)),i>0&&s>this._maxPayload)return this.writeBuffer.slice(0,i);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,y(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,i){return this._sendPacket("message",t,s,i),this}send(t,s,i){return this._sendPacket("message",t,s,i),this}_sendPacket(t,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let o={type:t,data:s,options:i};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),se&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Y.indexOf(this._offlineEventListener);i!==-1&&Y.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=j,r})(),z=class extends J{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;J.priorWebsocketSuccess=!1;let i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let C=new Error("probe error");C.transport=t.name,this.emitReserved("upgradeError",C)}}))};function n(){s||(s=!0,p(),t.close(),t=null)}let o=b=>{let C=new Error("probe error: "+b);C.transport=t.name,n(),this.emitReserved("upgradeError",C)};function c(){o("transport closed")}function a(){o("socket closed")}function m(b){t&&b.name!==t.name&&n()}let p=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",a),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",a),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}},T=class extends z{constructor(e,t={}){let s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>te[i]).filter(i=>!!i)),super(e,s)}};var ds=T.protocol;function Fe(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=x(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(t&&t.port===s.port?"":":"+s.port),s}var ae={};We(ae,{Decoder:()=>oe,Encoder:()=>ne,PacketType:()=>h,protocol:()=>He});var it=typeof ArrayBuffer=="function",nt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ie=Object.prototype.toString,ot=typeof Blob=="function"||typeof Blob<"u"&&Ie.call(Blob)==="[object BlobConstructor]",ct=typeof File=="function"||typeof File<"u"&&Ie.call(File)==="[object FileConstructor]";function D(r){return it&&(r instanceof ArrayBuffer||nt(r))||ot&&r instanceof Blob||ct&&r instanceof File}function q(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(q(r[t]))return!0;return!1}if(D(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return q(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&q(r[t]))return!0;return!1}function Ue(r){let e=[],t=r.data,s=r;return s.data=re(t,e),s.attachments=e.length,{packet:s,buffers:e}}function re(r,e){if(!r)return r;if(D(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=re(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=re(r[s],e));return t}return r}function Ve(r,e){return r.data=ie(r.data,e),delete r.attachments,r}function ie(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ie(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ie(r[t],e));return r}var at=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],He=5,h=function(r){return r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK",r}(h||{}),ne=class{constructor(e){this.replacer=e}encode(e){return(e.type===h.EVENT||e.type===h.ACK)&&q(e)?this.encodeAsBinary({type:e.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Ue(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}};function Me(r){return Object.prototype.toString.call(r)==="[object Object]"}var oe=class r extends f{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===h.BINARY_EVENT;s||t.type===h.BINARY_ACK?(t.type=s?h.EVENT:h.ACK,this.reconstructor=new ce(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(D(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(h[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===h.BINARY_EVENT||s.type===h.BINARY_ACK){let n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(n,t)}else s.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(r.isPayloadValid(s.type,n))s.data=n;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case h.CONNECT:return Me(t);case h.DISCONNECT:return t===void 0;case h.CONNECT_ERROR:return typeof t=="string"||Me(t);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&at.indexOf(t[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ce=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=Ve(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function l(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var ht=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),A=class extends f{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[l(e,"open",this.onopen.bind(this)),l(e,"packet",this.onpacket.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,n;if(ht.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:h.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let p=this.ids++,b=t.pop();this._registerAckCallback(p,b),o.id=p}let c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;let i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(n),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{let n=(o,c)=>o?i(o):s(c);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case h.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(e);break;case h.ACK:case h.BINARY_ACK:this.onack(e);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...i){s||(s=!0,t.packet({type:h.ACK,id:e,data:i}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function E(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}E.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=Math.floor(e*10)&1?r+t:r-t}return Math.min(r,this.max)|0};E.prototype.reset=function(){this.attempts=0};E.prototype.setMin=function(r){this.ms=r};E.prototype.setMax=function(r){this.max=r};E.prototype.setJitter=function(r){this.jitter=r};var R=class extends f{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,g(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new E({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let i=t.parser||ae;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new T(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let i=l(t,"open",function(){s.onopen(),e&&e()}),n=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=l(t,"error",n);if(this._timeout!==!1){let c=this._timeout,a=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},c);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(l(e,"ping",this.onping.bind(this)),l(e,"data",this.ondata.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this)),l(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){y(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new A(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var F={};function I(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Fe(r,e.path||"/socket.io"),s=t.source,i=t.id,n=t.path,o=F[i]&&n in F[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,a;return c?a=new R(s,e):(F[i]||(F[i]=new R(s,e)),a=F[i]),t.query&&!e.query&&(e.query=t.queryKey),a.socket(t.path,e)}Object.assign(I,{Manager:R,Socket:A,io:I,connect:I});var cr=(()=>{class r{$auth=ue(pe);namespaceConnectionCache={};constructor(){}connectToNamespace(t){if(this.namespaceConnectionCache[t]){let s=this.namespaceConnectionCache[t];return s.connected=new X,setTimeout(()=>{s.socket.connected&&s.connected.next(void 0)}),s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]}else{let s=this.establishConnectionToNamespace(t);return s.connected=new X,s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]=s,s}}getExistingNamespace(t){return this.namespaceConnectionCache[t]}establishConnectionToNamespace(t){let s=I(`${le.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new he(c=>{s.emit(n,o,a=>{typeof a=="object"&&a.error?c.error(a):c.next(a),c.complete()})})}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=fe({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{cr as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-7EH23OME.js";import"./chunk-YLEC7AUG.js";import"./chunk-T3GI7KUT.js";import"./chunk-SK6P7SRA.js";import"./chunk-J3RKUN7D.js";import"./chunk-WQOH45IS.js";import"./chunk-HA6CO5NZ.js";import"./chunk-675OFXLW.js";import"./chunk-CKNHTRCL.js";export{a as LoginComponent};
@@ -1 +1 @@
1
- import{o as k}from"./chunk-N4F42HDL.js";import{d as P}from"./chunk-T3GI7KUT.js";import{b as V}from"./chunk-2N2FIQZE.js";import{h as T,k as O}from"./chunk-YIXOCUUM.js";import{a as y,b as $}from"./chunk-675OFXLW.js";import{Bb as g,Cc as a,Dc as s,Mb as C,Rb as f,Wb as o,Xb as r,Yb as h,ac as v,dc as m,ec as b,ib as i,na as c,oc as l,pc as S,qc as d,ub as w,xa as u,ya as _}from"./chunk-CKNHTRCL.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(O);$router=c(P);$settings=c(V);$toastr=c(T);$translate=c(y);constructor(){}restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[k,$],encapsulation:2})}return t})();export{G as a};
1
+ import{o as k}from"./chunk-N4F42HDL.js";import{d as P}from"./chunk-T3GI7KUT.js";import{b as V}from"./chunk-J3RKUN7D.js";import{h as T,k as O}from"./chunk-WQOH45IS.js";import{a as y,b as $}from"./chunk-675OFXLW.js";import{Bb as g,Cc as a,Dc as s,Mb as C,Rb as f,Wb as o,Xb as r,Yb as h,ac as v,dc as m,ec as b,ib as i,na as c,oc as l,pc as S,qc as d,ub as w,xa as u,ya as _}from"./chunk-CKNHTRCL.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(O);$router=c(P);$settings=c(V);$toastr=c(T);$translate=c(y);constructor(){}restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[k,$],encapsulation:2})}return t})();export{G as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-OGMGPP6F.js";import"./chunk-IAME6HRQ.js";import"./chunk-C2XBPNOQ.js";import"./chunk-7BCHGXO4.js";import"./chunk-EQHMVJZQ.js";import"./chunk-SK6P7SRA.js";import"./chunk-J3RKUN7D.js";import"./chunk-WQOH45IS.js";import"./chunk-HA6CO5NZ.js";import"./chunk-675OFXLW.js";import"./chunk-CKNHTRCL.js";export{a as TerminalComponent};
@@ -1,4 +1,4 @@
1
- import{a as b}from"./chunk-C2XBPNOQ.js";import{a as p,b as w}from"./chunk-7BCHGXO4.js";import{a as c}from"./chunk-T7Y7UGKU.js";import{M as i,g as o,ha as m,n,na as h}from"./chunk-CKNHTRCL.js";var d=o(p(),1),a=o(w(),1),l=o(b(),1);var v=(()=>{class e{$ws=h(c);term;io;fitAddon;webLinksAddon;resize;elementResize;constructor(){}destroyTerminal(){this.io.end(),this.term.dispose(),this.resize.complete(),this.elementResize&&this.elementResize.complete()}startTerminal(r,s={},f){this.elementResize=f,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new d.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new a.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new n,this.term.open(r.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(i(200)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
1
+ import{a as b}from"./chunk-C2XBPNOQ.js";import{a as p,b as w}from"./chunk-7BCHGXO4.js";import{a as c}from"./chunk-EQHMVJZQ.js";import{M as i,g as o,ha as m,n,na as h}from"./chunk-CKNHTRCL.js";var d=o(p(),1),a=o(w(),1),l=o(b(),1);var v=(()=>{class e{$ws=h(c);term;io;fitAddon;webLinksAddon;resize;elementResize;constructor(){}destroyTerminal(){this.io.end(),this.term.dispose(),this.resize.complete(),this.elementResize&&this.elementResize.complete()}startTerminal(r,s={},f){this.elementResize=f,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new d.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new a.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new n,this.term.open(r.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(i(200)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
2
2
  \r
3
3
  \rTerminal disconnected. Is the server running?
4
4
  \r
@@ -0,0 +1 @@
1
+ import{a as X}from"./chunk-6YUXY73A.js";import{n as j}from"./chunk-N4F42HDL.js";import{c as M,d as C,e as P,f as V,g as O,j as F,m as R,p as W,q as N,y as D,z as G}from"./chunk-YLEC7AUG.js";import{e as L}from"./chunk-T3GI7KUT.js";import{c as Q}from"./chunk-SK6P7SRA.js";import{b as J}from"./chunk-J3RKUN7D.js";import{h as q,j as I,k as K}from"./chunk-WQOH45IS.js";import{l as E}from"./chunk-HA6CO5NZ.js";import{a as H,b as A}from"./chunk-675OFXLW.js";import{Bb as z,Cc as s,Dc as l,Mb as _,Rb as f,Wb as i,Xb as r,Yb as c,ac as y,bd as B,dc as b,ec as m,h as w,ib as t,na as g,oc as a,pc as d,qc as v,ub as T,w as S,xa as x,ya as h,yc as $,zc as k}from"./chunk-CKNHTRCL.js";var U=(n,u)=>({"is-valid":n,"is-invalid":u}),Z=n=>({"button-loading":n});function ee(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",3),i(2,"h3",4),a(3),s(4,"translate"),r(),i(5,"button",5),b("click",function(){x(e);let p=m();return h(p.onClickGettingStarted())}),a(6),s(7,"translate"),r(),i(8,"small",6)(9,"a",7),b("click",function(){x(e);let p=m();return h(p.onClickRestoreBackup())}),a(10),s(11,"translate"),r()()()}n&2&&(t(3),d(l(4,3,"setup.welcome_to_homebridge")),t(3),v(" ",l(7,5,"setup.button_get_started")," "),t(4),d(l(11,7,"setup_wizard_message_restore")))}function te(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),r(),i(5,"div",9)(6,"p"),a(7),s(8,"translate"),r(),i(9,"form",10),b("ngSubmit",function(){x(e);let p=m();return h(p.createFirstUser())}),i(10,"div",11),c(11,"i",12)(12,"input",13),i(13,"label",14),a(14),s(15,"translate"),r()(),i(16,"div",11),c(17,"i",15)(18,"input",16),i(19,"label",17),a(20),s(21,"translate"),r()(),i(22,"div",11),c(23,"i",15)(24,"input",18),i(25,"label",19),a(26),s(27,"translate"),r()(),i(28,"div",20)(29,"button",21),a(30),s(31,"translate"),c(32,"i",22),r()()()()()}if(n&2){let e=m();t(3),d(l(4,15,"setup.create_account")),t(4),d(l(8,17,"setup.create_account_reason")),t(2),_("formGroup",e.createUserForm),t(3),_("readonly",e.loading)("ngClass",k(27,U,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid)),t(2),d(l(15,19,"users.label_username")),t(4),_("readonly",e.loading)("ngClass",k(30,U,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors)),t(2),d(l(21,21,"users.label_password")),t(4),_("readonly",e.loading)("ngClass",k(33,U,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors)),t(2),d(l(27,23,"users.label_confirm_password")),t(3),_("disabled",e.createUserForm.invalid||e.loading)("ngClass",$(36,Z,e.loading)),t(),v(" ",l(31,25,"setup.create_account")," ")}}function ie(n,u){n&1&&(i(0,"span"),c(1,"i",29),a(2),s(3,"translate"),r()),n&2&&(t(2),v(" ",l(3,1,"backup.label_uploading")," "))}function ne(n,u){n&1&&(a(0),s(1,"translate")),n&2&&v(" ",l(1,1,"backup.button_restore_backup")," ")}function oe(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),r(),i(5,"p"),a(6),s(7,"translate"),r(),i(8,"div",23)(9,"input",24),b("change",function(p){x(e);let Y=m();return h(Y.handleRestoreFileInput(p.target.files))}),r(),i(10,"label",25),a(11),s(12,"translate"),r()(),i(13,"div",26)(14,"button",27),b("click",function(){x(e);let p=m();return h(p.onClickCancelRestore())}),a(15),s(16,"translate"),r(),i(17,"button",28),b("click",function(){x(e);let p=m();return h(p.onRestoreBackupClick())}),z(18,ie,4,3,"span")(19,ne,2,3),r()()()}if(n&2){let e=m();t(3),d(l(4,8,"form.button_restore")),t(3),d(l(7,10,"backup.restore_help_one")),t(5),v(" ",l(12,12,(e.selectedFile==null?null:e.selectedFile.name)||"backup.label_choose_backup_file_to_restore")," "),t(3),_("disabled",e.restoreUploading),t(),v(" ",l(16,14,"form.button_cancel")," "),t(2),_("disabled",e.restoreUploading||!e.selectedFile),t(),f(e.restoreUploading?18:-1),t(),f(e.restoreUploading?-1:19)}}function re(n,u){n&1&&(i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),r(),i(5,"h1"),c(6,"i",29),r()()),n&2&&(t(3),d(l(4,1,"restart.title_restart")))}function ae(n,u){n&1&&(i(0,"div",2),c(1,"img",8),i(2,"h3",30),a(3),s(4,"translate"),r(),i(5,"p",31),a(6),s(7,"translate"),r(),i(8,"a",32),a(9),s(10,"translate"),r()()),n&2&&(t(3),d(l(4,3,"setup_wizard_message_complete_title")),t(3),d(l(7,5,"setup_wizard_message_complete_message")),t(3),d(l(10,7,"setup.open_dashboard")))}var ye=(()=>{class n{$api=g(K);$auth=g(Q);$modal=g(j);$settings=g(J);$title=g(E);$toastr=g(q);$translate=g(H);previousTitle;step="welcome";createUserForm=new O({username:new F("",[C.required]),password:new F("",[C.compose([C.required,C.minLength(4)])]),passwordConfirm:new F("",[C.required])},this.matchPassword);loading=!1;selectedFile;restoreUploading=!1;constructor(){}ngOnInit(){this.previousTitle=this.$title.getTitle(),this.$title.setTitle("Setup Homebridge")}matchPassword(e){let o=e.get("password").value,p=e.get("passwordConfirm").value;if(o!==p)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}ngOnDestroy(){this.$title.setTitle(this.previousTitle)}onClickGettingStarted(){this.step="create-account"}onClickRestoreBackup(){this.step="restore-backup"}onClickCancelRestore(){this.selectedFile=null,this.step="welcome"}createFirstUser(){this.loading=!0;let e=this.createUserForm.getRawValue();e.name=e.username,this.$api.post("/setup-wizard/create-first-user",e).subscribe({next:()=>w(this,null,function*(){this.$settings.env.setupWizardComplete=!0,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}),error:o=>{this.loading=!1,console.error(o),this.$toastr.error(o.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?this.selectedFile=e[0]:delete this.selectedFile}onRestoreBackupClick(){this.restoreUploading=!0,this.uploadHomebridgeArchive()}uploadHomebridgeArchive(){return w(this,null,function*(){try{let e=yield S(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(I.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token;let o=new FormData;o.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield S(this.$api.post("/backup/restore",o)),this.openRestoreModal(),this.restoreUploading=!1}catch(e){this.restoreUploading=!1,console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}openRestoreModal(){let e=this.$modal.open(X,{size:"lg",backdrop:"static"});e.componentInstance.setupWizardRestore=!0,e.result.then(o=>{o===!0&&this.waitForHomebridgeToRestart()})}waitForHomebridgeToRestart(){return w(this,null,function*(){this.step="restarting",window.localStorage.removeItem(I.jwt.tokenKey),this.$auth.token=null,yield new Promise(o=>setTimeout(o,15e3));let e=setInterval(()=>w(this,null,function*(){try{yield S(this.$api.get("/auth/settings")),clearInterval(e),location.reload()}catch{}}),1e3)})}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=T({type:n,selectors:[["ng-component"]],decls:7,vars:5,consts:[[1,"setup-container","d-flex","align-items-center","justify-content-center"],[1,"w-100","setup-card","d-flex","py-5"],[1,"w-100","d-flex","flex-column","align-items-center"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","mx-auto"],[1,"pt-4","pb-3","text-center"],["type","button",1,"btn","btn-lg","btn-primary",3,"click"],[1,"mt-3"],["href","javascript:void(0)",1,"grey-text",3,"click"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","homebridge-logo-small","mx-auto"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"md-form"],[1,"fas","fa-fw","fa-user","prefix","grey-text"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-username"],[1,"fas","fa-fw","fa-lock","prefix","grey-text"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass-confirm"],[1,"w-100","text-center"],["type","submit",1,"btn","btn-primary",3,"disabled","ngClass"],[1,"button-loading-overlay","fas","fa-fw","fa-spinner","fa-pulse"],[1,"custom-file"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"custom-file-input",3,"change"],["for","restoreFileUpload",1,"custom-file-label"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ml-0",3,"click","disabled"],["type","button",1,"btn","btn-primary","mr-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"pt-4","pb-3"],[1,"text-center"],["routerLink","/",1,"btn","btn-lg","btn-primary","mt-3"]],template:function(o,p){o&1&&(i(0,"div",0)(1,"div",1),z(2,ee,12,9,"div",2)(3,te,33,38,"div",2)(4,oe,20,16,"div",2)(5,re,7,3,"div",2)(6,ae,11,9,"div",2),r()()),o&2&&(t(2),f(p.step==="welcome"?2:-1),t(),f(p.step==="create-account"?3:-1),t(),f(p.step==="restore-backup"?4:-1),t(),f(p.step==="restarting"?5:-1),t(),f(p.step==="setup-complete"?6:-1))},dependencies:[D,R,M,P,V,G,W,N,B,L,A],styles:[".setup-container[_ngcontent-%COMP%]{background-size:cover;z-index:-1;padding-top:1em;padding-bottom:1em}@media screen and (min-height: 500px) and (min-width: 600px){.setup-container[_ngcontent-%COMP%]{padding-top:4em}}.setup-card[_ngcontent-%COMP%]{max-width:600px;border-radius:15px;background-color:#fff;padding-right:25px;padding-left:25px}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 600px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.homebridge-logo[_ngcontent-%COMP%]{margin-right:10px;height:200px}@media screen and (max-height: 500px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}@media screen and (max-width: 600px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}.homebridge-logo-small[_ngcontent-%COMP%]{height:50px}.button-loading[_ngcontent-%COMP%]{position:relative;color:#0000}.button-loading[_ngcontent-%COMP%] .button-loading-overlay[_ngcontent-%COMP%]{display:block;color:#fff}.button-loading-overlay[_ngcontent-%COMP%]{display:none;position:absolute;top:9px;left:0;right:0}small[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})}return n})();export{ye as a};
@@ -1 +1 @@
1
- import{d as n}from"./chunk-T3GI7KUT.js";import{b as s}from"./chunk-2N2FIQZE.js";import{h as r,ha as o,na as e,w as i}from"./chunk-CKNHTRCL.js";var l=(()=>{class t{$router=e(n);$settings=e(s);constructor(){}canActivate(){return r(this,null,function*(){return this.$settings.settingsLoaded||(yield i(this.$settings.onSettingsLoaded)),this.$settings.env.setupWizardComplete===!1||this.$router.navigate(["/"]),!0})}static \u0275fac=function(a){return new(a||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{l as a};
1
+ import{d as n}from"./chunk-T3GI7KUT.js";import{b as s}from"./chunk-J3RKUN7D.js";import{h as r,ha as o,na as e,w as i}from"./chunk-CKNHTRCL.js";var l=(()=>{class t{$router=e(n);$settings=e(s);constructor(){}canActivate(){return r(this,null,function*(){return this.$settings.settingsLoaded||(yield i(this.$settings.onSettingsLoaded)),this.$settings.env.setupWizardComplete===!1||this.$router.navigate(["/"]),!0})}static \u0275fac=function(a){return new(a||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{l as a};
@@ -0,0 +1 @@
1
+ import{h as et,k as it}from"./chunk-WQOH45IS.js";import{l as X}from"./chunk-HA6CO5NZ.js";import{a as tt}from"./chunk-675OFXLW.js";import{U as K,e as ut,g as ct,h as Q,ha as R,n as G,na as Y,w as F}from"./chunk-CKNHTRCL.js";var nt=ut((J,Z)=>{(function(M,b){typeof J=="object"&&typeof Z<"u"?Z.exports=b():typeof define=="function"&&define.amd?define(b):(M=typeof globalThis<"u"?globalThis:M||self).dayjs=b()})(J,function(){"use strict";var M=1e3,b=6e4,o=36e5,h="millisecond",$="second",L="minute",O="hour",y="day",W="week",v="month",z="quarter",S="year",_="date",B="Invalid Date",rt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,st=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,at={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},U=function(r,i,t){var n=String(r);return!n||n.length>=i?r:""+Array(i+1-n.length).join(t)+r},ot={s:U,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),n=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+U(n,2,"0")+":"+U(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var n=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(n,v),s=t-e<0,a=i.clone().add(n+(s?-1:1),v);return+(-(n+(t-e)/(s?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:v,y:S,w:W,d:y,D:_,h:O,m:L,s:$,ms:h,Q:z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},x="en",D={};D[x]=at;var E="$isDayjsObject",N=function(r){return r instanceof V||!(!r||!r[E])},I=function r(i,t,n){var e;if(!i)return x;if(typeof i=="string"){var s=i.toLowerCase();D[s]&&(e=s),t&&(D[s]=t,e=s);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;D[c]=i,e=c}return!n&&e&&(x=e),e||!n&&x},f=function(r,i){if(N(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new V(t)},u=ot;u.l=I,u.i=N,u.w=function(r,i){return f(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var V=function(){function r(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[E]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(n){var e=n.date,s=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(rt);if(a){var c=a[2]-1||0,d=(a[7]||"0").substring(0,3);return s?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,d)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,d)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==B},i.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return f(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<f(t)},i.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,n){var e=this,s=!!u.u(n)||n,a=u.p(t),c=function(k,m){var w=u.w(e.$u?Date.UTC(e.$y,m,k):new Date(e.$y,m,k),e);return s?w:w.endOf(y)},d=function(k,m){return u.w(e.toDate()[k].apply(e.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(m)),e)},l=this.$W,g=this.$M,p=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return s?c(1,0):c(31,11);case v:return s?c(1,g):c(0,g+1);case W:var T=this.$locale().weekStart||0,A=(l<T?l+7:l)-T;return c(s?p-A:p+(6-A),g);case y:case _:return d(j+"Hours",0);case O:return d(j+"Minutes",1);case L:return d(j+"Seconds",2);case $:return d(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,n){var e,s=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[y]=a+"Date",e[_]=a+"Date",e[v]=a+"Month",e[S]=a+"FullYear",e[O]=a+"Hours",e[L]=a+"Minutes",e[$]=a+"Seconds",e[h]=a+"Milliseconds",e)[s],d=s===y?this.$D+(n-this.$W):n;if(s===v||s===S){var l=this.clone().set(_,1);l.$d[c](d),l.init(),this.$d=l.set(_,Math.min(this.$D,l.daysInMonth())).$d}else c&&this.$d[c](d);return this.init(),this},i.set=function(t,n){return this.clone().$set(t,n)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,n){var e,s=this;t=Number(t);var a=u.p(n),c=function(g){var p=f(s);return u.w(p.date(p.date()+Math.round(g*t)),s)};if(a===v)return this.set(v,this.$M+t);if(a===S)return this.set(S,this.$y+t);if(a===y)return c(1);if(a===W)return c(7);var d=(e={},e[L]=b,e[O]=o,e[$]=M,e)[a]||1,l=this.$d.getTime()+t*d;return u.w(l,this)},i.subtract=function(t,n){return this.add(-1*t,n)},i.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||B;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,d=this.$m,l=this.$M,g=e.weekdays,p=e.months,j=e.meridiem,T=function(m,w,H,C){return m&&(m[w]||m(n,s))||H[w].slice(0,C)},A=function(m){return u.s(c%12||12,m,"0")},k=j||function(m,w,H){var C=m<12?"AM":"PM";return H?C.toLowerCase():C};return s.replace(st,function(m,w){return w||function(H){switch(H){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return l+1;case"MM":return u.s(l+1,2,"0");case"MMM":return T(e.monthsShort,l,p,3);case"MMMM":return T(p,l);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return T(e.weekdaysMin,n.$W,g,2);case"ddd":return T(e.weekdaysShort,n.$W,g,3);case"dddd":return g[n.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return A(1);case"hh":return A(2);case"a":return k(c,d,!0);case"A":return k(c,d,!1);case"m":return String(d);case"mm":return u.s(d,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null}(m)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,n,e){var s,a=this,c=u.p(n),d=f(t),l=(d.utcOffset()-this.utcOffset())*b,g=this-d,p=function(){return u.m(a,d)};switch(c){case S:s=p()/12;break;case v:s=p();break;case z:s=p()/3;break;case W:s=(g-l)/6048e5;break;case y:s=(g-l)/864e5;break;case O:s=g/o;break;case L:s=g/b;break;case $:s=g/M;break;default:s=g}return e?s:u.a(s)},i.daysInMonth=function(){return this.endOf(v).$D},i.$locale=function(){return D[this.$L]},i.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),s=I(t,n,!0);return s&&(e.$L=s),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r}(),P=V.prototype;return f.prototype=P,[["$ms",h],["$s",$],["$m",L],["$H",O],["$W",y],["$M",v],["$y",S],["$D",_]].forEach(function(r){P[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),f.extend=function(r,i){return r.$i||(r(i,V,f),r.$i=!0),f},f.locale=I,f.isDayjs=N,f.unix=function(r){return f(1e3*r)},f.en=D[x],f.Ls=D,f.p={},f})});var q=ct(nt(),1);var vt=(()=>{class M{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);env={};formAuth=!0;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;loginWallpaper;serverTimeOffset=0;defaultTheme="orange";themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];rtl=!1;settingsLoadedSubject=new G;onSettingsLoaded=this.settingsLoadedSubject.pipe(K());settingsLoaded=!1;constructor(){this.getAppSettings()}getAppSettings(){return Q(this,null,function*(){let o=yield F(this.$api.get("/auth/settings"));this.formAuth=o.formAuth,this.env=o.env,this.lightingMode=o.lightingMode,this.loginWallpaper=o.loginWallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(o.theme),this.setMenuMode(o.menuMode),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(o.serverTimestamp),this.setUiVersion(o.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(o){this.browserLightingMode=o,this.lightingMode==="auto"&&this.setLightingMode(o,"browser")}setLightingMode(o,h){h==="user"&&(this.lightingMode=o),this.currentLightingMode=o,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(o){(!o||!this.themeList.includes(o))&&(o=this.defaultTheme,F(this.$api.put("/config-editor/ui",{key:"theme",value:o})).catch($=>console.error($)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=o,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode"))}setMenuMode(o){F(this.$api.put("/config-editor/ui",{key:"menuMode",value:o})).catch(h=>console.error(h)),this.menuMode=o}setTitle(o){this.$title.setTitle(o||"Homebridge")}setUiVersion(o){this.uiVersion||(this.uiVersion=o)}setLang(o){o?this.$translate.use(o):o="auto",this.env.lang=o}setEnvItem(o,h){this.env[o]=h}checkServerTime(o){let $=(0,q.default)(o).diff((0,q.default)(),"hour");this.serverTimeOffset=$*60*60,($>=8||$<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}static \u0275fac=function(h){return new(h||M)};static \u0275prov=R({token:M,factory:M.\u0275fac,providedIn:"root"})}return M})();export{nt as a,vt as b};
@@ -0,0 +1 @@
1
+ import{a as E}from"./chunk-EQHMVJZQ.js";import{d as S}from"./chunk-T3GI7KUT.js";import{b}from"./chunk-J3RKUN7D.js";import{h as k,k as w}from"./chunk-WQOH45IS.js";import{a as $,b as T}from"./chunk-675OFXLW.js";import{Bb as x,Cc as c,Dc as p,Ec as C,Mb as g,Rb as m,Wb as r,Xb as n,Yb as f,db as v,ec as h,ib as i,na as a,oc as o,pc as s,ub as _,yc as y}from"./chunk-CKNHTRCL.js";var I=t=>({command:t});function R(t,u){t&1&&(r(0,"p",7),o(1),c(2,"translate"),n()),t&2&&(i(),s(p(2,1,"restart.please_wait_while_server_restarts")))}function D(t,u){if(t&1&&(r(0,"div",8),o(1),n()),t&2){let e=h();i(),s(e.error)}}function B(t,u){t&1&&(r(0,"div",9)(1,"div",11),f(2,"i",12),n()())}function M(t,u){if(t&1&&(r(0,"div",10)(1,"p"),o(2),c(3,"translate"),n(),f(4,"p",13),c(5,"translate"),n()),t&2){let e=h();i(2),s(p(3,2,"platform.docker.server_long_time")),i(2),g("innerHTML",C(5,4,"platform.docker.run_with_restart",y(7,I,e.command)),v)}}var N=(()=>{class t{$api=a(w);$router=a(S);$settings=a(b);$toastr=a(k);$translate=a($);$ws=a(E);checkTimeout;checkDelay;resp={};timeout=!1;error=!1;command='<span class="text-monospace">--restart=always</span>';io;constructor(){}ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(e),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}static \u0275fac=function(l){return new(l||t)};static \u0275cmp=_({type:t,selectors:[["ng-component"]],decls:15,vars:10,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fab","fa-fw","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"grey-text"],[1,"alert","alert-error","my-4"],[1,"justify-content-center","my-4"],[1,"alert","alert-warning","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(l,d){l&1&&(r(0,"div",0)(1,"h3",1),o(2),c(3,"translate"),n()(),r(4,"div",2)(5,"div",3),f(6,"i",4),n(),r(7,"div",5)(8,"h4",6),o(9),c(10,"translate"),n(),x(11,R,3,3,"p",7)(12,D,2,1,"div",8)(13,B,3,0,"div",9)(14,M,6,9,"div",10),n()()),l&2&&(i(2),s(p(3,6,"menu.restart.title")),i(7),s(p(10,8,"platform.docker.title_restarting")),i(2),m(d.error?-1:11),i(),m(d.error?12:-1),i(),m(d.error?-1:13),i(),m(d.timeout?14:-1))},dependencies:[T],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;margin-top:15px}"]})}return t})();export{N as a};
@@ -1 +1 @@
1
- import"./chunk-MA2NAED5.js";import"./chunk-NF2LWORY.js";import"./chunk-T7Y7UGKU.js";import{g as n}from"./chunk-T3GI7KUT.js";import"./chunk-TQEO2WY5.js";import"./chunk-2N2FIQZE.js";import"./chunk-YIXOCUUM.js";import"./chunk-HA6CO5NZ.js";import{c as m}from"./chunk-675OFXLW.js";import{ia as t,kd as i,vb as r}from"./chunk-CKNHTRCL.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"restart-server",loadComponent:()=>import("./chunk-EFJQDZWX.js").then(o=>o.RestartLinuxComponent)},{path:"shutdown-server",loadComponent:()=>import("./chunk-KFOQEXZZ.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-4JBDAK6H.js";import"./chunk-NMDGMKTC.js";import"./chunk-EQHMVJZQ.js";import{g as n}from"./chunk-T3GI7KUT.js";import"./chunk-SK6P7SRA.js";import"./chunk-J3RKUN7D.js";import"./chunk-WQOH45IS.js";import"./chunk-HA6CO5NZ.js";import{c as m}from"./chunk-675OFXLW.js";import{ia as t,kd as i,vb as r}from"./chunk-CKNHTRCL.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"restart-server",loadComponent:()=>import("./chunk-MOYAUTWQ.js").then(o=>o.RestartLinuxComponent)},{path:"shutdown-server",loadComponent:()=>import("./chunk-7JAZ6D7D.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};
@@ -0,0 +1 @@
1
+ import{m as w}from"./chunk-N4F42HDL.js";import{b as S}from"./chunk-675OFXLW.js";import{Bb as d,Cc as m,Dc as p,Lb as _,Mb as b,Qb as y,Rb as r,Wb as o,Xb as a,Yb as u,ac as B,db as k,dc as x,eb as g,ec as s,ib as i,na as L,oc as c,pc as M,qc as C,ub as T,xa as v,ya as I}from"./chunk-CKNHTRCL.js";function E(t,f){if(t&1&&u(0,"i",15),t&2){let e=s();y("fas fa-fw ",e.faIconClass," mb-3")}}function h(t,f){if(t&1&&u(0,"h6",7),t&2){let e=s();b("innerHTML",e.subtitle,k)}}function D(t,f){if(t&1){let e=B();o(0,"button",16),m(1,"translate"),x("click",function(){v(e);let n=s();return I(n.$activeModal.dismiss("Dismiss"))}),c(2),m(3,"translate"),a()}t&2&&(_("aria-label",p(1,2,"form.button_close")),i(2),C(" ",p(3,4,"form.button_close")," "))}function H(t,f){if(t&1){let e=B();o(0,"button",16),m(1,"translate"),x("click",function(){v(e);let n=s();return I(n.$activeModal.dismiss("Dismiss"))}),c(2),m(3,"translate"),a()}t&2&&(_("aria-label",p(1,2,"form.button_close")),i(2),C(" ",p(3,4,"form.button_close")," "))}function V(t,f){if(t&1&&(o(0,"a",14),c(1),u(2,"i",17),a()),t&2){let e=s();b("href",e.ctaButtonLink,g),i(),C(" ",e.ctaButtonLabel," ")}}var U=(()=>{class t{$activeModal=L(w);title;subtitle;message;ctaButtonLabel;ctaButtonLink;faIconClass;constructor(){}static \u0275fac=function(l){return new(l||t)};static \u0275cmp=T({type:t,selectors:[["ng-component"]],inputs:{title:"title",subtitle:"subtitle",message:"message",ctaButtonLabel:"ctaButtonLabel",ctaButtonLink:"ctaButtonLink",faIconClass:"faIconClass"},decls:19,vars:10,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body","text-center"],[2,"font-size","75px",3,"class"],[1,"mb-3",3,"innerHTML"],[1,"mb-0",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-right"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[2,"font-size","75px"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(l,n){l&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),c(3),a(),o(4,"button",3),m(5,"translate"),x("click",function(){return n.$activeModal.dismiss("Dismiss")}),o(6,"span",4),c(7,"\xD7"),a()()(),o(8,"div",5),d(9,E,1,3,"i",6)(10,h,1,1,"h6",7),u(11,"p",8),a(),o(12,"div",9)(13,"div",10),d(14,D,4,6,"button",11),a(),o(15,"div",12),d(16,H,4,6,"button",11),a(),o(17,"div",13),d(18,V,3,2,"a",14),a()()()),l&2&&(i(3),M(n.title),i(),_("aria-label",p(5,8,"form.button_close")),i(5),r(n.faIconClass?9:-1),i(),r(n.subtitle?10:-1),i(),b("innerHTML",n.message,k),i(3),r(n.ctaButtonLink?14:-1),i(2),r(n.ctaButtonLink?-1:16),i(2),r(n.ctaButtonLink?18:-1))},dependencies:[S],encapsulation:2})}return t})();export{U as a};
@@ -0,0 +1 @@
1
+ import{a as we}from"./chunk-6YUXY73A.js";import{a as Be}from"./chunk-Q23I6M54.js";import{v as ye}from"./chunk-77AXHBP3.js";import{b as De}from"./chunk-PALAGBX5.js";import{g as K,m as N,n as J,o as he}from"./chunk-N4F42HDL.js";import{b as j,c as oe,e as G,f as le,g as Y,j as H,k as se,l as W,m as pe,n as de,o as ce,p as me,q as ue,r as _e,s as ge,t as be,u as ve,v as xe,y as q,z as fe}from"./chunk-YLEC7AUG.js";import{d as Ce,e as Se}from"./chunk-T3GI7KUT.js";import{b as ke}from"./chunk-J3RKUN7D.js";import{h as V,k as D}from"./chunk-WQOH45IS.js";import{a as F,b as I}from"./chunk-675OFXLW.js";import{Bb as h,Cc as o,Dc as l,Ec as R,Lb as f,M as Q,Mb as g,Rb as b,Tb as T,Ub as M,Vb as A,Wb as i,Xb as a,Yb as c,ac as w,bd as z,db as X,dc as v,ec as _,g as Ve,gd as U,h as y,ib as t,id as re,na as k,oc as r,pc as d,qc as u,tc as ie,ub as E,uc as ne,vc as ae,w as $,xa as C,ya as S,yc as P,zc as B}from"./chunk-CKNHTRCL.js";var Z=Ve(De(),1);var Re=(n,m)=>({"fa-arrow-right":n,"fa-cog fa-spin":m}),Pe=n=>({backupTime:n,dayCount:7}),ze=(n,m)=>({"fa-trash":n,"fa-cog fa-spin":m}),He=(n,m)=>({backupSize:n,maxBackupSizeText:m});function Oe(n,m){if(n&1&&(r(0),o(1,"date"),o(2,"translate")),n&2){let e=_(2);u(" ",R(2,4,"backup.scheduled_backup_time",P(7,Pe,R(1,1,e.backupTime,"shortTime")))," ")}}function Le(n,m){n&1&&(r(0),o(1,"translate")),n&2&&u(" ",l(1,1,"backup.scheduled_backup_disabled")," ")}function Ue(n,m){if(n&1&&(i(0,"span",25),o(1,"translate"),c(2,"i",32),r(3),a()),n&2){let e=_().$implicit;g("ngbTooltip",R(1,2,"backup.backup_exceeds_max_size",B(5,He,e.size+"MB",e.maxBackupSizeText))),t(3),u(" ",e.size,"MB ")}}function je(n,m){if(n&1&&(i(0,"span"),r(1),a()),n&2){let e=_().$implicit;t(),u(" ",e.size,"MB ")}}function Ge(n,m){if(n&1){let e=w();i(0,"li",10)(1,"span")(2,"span",24),r(3),o(4,"date"),a(),c(5,"br"),i(6,"small",11),r(7),o(8,"date"),h(9,Ue,4,8,"span",25)(10,je,2,1,"span"),a()(),i(11,"span",26)(12,"button",27),o(13,"translate"),o(14,"translate"),v("click",function(){let s=C(e).$implicit,x=_(2);return S(x.restore(s))}),c(15,"i",28),a(),i(16,"button",29),o(17,"translate"),o(18,"translate"),v("click",function(){let s=C(e).$implicit,x=_(2);return S(x.download(s))}),c(19,"i",30),a(),i(20,"button",31),o(21,"translate"),o(22,"translate"),v("click",function(){let s=C(e).$implicit,x=_(2);return S(x.delete(s))}),c(23,"i",13),a()()()}if(n&2){let e=m.$implicit,p=_(2);t(2),g("ngbTooltip",e.fileName),t(),u(" ",R(4,15,e.timestamp,"mediumDate")," "),t(4),u(" ",R(8,18,e.timestamp,"shortTime")," \xB7 "),t(2),b(e.size>e.maxBackupSize?9:-1),t(),b(e.size<=e.maxBackupSize?10:-1),t(2),g("disabled",p.clicked||p.deleting||e.size>e.maxBackupSize)("ngbTooltip",l(13,21,"form.button_restore")),f("aria-label",l(14,23,"form.button_restore")),t(4),g("disabled",p.clicked||p.deleting)("ngbTooltip",l(17,25,"form.button_download")),f("aria-label",l(18,27,"form.button_download")),t(4),g("disabled",p.clicked||p.deleting)("ngbTooltip",l(21,29,"form.button_delete")),f("aria-label",l(22,31,"form.button_delete")),t(3),g("ngClass",B(33,ze,e.id!==p.deleting,e.id===p.deleting))}}function We(n,m){if(n&1&&(i(0,"ul",15)(1,"li",21)(2,"h6",22),r(3),o(4,"translate"),a(),i(5,"p",23),h(6,Oe,3,9)(7,Le,2,3),a()(),M(8,Ge,24,36,"li",10,T),a()),n&2){let e=_();t(3),d(l(4,3,"backup.files_auto")),t(3),b(e.backupTime?6:-1),t(),b(e.backupTime?-1:7),t(),A(e.scheduledBackups)}}var Ee=(()=>{class n{$activeModal=k(N);$api=k(D);$modal=k(J);$toastr=k(V);$translate=k(F);clicked=!1;scheduledBackups=[];backupTime;deleting=null;constructor(){}ngOnInit(){this.getScheduledBackups(),this.getNextBackup()}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:p=>{let s=e.fileName||"homebridge-backup.tar.gz",x=p.body.size;if(x>globalThis.backup.maxBackupSize){let O=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(x/1048576).toFixed(1)}MB`});this.$toastr.warning(O,this.$translate.instant("toast.title_warning"))}(0,Z.saveAs)(p.body,s)},error:p=>{console.error(p),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})}restore(e){this.$activeModal.close();let p=this.$modal.open(we,{size:"lg",backdrop:"static"});p.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:p=>{this.deleting=null,console.error(p),this.$toastr.error(this.$translate.instant("backup.backup_delete_failed"),this.$translate.instant("toast.title_error"))}})}onDownloadBackupClick(){return y(this,null,function*(){this.clicked=!0,this.$api.get("/backup/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{let p=e.headers.get("File-Name")||"homebridge-backup.tar.gz";this.clicked=!1;let s=e.body.size;if(s>globalThis.backup.maxBackupSize){let x=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(s/1048576).toFixed(1)}MB`});this.$toastr.warning(x,this.$translate.instant("toast.title_warning"))}(0,Z.saveAs)(e.body,p)},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})})}Date=Date;static \u0275fac=function(p){return new(p||n)};static \u0275cmp=E({type:n,selectors:[["ng-component"]],decls:55,vars:45,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[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",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,"modal-footer","justify-content-between"],[1,"text-left"],[1,"text-center"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-right"],[1,"list-group-item"],[1,"mb-1","text-center"],[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","ml-3",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","ml-1",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-danger","ml-1",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-exclamation-circle"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),a()()(),i(9,"div",5)(10,"div",6),c(11,"i",7),a(),i(12,"ul",8)(13,"li"),r(14),o(15,"translate"),a(),i(16,"li"),r(17),o(18,"translate"),a(),i(19,"li"),r(20),o(21,"translate"),a()(),i(22,"ul",9)(23,"li",10)(24,"div")(25,"span"),r(26),o(27,"translate"),a(),c(28,"br"),i(29,"small",11),r(30),o(31,"translate"),a()(),i(32,"button",12),o(33,"translate"),v("click",function(){return s.onDownloadBackupClick()}),c(34,"i",13),a()(),i(35,"li",10)(36,"div")(37,"span"),r(38),o(39,"translate"),a(),c(40,"br"),i(41,"small",11),r(42),o(43,"translate"),a()(),i(44,"button",12),o(45,"translate"),v("click",function(){return s.restore(null)}),c(46,"i",14),a()()(),h(47,We,10,5,"ul",15),a(),i(48,"div",16),c(49,"div",17),i(50,"div",18)(51,"button",19),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(52),o(53,"translate"),a()(),c(54,"div",20),a()()),p&2&&(t(3),d(l(4,18,"backup.title_backup")),t(2),g("disabled",s.clicked||s.deleting),f("aria-label",l(6,20,"form.button_close")),t(9),d(l(15,22,"backup.backup_help_one")),t(3),d(l(18,24,"backup.backup_help_two")),t(3),d(l(21,26,"backup.backup_warning")),t(6),d(l(27,28,"backup.backup_now")),t(4),d(l(31,30,"backup.backup_now_desc")),t(2),g("disabled",s.clicked),f("aria-label",l(33,32,"backup.backup_now")),t(2),g("ngClass",B(42,Re,!s.clicked,s.clicked)),t(4),d(l(39,34,"backup.restore_now")),t(4),d(l(43,36,"backup.restore_now_desc")),t(2),g("disabled",s.clicked),f("aria-label",l(45,38,"backup.restore_now")),t(3),b(s.scheduledBackups.length?47:-1),t(4),g("disabled",s.clicked||s.deleting),t(),u(" ",l(53,40,"form.button_close")," "))},dependencies:[he,z,re,I],encapsulation:2})}return n})();function qe(n,m){n&1&&(i(0,"div",13),c(1,"i",14),a(),i(2,"p",15),r(3),o(4,"translate"),a()),n&2&&(t(3),d(l(4,1,"reset.no_accessories")))}function Ke(n,m){n&1&&(i(0,"div",13),c(1,"i",16),a(),i(2,"ul",17)(3,"li"),r(4),o(5,"translate"),a(),i(6,"li"),r(7),o(8,"translate"),a(),i(9,"li"),r(10),o(11,"translate"),a()(),i(12,"ngb-alert",18)(13,"p",19),r(14),o(15,"translate"),a()()),n&2&&(t(4),d(l(5,5,"reset.accessory_all.list_1")),t(3),d(l(8,7,"reset.accessory_all.list_2")),t(3),d(l(11,9,"reset.accessory_all.list_3")),t(2),g("dismissible",!1),t(2),d(l(15,11,"reset.action_is_irreversible")))}function Je(n,m){if(n&1){let e=w();i(0,"button",20),o(1,"translate"),v("click",function(){C(e);let s=_();return S(s.$activeModal.dismiss("Dismiss"))}),r(2),o(3,"translate"),a()}if(n&2){let e=_();g("disabled",e.clicked),f("aria-label",l(1,3,"form.button_close")),t(2),u(" ",l(3,5,"form.button_close")," ")}}function Qe(n,m){if(n&1){let e=w();i(0,"button",21),o(1,"translate"),v("click",function(){C(e);let s=_();return S(s.$activeModal.dismiss("Dismiss"))}),r(2),o(3,"translate"),a()}n&2&&(f("aria-label",l(1,2,"form.button_close")),t(2),u(" ",l(3,4,"form.button_close")," "))}function Xe(n,m){n&1&&(r(0),o(1,"translate")),n&2&&u(" ",l(1,1,"form.button_remove")," ")}function Ye(n,m){n&1&&c(0,"i",23)}function Ze(n,m){if(n&1){let e=w();i(0,"button",22),v("click",function(){C(e);let s=_();return S(s.onResetCachedAccessoriesClick())}),h(1,Xe,2,3)(2,Ye,1,0,"i",23),a()}if(n&2){let e=_();g("disabled",e.clicked),t(),b(e.clicked?-1:1),t(),b(e.clicked?2:-1)}}var Ie=(()=>{class n{$activeModal=k(N);$api=k(D);$toastr=k(V);$translate=k(F);clicked;cachedAccessories=[];constructor(){}ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return y(this,null,function*(){try{this.cachedAccessories=yield $(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()},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(p){return new(p||n)};static \u0275cmp=E({type:n,selectors:[["ng-component"]],decls:19,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-dismiss","modal",1,"btn","btn-elegant"],[1,"text-right"],["type","button","data-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-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),a()()(),i(9,"div",5),h(10,qe,5,3)(11,Ke,16,13),a(),i(12,"div",6)(13,"div",7),h(14,Je,4,7,"button",8),a(),i(15,"div",9),h(16,Qe,4,6,"button",10),a(),i(17,"div",11),h(18,Ze,3,3,"button",12),a()()()),p&2&&(t(3),d(l(4,8,"reset.accessory_all.title")),t(2),g("disabled",s.clicked),f("aria-label",l(6,10,"form.button_close")),t(5),b(s.cachedAccessories.length===0?10:-1),t(),b(s.cachedAccessories.length>0?11:-1),t(3),b(s.cachedAccessories.length>0?14:-1),t(2),b(s.cachedAccessories.length===0?16:-1),t(2),b(s.cachedAccessories.length>0?18:-1))},dependencies:[K,I],encapsulation:2})}return n})();var et=(n,m)=>({"green-text fa-link":n,"grey-text fa-link-slash":m}),tt=(n,m)=>({"btn-danger":n,"btn-elegant":m}),it=(n,m)=>({"fa-broom":n,"fa-undo":m});function nt(n,m){n&1&&(i(0,"div",12),c(1,"i",13),a(),i(2,"p",14),r(3),o(4,"translate"),a()),n&2&&(t(3),d(l(4,1,"reset.bridge_accessories.empty")))}function at(n,m){if(n&1){let e=w();i(0,"li",18)(1,"span"),r(2),c(3,"br"),i(4,"small",19),c(5,"i",20),r(6),o(7,"translate"),i(8,"span",21),r(9),a()()(),i(10,"button",22),o(11,"translate"),v("click",function(){let s=C(e).$implicit,x=_(2);return S(x.toggleList(s._id))}),c(12,"i",20),a()()}if(n&2){let e=m.$implicit,p=_(2);t(2),u(" ",e.name," "),t(3),g("ngClass",B(11,et,e._isPaired,!e._isPaired)),t(),u(" ",l(7,7,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),d(e._username),t(),g("ngClass",B(14,tt,!p.toDelete.includes(e._id),p.toDelete.includes(e._id))),f("aria-label",l(11,9,"form.button_delete")),t(2),g("ngClass",B(17,it,!p.toDelete.includes(e._id),p.toDelete.includes(e._id)))}}function rt(n,m){if(n&1&&(i(0,"div",12),c(1,"i",15),a(),i(2,"ul",16)(3,"li"),r(4),o(5,"translate"),a(),i(6,"li"),r(7),o(8,"translate"),a(),i(9,"li"),r(10),o(11,"translate"),a()(),i(12,"ul",17),M(13,at,13,20,"li",18,T),a()),n&2){let e=_();t(4),d(l(5,3,"reset.bridge_accessories.list_1")),t(3),d(l(8,5,"reset.clear_cache_single.list_3")),t(3),d(l(11,7,"reset.bridge_accessories.list_2")),t(3),A(e.pairings)}}function ot(n,m){if(n&1){let e=w();i(0,"button",23),v("click",function(){C(e);let s=_();return S(s.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),a()}n&2&&(t(),u(" ",l(2,1,"form.button_close")," "))}function lt(n,m){if(n&1){let e=w();i(0,"button",23),v("click",function(){C(e);let s=_();return S(s.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),a()}n&2&&(t(),u(" ",l(2,1,"form.button_close")," "))}function st(n,m){if(n&1&&r(0),n&2){let e=_(2);u(" (",e.toDelete.length,") ")}}function pt(n,m){if(n&1){let e=w();i(0,"button",24),v("click",function(){C(e);let s=_();return S(s.cleanBridges())}),r(1),o(2,"translate"),h(3,st,1,1),a()}if(n&2){let e=_();g("disabled",!e.toDelete.length),t(),u(" ",l(2,3,"form.button_remove")," "),t(2),b(e.toDelete.length>0?3:-1)}}var $e=(()=>{class n{$activeModal=k(N);$api=k(D);$toastr=k(V);$translate=k(F);pairings=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{this.pairings=(yield $(this.$api.get("/server/pairings"))).filter(e=>e._category==="bridge"&&!e._main).sort((e,p)=>e.name.localeCompare(p.name))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e){this.toDelete.includes(e)?this.toDelete=this.toDelete.filter(p=>p!==e):this.toDelete.push(e)}cleanBridges(){this.$activeModal.close(),this.$toastr.info(this.$translate.instant("reset.accessory_ind.wait")),this.$api.delete("/server/pairings/accessories",{body:this.toDelete.map(e=>({id:e}))}).subscribe({next:()=>{this.$toastr.info(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success"))},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(p){return new(p||n)};static \u0275cmp=E({type:n,selectors:[["ng-component"]],decls:19,vars:11,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-right"],["type","button","data-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","mt-2"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw",3,"ngClass"],[1,"text-monospace"],[1,"btn","btn-danger",3,"click","ngClass"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),a()()(),i(9,"div",5),h(10,nt,5,3)(11,rt,15,9),a(),i(12,"div",6)(13,"div",7),h(14,ot,3,3,"button",8),a(),i(15,"div",9),h(16,lt,3,3,"button",8),a(),i(17,"div",10),h(18,pt,4,5,"button",11),a()()()),p&2&&(t(3),d(l(4,7,"reset.bridge_accessories.title")),t(2),f("aria-label",l(6,9,"form.button_close")),t(5),b(s.pairings.length===0?10:-1),t(),b(s.pairings.length>0?11:-1),t(3),b(s.pairings.length>0?14:-1),t(2),b(s.pairings.length===0?16:-1),t(2),b(s.pairings.length>0?18:-1))},dependencies:[z,I],encapsulation:2})}return n})();function dt(n,m){n&1&&(r(0),o(1,"translate")),n&2&&u(" ",l(1,1,"form.button_reset")," ")}function ct(n,m){n&1&&c(0,"i",17)}var Te=(()=>{class n{$activeModal=k(N);$api=k(D);$route=k(Ce);$toastr=k(V);$translate=k(F);clicked;constructor(){}onResetHomebridgeAccessoryClick(){return this.clicked=!0,this.$api.put("/server/reset-homebridge-accessory",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_reset"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$route.navigate(["/restart"])},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(p){return new(p||n)};static \u0275cmp=E({type:n,selectors:[["ng-component"]],decls:40,vars:33,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click","disabled"],["aria-hidden","true"],[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-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),a()()(),i(9,"div",5)(10,"div",6),c(11,"i",7),a(),i(12,"ul",8)(13,"li"),r(14),o(15,"translate"),a(),i(16,"li"),r(17),o(18,"translate"),a(),i(19,"li"),r(20),o(21,"translate"),a(),i(22,"li"),r(23),o(24,"translate"),a()(),i(25,"ngb-alert",9)(26,"p",10),r(27),o(28,"translate"),a()()(),i(29,"div",11)(30,"div",12)(31,"button",13),o(32,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(33),o(34,"translate"),a()(),c(35,"div",14),i(36,"div",15)(37,"button",16),v("click",function(){return s.onResetHomebridgeAccessoryClick()}),h(38,dt,2,3)(39,ct,1,0,"i",17),a()()()()),p&2&&(t(3),d(l(4,15,"reset.bridge_all.title")),t(2),g("disabled",s.clicked),f("aria-label",l(6,17,"form.button_close")),t(9),d(l(15,19,"reset.bridge_all.list_1")),t(3),d(l(18,21,"reset.bridge_all.list_2")),t(3),d(l(21,23,"reset.bridge_all.list_3")),t(3),d(l(24,25,"reset.bridge_all.list_4")),t(2),g("dismissible",!1),t(2),d(l(28,27,"reset.action_is_irreversible")),t(4),g("disabled",s.clicked),f("aria-label",l(32,29,"form.button_close")),t(2),u(" ",l(34,31,"form.button_close")," "),t(4),g("disabled",s.clicked),t(),b(s.clicked?-1:38),t(),b(s.clicked?39:-1))},dependencies:[K,I],encapsulation:2})}return n})();var ee=(n,m)=>({"green-text fa-link":n,"grey-text fa-link-slash":m}),te=(n,m)=>({"btn-danger":n,"btn-elegant":m}),Me=(n,m)=>({"fa-refresh":n,"fa-undo":m}),mt=(n,m)=>({"fa-trash":n,"fa-undo":m});function ut(n,m){n&1&&(i(0,"div",12),c(1,"i",13),a(),i(2,"p",14),r(3),o(4,"translate"),a()),n&2&&(t(3),d(l(4,1,"reset.bridges.empty")))}function _t(n,m){if(n&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),a(),r(10),o(11,"titlecase"),a()(),i(12,"button",24),o(13,"translate"),v("click",function(){let s=C(e).$implicit,x=_(3);return S(x.toggleList(s._id,!1))}),c(14,"i",22),a()()}if(n&2){let e=m.$implicit,p=_(3);t(2),u(" ",e.name," "),t(3),g("ngClass",B(14,ee,e._isPaired,!e._isPaired)),t(),u(" ",l(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),d(e._username),t(),u(" \xB7 ",e._main?"Homebridge":l(11,10,e._category)," "),t(2),g("ngClass",B(17,te,!p.isInList(e._id),p.isInList(e._id))),f("aria-label",l(13,12,"form.button_unpair")),t(2),g("ngClass",B(20,Me,!p.isInList(e._id),p.isInList(e._id)))}}function gt(n,m){if(n&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),a(),i(5,"p",19),r(6),o(7,"translate"),a()(),M(8,_t,15,23,"li",20,T),a()),n&2){let e=_(2);t(3),d(l(4,2,"reset.bridge_ind.head_non_child")),t(3),d(l(7,4,"reset.bridge_ind.desc_non_child")),t(2),A(e.pairingsNonChild)}}function bt(n,m){if(n&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),a()()(),i(10,"button",24),o(11,"translate"),v("click",function(){let s=C(e).$implicit,x=_(3);return S(x.toggleList(s._id,!0))}),c(12,"i",22),a()()}if(n&2){let e=m.$implicit,p=_(3);t(2),u(" ",e.name," "),t(3),g("ngClass",B(11,ee,e._isPaired,!e._isPaired)),t(),u(" ",l(7,7,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),d(e._username),t(),g("ngClass",B(14,te,!p.isInList(e._id),p.isInList(e._id))),f("aria-label",l(11,9,"form.button_unpair")),t(2),g("ngClass",B(17,Me,!p.isInList(e._id),p.isInList(e._id)))}}function vt(n,m){if(n&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),a(),i(5,"p",19),r(6),o(7,"translate"),a()(),M(8,bt,13,20,"li",20,T),a()),n&2){let e=_(2);t(3),d(l(4,2,"reset.bridge_ind.head_child_active")),t(3),d(l(7,4,"reset.bridge_ind.desc_child_active")),t(2),A(e.pairingsChildActive)}}function xt(n,m){if(n&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),a()()(),i(10,"button",24),o(11,"translate"),v("click",function(){let s=C(e).$implicit,x=_(3);return S(x.toggleList(s._id,!1))}),c(12,"i",22),a()()}if(n&2){let e=m.$implicit,p=_(3);t(2),u(" ",e.name," "),t(3),g("ngClass",B(11,ee,e._isPaired,!e._isPaired)),t(),u(" ",l(7,7,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),d(e._username),t(),g("ngClass",B(14,te,!p.isInList(e._id),p.isInList(e._id))),f("aria-label",l(11,9,"form.button_unpair")),t(2),g("ngClass",B(17,mt,!p.isInList(e._id),p.isInList(e._id)))}}function ft(n,m){if(n&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),a(),i(5,"p",19),r(6),o(7,"translate"),a()(),M(8,xt,13,20,"li",20,T),a()),n&2){let e=_(2);t(3),d(l(4,2,"reset.bridge_ind.head_child_stale")),t(3),d(l(7,4,"reset.bridge_ind.desc_child_stale")),t(2),A(e.pairingsChildStale)}}function ht(n,m){if(n&1&&(i(0,"div",12),c(1,"i",15),a(),h(2,gt,10,6,"ul",16)(3,vt,10,6,"ul",16)(4,ft,10,6,"ul",16)),n&2){let e=_();t(2),b(e.pairingsNonChild.length>0?2:-1),t(),b(e.pairingsChildActive.length>0?3:-1),t(),b(e.pairingsChildStale.length>0?4:-1)}}function Ct(n,m){if(n&1){let e=w();i(0,"button",25),v("click",function(){C(e);let s=_();return S(s.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),a()}n&2&&(t(),u(" ",l(2,1,"form.button_close")," "))}function St(n,m){if(n&1){let e=w();i(0,"button",25),v("click",function(){C(e);let s=_();return S(s.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),a()}n&2&&(t(),u(" ",l(2,1,"form.button_close")," "))}function kt(n,m){if(n&1&&r(0),n&2){let e=_(2);u(" (",e.toDelete.length,") ")}}function wt(n,m){if(n&1){let e=w();i(0,"button",26),v("click",function(){C(e);let s=_();return S(s.removeBridges())}),r(1),o(2,"translate"),h(3,kt,1,1),a()}if(n&2){let e=_();g("disabled",!e.toDelete.length),t(),u(" ",l(2,3,"form.button_reset")," "),t(2),b(e.toDelete.length>0?3:-1)}}var Ae=(()=>{class n{$activeModal=k(N);$api=k(D);$toastr=k(V);$translate=k(F);pairingsNonChild=[];pairingsChildActive=[];pairingsChildStale=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{let e=(yield $(this.$api.get("/server/pairings"))).filter(p=>!p._main).sort((p,s)=>p.name.localeCompare(s.name));this.pairingsChildActive=e.filter(p=>p._category==="bridge"&&!p._couldBeStale),this.pairingsNonChild=e.filter(p=>p._category!=="bridge"),this.pairingsChildStale=e.filter(p=>p._category==="bridge"&&p._couldBeStale)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e,p=!1){this.toDelete.some(s=>s.id===e)?this.toDelete=this.toDelete.filter(s=>s.id!==e):this.toDelete.push({id:e,resetPairingInfo:p})}isInList(e){return this.toDelete.some(p=>p.id===e)}removeBridges(){this.$activeModal.close(),this.$toastr.info(this.$translate.instant("reset.bridge_ind.wait")),this.$api.delete("/server/pairings",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.info(this.$translate.instant("reset.bridge_ind.done"),this.$translate.instant("toast.title_success"))},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.bridge_ind.fail"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(p){return new(p||n)};static \u0275cmp=E({type:n,selectors:[["ng-component"]],decls:19,vars:11,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-right"],["type","button","data-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",3,"ngClass"],[1,"text-monospace"],[1,"btn","btn-danger",3,"click","ngClass"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),a()()(),i(9,"div",5),h(10,ut,5,3)(11,ht,5,3),a(),i(12,"div",6)(13,"div",7),h(14,Ct,3,3,"button",8),a(),i(15,"div",9),h(16,St,3,3,"button",8),a(),i(17,"div",10),h(18,wt,4,5,"button",11),a()()()),p&2&&(t(3),d(l(4,7,"reset.bridge_ind.title")),t(2),f("aria-label",l(6,9,"form.button_close")),t(5),b(s.pairingsChildActive.length===0&&s.pairingsChildStale.length===0&&s.pairingsNonChild.length===0?10:-1),t(),b(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?11:-1),t(3),b(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?14:-1),t(2),b(s.pairingsChildActive.length===0&&s.pairingsChildStale.length===0&&s.pairingsNonChild.length===0?16:-1),t(2),b(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?18:-1))},dependencies:[z,U,I],encapsulation:2})}return n})();function yt(n,m){if(n&1){let e=w();i(0,"li",11)(1,"span")(2,"label",18)(3,"input",19),ae("ngModelChange",function(s){let x=C(e).$implicit;return ne(x.selected,s)||(x.selected=s),S(s)}),a(),i(4,"span"),r(5),a(),c(6,"span",20),a()(),i(7,"span",21),r(8),a()()}if(n&2){let e=m.$implicit;t(2),g("for","adapter"+e.iface),t(),g("id","adapter"+e.iface),ie("ngModel",e.selected),t(2),d(e.iface),t(3),d(e.ip4||e.ip6)}}var Ne=(()=>{class n{$activeModal=k(N);availableNetworkAdapters=[];bridgeNetworkAdapters=[];constructor(){}submit(){this.$activeModal.close(this.availableNetworkAdapters.filter(e=>e.selected).map(e=>e.iface))}static \u0275fac=function(p){return new(p||n)};static \u0275cmp=E({type:n,selectors:[["ng-component"]],inputs:{availableNetworkAdapters:"availableNetworkAdapters",bridgeNetworkAdapters:"bridgeNetworkAdapters"},decls:37,vars:24,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[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-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click"],[1,"hb-uix-switch","d-inline","pr-3",3,"for"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"hb-uix-slider","hb-uix-round"],[1,"text-monospace"]],template:function(p,s){p&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),i(7,"span",4),r(8,"\xD7"),a()()(),i(9,"div",5)(10,"div",6),c(11,"i",7),a(),i(12,"ul",8)(13,"li"),r(14),o(15,"translate"),a()(),i(16,"ul",9)(17,"li",10)(18,"strong"),r(19),o(20,"translate"),a(),i(21,"strong"),r(22),o(23,"translate"),a()(),M(24,yt,9,5,"li",11,T),a()(),i(26,"div",12)(27,"div",13)(28,"button",14),o(29,"translate"),v("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(30),o(31,"translate"),a()(),c(32,"div",15),i(33,"div",16)(34,"button",17),v("click",function(){return s.submit()}),r(35),o(36,"translate"),a()()()()),p&2&&(t(3),d(l(4,8,"settings.network.title_network_interfaces")),t(2),f("aria-label",l(6,10,"form.button_close")),t(9),d(l(15,12,"settings.network.message_network_interface")),t(5),d(l(20,14,"settings.network.label_interface_name")),t(3),d(l(23,16,"settings.network.label_ip_address")),t(2),A(s.availableNetworkAdapters),t(4),f("aria-label",l(29,18,"form.button_close")),t(2),u(" ",l(31,20,"form.button_close")," "),t(5),u(" ",l(36,22,"form.button_save")," "))},dependencies:[q,j,G,W,I],encapsulation:2})}return n})();var Et=n=>({file:n}),It=n=>({link:n}),$t=n=>({"fa-pulse":n}),Fe=n=>({"is-invalid":n}),Tt=(n,m)=>({"badge-danger":n,"badge-info":m});function Mt(n,m){if(n&1){let e=w();i(0,"ul",5)(1,"li",12)(2,"span",13),r(3),o(4,"translate"),a(),i(5,"button",14),o(6,"translate"),v("click",function(){C(e);let s=_();return S(s.openUiSettings())}),c(7,"i",15),a()(),i(8,"li",12)(9,"span",13),r(10),o(11,"translate"),a(),i(12,"button",14),o(13,"translate"),v("click",function(){C(e);let s=_();return S(s.openBackupModal())}),c(14,"i",15),a()(),i(15,"li",12)(16,"span",13),r(17),o(18,"translate"),a(),i(19,"a",16),o(20,"translate"),c(21,"i",15),a()()()}n&2&&(t(3),u(" ",l(4,6,"menu.label_settings_advanced")," "),t(2),f("aria-label",l(6,8,"menu.label_settings_advanced")),t(5),u(" ",l(11,10,"backup.title_backup")," "),t(2),f("aria-label",l(13,12,"backup.title_backup")),t(5),u(" ",l(18,14,"menu.tooltip_user_accounts")," "),t(2),f("aria-label",l(20,16,"menu.tooltip_user_accounts")))}function At(n,m){n&1&&(i(0,"li",70)(1,"small",71),r(2),o(3,"translate"),a(),i(4,"button",72),o(5,"translate"),r(6),o(7,"translate"),a()()),n&2&&(t(2),d(l(3,3,"settings.changes.saved")),t(2),f("aria-label",l(5,5,"menu.tooltip_restart")),t(2),u(" ",l(7,7,"menu.tooltip_restart")," "))}function Nt(n,m){if(n&1){let e=w();i(0,"ul",6)(1,"li",17),r(2),o(3,"translate"),i(4,"div",18)(5,"select",19),v("ngModelChange",function(s){C(e);let x=_();return S(x.saveUiSettingChange("lang",s))}),i(6,"option",20),r(7),o(8,"translate"),a(),i(9,"option",21),r(10,"Bulgarian (bg)"),a(),i(11,"option",22),r(12,"Catalan (ca)"),a(),i(13,"option",23),r(14,"Chinese - Simplified (zh-CN)"),a(),i(15,"option",24),r(16,"Chinese - Traditional (zh-TW)"),a(),i(17,"option",25),r(18,"Czech (cs)"),a(),i(19,"option",26),r(20,"Dutch (nl)"),a(),i(21,"option",27),r(22,"English (en)"),a(),i(23,"option",28),r(24,"Finnish (fi)"),a(),i(25,"option",29),r(26,"French (fr)"),a(),i(27,"option",30),r(28,"German (de)"),a(),i(29,"option",31),r(30,"Hebrew (he)"),a(),i(31,"option",32),r(32,"Hungarian (hu)"),a(),i(33,"option",33),r(34,"Indonesian (id)"),a(),i(35,"option",34),r(36,"Italian (it)"),a(),i(37,"option",35),r(38,"Japanese (ja)"),a(),i(39,"option",36),r(40,"Korean (ko)"),a(),i(41,"option",37),r(42,"Macedonian (mk)"),a(),i(43,"option",38),r(44,"Norwegian (no)"),a(),i(45,"option",39),r(46,"Polish (pl)"),a(),i(47,"option",40),r(48,"Portuguese (Brazil)"),a(),i(49,"option",41),r(50,"Portuguese (Portugal)"),a(),i(51,"option",42),r(52,"Russian (ru)"),a(),i(53,"option",43),r(54,"Slovenian (sl)"),a(),i(55,"option",44),r(56,"Spanish (es)"),a(),i(57,"option",45),r(58,"Swedish (sv)"),a(),i(59,"option",46),r(60,"Thai (th)"),a(),i(61,"option",47),r(62,"Turkish (tr)"),a(),i(63,"option",48),r(64,"Ukrainian (uk)"),a()()()(),i(65,"li",17),r(66),o(67,"translate"),i(68,"div",18)(69,"select",19),v("ngModelChange",function(s){C(e);let x=_();return S(x.saveUiSettingChange("theme",s))}),i(70,"option",49),r(71),o(72,"translate"),a(),i(73,"option",50),r(74),o(75,"translate"),a(),i(76,"option",51),r(77),o(78,"translate"),a(),i(79,"option",52),r(80),o(81,"translate"),a(),i(82,"option",53),r(83),o(84,"translate"),a(),i(85,"option",54),r(86),o(87,"translate"),a(),i(88,"option",55),r(89),o(90,"translate"),a(),i(91,"option",56),r(92),o(93,"translate"),a(),i(94,"option",57),r(95),o(96,"translate"),a(),i(97,"option",58),r(98),o(99,"translate"),a(),i(100,"option",59),r(101),o(102,"translate"),a(),i(103,"option",60),r(104),o(105,"translate"),a(),i(106,"option",61),r(107),o(108,"translate"),a()()()(),i(109,"li",17),r(110),o(111,"translate"),i(112,"div",18)(113,"select",19),v("ngModelChange",function(s){C(e);let x=_();return S(x.saveUiSettingChange("lightingMode",s))}),i(114,"option",20),r(115),o(116,"translate"),a(),i(117,"option",62),r(118),o(119,"translate"),a(),i(120,"option",63),r(121),o(122,"translate"),a()()()(),i(123,"li",17),r(124),o(125,"translate"),i(126,"div",18)(127,"select",19),v("ngModelChange",function(s){C(e);let x=_();return S(x.saveUiSettingChange("menuMode",s))}),i(128,"option",64),r(129),o(130,"translate"),a(),i(131,"option",65),r(132),o(133,"translate"),a()()()(),i(134,"li",17)(135,"span"),r(136),o(137,"translate"),c(138,"br")(139,"small",66),o(140,"translate"),a(),i(141,"div",18)(142,"input",67),v("ngModelChange",function(s){C(e);let x=_();return S(x.saveUiSettingChange("loginWallpaper",s))}),a()()(),i(143,"li",17),r(144),o(145,"translate"),i(146,"div",18)(147,"select",19),v("ngModelChange",function(s){C(e);let x=_();return S(x.saveUiSettingChange("tempUnits",s))}),i(148,"option",68),r(149),o(150,"translate"),a(),i(151,"option",69),r(152),o(153,"translate"),a()()()(),h(154,At,8,9,"li",70),a()}if(n&2){let e=_();t(2),u(" ",l(3,35,"settings.display.lang")," "),t(3),g("ngModel",e.$settings.env.lang),t(2),d(l(8,37,"form.select.auto")),t(59),u(" ",l(67,39,"settings.display.theme")," "),t(3),g("ngModel",e.$settings.theme),t(2),d(l(72,41,"settings.display.orange")),t(3),d(l(75,43,"settings.display.red")),t(3),d(l(78,45,"settings.display.pink")),t(3),d(l(81,47,"settings.display.purple")),t(3),d(l(84,49,"settings.display.deep_purple")),t(3),d(l(87,51,"settings.display.indigo")),t(3),d(l(90,53,"settings.display.blue")),t(3),d(l(93,55,"settings.display.bluegrey")),t(3),d(l(96,57,"settings.display.cyan")),t(3),d(l(99,59,"settings.display.green")),t(3),d(l(102,61,"settings.display.teal")),t(3),d(l(105,63,"settings.display.grey")),t(3),d(l(108,65,"settings.display.brown")),t(3),u(" ",l(111,67,"settings.display.lighting_mode")," "),t(3),g("ngModel",e.$settings.lightingMode),t(2),d(l(116,69,"form.select.auto")),t(3),d(l(119,71,"settings.display.light")),t(3),d(l(122,73,"settings.display.dark")),t(3),u(" ",l(125,75,"settings.display.menu_mode")," "),t(3),g("ngModel",e.$settings.menuMode),t(2),d(l(130,77,"settings.display.menu_default")),t(3),d(l(133,79,"settings.display.menu_freeze")),t(4),u(" ",l(137,81,"settings.display.login_wallpaper"),""),t(3),g("innerHTML",R(140,83,"settings.display.login_wallpaper_desc",P(92,Et,e.file)),X),t(3),g("ngModel",e.$settings.loginWallpaper),t(2),u(" ",l(145,86,"settings.display.temp_units")," "),t(3),g("ngModel",e.$settings.env.temperatureUnits),t(2),d(l(150,88,"settings.display.temp_units.c")),t(3),d(l(153,90,"settings.display.temp_units.f")),t(2),b(e.hasChangedLoginWallpaper?154:-1)}}function Ft(n,m){if(n&1&&(i(0,"li",12)(1,"span"),r(2),o(3,"translate"),i(4,"code"),r(5,"-D"),a(),c(6,"br"),i(7,"small",74),r(8),o(9,"translate"),a()(),c(10,"input",75),o(11,"translate"),c(12,"label",76),a()),n&2){let e=_(3);t(2),u(" ",l(3,3,"settings.startup.debug")," "),t(6),u(" ",l(9,5,e.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),t(2),f("aria-label",l(11,7,"settings.startup.debug"))}}function Vt(n,m){n&1&&(i(0,"li",12)(1,"span"),r(2),o(3,"translate"),i(4,"code"),r(5,"-I"),a(),c(6,"br"),i(7,"small",74),r(8),o(9,"translate"),a()(),c(10,"input",77),o(11,"translate"),c(12,"label",78),a()),n&2&&(t(2),u(" ",l(3,3,"settings.startup.insecure")," "),t(6),d(l(9,5,"settings.startup.insecure_desc")),t(2),f("aria-label",l(11,7,"settings.startup.insecure")))}function Dt(n,m){n&1&&(i(0,"li",12)(1,"span"),r(2),o(3,"translate"),i(4,"code"),r(5,"-K"),a(),c(6,"br"),i(7,"small",74),r(8),o(9,"translate"),a()(),c(10,"input",79),o(11,"translate"),c(12,"label",80),a()),n&2&&(t(2),u(" ",l(3,3,"settings.startup.keep_accessories")," "),t(6),d(l(9,5,"settings.startup.keep_accessories_desc")),t(2),f("aria-label",l(11,7,"settings.startup.keep_accessories")))}function Rt(n,m){if(n&1&&(i(0,"li",17)(1,"span")(2,"span",81),r(3,"DEBUG"),a(),c(4,"br")(5,"small",66),o(6,"translate"),a(),i(7,"div",18),c(8,"input",82),a()()),n&2){let e=_(3);t(5),g("innerHTML",R(6,1,"settings.service.debug_tooltip",P(4,It,e.linkDebug)),X)}}function Pt(n,m){n&1&&(i(0,"li",17)(1,"span")(2,"span",81),r(3,"NODE_OPTIONS"),a(),c(4,"br"),i(5,"small",74),r(6),o(7,"translate"),a()(),i(8,"div",18),c(9,"input",83),a()()),n&2&&(t(6),d(l(7,1,"settings.service.node_tooltip")))}function zt(n,m){n&1&&(i(0,"li",12)(1,"span"),r(2),o(3,"translate"),c(4,"br"),i(5,"small",74),r(6),o(7,"translate"),a()(),i(8,"a",84),o(9,"translate"),c(10,"i",15),a()()),n&2&&(t(2),u(" ",l(3,3,"menu.docker.startup_script"),""),t(4),d(l(7,5,"platform.docker.script_help")),t(2),f("aria-label",l(9,7,"menu.docker.startup_script")))}function Ht(n,m){n&1&&(i(0,"li",70)(1,"small",71),r(2),o(3,"translate"),a(),i(4,"button",72),o(5,"translate"),r(6),o(7,"translate"),a()()),n&2&&(t(2),d(l(3,3,"settings.changes.saved")),t(2),f("aria-label",l(5,5,"menu.tooltip_restart")),t(2),u(" ",l(7,7,"menu.tooltip_restart")," "))}function Ot(n,m){if(n&1&&(i(0,"ul",73),h(1,Ft,13,9,"li",12)(2,Vt,13,9,"li",12)(3,Dt,13,9,"li",12)(4,Rt,9,6,"li",17)(5,Pt,10,3,"li",17)(6,zt,11,9,"li",12)(7,Ht,8,9,"li",70),a()),n&2){let e=_(2);t(),b(e.$settings.env.serviceMode?1:-1),t(),b(e.$settings.env.serviceMode?2:-1),t(),b(e.$settings.env.serviceMode?3:-1),t(),b(e.$settings.env.serviceMode?4:-1),t(),b(e.$settings.env.serviceMode?5:-1),t(),b(e.$settings.env.runningInDocker?6:-1),t(),b(e.hasChangedService?7:-1)}}function Lt(n,m){if(n&1){let e=w();i(0,"form",7)(1,"div",2),v("click",function(){C(e);let s=_();return S(s.toggleSection("startup"))}),i(2,"h5",3),c(3,"i",4),r(4),o(5,"translate"),a()(),h(6,Ot,8,7,"ul",73),a()}if(n&2){let e=_();g("formGroup",e.serviceForm),t(),f("aria-expanded",e.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),t(2),g("ngClass",e.showFields.startup?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(5,6,"settings.title_startup_options")," "),t(2),b(e.showFields.startup?6:-1)}}function Ut(n,m){n&1&&c(0,"i",95)}function jt(n,m){if(n&1&&(i(0,"span")(1,"span",94),h(2,Ut,1,0,"i",95),r(3),i(4,"span",96),r(5),o(6,"translate"),a()()()),n&2){let e=m.$implicit;t(),g("ngClass",B(6,Tt,e.missing,!e.missing)),t(),b(e.missing?2:-1),t(),u(" ",e.iface,": "),t(2),d(e.missing?l(6,4,"settings.mdns_advertiser_not_connected"):e.ip4||e.ip6)}}function Gt(n,m){n&1&&(i(0,"option",88),r(1),o(2,"translate"),a()),n&2&&(t(),u("Avahi (",l(2,1,"settings.mdns_advertiser_rec"),")"))}function Wt(n,m){n&1&&(i(0,"option",91),r(1),o(2,"translate"),a()),n&2&&(t(),u("systemd-resolved (",l(2,1,"settings.mdns_advertiser_exp"),")"))}function qt(n,m){n&1&&(i(0,"li",70)(1,"small",71),r(2),o(3,"translate"),a(),i(4,"button",72),o(5,"translate"),r(6),o(7,"translate"),a()()),n&2&&(t(2),d(l(3,3,"settings.changes.saved")),t(2),f("aria-label",l(5,5,"menu.tooltip_restart")),t(2),u(" ",l(7,7,"menu.tooltip_restart")," "))}function Kt(n,m){if(n&1){let e=w();i(0,"ul",8)(1,"li",12)(2,"span",13),r(3),o(4,"translate"),c(5,"br"),i(6,"small",74),r(7),o(8,"translate"),a(),M(9,jt,7,9,"span",null,T),a(),i(11,"button",85),o(12,"translate"),v("click",function(){C(e);let s=_();return S(s.selectNetworkInterfaces())}),c(13,"i",86),a()(),i(14,"li",17)(15,"span"),r(16),o(17,"translate"),c(18,"br"),i(19,"small",74),r(20),o(21,"translate"),a()(),i(22,"div",18)(23,"select",87),o(24,"translate"),h(25,Gt,3,3,"option",88),i(26,"option",89),r(27),o(28,"translate"),a(),i(29,"option",90),r(30,"Bonjour HAP"),a(),h(31,Wt,3,3,"option",91),a()()(),i(32,"li",17)(33,"span"),r(34),o(35,"translate"),c(36,"br"),i(37,"small",74),r(38),o(39,"translate"),a()(),i(40,"div",18),c(41,"input",92),o(42,"translate"),a()(),i(43,"li",17)(44,"span"),r(45),o(46,"translate"),c(47,"br"),i(48,"small",74),r(49),o(50,"translate"),a()(),i(51,"div",18),c(52,"input",93),o(53,"translate"),a()(),h(54,qt,8,9,"li",70),a()}if(n&2){let e=_();t(3),u(" ",l(4,22,"settings.network.title_network_interfaces"),""),t(4),d(l(8,24,"settings.network.message_network_interface")),t(2),A(e.bridgeNetworkAdapters),t(2),g("disabled",!e.availableNetworkAdapters.length),f("aria-label",l(12,26,"settings.network.title_network_interfaces")),t(2),g("ngClass",P(48,$t,!e.availableNetworkAdapters.length)),t(3),u(" ",l(17,28,"settings.mdns_advertiser"),""),t(4),d(l(21,30,"settings.mdns_advertiser_help")),t(3),g("formControl",e.legacyMdnsFormControl),f("aria-label",l(24,32,"settings.mdns_advertiser")),t(2),b(e.showAvahiMdnsOption?25:-1),t(2),u(" Ciao ",e.showAvahiMdnsOption?"":"("+l(28,34,"settings.mdns_advertiser_rec")+")"," "),t(4),b(e.showResolvedMdnsOption?31:-1),t(3),u(" ",l(35,36,"settings.network.port_hb"),""),t(4),d(l(39,38,"settings.network.port_hb_desc")),t(3),g("formControl",e.hbPortFormControl)("ngClass",P(50,Fe,e.isInvalidHbPort)),f("aria-label",l(42,40,"settings.network.port_ui")),t(4),u(" ",l(46,42,"settings.network.port_ui"),""),t(4),d(l(50,44,"settings.network.port_ui_desc")),t(3),g("ngClass",P(52,Fe,e.isInvalidHbUiPort)),f("aria-label",l(53,46,"settings.network.port_ui")),t(2),b(e.hasChangedHbPort||e.hasChangedUiSettings||e.hasChangedMdns||e.hasChangedBridgeNetworkAdapters?54:-1)}}function Jt(n,m){n&1&&(i(0,"p",9),r(1),o(2,"translate"),a()),n&2&&(t(),d(l(2,1,"settings.cache.desc")))}function Qt(n,m){if(n&1){let e=w();i(0,"ul",97)(1,"li",12)(2,"span",13),r(3),o(4,"translate"),c(5,"br"),i(6,"small",74),r(7),o(8,"translate"),a()(),i(9,"button",14),o(10,"translate"),v("click",function(){C(e);let s=_(2);return S(s.removeSingleCachedAccessories())}),c(11,"i",15),a()(),i(12,"li",12)(13,"span",13),r(14),o(15,"translate"),c(16,"br"),i(17,"small",74),r(18),o(19,"translate"),a()(),i(20,"button",14),o(21,"translate"),v("click",function(){C(e);let s=_(2);return S(s.removeBridgeAccessories())}),c(22,"i",15),a()(),i(23,"li",12)(24,"span",13),r(25),o(26,"translate"),c(27,"br"),i(28,"small",74),r(29),o(30,"translate"),a()(),i(31,"button",14),o(32,"translate"),v("click",function(){C(e);let s=_(2);return S(s.removeAllCachedAccessories())}),c(33,"i",15),a()()()}n&2&&(t(3),u(" ",l(4,9,"reset.accessory_ind.title"),""),t(4),d(l(8,11,"reset.accessory_ind.desc")),t(2),f("aria-label",l(10,13,"reset.accessory_ind.title")),t(5),u(" ",l(15,15,"reset.bridge_accessories.title"),""),t(4),d(l(19,17,"reset.bridge_accessories.desc")),t(2),f("aria-label",l(21,19,"reset.accessory_all.title")),t(5),u(" ",l(26,21,"reset.accessory_all.title"),""),t(4),d(l(30,23,"reset.accessory_all.desc")),t(2),f("aria-label",l(32,25,"reset.accessory_all.title")))}function Xt(n,m){if(n&1){let e=w();i(0,"div",1)(1,"div",2),v("click",function(){C(e);let s=_();return S(s.toggleSection("cache"))}),i(2,"h5",3),c(3,"i",4),r(4),o(5,"translate"),a()(),h(6,Jt,3,3,"p",9)(7,Qt,34,27,"ul",97),a()}if(n&2){let e=_();t(),f("aria-expanded",e.showFields.cache?"true":"false")("aria-controls","fieldsCache"),t(2),g("ngClass",e.showFields.cache?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(5,6,"settings.cache.title")," "),t(2),b(e.showFields.cache?6:-1),t(),b(e.showFields.cache?7:-1)}}function Yt(n,m){n&1&&(i(0,"p",9),r(1),o(2,"translate"),a()),n&2&&(t(),d(l(2,1,"reset.bridges.desc")))}function Zt(n,m){if(n&1){let e=w();i(0,"li",12)(1,"span",13),r(2),o(3,"translate"),c(4,"br"),i(5,"small",74),r(6),o(7,"translate"),a()(),i(8,"button",14),o(9,"translate"),v("click",function(){C(e);let s=_(2);return S(s.unpairAccessory())}),c(10,"i",15),a()()}n&2&&(t(2),u(" ",l(3,3,"reset.bridge_ind.title"),""),t(4),d(l(7,5,"reset.bridge_ind.desc")),t(2),f("aria-label",l(9,7,"reset.bridge_ind.title")))}function ei(n,m){if(n&1){let e=w();i(0,"ul",10),h(1,Zt,11,9,"li",12),i(2,"li",12)(3,"span",13),r(4),o(5,"translate"),o(6,"titlecase"),c(7,"br"),i(8,"small",74),r(9),o(10,"translate"),a()(),i(11,"button",14),o(12,"translate"),v("click",function(){C(e);let s=_();return S(s.resetHomebridgeState())}),c(13,"i",15),a()()()}if(n&2){let e=_();t(),b(e.$settings.env.serviceMode?1:-1),t(3),u(" ",l(6,6,l(5,4,"reset.bridge_all.title")),""),t(5),d(l(10,8,"reset.bridge_all.desc")),t(2),f("aria-label",l(12,10,"reset.bridge_all.title"))}}var Sn=(()=>{class n{$api=k(D);$modal=k(J);$plugin=k(ye);$settings=k(ke);$toastr=k(V);$translate=k(F);originalServiceForm={HOMEBRIDGE_DEBUG:!1,HOMEBRIDGE_KEEP_ORPHANS:!1,HOMEBRIDGE_INSECURE:!0,ENV_DEBUG:"",ENV_NODE_OPTIONS:""};originalUiSettingsForm={port:0};originalLoginWallpaper="";originalMdnsSetting="";originalBridgeNetworkAdapters=[];originalHbPort=0;hasChangedService=!1;hasChangedUiSettings=!1;hasChangedMdns=!1;hasChangedBridgeNetworkAdapters=!1;hasChangedHbPort=!1;hasChangedLoginWallpaper=!1;isInvalidHbPort=!1;isInvalidHbUiPort=!1;serviceForm=new Y({HOMEBRIDGE_DEBUG:new H(!1),HOMEBRIDGE_KEEP_ORPHANS:new H(!1),HOMEBRIDGE_INSECURE:new H(!0),ENV_DEBUG:new H(""),ENV_NODE_OPTIONS:new H("")});uiSettingsForm=new Y({port:new H(0)});loginWallpaper="";legacyMdnsFormControl=new se(!1);showAvahiMdnsOption=!1;showResolvedMdnsOption=!1;availableNetworkAdapters=[];bridgeNetworkAdapters=[];hbPortFormControl=new H(0);isHbV2=!1;showFields={general:!0,display:!0,startup:!0,network:!0,reset:!0,cache:!0};file='<span class="text-monospace">ui-wallpaper.jpg</span>';linkDebug='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Debug-Common-Values" target="_blank"><i class="fa fa-fw fa-external-link-alt"></i></a>';constructor(){}ngOnInit(){this.isHbV2=this.$settings.env.homebridgeVersion.startsWith("2"),this.initUiSettingsForm(),this.initDisplaySettingsForm(),this.initNetworkingOptions(),this.$settings.env.serviceMode&&this.initServiceModeForm()}initUiSettingsForm(){this.originalUiSettingsForm={port:this.$settings.env.port},this.uiSettingsForm.patchValue({port:this.$settings.env.port}),this.uiSettingsForm.valueChanges.pipe(Q(500)).subscribe(e=>{let p=!1;Object.keys(e).forEach(s=>{this.originalUiSettingsForm[s]!==e[s]&&(this.saveUiSettingChange(s,e[s]),p=!0)}),this.hasChangedUiSettings=p})}initServiceModeForm(){this.$api.get("/platform-tools/hb-service/homebridge-startup-settings").subscribe({next:e=>{Object.keys(e).forEach(p=>{this.originalServiceForm[p]=e[p]}),this.serviceForm.patchValue(e),this.serviceForm.valueChanges.pipe(Q(500)).subscribe(this.saveServiceModeSettings.bind(this))},error:e=>{console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}initDisplaySettingsForm(){this.originalLoginWallpaper=this.$settings.loginWallpaper,this.loginWallpaper=this.$settings.loginWallpaper}saveUiSettingChange(e,p){switch(e){case"lang":this.$settings.setLang(p);break;case"lightingMode":this.$settings.setLightingMode(p,"user");break;case"menuMode":this.$settings.setMenuMode(p),window.location.reload();break;case"theme":this.$settings.setTheme(p);break;case"tempUnits":this.$settings.setEnvItem("temperatureUnits",p);break;case"loginWallpaper":this.$settings.setEnvItem("loginWallpaper",p),this.hasChangedLoginWallpaper=p!==this.originalLoginWallpaper;break;case"port":if(!p||typeof p!="number"||p<1025||p>65533||Number.isInteger(p)===!1||p===this.hbPortFormControl.value){this.isInvalidHbUiPort=!0;return}this.$settings.setEnvItem("port",p),this.isInvalidHbUiPort=!1;break}$(this.$api.put("/config-editor/ui",{key:e,value:p})).catch(s=>{console.error(s),this.$toastr.error(s.message,this.$translate.instant("toast.title_error"))})}openUiSettings(){this.$plugin.settings({name:"homebridge-config-ui-x",displayName:"Homebridge UI",settingsSchema:!0,links:{}})}openBackupModal(){this.$modal.open(Ee,{size:"lg",backdrop:"static"})}saveServiceModeSettings(e=this.serviceForm.value){this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",e).subscribe({next:()=>{this.hasChangedService=JSON.stringify(e)!==JSON.stringify(this.originalServiceForm)},error:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}resetHomebridgeState(){this.$modal.open(Te,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(Ae,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open(Ie,{size:"lg",backdrop:"static"})}removeSingleCachedAccessories(){this.$modal.open(Be,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open($e,{size:"lg",backdrop:"static"})}initNetworkingOptions(){return y(this,null,function*(){try{this.getNetworkSettings(),(this.$settings.env.runningInLinux||this.$settings.env.runningInDocker||this.$settings.env.runningInSynologyPackage||this.$settings.env.runningInPackageMode)&&(this.showAvahiMdnsOption=!0,this.showResolvedMdnsOption=!0)}catch{}})}getNetworkSettings(){return y(this,null,function*(){return Promise.all([$(this.$api.get("/server/network-interfaces/system")),$(this.$api.get("/server/network-interfaces/bridge")),$(this.$api.get("/server/mdns-advertiser")),$(this.$api.get("/server/port"))]).then(([e,p,s,x])=>{this.availableNetworkAdapters=e,this.buildBridgeNetworkAdapterList(p),this.legacyMdnsFormControl.patchValue(s.advertiser),this.originalMdnsSetting=s.advertiser,this.originalBridgeNetworkAdapters=this.bridgeNetworkAdapters.map(O=>O.iface),this.legacyMdnsFormControl.valueChanges.subscribe(O=>{this.setHomebridgeMdnsSetting(O)}),this.hbPortFormControl.patchValue(x.port),this.hbPortFormControl.valueChanges.subscribe(O=>this.setHomebridgePort(O)),this.originalHbPort=x.port})})}setHomebridgeMdnsSetting(e){return y(this,null,function*(){this.$api.put("/server/mdns-advertiser",{advertiser:e}).subscribe({next:()=>{this.hasChangedMdns=e!==this.originalMdnsSetting},error:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})})}setNetworkInterfaces(e){return y(this,null,function*(){this.$api.put("/server/network-interfaces/bridge",{adapters:e}).subscribe({next:()=>{this.hasChangedBridgeNetworkAdapters=this.originalBridgeNetworkAdapters.join(",")!==e.join(",")},error:p=>{console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})})}setHomebridgePort(e){return y(this,null,function*(){if(e===this.uiSettingsForm.get("port").value){this.isInvalidHbPort=!0;return}this.$api.put("/server/port",{port:e}).subscribe({next:()=>{this.hasChangedHbPort=this.originalHbPort!==e,this.isInvalidHbPort=!1},error:()=>{this.isInvalidHbPort=!0}})})}buildBridgeNetworkAdapterList(e){if(!e.length){this.bridgeNetworkAdapters=[];return}this.bridgeNetworkAdapters=e.map(p=>{let s=this.availableNetworkAdapters.find(x=>x.iface===p);return s?(s.selected=!0,s.missing=!1,s):{iface:p,missing:!0}})}selectNetworkInterfaces(){let e=this.$modal.open(Ne,{size:"lg",backdrop:"static"});e.componentInstance.availableNetworkAdapters=this.availableNetworkAdapters,e.componentInstance.bridgeNetworkAdapters=this.bridgeNetworkAdapters,e.result.then(p=>{this.buildBridgeNetworkAdapterList(p),this.setNetworkInterfaces(p)}).catch(()=>{})}toggleSection(e){this.showFields[e]=!this.showFields[e]}static \u0275fac=function(p){return new(p||n)};static \u0275cmp=E({type:n,selectors:[["ng-component"]],decls:35,vars:35,consts:[[1,"primary-text","m-0"],[1,"my-4"],["role","button","tabindex","0",1,"mt-3","hover-pointer",3,"click"],[1,"primary-text"],[1,"fa","fa-fw",3,"ngClass"],["id","fieldsGeneral",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsDisplay",1,"list-group","list-group-box","mt-2","mx-0"],["novalidate","",1,"my-4",3,"formGroup"],["id","fieldsNetwork",1,"list-group","list-group-box","mt-2","mx-0"],[1,"small","grey-text","mb-2","mx-0"],["id","fieldsReset",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pr-2"],[1,"btn","btn-primary","waves-effect","m-0","ml-3",2,"min-width","50px",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["routerLink","/users",1,"btn","btn-primary","waves-effect","m-0","ml-3",2,"min-width","50px"],[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"],[1,"custom-select","resp-select",3,"ngModelChange","ngModel"],["value","auto"],["value","bg"],["value","ca"],["value","zh-CN"],["value","zh-TW"],["value","cs"],["value","nl"],["value","en"],["value","fi"],["value","fr"],["value","de"],["value","he"],["value","hu"],["value","id"],["value","it"],["value","ja"],["value","ko"],["value","mk"],["value","no"],["value","pl"],["value","pt-BR"],["value","pt"],["value","ru"],["value","sl"],["value","es"],["value","sv"],["value","th"],["value","tr"],["value","uk"],["value","orange"],["value","red"],["value","pink"],["value","purple"],["value","deep-purple"],["value","indigo"],["value","blue"],["value","blue-grey"],["value","cyan"],["value","green"],["value","teal"],["value","grey"],["value","brown"],["value","light"],["value","dark"],["value","default"],["value","freeze"],[1,"grey-text","pr-2",3,"innerHTML"],["name","search_wallpaper","autocomplete","off","type","text","placeholder","/path-to/image.png",1,"form-control","custom-input","form-control-sm","resp-input",3,"ngModelChange","ngModel"],["value","c"],["value","f"],[1,"list-group-item","d-flex","flex-column","align-items-center"],[1,"grey-text","my-2"],["routerLink","/restart",1,"btn","btn-primary","waves-effect","my-2"],["id","fieldsStartup",1,"list-group","list-group-box","mb-4","mx-0"],[1,"grey-text","pr-2"],["type","checkbox","id","homebridgeDebugMode","formControlName","HOMEBRIDGE_DEBUG",1,"rendux-input"],["for","homebridgeDebugMode",1,"rendux-label","ml-3",2,"min-width","50px"],["type","checkbox","id","homebridgeInsecureMode","formControlName","HOMEBRIDGE_INSECURE",1,"rendux-input"],["for","homebridgeInsecureMode",1,"rendux-label","ml-3",2,"min-width","50px"],["type","checkbox","id","homebridgeKeepOrphans","formControlName","HOMEBRIDGE_KEEP_ORPHANS",1,"rendux-input"],["for","homebridgeKeepOrphans",1,"rendux-label","ml-3",2,"min-width","50px"],[1,"text-monospace"],["formControlName","ENV_DEBUG","type","text","placeholder","HAP-NodeJS:Advertiser,HAP-NodeJS:Service",1,"form-control","custom-input","form-control-sm","resp-input"],["formControlName","ENV_NODE_OPTIONS","type","text","placeholder","--max-old-space-size=512 --max-http-header-size=8192",1,"form-control","custom-input","form-control-sm","resp-input"],["routerLink","/platform-tools/docker/startup-script",1,"btn","btn-primary","waves-effect","m-0","ml-3",2,"min-width","50px"],[1,"btn","btn-primary","waves-effect","m-0","ml-3",2,"min-width","50px",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right",3,"ngClass"],[1,"custom-select","resp-select",3,"formControl"],["value","avahi"],["value","ciao"],["value","bonjour-hap"],["value","resolved"],["type","number","min","1025","max","65533",1,"form-control","custom-input","form-control-sm","resp-input",3,"formControl","ngClass"],["type","number","min","1025","max","65533","placeholder","8581","formControlName","port",1,"form-control","custom-input","form-control-sm","resp-input",3,"ngClass"],[1,"badge","badge-pill","mr-1",3,"ngClass"],[1,"fas","fa-fw","fa-exclamation-triangle"],[1,"font-weight-normal"],["id","fieldsCache",1,"list-group","list-group-box","mb-4","mx-0"]],template:function(p,s){p&1&&(i(0,"h3",0),r(1),o(2,"translate"),a(),i(3,"div",1)(4,"div",2),v("click",function(){return s.toggleSection("general")}),i(5,"h5",3),c(6,"i",4),r(7),o(8,"translate"),a()(),h(9,Mt,22,18,"ul",5),a(),i(10,"div",1)(11,"div",2),v("click",function(){return s.toggleSection("display")}),i(12,"h5",3),c(13,"i",4),r(14),o(15,"translate"),a()(),h(16,Nt,155,94,"ul",6),a(),h(17,Lt,7,8,"form",7),i(18,"form",7)(19,"div",2),v("click",function(){return s.toggleSection("network")}),i(20,"h5",3),c(21,"i",4),r(22),o(23,"translate"),a()(),h(24,Kt,55,54,"ul",8),a(),h(25,Xt,8,8,"div",1),i(26,"div",1)(27,"div",2),v("click",function(){return s.toggleSection("reset")}),i(28,"h5",3),c(29,"i",4),r(30),o(31,"translate"),a()(),h(32,Yt,3,3,"p",9)(33,ei,14,12,"ul",10),a(),c(34,"div",11)),p&2&&(t(),d(l(2,25,"menu.settings.title")),t(3),f("aria-expanded",s.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),t(2),g("ngClass",s.showFields.general?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(8,27,"settings.general.title_general")," "),t(2),b(s.showFields.general?9:-1),t(2),f("aria-expanded",s.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),t(2),g("ngClass",s.showFields.display?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(15,29,"settings.general.title_display")," "),t(2),b(s.showFields.display?16:-1),t(),b(s.$settings.env.serviceMode||s.$settings.env.runningInDocker?17:-1),t(),g("formGroup",s.uiSettingsForm),t(),f("aria-expanded",s.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),t(2),g("ngClass",s.showFields.network?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(23,31,"settings.network.title_network")," "),t(2),b(s.showFields.network?24:-1),t(),b(s.$settings.env.serviceMode?25:-1),t(2),f("aria-expanded",s.showFields.reset?"true":"false")("aria-controls","fieldsReset"),t(2),g("ngClass",s.showFields.reset?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(31,33,"reset.bridges.title")," "),t(2),b(s.showFields.reset?32:-1),t(),b(s.showFields.reset?33:-1))},dependencies:[z,Se,q,pe,ge,be,oe,de,j,_e,G,le,xe,ve,W,fe,ce,me,ue,U,I],encapsulation:2})}return n})();export{Ie as a,Te as b,Ne as c,Sn as d};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-4JBDAK6H.js";import"./chunk-EQHMVJZQ.js";import"./chunk-T3GI7KUT.js";import"./chunk-SK6P7SRA.js";import"./chunk-J3RKUN7D.js";import"./chunk-WQOH45IS.js";import"./chunk-HA6CO5NZ.js";import"./chunk-675OFXLW.js";import"./chunk-CKNHTRCL.js";export{a as RestartLinuxComponent};