homebridge-config-ui-x 5.4.2-beta.4 → 5.4.2-beta.40
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.
- package/CHANGELOG.md +36 -13
- package/dist/bin/hb-service.js +1 -1
- package/dist/bin/hb-service.js.map +1 -1
- package/dist/core/auth/auth.controller.d.ts +2 -0
- package/dist/core/config/config.interfaces.d.ts +64 -0
- package/dist/core/config/config.interfaces.js +3 -0
- package/dist/core/config/config.interfaces.js.map +1 -0
- package/dist/core/config/config.service.d.ts +7 -22
- package/dist/core/config/config.service.js +7 -2
- package/dist/core/config/config.service.js.map +1 -1
- package/dist/core/config/config.startup.d.ts +2 -12
- package/dist/core/config/config.startup.js +11 -3
- package/dist/core/config/config.startup.js.map +1 -1
- package/dist/core/spa/spa-html.service.d.ts +5 -0
- package/dist/core/spa/spa-html.service.js +38 -0
- package/dist/core/spa/spa-html.service.js.map +1 -0
- package/dist/core/spa/spa.filter.d.ts +3 -0
- package/dist/core/spa/spa.filter.js +22 -2
- package/dist/core/spa/spa.filter.js.map +1 -1
- package/dist/globalDefaults.js +3 -0
- package/dist/globalDefaults.js.map +1 -1
- package/dist/main.js +18 -3
- package/dist/main.js.map +1 -1
- package/dist/modules/accessories/accessories.service.js +5 -1
- package/dist/modules/accessories/accessories.service.js.map +1 -1
- package/dist/modules/backup/backup.service.js +4 -1
- package/dist/modules/backup/backup.service.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +3 -3
- package/dist/modules/config-editor/config-editor.service.d.ts +3 -2
- package/dist/modules/config-editor/config-editor.service.js +38 -15
- package/dist/modules/config-editor/config-editor.service.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.d.ts +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +2 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
- package/dist/modules/log/log.gateway.d.ts +1 -1
- package/dist/modules/log/log.interfaces.d.ts +4 -0
- package/dist/modules/log/log.interfaces.js +3 -0
- package/dist/modules/log/log.interfaces.js.map +1 -0
- package/dist/modules/log/log.service.d.ts +1 -4
- package/dist/modules/log/log.service.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +1 -1
- package/dist/modules/platform-tools/terminal/terminal.interfaces.d.ts +8 -0
- package/dist/modules/platform-tools/terminal/terminal.interfaces.js +3 -0
- package/dist/modules/platform-tools/terminal/terminal.interfaces.js.map +1 -0
- package/dist/modules/platform-tools/terminal/terminal.service.d.ts +1 -8
- package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
- package/dist/modules/plugins/plugins.controller.d.ts +5 -5
- package/dist/modules/plugins/plugins.interfaces.d.ts +211 -0
- package/dist/modules/plugins/plugins.interfaces.js +3 -0
- package/dist/modules/plugins/plugins.interfaces.js.map +1 -0
- package/dist/modules/plugins/plugins.service.d.ts +2 -1
- package/dist/modules/plugins/plugins.service.js +33 -15
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/server/server.controller.d.ts +3 -0
- package/dist/modules/server/server.controller.js +13 -0
- package/dist/modules/server/server.controller.js.map +1 -1
- package/dist/modules/server/server.service.js +6 -4
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/status/status.controller.d.ts +2 -2
- package/dist/modules/status/status.gateway.d.ts +5 -5
- package/dist/modules/status/status.interfaces.d.ts +27 -0
- package/dist/modules/status/status.interfaces.js +10 -0
- package/dist/modules/status/status.interfaces.js.map +1 -0
- package/dist/modules/status/status.service.d.ts +2 -29
- package/dist/modules/status/status.service.js +4 -9
- package/dist/modules/status/status.service.js.map +1 -1
- package/package.json +16 -11
- package/public/3rdpartylicenses.txt +16 -40
- package/public/assets/monaco/ThirdPartyNotices.txt +448 -0
- package/public/assets/monaco/min/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/public/assets/monaco/min/vs/base/worker/workerMain.js +31 -0
- package/public/assets/monaco/min/vs/basic-languages/shell/shell.js +10 -0
- package/public/assets/monaco/min/vs/editor/editor.main.css +8 -0
- package/public/assets/monaco/min/vs/editor/editor.main.js +798 -0
- package/public/assets/monaco/min/vs/language/json/jsonMode.js +19 -0
- package/public/assets/monaco/min/vs/language/json/jsonWorker.js +42 -0
- package/public/assets/monaco/min/vs/loader.js +11 -0
- package/public/chunk-2DNOEBYN.js +1 -0
- package/public/chunk-32NC3IVK.js +16 -0
- package/public/chunk-354C3X7T.js +19 -0
- package/public/chunk-3G7IDMFU.js +1 -0
- package/public/{chunk-U6ROY5ZN.js → chunk-3YOGUN4W.js} +1 -1
- package/public/chunk-42EXBOPA.js +1 -0
- package/public/chunk-4FC5JCBA.js +1 -0
- package/public/{chunk-6N2SOTOL.js → chunk-4HJOARLT.js} +2 -2
- package/public/chunk-4QZG5IBV.js +1 -0
- package/public/chunk-4YMIOPY5.js +1 -0
- package/public/chunk-5AW36TN3.js +1 -0
- package/public/chunk-5BAB4FLA.js +1 -0
- package/public/{chunk-CQKCDD3I.js → chunk-5YEYAEII.js} +1 -1
- package/public/{chunk-BEYU5GMW.js → chunk-6DTD6NF3.js} +2 -2
- package/public/chunk-6TWUTMWM.js +40 -0
- package/public/{chunk-P5LYIXY6.js → chunk-A7SU4MHQ.js} +1 -1
- package/public/chunk-AACIDDLQ.js +9 -0
- package/public/chunk-BG3D2DZW.js +1 -0
- package/public/chunk-CWZT5DC3.js +1 -0
- package/public/{chunk-OPYWX2UT.js → chunk-D2HNCCB6.js} +1 -1
- package/public/{chunk-3DFE4GXY.js → chunk-EOXVJQVC.js} +1 -1
- package/public/chunk-FON7X6PI.js +1 -0
- package/public/chunk-FSS52C6M.js +1 -0
- package/public/chunk-GBKV42JT.js +1 -0
- package/public/chunk-GC5ZVIAR.js +1 -0
- package/public/chunk-HNJPAXQ5.js +1 -0
- package/public/{chunk-QNF5ENQG.js → chunk-HQBRFFPL.js} +1 -1
- package/public/chunk-I32XNZAC.js +1 -0
- package/public/{chunk-FVSVQWIM.js → chunk-IDS6CACH.js} +1 -1
- package/public/{chunk-G3CSSNW3.js → chunk-IL6JW6PB.js} +1 -1
- package/public/chunk-JPNMUW6S.js +1 -0
- package/public/{chunk-WMIMAPZH.js → chunk-KCLLEPG3.js} +1 -1
- package/public/chunk-NC7XPNIV.js +1 -0
- package/public/{chunk-DD4UIDDU.js → chunk-NHATITBP.js} +1 -1
- package/public/chunk-NLE7I54S.js +1 -0
- package/public/{chunk-E5M5VUTV.js → chunk-NNGM3PUS.js} +1 -1
- package/public/chunk-NW5L2FIY.js +1 -0
- package/public/chunk-ONSFSQPA.js +1 -0
- package/public/{chunk-ZVJPMFYX.js → chunk-PHIVEHY2.js} +1 -1
- package/public/chunk-PRNMO4E2.js +5 -0
- package/public/chunk-QKQFWEQY.js +3 -0
- package/public/{chunk-NFD7N6TO.js → chunk-QTUF3RXY.js} +1 -1
- package/public/{chunk-JWSIULJX.js → chunk-R6ROHI5E.js} +1 -1
- package/public/chunk-R7VTFW66.js +1 -0
- package/public/{chunk-WCMFALUQ.js → chunk-RJ7DGOUE.js} +1 -1
- package/public/chunk-RMBCZ6PE.js +1 -0
- package/public/chunk-RR2V2D4G.js +1 -0
- package/public/chunk-RTZVASBV.js +1 -0
- package/public/chunk-S2UVMNTQ.js +1 -0
- package/public/chunk-S4DTLIZU.js +1 -0
- package/public/{chunk-LIIIEDKB.js → chunk-SGMZN62K.js} +1 -1
- package/public/chunk-SLFDMPM6.js +49 -0
- package/public/chunk-TGMT2CPD.js +4 -0
- package/public/chunk-TTSDYAR7.js +1 -0
- package/public/chunk-TUN7H57E.js +1 -0
- package/public/chunk-UOOMSN4Q.js +1 -0
- package/public/chunk-USGWBGHR.js +1 -0
- package/public/{chunk-LOC52TG7.js → chunk-UWI7PQIM.js} +1 -1
- package/public/chunk-VCWEPDEP.js +1 -0
- package/public/chunk-VIHCQCPQ.js +1 -0
- package/public/{chunk-5KZJLK3B.js → chunk-VOI666RM.js} +4 -4
- package/public/chunk-VSX4HMXR.js +1 -0
- package/public/chunk-W5NNVVIP.js +1 -0
- package/public/chunk-WALOI7QT.js +1 -0
- package/public/chunk-XEMTN2GZ.js +1 -0
- package/public/chunk-XLPPT7E7.js +4 -0
- package/public/chunk-YIXIXCO4.js +2 -0
- package/public/chunk-ZX7APSEP.js +1 -0
- package/public/index.html +2 -2
- package/public/main-WMR4TUCJ.js +1 -0
- package/public/polyfills-5KWHJ7II.js +2 -0
- package/public/styles-643WFJRY.css +1 -0
- package/config.schema.json +0 -590
- package/public/assets/hap-icons/light-bulb.svg +0 -25
- package/public/assets/hap-icons/outlet.svg +0 -25
- package/public/assets/hap-icons/switch.svg +0 -25
- package/public/assets/hap-icons/unknown.svg +0 -25
- package/public/assets/monaco-0.21.3/README.md +0 -96
- package/public/assets/monaco-0.21.3/ThirdPartyNotices.txt +0 -283
- package/public/assets/monaco-0.21.3/min/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/public/assets/monaco-0.21.3/min/vs/base/worker/workerMain.js +0 -160
- package/public/assets/monaco-0.21.3/min/vs/basic-languages/shell/shell.js +0 -7
- package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.css +0 -6
- package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.js +0 -2368
- package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.nls.js +0 -39
- package/public/assets/monaco-0.21.3/min/vs/language/json/jsonMode.js +0 -7
- package/public/assets/monaco-0.21.3/min/vs/language/json/jsonWorker.js +0 -7
- package/public/assets/monaco-0.21.3/min/vs/loader.js +0 -38
- package/public/assets/monaco-0.21.3/package.json +0 -38
- package/public/chunk-2ETJ2W67.js +0 -1
- package/public/chunk-2IPYU27V.js +0 -20
- package/public/chunk-4IS25CEL.js +0 -1
- package/public/chunk-4ZMTZF3W.js +0 -1
- package/public/chunk-5J7OMTCR.js +0 -1
- package/public/chunk-5KFQUVTY.js +0 -1
- package/public/chunk-6FXNHKMA.js +0 -1
- package/public/chunk-6MRWZBRB.js +0 -1
- package/public/chunk-A76CGVLE.js +0 -1
- package/public/chunk-ABEVAIAL.js +0 -1
- package/public/chunk-ABOVGRBT.js +0 -1
- package/public/chunk-AIKHSPDS.js +0 -1
- package/public/chunk-CV5P3VHY.js +0 -1
- package/public/chunk-D32NWYHS.js +0 -1
- package/public/chunk-EUPINTFY.js +0 -3
- package/public/chunk-EUQRX7LQ.js +0 -1
- package/public/chunk-H6CYTQYR.js +0 -1
- package/public/chunk-M5HYAGSQ.js +0 -1
- package/public/chunk-MCRAOLRB.js +0 -1
- package/public/chunk-NRU4C4QO.js +0 -1
- package/public/chunk-NRVKNZMW.js +0 -14
- package/public/chunk-NVSHJ7LK.js +0 -1
- package/public/chunk-OIV4KXSV.js +0 -1
- package/public/chunk-OUS4RGQP.js +0 -1
- package/public/chunk-PFU546XJ.js +0 -1
- package/public/chunk-PMVD4FUJ.js +0 -9
- package/public/chunk-PP5MH7GY.js +0 -2
- package/public/chunk-QABGEKAZ.js +0 -2
- package/public/chunk-QBGF33DL.js +0 -1
- package/public/chunk-QK7Z3CEZ.js +0 -1
- package/public/chunk-RPTZSO5O.js +0 -1
- package/public/chunk-RT24VDZP.js +0 -1
- package/public/chunk-S6BASE5W.js +0 -1
- package/public/chunk-S6W546ZE.js +0 -4
- package/public/chunk-SD2QP7RK.js +0 -1
- package/public/chunk-SMCVOWDV.js +0 -1
- package/public/chunk-T3KHQZNL.js +0 -1
- package/public/chunk-TG5OFUMM.js +0 -1
- package/public/chunk-UNUGLKWP.js +0 -1
- package/public/chunk-UT3VB4SC.js +0 -49
- package/public/chunk-VWR3K52A.js +0 -1
- package/public/chunk-WBMAWHKA.js +0 -12
- package/public/chunk-XEXJIDEI.js +0 -4
- package/public/chunk-XWYKEZQQ.js +0 -4
- package/public/chunk-YERWTYFA.js +0 -1
- package/public/chunk-YSZKQXWK.js +0 -1
- package/public/chunk-ZKETDQ54.js +0 -1
- package/public/chunk-ZM5B4KXN.js +0 -1
- package/public/chunk-ZNONDSJT.js +0 -1
- package/public/main-MRP2WE3O.js +0 -1
- package/public/polyfills-WE4HA5DL.js +0 -2
- package/public/styles-LKRXKJ7O.css +0 -1
- /package/public/assets/{monaco-0.21.3 → monaco}/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ba as Se,H as ee,Qa as te,Xa as Oe,Ya as ke,bb as Ie,e as $,ea as Ce,fa as Me,g as yt,i as Q,ia as ye,n as Z,x as we,ya as xe}from"./chunk-PRNMO4E2.js";var $e=$((Jt,De)=>{De.exports=function(r,a){return Array.prototype.slice.call(r,a)}});var Ne=$((Qt,Re)=>{var xt=typeof setImmediate=="function",re;xt?re=function(e){setImmediate(e)}:re=function(e){setTimeout(e,0)};Re.exports=re});var Ye=$((Zt,Xe)=>{"use strict";var St=Ne();Xe.exports=function(r,a,t){r&&St(function(){r.apply(t||null,a||[])})}});var Be=$((er,je)=>{"use strict";var Fe=$e(),Ot=Ye();je.exports=function(r,a){var t=a||{},n={};return r===void 0&&(r={}),r.on=function(i,s){return n[i]?n[i].push(s):n[i]=[s],r},r.once=function(i,s){return s._once=!0,r.on(i,s),r},r.off=function(i,s){var u=arguments.length;if(u===1)delete n[i];else if(u===0)n={};else{var f=n[i];if(!f)return r;f.splice(f.indexOf(s),1)}return r},r.emit=function(){var i=Fe(arguments);return r.emitterSnapshot(i.shift()).apply(this,i)},r.emitterSnapshot=function(i){var s=(n[i]||[]).slice(0);return function(){var u=Fe(arguments),f=this||r;if(i==="error"&&t.throws!==!1&&!s.length)throw u.length===1?u[0]:u;return s.forEach(function(p){t.async?Ot(p,u,f):p.apply(f,u),p._once&&r.off(i,p)}),r}},r}});var qe=$((tr,Ae)=>{var Pe=global.CustomEvent;function kt(){try{var e=new Pe("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}Ae.exports=kt()?Pe:typeof document<"u"&&typeof document.createEvent=="function"?function(r,a){var t=document.createEvent("CustomEvent");return a?t.initCustomEvent(r,a.bubbles,a.cancelable,a.detail):t.initCustomEvent(r,!1,!1,void 0),t}:function(r,a){var t=document.createEventObject();return t.type=r,a?(t.bubbles=!!a.bubbles,t.cancelable=!!a.cancelable,t.detail=a.detail):(t.bubbles=!1,t.cancelable=!1,t.detail=void 0),t}});var Ge=$((rr,Ve)=>{"use strict";var Te=[],ne="",It=/^on/;for(ne in global)It.test(ne)&&Te.push(ne.slice(2));Ve.exports=Te});var Ke=$((nr,ze)=>{"use strict";var Dt=qe(),$t=Ge(),H=global.document,He=Rt,Le=Xt,q=[];global.addEventListener||(He=Nt,Le=Yt);ze.exports={add:He,remove:Le,fabricate:Ft};function Rt(e,r,a,t){return e.addEventListener(r,a,t)}function Nt(e,r,a){return e.attachEvent("on"+r,Bt(e,r,a))}function Xt(e,r,a,t){return e.removeEventListener(r,a,t)}function Yt(e,r,a){var t=_e(e,r,a);if(t)return e.detachEvent("on"+r,t)}function Ft(e,r,a){var t=$t.indexOf(r)===-1?i():n();e.dispatchEvent?e.dispatchEvent(t):e.fireEvent("on"+r,t);function n(){var s;return H.createEvent?(s=H.createEvent("Event"),s.initEvent(r,!0,!0)):H.createEventObject&&(s=H.createEventObject()),s}function i(){return new Dt(r,{detail:a})}}function jt(e,r,a){return function(n){var i=n||global.event;i.target=i.target||i.srcElement,i.preventDefault=i.preventDefault||function(){i.returnValue=!1},i.stopPropagation=i.stopPropagation||function(){i.cancelBubble=!0},i.which=i.which||i.keyCode,a.call(e,i)}}function Bt(e,r,a){var t=_e(e,r,a)||jt(e,r,a);return q.push({wrapper:t,element:e,type:r,fn:a}),t}function _e(e,r,a){var t=Pt(e,r,a);if(t){var n=q[t].wrapper;return q.splice(t,1),n}}function Pt(e,r,a){var t,n;for(t=0;t<q.length;t++)if(n=q[t],n.element===e&&n.type===r&&n.fn===a)return t}});var Qe=$((ir,Je)=>{"use strict";var Ue={},At="(?:^|\\s)",qt="(?:\\s|$)";function We(e){var r=Ue[e];return r?r.lastIndex=0:Ue[e]=r=new RegExp(At+e+qt,"g"),r}function Tt(e,r){var a=e.className;a.length?We(r).test(a)||(e.className+=" "+r):e.className=r}function Vt(e,r){e.className=e.className.replace(We(r)," ").trim()}Je.exports={add:Tt,rm:Vt}});var ut=$((or,st)=>{"use strict";var Gt=Be(),P=Ke(),X=Qe(),A=document,D=A.documentElement;function Ht(e,r){var a=arguments.length;a===1&&Array.isArray(e)===!1&&(r=e,e=[]);var t,n,i,s,u,f,b,p,C,h,w,M=null,O,c=r||{};c.moves===void 0&&(c.moves=rt),c.accepts===void 0&&(c.accepts=rt),c.invalid===void 0&&(c.invalid=ht),c.containers===void 0&&(c.containers=e||[]),c.isContainer===void 0&&(c.isContainer=_t),c.copy===void 0&&(c.copy=!1),c.copySortSource===void 0&&(c.copySortSource=!1),c.revertOnSpill===void 0&&(c.revertOnSpill=!1),c.removeOnSpill===void 0&&(c.removeOnSpill=!1),c.direction===void 0&&(c.direction="vertical"),c.ignoreInputTextSelection===void 0&&(c.ignoreInputTextSelection=!0),c.mirrorContainer===void 0&&(c.mirrorContainer=A.body);var g=Gt({containers:c.containers,start:vt,end:fe,cancel:pe,remove:me,destroy:ct,canMove:ft,dragging:!1});return c.removeOnSpill===!0&&g.on("over",mt).on("out",pt),ue(),g;function L(o){return g.containers.indexOf(o)!==-1||c.isContainer(o)}function ue(o){var l=o?"remove":"add";T(D,l,"mousedown",lt),T(D,l,"mouseup",K)}function _(o){var l=o?"remove":"add";T(D,l,"mousemove",dt)}function ce(o){var l=o?"remove":"add";P[l](D,"selectstart",le),P[l](D,"click",le)}function ct(){ue(!0),K({})}function le(o){O&&o.preventDefault()}function lt(o){f=o.clientX,b=o.clientY;var l=Ze(o)!==1||o.metaKey||o.ctrlKey;if(!l){var d=o.target,m=z(d);m&&(O=m,_(),o.type==="mousedown"&&(ot(d)?d.focus():o.preventDefault()))}}function dt(o){if(O){if(Ze(o)===0){K({});return}if(!(o.clientX!==void 0&&Math.abs(o.clientX-f)<=(c.slideFactorX||0)&&o.clientY!==void 0&&Math.abs(o.clientY-b)<=(c.slideFactorY||0))){if(c.ignoreInputTextSelection){var l=Y("clientX",o)||0,d=Y("clientY",o)||0,m=A.elementFromPoint(l,d);if(ot(m))return}var x=O;_(!0),ce(),fe(),de(x);var E=Lt(i);s=Y("pageX",o)-E.left,u=Y("pageY",o)-E.top,X.add(h||i,"gu-transit"),gt(),J(o)}}}function z(o){if(!(g.dragging&&t)&&!L(o)){for(var l=o;S(o)&&L(S(o))===!1;)if(c.invalid(o,l)||(o=S(o),!o))return;var d=S(o);if(d&&!c.invalid(o,l)){var m=c.moves(o,d,l,V(o));if(m)return{item:o,source:d}}}}function ft(o){return!!z(o)}function vt(o){var l=z(o);l&&de(l)}function de(o){Et(o.item,o.source)&&(h=o.item.cloneNode(!0),g.emit("cloned",h,o.item,"copy")),n=o.source,i=o.item,p=C=V(o.item),g.dragging=!0,g.emit("drag",i,n)}function ht(){return!1}function fe(){if(g.dragging){var o=h||i;he(o,S(o))}}function ve(){O=!1,_(!0),ce(!0)}function K(o){if(ve(),!!g.dragging){var l=h||i,d=Y("clientX",o)||0,m=Y("clientY",o)||0,x=tt(t,d,m),E=ge(x,d,m);E&&(h&&c.copySortSource||!h||E!==n)?he(l,E):c.removeOnSpill?me():pe()}}function he(o,l){var d=S(o);h&&c.copySortSource&&l===n&&d.removeChild(i),W(l)?g.emit("cancel",o,n,n):g.emit("drop",o,l,n,C),U()}function me(){if(g.dragging){var o=h||i,l=S(o);l&&l.removeChild(o),g.emit(h?"cancel":"remove",o,l,n),U()}}function pe(o){if(g.dragging){var l=arguments.length>0?o:c.revertOnSpill,d=h||i,m=S(d),x=W(m);x===!1&&l&&(h?m&&m.removeChild(h):n.insertBefore(d,p)),x||l?g.emit("cancel",d,n,n):g.emit("drop",d,m,n,C),U()}}function U(){var o=h||i;ve(),bt(),o&&X.rm(o,"gu-transit"),w&&clearTimeout(w),g.dragging=!1,M&&g.emit("out",o,M,n),g.emit("dragend",o),n=i=h=p=C=w=M=null}function W(o,l){var d;return l!==void 0?d=l:t?d=C:d=V(h||i),o===n&&d===p}function ge(o,l,d){for(var m=o;m&&!x();)m=S(m);return m;function x(){var E=L(m);if(E===!1)return!1;var B=be(m,o),y=Ee(m,B,l,d),R=W(m,y);return R?!0:c.accepts(i,m,n,y)}}function J(o){if(!t)return;o.preventDefault();var l=Y("clientX",o)||0,d=Y("clientY",o)||0,m=l-s,x=d-u;t.style.left=m+"px",t.style.top=x+"px";var E=h||i,B=tt(t,l,d),y=ge(B,l,d),R=y!==null&&y!==M;(R||y===null)&&(Ct(),M=y,wt());var k=S(E);if(y===n&&h&&!c.copySortSource){k&&k.removeChild(E);return}var I,F=be(y,B);if(F!==null)I=Ee(y,F,l,d);else if(c.revertOnSpill===!0&&!h)I=p,y=n;else{h&&k&&k.removeChild(E);return}(I===null&&R||I!==E&&I!==V(E))&&(C=I,y.insertBefore(E,I),g.emit("shadow",E,y,n));function N(Mt){g.emit(Mt,E,M,n)}function wt(){R&&N("over")}function Ct(){M&&N("out")}}function mt(o){X.rm(o,"gu-hide")}function pt(o){g.dragging&&X.add(o,"gu-hide")}function gt(){if(!t){var o=i.getBoundingClientRect();t=i.cloneNode(!0),t.style.width=nt(o)+"px",t.style.height=it(o)+"px",X.rm(t,"gu-transit"),X.add(t,"gu-mirror"),c.mirrorContainer.appendChild(t),T(D,"add","mousemove",J),X.add(c.mirrorContainer,"gu-unselectable"),g.emit("cloned",t,i,"mirror")}}function bt(){t&&(X.rm(c.mirrorContainer,"gu-unselectable"),T(D,"remove","mousemove",J),S(t).removeChild(t),t=null)}function be(o,l){for(var d=l;d!==o&&S(d)!==o;)d=S(d);return d===D?null:d}function Ee(o,l,d,m){var x=c.direction==="horizontal",E=l!==o?y():B();return E;function B(){var k=o.children.length,I,F,N;for(I=0;I<k;I++)if(F=o.children[I],N=F.getBoundingClientRect(),x&&N.left+N.width/2>d||!x&&N.top+N.height/2>m)return F;return null}function y(){var k=l.getBoundingClientRect();return R(x?d>k.left+nt(k)/2:m>k.top+it(k)/2)}function R(k){return k?V(l):l}}function Et(o,l){return typeof c.copy=="boolean"?c.copy:c.copy(o,l)}}function T(e,r,a,t){var n={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},i={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},s={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};global.navigator.pointerEnabled?P[r](e,i[a],t):global.navigator.msPointerEnabled?P[r](e,s[a],t):(P[r](e,n[a],t),P[r](e,a,t))}function Ze(e){if(e.touches!==void 0)return e.touches.length;if(e.which!==void 0&&e.which!==0)return e.which;if(e.buttons!==void 0)return e.buttons;var r=e.button;if(r!==void 0)return r&1?1:r&2?3:r&4?2:0}function Lt(e){var r=e.getBoundingClientRect();return{left:r.left+et("scrollLeft","pageXOffset"),top:r.top+et("scrollTop","pageYOffset")}}function et(e,r){return typeof global[r]<"u"?global[r]:D.clientHeight?D[e]:A.body[e]}function tt(e,r,a){e=e||{};var t=e.className||"",n;return e.className+=" gu-hide",n=A.elementFromPoint(r,a),e.className=t,n}function _t(){return!1}function rt(){return!0}function nt(e){return e.width||e.right-e.left}function it(e){return e.height||e.bottom-e.top}function S(e){return e.parentNode===A?null:e.parentNode}function ot(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"||at(e)}function at(e){return!e||e.contentEditable==="false"?!1:e.contentEditable==="true"?!0:at(S(e))}function V(e){return e.nextElementSibling||r();function r(){var a=e;do a=a.nextSibling;while(a&&a.nodeType!==1);return a}}function zt(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}function Y(e,r){var a=zt(r),t={pageX:"clientX",pageY:"clientY"};return e in t&&!(e in a)&&t[e]in a&&(e=t[e]),a[e]}st.exports=Ht});var se=yt(ut(),1),ie=class{constructor(r,a,t){this.name=r,this.drake=a,this.options=t,this.initEvents=!1}},v=(function(e){return e.Cancel="cancel",e.Cloned="cloned",e.Drag="drag",e.DragEnd="dragend",e.Drop="drop",e.Out="out",e.Over="over",e.Remove="remove",e.Shadow="shadow",e.DropModel="dropModel",e.RemoveModel="removeModel",e})(v||{}),Kt=Object.keys(v).map(e=>v[e]),Ut=se.default||se,G=class{constructor(r=Ut){this.build=r}},j=(e,r,a)=>t=>t.pipe(ee(({event:n,name:i})=>n===e&&(r===void 0||i===r)),we(({name:n,args:i})=>a(n,i))),Wt=(e,[r,a,t])=>({name:e,el:r,container:a,source:t}),oe=(()=>{let r=class r{constructor(t){this.drakeFactory=t,this.groups={},this.dispatch$=new Z,this.elContainerSource=n=>i=>this.dispatch$.pipe(j(n,i,Wt)),this.cancel=this.elContainerSource(v.Cancel),this.remove=this.elContainerSource(v.Remove),this.shadow=this.elContainerSource(v.Shadow),this.over=this.elContainerSource(v.Over),this.out=this.elContainerSource(v.Out),this.drag=n=>this.dispatch$.pipe(j(v.Drag,n,(i,[s,u])=>({name:i,el:s,source:u}))),this.dragend=n=>this.dispatch$.pipe(j(v.DragEnd,n,(i,[s])=>({name:i,el:s}))),this.drop=n=>this.dispatch$.pipe(j(v.Drop,n,(i,[s,u,f,b])=>({name:i,el:s,target:u,source:f,sibling:b}))),this.cloned=n=>this.dispatch$.pipe(j(v.Cloned,n,(i,[s,u,f])=>({name:i,clone:s,original:u,cloneType:f}))),this.dropModel=n=>this.dispatch$.pipe(j(v.DropModel,n,(i,[s,u,f,b,p,C,h,w,M])=>({name:i,el:s,target:u,source:f,sibling:b,item:p,sourceModel:C,targetModel:h,sourceIndex:w,targetIndex:M}))),this.removeModel=n=>this.dispatch$.pipe(j(v.RemoveModel,n,(i,[s,u,f,b,p,C])=>({name:i,el:s,container:u,source:f,item:b,sourceModel:p,sourceIndex:C}))),(this.drakeFactory===null||this.drakeFactory===void 0)&&(this.drakeFactory=new G)}add(t){if(this.find(t.name))throw new Error('Group named: "'+t.name+'" already exists.');return this.groups[t.name]=t,this.handleModels(t),this.setupEvents(t),t}find(t){return this.groups[t]}destroy(t){let n=this.find(t);n&&(n.drake&&n.drake.destroy(),delete this.groups[t])}createGroup(t,n){return this.add(new ie(t,this.drakeFactory.build([],n),n))}handleModels({name:t,drake:n,options:i}){let s,u,f;n.on("remove",(b,p,C)=>{if(!n.models)return;let h=n.models[n.containers.indexOf(C)];h=h.slice(0);let w=h.splice(u,1)[0];this.dispatch$.next({event:v.RemoveModel,name:t,args:[b,p,C,w,h,u]})}),n.on("drag",(b,p)=>{n.models&&(s=b,u=this.domIndexOf(b,p))}),n.on("drop",(b,p,C,h)=>{if(!n.models||!p)return;f=this.domIndexOf(b,p);let w=n.models[n.containers.indexOf(C)],M=n.models[n.containers.indexOf(p)],O;if(p===C)w=w.slice(0),O=w.splice(u,1)[0],w.splice(f,0,O),M=w;else{let c=s!==b;if(O=w[u],c){if(!i.copyItem)throw new Error("If you have enabled `copy` on a group, you must provide a `copyItem` function.");O=i.copyItem(O)}if(c||(w=w.slice(0),w.splice(u,1)),M=M.slice(0),M.splice(f,0,O),c)try{p.removeChild(b)}catch{}}this.dispatch$.next({event:v.DropModel,name:t,args:[b,p,C,h,O,w,M,u,f]})})}setupEvents(t){if(t.initEvents)return;t.initEvents=!0;let n=t.name,i=this,s=u=>{switch(u){case v.Drag:t.drake.on(u,(...f)=>{this.dispatch$.next({event:u,name:n,args:f})});break;case v.Drop:t.drake.on(u,(...f)=>{this.dispatch$.next({event:u,name:n,args:f})});break;case v.DragEnd:t.drake.on(u,(...f)=>{this.dispatch$.next({event:u,name:n,args:f})});break;case v.Cancel:case v.Remove:case v.Shadow:case v.Over:case v.Out:t.drake.on(u,(...f)=>{this.dispatch$.next({event:u,name:n,args:f})});break;case v.Cloned:t.drake.on(u,(...f)=>{this.dispatch$.next({event:u,name:n,args:f})});break;case v.DropModel:t.drake.on(u,(...f)=>{this.dispatch$.next({event:u,name:n,args:f})});break;case v.RemoveModel:t.drake.on(u,(...f)=>{this.dispatch$.next({event:u,name:n,args:f})});break;default:break}};Kt.forEach(s)}domIndexOf(t,n){if(n)return Array.prototype.indexOf.call(n.children,t)}};r.\u0275fac=function(n){return new(n||r)(ye(G,8))},r.\u0275prov=Ce({token:r,factory:r.\u0275fac,providedIn:"root"});let e=r;return e})(),pr=(()=>{let r=class r{get container(){return this.el&&this.el.nativeElement}constructor(t,n){this.el=t,this.dragulaService=n,this.dragulaModelChange=new Ie}ngOnChanges(t){if(t&&t.dragula){let{previousValue:n,currentValue:i}=t.dragula,s=!!n,u=!!i;s&&this.teardown(n),u&&this.setup()}else if(t&&t.dragulaModel){let{previousValue:n,currentValue:i}=t.dragulaModel,s=this.group?.drake;if(this.dragula&&s){s.models=s.models||[];let u=s.models.indexOf(n);u!==-1?(s.models.splice(u,1),i&&s.models.splice(u,0,i)):i&&s.models.push(i)}}}setup(){let t=i=>{this.dragulaModel&&(i.drake?.models?i.drake?.models?.push(this.dragulaModel):i.drake&&(i.drake.models=[this.dragulaModel]))};if(!this.dragula)return;let n=this.dragulaService.find(this.dragula);if(!n){let i={};n=this.dragulaService.createGroup(this.dragula,i)}t(n),n.drake?.containers.push(this.container),this.subscribe(this.dragula),this.group=n}subscribe(t){this.subs=new Q,this.subs.add(this.dragulaService.dropModel(t).subscribe(({source:n,target:i,sourceModel:s,targetModel:u})=>{n===this.el.nativeElement?this.dragulaModelChange.emit(s):i===this.el.nativeElement&&this.dragulaModelChange.emit(u)})),this.subs.add(this.dragulaService.removeModel(t).subscribe(({source:n,sourceModel:i})=>{n===this.el.nativeElement&&this.dragulaModelChange.emit(i)}))}teardown(t){this.subs?.unsubscribe();let n=this.dragulaService.find(t);if(n){let i=n.drake?.containers.indexOf(this.el.nativeElement);if(i!==-1&&n.drake?.containers.splice(i,1),this.dragulaModel&&n.drake&&n.drake.models){let s=n.drake.models.indexOf(this.dragulaModel);s!==-1&&n.drake.models.splice(s,1)}}}ngOnDestroy(){this.dragula&&this.teardown(this.dragula)}};r.\u0275fac=function(n){return new(n||r)(te(Se),te(oe))},r.\u0275dir=ke({type:r,selectors:[["","dragula",""]],inputs:{dragula:"dragula",dragulaModel:"dragulaModel"},outputs:{dragulaModelChange:"dragulaModelChange"},standalone:!1,features:[xe]});let e=r;return e})(),gr=(()=>{let r=class r{static forRoot(){return{ngModule:r,providers:[oe]}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275mod=Oe({type:r}),r.\u0275inj=Me({providers:[oe]});let e=r;return e})(),br=new G((e,r)=>new ae(e,r)),ae=class{constructor(r=[],a={},t){this.containers=r,this.options=a,this.models=t,this.emitter$=new Z,this.subs=new Q,this.dragging=!1}on(r,a){this.subs.add(this.emitter$.pipe(ee(({eventType:t})=>t===r)).subscribe(({eventType:t,args:n})=>{if(t===v.Drag){let i=Array.from(n),s=i[0],u=i[1];a(s,u);return}if(t===v.Drop){let i=Array.from(n),s=i[0],u=i[1],f=i[2],b=i[3];a(s,u,f,b);return}if(t===v.Remove){let i=Array.from(n),s=i[0],u=i[1],f=i[2];a(s,u,f);return}a(n)}))}start(r){this.dragging=!0}end(){this.dragging=!1}cancel(r){this.dragging=!1}canMove(r){return this.options.accepts?this.options.accepts(r):!1}remove(){this.dragging=!1}destroy(){this.subs.unsubscribe()}emit(r,...a){this.emitter$.next({eventType:r,args:a})}};export{oe as a,pr as b,gr as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as H}from"./chunk-
|
|
1
|
+
import{b as H}from"./chunk-4HJOARLT.js";import{a as L,b as S}from"./chunk-D2HNCCB6.js";import{m as T}from"./chunk-6DTD6NF3.js";import{l as B}from"./chunk-NC7XPNIV.js";import{Db as k,Ga as u,Gb as b,Ha as O,Ib as d,La as o,Ub as y,Vb as f,Wa as v,Wb as w,Xb as M,dc as I,ja as h,kb as C,lb as r,mb as l,mc as g,nc as _,oa as x,pa as P,rb as p,sb as i,tb as a,ub as m}from"./chunk-PRNMO4E2.js";function E(t,c){if(t&1&&m(0,"i",16),t&2){let n=d();y(I("fas fa-fw ",n.faIconClass," mb-3"))}}function z(t,c){if(t&1&&m(0,"h5",6),t&2){let n=d();p("innerHTML",n.subtitle,u)}}function V(t,c){if(t&1&&m(0,"p",8),t&2){let n=d();p("innerHTML",n.message2,u)}}function D(t,c){if(t&1&&m(0,"markdown",9),t&2){let n=d();p("data",n.markdownMessage2)}}function N(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),f(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function j(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),f(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function A(t,c){if(t&1&&(i(0,"a",15),f(1),m(2,"i",18),a()),t&2){let n=d();p("href",n.ctaButtonLink,O),o(),M(" ",n.ctaButtonLabel," ")}}var X=(()=>{class t{$activeModal=h(T);title;subtitle;message;message2;ctaButtonLabel;ctaButtonLink;faIconClass;markdownMessage2;dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=v({type:t,selectors:[["ng-component"]],inputs:{title:"title",subtitle:"subtitle",message:"message",message2:"message2",ctaButtonLabel:"ctaButtonLabel",ctaButtonLink:"ctaButtonLink",faIconClass:"faIconClass",markdownMessage2:"markdownMessage2"},decls:19,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],[2,"font-size","75px",3,"class"],[1,"mb-3",3,"innerHTML"],[1,"mb-0",3,"innerHTML"],[1,"mb-0","mt-3",3,"innerHTML"],[1,"plugin-md",3,"data"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(s,e){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),f(3),a(),i(4,"button",3),g(5,"translate"),b("click",function(){return e.dismissModal()}),a()(),i(6,"div",4),r(7,E,1,3,"i",5),r(8,z,1,1,"h5",6),m(9,"p",7),r(10,V,1,1,"p",8),r(11,D,1,1,"markdown",9),a(),i(12,"div",10)(13,"div",11),r(14,N,4,6,"button",12),a(),i(15,"div",13),r(16,j,4,6,"button",12),a(),i(17,"div",14),r(18,A,3,2,"a",15),a()()()),s&2&&(o(3),w(e.title),o(),C("aria-label",_(5,10,"form.button_close")),o(3),l(e.faIconClass?7:-1),o(),l(e.subtitle?8:-1),o(),p("innerHTML",e.message,u),o(),l(e.message2?10:-1),o(),l(e.markdownMessage2?11:-1),o(3),l(e.ctaButtonLink?14:-1),o(2),l(e.ctaButtonLink?-1:16),o(2),l(e.ctaButtonLink?18:-1))},dependencies:[S,L,H,B],styles:["[_nghost-%COMP%] .plugin-md{display:block!important;background-color:#f6f8fa!important;border-radius:6px!important;padding:16px!important;margin:16px auto!important;width:100%!important;max-width:632px!important}[_nghost-%COMP%] .plugin-md table{width:100%;max-width:600px;margin:0 auto!important;border-collapse:collapse;border:1px solid #d0d7de!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif!important;font-size:14px!important;color:#24292e!important}[_nghost-%COMP%] .plugin-md th, [_nghost-%COMP%] .plugin-md td{padding:6px 13px!important;border:1px solid #d0d7de!important;text-align:left;color:#24292e!important}[_nghost-%COMP%] .plugin-md th{background-color:#f6f8fa!important;font-weight:600!important;text-align:center!important}[_nghost-%COMP%] .plugin-md td[align=center]{text-align:center!important}[_nghost-%COMP%] .plugin-md tr{color:#24292e!important}[_nghost-%COMP%] .plugin-md tr:nth-child(odd){background-color:#fff!important}[_nghost-%COMP%] .plugin-md tr:nth-child(2n){background-color:#f6f8fa!important}[_nghost-%COMP%] .plugin-md tr:hover{background-color:#f0f2f5!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%]{background-color:#2b2b2b!important;color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#3c3c3c!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#323232!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#2b2b2b!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#454545!important}"]})}return t})();export{X as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as tt,n as et,q as it}from"./chunk-NC7XPNIV.js";import{T as G,e as ut,ea as R,g as ct,h as P,hd as X,ja as W,n as Q,w as N}from"./chunk-PRNMO4E2.js";var st=ut((J,K)=>{(function(b,D){typeof J=="object"&&typeof K<"u"?K.exports=D():typeof define=="function"&&define.amd?define(D):(b=typeof globalThis<"u"?globalThis:b||self).dayjs=D()})(J,function(){"use strict";var b=1e3,D=6e4,n=36e5,h="millisecond",d="second",m="minute",M="hour",v="day",f="week",L="month",B="quarter",S="year",_="date",E="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var s=String(r);return!s||s.length>=i?r:""+Array(i+1-s.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),s=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(s,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var s=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(s,L),o=t-e<0,a=i.clone().add(s+(o?-1:1),L);return+(-(s+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:L,y:S,w:f,d:v,D:_,h:M,m,s:d,ms:h,Q:B}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},j="en",T={};T[j]=ot;var Z="$isDayjsObject",U=function(r){return r instanceof C||!(!r||!r[Z])},Y=function r(i,t,s){var e;if(!i)return j;if(typeof i=="string"){var o=i.toLowerCase();T[o]&&(e=o),t&&(T[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;T[c]=i,e=c}return!s&&e&&(j=e),e||!s&&j},g=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new C(t)},u=at;u.l=Y,u.i=U,u.w=function(r,i){return g(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var C=(function(){function r(t){this.$L=Y(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[Z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=(function(s){var e=s.date,o=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,l=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)}}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()!==E},i.isSame=function(t,s){var e=g(t);return this.startOf(s)<=e&&e<=this.endOf(s)},i.isAfter=function(t,s){return g(t)<this.startOf(s)},i.isBefore=function(t,s){return this.endOf(s)<g(t)},i.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,s){var e=this,o=!!u.u(s)||s,a=u.p(t),c=function(x,y){var k=u.w(e.$u?Date.UTC(e.$y,y,x):new Date(e.$y,y,x),e);return o?k:k.endOf(v)},l=function(x,y){return u.w(e.toDate()[x].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(y)),e)},$=this.$W,p=this.$M,w=this.$D,H="set"+(this.$u?"UTC":"");switch(a){case S:return o?c(1,0):c(31,11);case L:return o?c(1,p):c(0,p+1);case f:var O=this.$locale().weekStart||0,A=($<O?$+7:$)-O;return c(o?w-A:w+(6-A),p);case v:case _:return l(H+"Hours",0);case M:return l(H+"Minutes",1);case m:return l(H+"Seconds",2);case d:return l(H+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,s){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[v]=a+"Date",e[_]=a+"Date",e[L]=a+"Month",e[S]=a+"FullYear",e[M]=a+"Hours",e[m]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],l=o===v?this.$D+(s-this.$W):s;if(o===L||o===S){var $=this.clone().set(_,1);$.$d[c](l),$.init(),this.$d=$.set(_,Math.min(this.$D,$.daysInMonth())).$d}else c&&this.$d[c](l);return this.init(),this},i.set=function(t,s){return this.clone().$set(t,s)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,s){var e,o=this;t=Number(t);var a=u.p(s),c=function(p){var w=g(o);return u.w(w.date(w.date()+Math.round(p*t)),o)};if(a===L)return this.set(L,this.$M+t);if(a===S)return this.set(S,this.$y+t);if(a===v)return c(1);if(a===f)return c(7);var l=(e={},e[m]=D,e[M]=n,e[d]=b,e)[a]||1,$=this.$d.getTime()+t*l;return u.w($,this)},i.subtract=function(t,s){return this.add(-1*t,s)},i.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||E;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,l=this.$m,$=this.$M,p=e.weekdays,w=e.months,H=e.meridiem,O=function(y,k,I,V){return y&&(y[k]||y(s,o))||I[k].slice(0,V)},A=function(y){return u.s(c%12||12,y,"0")},x=H||function(y,k,I){var V=y<12?"AM":"PM";return I?V.toLowerCase():V};return o.replace(rt,function(y,k){return k||(function(I){switch(I){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return $+1;case"MM":return u.s($+1,2,"0");case"MMM":return O(e.monthsShort,$,w,3);case"MMMM":return O(w,$);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return O(e.weekdaysMin,s.$W,p,2);case"ddd":return O(e.weekdaysShort,s.$W,p,3);case"dddd":return p[s.$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 x(c,l,!0);case"A":return x(c,l,!1);case"m":return String(l);case"mm":return u.s(l,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return a}return null})(y)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,s,e){var o,a=this,c=u.p(s),l=g(t),$=(l.utcOffset()-this.utcOffset())*D,p=this-l,w=function(){return u.m(a,l)};switch(c){case S:o=w()/12;break;case L:o=w();break;case B:o=w()/3;break;case f:o=(p-$)/6048e5;break;case v:o=(p-$)/864e5;break;case M:o=p/n;break;case m:o=p/D;break;case d:o=p/b;break;default:o=p}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(L).$D},i.$locale=function(){return T[this.$L]},i.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),o=Y(t,s,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r})(),z=C.prototype;return g.prototype=z,[["$ms",h],["$s",d],["$m",m],["$H",M],["$W",v],["$M",L],["$y",S],["$D",_]].forEach(function(r){z[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),g.extend=function(r,i){return r.$i||(r(i,C,g),r.$i=!0),g},g.locale=Y,g.isDayjs=U,g.unix=function(r){return g(1e3*r)},g.en=T[j],g.Ls=T,g.p={},g})});var q=ct(st(),1);var yt=(()=>{class b{$api=W(it);$title=W(X);$toastr=W(et);$translate=W(tt);settingsLoadedSubject=new Q;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];env={};host;proxyHost;webroot;originalWebroot;formAuth=!0;sessionTimeout=28800;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;browserLang;onSettingsLoaded=this.settingsLoadedSubject.pipe(G());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let n=yield N(this.$api.get("/auth/settings"));this.formAuth=n.formAuth,this.sessionTimeout=n.sessionTimeout,this.env=n.env,this.host=n.host,this.webroot=n.webroot,this.originalWebroot=n.originalWebroot,this.proxyHost=n.proxyHost,this.lightingMode=n.lightingMode,this.wallpaper=n.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(n.theme),this.setMenuMode(n.menuMode),this.setKeepOrphans(n.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(n.serverTimestamp),this.setUiVersion(n.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0),this.browserLang=this.$translate.getBrowserCultureLang()})}setBrowserLightingMode(n){this.browserLightingMode=n,this.lightingMode==="auto"&&this.setLightingMode(n,"browser")}setLightingMode(n,h){h==="user"&&(this.lightingMode=n),this.currentLightingMode=n,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(n){(!n||!this.themeList.includes(n))&&(n=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:n})).catch(m=>console.error("Error saving setTheme:",m)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=n,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((m,M)=>{try{let v=m.contentDocument;if(v){let f=v.body;this.actualLightingMode==="dark"?(f.classList.contains(`config-ui-x-${this.theme}`)&&f.classList.remove(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)||f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode"),f.style.backgroundColor="#242424 !important",f.style.color="#ffffff !important"):(f.classList.contains(`config-ui-x-${this.theme}`)||f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)&&f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"),f.style.backgroundColor="#ffffff !important",f.style.color="#000000 !important"),m.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:n},window.location.origin)}}catch(v){console.warn(`Iframe ${M}: Access denied (cross-origin?)`,{error:v,src:m.src})}})}setMenuMode(n){this.menuMode=n}setKeepOrphans(n){this.keepOrphans=n}setLang(n){n?this.$translate.use(n):n="auto",this.env.lang=n}setItem(n,h){this[n]=h}setEnvItem(n,h){if(n.includes(".")){let d=n.split("."),m=this.env;for(let M=0;M<d.length-1;M+=1){if(this.forbiddenKeys.includes(d[M]))return;m[d[M]]||(m[d[M]]={}),m=m[d[M]]}this.forbiddenKeys.includes(d[d.length-1])||(m[d[d.length-1]]=h)}else this.env[n]=h}checkServerTime(n){let d=(0,q.default)(n).diff((0,q.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}setUiVersion(n){this.uiVersion||(this.uiVersion=n)}setTitle(n){this.$title.setTitle(n||"Homebridge")}static \u0275fac=function(h){return new(h||b)};static \u0275prov=R({token:b,factory:b.\u0275fac,providedIn:"root"})}return b})();export{st as a,yt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as pe}from"./chunk-UOOMSN4Q.js";import{p as le}from"./chunk-NC7XPNIV.js";import{ea as fe,f as We,ja as ue,k as he,n as X}from"./chunk-PRNMO4E2.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)==0?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={};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 as M}from"./chunk-UWI7PQIM.js";import"./chunk-AACIDDLQ.js";import{a as O}from"./chunk-HQBRFFPL.js";import{a as _}from"./chunk-IDS6CACH.js";import{n as z,t as D}from"./chunk-6DTD6NF3.js";import"./chunk-KCLLEPG3.js";import"./chunk-RR2V2D4G.js";import{b as H}from"./chunk-UOOMSN4Q.js";import"./chunk-RMBCZ6PE.js";import{k as E,l as A,n as F,q as V}from"./chunk-NC7XPNIV.js";import{Db as T,Gb as p,Ib as b,Ka as y,La as l,Pb as L,Qb as S,Vb as I,Wa as $,Wb as B,g as q,h as w,ja as i,kb as u,lb as x,mb as C,mc as a,n as v,nc as s,oa as d,pa as g,rb as f,sb as c,tb as r,ub as m,xc as k}from"./chunk-PRNMO4E2.js";var N=q(O(),1);var Q=["logoutput"];function W(o,P){if(o&1){let t=T();c(0,"div",4)(1,"button",7),a(2,"translate"),a(3,"translate"),p("click",function(){d(t);let n=b();return g(n.downloadLogFile())}),m(4,"i",8),r(),c(5,"button",9),a(6,"translate"),a(7,"translate"),p("click",function(){d(t);let n=b();return g(n.truncateLogFile())}),m(8,"i",10),r()()}o&2&&(l(),f("openDelay",150)("ngbTooltip",s(2,6,"form.button_download")),u("aria-label",s(3,8,"form.button_download")),l(4),f("openDelay",150)("ngbTooltip",s(6,10,"form.button_delete")),u("aria-label",s(7,12,"form.button_delete")))}var it=(()=>{class o{$api=i(V);$auth=i(H);$log=i(M);$modal=i(z);$toastr=i(F);$translate=i(E);termTarget=k("logoutput");resizeEvent=new v;isAdmin=this.$auth.user.admin;onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget(),{allowProposedApi:!0},this.resizeEvent)}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-fw fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,N.saveAs)(e.body,"homebridge.log.txt")},error:e=>w(this,null,function*(){let n;try{n=JSON.parse(yield e.error.text()).message}catch(h){console.error(h)}this.$toastr.error(n||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-fw fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=$({type:o,selectors:[["ng-component"]],viewQuery:function(e,n){e&1&&L(n.termTarget,Q,5),e&2&&S()},hostBindings:function(e,n){e&1&&p("resize",function(j){return n.onWindowResize(j)},y)},decls:9,vars:4,consts:[["logoutput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"flex-column","d-flex","align-items-stretch","adjust-for-mobile"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-trash-alt"]],template:function(e,n){e&1&&(c(0,"div",1)(1,"div",2)(2,"h3",3),I(3),a(4,"translate"),r()(),x(5,W,9,14,"div",4),r(),c(6,"div",5),m(7,"div",6,0),r()),e&2&&(l(3),B(s(4,2,"menu.linux.label_logs")),l(2),C(n.isAdmin?5:-1))},dependencies:[D,A],encapsulation:2})}return o})();export{it as LogsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as u,g as s}from"./chunk-ZX7APSEP.js";import{k as p,n as l,q as d}from"./chunk-NC7XPNIV.js";import{Xa as n,ea as c,fa as i,h as f,ja as e,w as m}from"./chunk-PRNMO4E2.js";var a=(()=>{class t{$api=e(d);$router=e(u);$toastr=e(l);$translate=e(p);resolve(){return f(this,null,function*(){try{let o=yield m(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(r){return new(r||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var y=[{path:"",loadComponent:()=>import("./chunk-354C3X7T.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],v=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(y),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[v]})}return t})();export{T as ConfigEditorModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as P}from"./chunk-RR2V2D4G.js";import"./chunk-UOOMSN4Q.js";import{d as D}from"./chunk-ZX7APSEP.js";import{b as F}from"./chunk-RMBCZ6PE.js";import{k as E,l as R,n as B,q as U}from"./chunk-NC7XPNIV.js";import{Db as S,Gb as T,Ib as u,Kc as O,La as r,Vb as a,Wa as y,Wb as p,Xb as x,gc as k,h as w,hc as g,ja as d,lb as h,mb as f,mc as l,nc as c,oa as C,pa as $,rb as _,sb as s,tb as n,ub as v,w as b,zc as I}from"./chunk-PRNMO4E2.js";var W=(e,m)=>({"fas fa-fw fa-spinner fa-spin":e,"far fa-fw fa-check-circle":m}),M=e=>({"grey-text":e}),V=(e,m)=>({"far fa-fw fa-circle":e,"fas fa-fw fa-spinner fa-spin":m});function j(e,m){if(e&1&&(s(0,"div",7),a(1),n()),e&2){let t=u();r(),p(t.error)}}function q(e,m){if(e&1&&(s(0,"p",9),a(1),l(2,"translate"),n(),s(3,"div",10)(4,"div",11)(5,"span"),v(6,"i",12),a(7),l(8,"translate"),n()(),s(9,"div",11)(10,"span",12),v(11,"i",12),a(12),l(13,"translate"),n()()()),e&2){let t=u();r(),p(c(2,6,"restart.please_wait_while_server_restarts")),r(5),_("ngClass",g(12,W,!t.uiOnline,t.uiOnline)),r(),x(" ",c(8,8,"restart.ui_online")," "),r(3),_("ngClass",k(15,M,!t.uiOnline)),r(),_("ngClass",g(17,V,!t.uiOnline,t.uiOnline)),r(),x(" ",c(13,10,"restart.service_ready")," ")}}function z(e,m){if(e&1){let t=S();s(0,"p",15)(1,"button",16),T("click",function(){C(t);let o=u(2);return $(o.viewLogs())}),a(2),l(3,"translate"),n()()}e&2&&(r(2),p(c(3,1,"menu.tooltip_view_logs")))}function A(e,m){if(e&1&&(s(0,"div",8)(1,"p"),a(2),l(3,"translate"),n(),s(4,"p",13),a(5),l(6,"translate"),s(7,"span",14),a(8),n()(),h(9,z,4,3,"p",15),n()),e&2){let t=u();r(2),p(c(3,4,"restart.server_is_taking_long_time_to_restart")),r(3),x(" ",c(6,6,"restart.label_restart_command_executed"),": "),r(3),p(t.resp.command||"End Process"),r(),f(t.uiOnline?9:-1)}}var et=(()=>{class e{$api=d(U);$router=d(D);$settings=d(F);$toastr=d(B);$translate=d(E);$ws=d(P);checkTimeout;checkDelay;io;webrootChanged=!1;uiOnline=!1;error=!1;resp={};timeout=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$router.parseUrl(this.$router.url).queryParams.restarting==="true"?(this.uiOnline=!0,this.checkIfServerUp()):this.performRestart()}viewLogs(){this.$router.navigate(["/logs"])}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}performRestart(){return w(this,null,function*(){try{let t=this.$settings.originalWebroot||"",i=this.$settings.webroot||"";this.webrootChanged=t!==i&&t!==globalThis.webroot.errorCode,this.webrootChanged&&(yield b(this.$api.put("/server/webroot",{webroot:i}))),this.$api.put("/server/restart",{}).subscribe({next:o=>{this.resp=o,this.checkIfServerUp(),o.restartingUI||(this.uiOnline=!0)},error:o=>{console.error(o),this.error=this.$translate.instant("restart.toast_server_restart_error"),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}catch(t){console.error("Failed to update webroot:",t),this.$api.put("/server/restart",{}).subscribe({next:i=>{this.resp=i,this.checkIfServerUp(),i.restartingUI||(this.uiOnline=!0)},error:i=>{console.error(i),this.error=this.$translate.instant("restart.toast_server_restart_error"),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",t=>{if(this.uiOnline=!0,t.status==="up"||t.status==="pending")if(this.$toastr.success(this.$translate.instant("restart.toast_server_restarted"),this.$translate.instant("toast.title_success")),this.webrootChanged&&!I()){let i=this.$settings.webroot?.replace(/^\/+|\/+$/g,"")||"";window.location.href=i?`/${i}/`:"/"}else this.$router.navigate(["/"])})},7e3),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},4e4)}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=y({type:e,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[3,"ngClass"],[1,"grey-text","mb-0"],[1,"font-monospace"],[1,"mt-2","mb-0"],[1,"btn","btn-primary","mb-0",3,"click"]],template:function(i,o){i&1&&(s(0,"div",0)(1,"h3",1),a(2),l(3,"translate"),n()(),s(4,"div",2)(5,"div",3),v(6,"i",4),n(),s(7,"div",5)(8,"h4",6),a(9),l(10,"translate"),n(),h(11,j,2,1,"div",7)(12,q,14,20),h(13,A,10,8,"div",8),n()()),i&2&&(r(2),p(c(3,4,"menu.restart.title")),r(7),p(c(10,6,"restart.title_restart")),r(2),f(o.error?11:12),r(2),f(o.timeout?13:-1))},dependencies:[O,R],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return e})();export{et as RestartComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as z,b,c as k}from"./chunk-
|
|
1
|
+
import{a as z,b,c as k}from"./chunk-AACIDDLQ.js";import{a as u}from"./chunk-RR2V2D4G.js";import{q as f}from"./chunk-NC7XPNIV.js";import{M as t,ea as p,g as n,h as c,ja as a,n as h}from"./chunk-PRNMO4E2.js";var d=n(z(),1),l=n(b(),1),m=n(k(),1);var v=(()=>{class o{$ws=a(u);$api=a(f);io;fitAddon;webLinksAddon;resize;elementResize;dataDisposable=null;isInitializing=!1;hasUserTyped=!1;term;destroyTerminal(){this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.io&&this.io.end(),this.term&&(this.term.dispose(),this.term=null),this.resize&&this.resize.complete(),this.elementResize&&this.elementResize.complete(),this.isInitializing=!1,this.hasUserTyped=!1}destroyPersistentSession(){this.destroyTerminal(),this.$api.post("/platform-tools/terminal/destroy-persistent-session",{}).subscribe({error:s=>console.error("Failed to destroy persistent session:",s)})}detachTerminal(){this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.term&&this.term.dispose(),this.resize&&this.resize.complete(),this.elementResize&&this.elementResize.complete(),this.isInitializing=!1}hasActiveSession(){return this.io&&this.io.socket&&this.io.socket.connected}checkBackendPersistentSession(){return c(this,null,function*(){try{return(yield this.$api.get("/platform-tools/terminal/has-persistent-session").toPromise()).hasPersistentSession}catch(s){return console.error("Failed to check backend persistent session:",s),!1}})}hasUserTypedInSession(){return this.hasUserTyped}isTerminalReady(){return this.term&&!this.isInitializing}reconnectTerminal(s,e={},r){if(this.isInitializing)return!1;this.isInitializing=!0,this.elementResize=r,this.io&&this.io.socket&&this.io.socket.connected?(this.term=new m.Terminal(e),this.fitAddon=new d.FitAddon,this.webLinksAddon=new l.WebLinksAddon,setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.resize=new h,this.term.open(s.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.socket.removeAllListeners("stdout"),this.io.socket.removeAllListeners("process-exit"),this.io.socket.on("stdout",i=>{this.term.write(i)}),this.io.socket.on("process-exit",()=>{this.startSession()}),this.dataDisposable&&this.dataDisposable.dispose(),this.dataDisposable=this.term.onData(i=>{this.hasUserTyped=!0,this.io.socket.emit("stdin",i)}),this.term.onResize(i=>{this.resize.next(i)}),this.resize.pipe(t(500)).subscribe(i=>{this.io.socket.emit("resize",i)}),this.elementResize&&this.elementResize.pipe(t(100)).subscribe({next:()=>{this.fitAddon.fit()}}),this.io.socket.emit("start-session",{cols:this.term.cols,rows:this.term.rows}),this.isInitializing=!1):this.startTerminal(s,e,r)}startTerminal(s,e={},r){return this.isInitializing?!1:(this.isInitializing=!0,this.elementResize=r,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new m.Terminal(e),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new d.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new h,this.term.open(s.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(t(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
|