homebridge-config-ui-x 5.0.0-beta.7 → 5.0.0-beta.71
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 +407 -31
- package/CONTRIBUTING.md +5 -4
- package/LICENSE +1 -1
- package/config.schema.json +34 -144
- package/dist/bin/hb-service.d.ts +2 -2
- package/dist/bin/hb-service.js +51 -50
- package/dist/bin/hb-service.js.map +1 -1
- package/dist/bin/platforms/darwin.js +2 -2
- package/dist/bin/platforms/darwin.js.map +1 -1
- package/dist/bin/platforms/win32.js +4 -2
- package/dist/bin/platforms/win32.js.map +1 -1
- package/dist/bin/standalone.js +1 -0
- package/dist/bin/standalone.js.map +1 -1
- package/dist/core/auth/auth.controller.d.ts +2 -2
- package/dist/core/auth/auth.controller.js.map +1 -1
- package/dist/core/auth/auth.module.js +1 -1
- package/dist/core/auth/auth.module.js.map +1 -1
- package/dist/core/auth/auth.service.js +10 -10
- package/dist/core/auth/auth.service.js.map +1 -1
- package/dist/core/auth/jwt.strategy.d.ts +3 -1
- package/dist/core/config/config.service.d.ts +4 -6
- package/dist/core/config/config.service.js +9 -9
- package/dist/core/config/config.service.js.map +1 -1
- package/dist/core/config/config.startup.js +2 -2
- package/dist/core/config/config.startup.js.map +1 -1
- package/dist/core/homebridge-ipc/homebridge-ipc.service.js +3 -3
- package/dist/core/homebridge-ipc/homebridge-ipc.service.js.map +1 -1
- package/dist/index.js +6 -77
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/modules/accessories/accessories.controller.js +5 -5
- package/dist/modules/accessories/accessories.controller.js.map +1 -1
- package/dist/modules/accessories/accessories.service.js +8 -7
- package/dist/modules/accessories/accessories.service.js.map +1 -1
- package/dist/modules/backup/backup.controller.js +7 -7
- package/dist/modules/backup/backup.controller.js.map +1 -1
- package/dist/modules/backup/backup.service.js +19 -79
- package/dist/modules/backup/backup.service.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.service.js +0 -7
- package/dist/modules/child-bridges/child-bridges.service.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +1 -1
- package/dist/modules/config-editor/config-editor.controller.js +8 -8
- package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
- package/dist/modules/config-editor/config-editor.service.d.ts +1 -1
- package/dist/modules/config-editor/config-editor.service.js +62 -64
- 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 +13 -11
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
- package/dist/modules/log/log.gateway.d.ts +2 -1
- package/dist/modules/log/log.gateway.js.map +1 -1
- package/dist/modules/log/log.service.js +3 -3
- package/dist/modules/log/log.service.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.controller.js +3 -3
- package/dist/modules/platform-tools/docker/docker.controller.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.service.js +1 -1
- package/dist/modules/platform-tools/docker/docker.service.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js +3 -3
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.service.js +6 -6
- package/dist/modules/platform-tools/hb-service/hb-service.service.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.controller.js +2 -2
- package/dist/modules/platform-tools/linux/linux.controller.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.service.js +2 -2
- package/dist/modules/platform-tools/linux/linux.service.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +2 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.service.js +2 -2
- package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
- package/dist/modules/plugins/plugins.controller.js +4 -4
- package/dist/modules/plugins/plugins.controller.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +4 -1
- package/dist/modules/plugins/plugins.service.js +168 -103
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/server/server.controller.d.ts +22 -2
- package/dist/modules/server/server.controller.js +86 -18
- package/dist/modules/server/server.controller.js.map +1 -1
- package/dist/modules/server/server.service.d.ts +24 -6
- package/dist/modules/server/server.service.js +165 -66
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/status/status.controller.d.ts +0 -1
- package/dist/modules/status/status.controller.js +3 -4
- package/dist/modules/status/status.controller.js.map +1 -1
- package/dist/modules/status/status.gateway.d.ts +1 -1
- package/dist/modules/status/status.service.d.ts +1 -1
- package/dist/modules/status/status.service.js +17 -41
- package/dist/modules/status/status.service.js.map +1 -1
- package/dist/modules/users/users.controller.js +7 -7
- package/dist/modules/users/users.controller.js.map +1 -1
- package/dist/self-check.js +6 -6
- package/dist/self-check.js.map +1 -1
- package/package.json +45 -43
- package/public/3rdpartylicenses.txt +145 -62
- package/public/assets/hap-icons/airpurifier.svg +49 -16
- package/public/assets/hap-icons/airquality.svg +24 -13
- package/public/assets/hap-icons/co-sensor.svg +72 -0
- package/public/assets/hap-icons/co2-sensor.svg +72 -0
- package/public/assets/hap-icons/contactsensor-closed.svg +35 -2
- package/public/assets/hap-icons/contactsensor-open.svg +80 -2
- package/public/assets/hap-icons/door-closed.svg +32 -2
- package/public/assets/hap-icons/door-open.svg +48 -2
- package/public/assets/hap-icons/fan-off.svg +24 -13
- package/public/assets/hap-icons/fan-on.svg +24 -13
- package/public/assets/hap-icons/garagedoor.svg +24 -13
- package/public/assets/hap-icons/humidity.svg +24 -13
- package/public/assets/hap-icons/irrigation-system.svg +47 -18
- package/public/assets/hap-icons/leaksensor.svg +52 -2
- package/public/assets/hap-icons/light.svg +47 -28
- package/public/assets/hap-icons/lightbulb.svg +24 -13
- package/public/assets/hap-icons/lock-locked.svg +24 -13
- package/public/assets/hap-icons/lock-unlocked.svg +24 -13
- package/public/assets/hap-icons/motionsensor.svg +100 -2
- package/public/assets/hap-icons/occupancysensor.svg +97 -2
- package/public/assets/hap-icons/outlet.svg +24 -13
- package/public/assets/hap-icons/securitysystem-active.svg +102 -2
- package/public/assets/hap-icons/securitysystem-off.svg +68 -2
- package/public/assets/hap-icons/smokesensor.svg +42 -9
- package/public/assets/hap-icons/speaker.svg +29 -13
- package/public/assets/hap-icons/statelessprogrammableswitch.svg +51 -2
- package/public/assets/hap-icons/switch.svg +24 -13
- package/public/assets/hap-icons/television.svg +15 -4
- package/public/assets/hap-icons/temperature.svg +24 -13
- package/public/assets/hap-icons/unknown.svg +24 -13
- package/public/assets/hap-icons/valve-generic.svg +27 -16
- package/public/assets/hap-icons/valve-irrigation.svg +37 -21
- package/public/assets/hap-icons/valve-showerhead.svg +52 -0
- package/public/assets/hap-icons/valve-waterfaucet.svg +21 -0
- package/public/assets/hap-icons/window-closed.svg +85 -2
- package/public/assets/hap-icons/window-open.svg +136 -2
- package/public/assets/hap-icons/windowcovering-closed.svg +45 -49
- package/public/assets/hap-icons/windowcovering-open.svg +40 -44
- package/public/assets/homebridge-color-round.svg +36 -1
- package/public/assets/homebridge-logo.svg +11 -1
- package/public/assets/mask-icon.svg +5 -1
- package/public/{chunk-7EUQWCP5.js → chunk-2FGEOEQD.js} +2 -2
- package/public/chunk-2OBPFCY2.js +1 -0
- package/public/chunk-2SXSAYFM.js +1 -0
- package/public/chunk-3EHBMPWY.js +6 -0
- package/public/{chunk-WNWWUCCZ.js → chunk-3VIG5M5R.js} +3 -3
- package/public/chunk-4CHNDLJI.js +1 -0
- package/public/chunk-4NDOCFGG.js +1 -0
- package/public/chunk-4WTLH2XC.js +1 -0
- package/public/{chunk-6TCHCTXZ.js → chunk-4XCUHCZU.js} +1 -1
- package/public/chunk-5CVOEJKH.js +1 -0
- package/public/chunk-5K7NARQK.js +20 -0
- package/public/chunk-5PQJRA5G.js +1 -0
- package/public/chunk-5T7JAJJE.js +1 -0
- package/public/chunk-752FLZDX.js +1 -0
- package/public/chunk-A2LWX7FC.js +1 -0
- package/public/chunk-AK4S37TG.js +1 -0
- package/public/chunk-ASBFWS7L.js +2 -0
- package/public/chunk-AWX3JVVV.js +1 -0
- package/public/chunk-AXOQXZMS.js +1 -0
- package/public/chunk-B4ZMGETB.js +1 -0
- package/public/chunk-C53ZM5K2.js +1 -0
- package/public/chunk-CAAUHMGY.js +1 -0
- package/public/chunk-CWBE5JGC.js +1 -0
- package/public/chunk-DJ7A6WCT.js +1 -0
- package/public/chunk-DJKI5XBW.js +1 -0
- package/public/chunk-ECZONFVO.js +1 -0
- package/public/chunk-EO357XL5.js +1 -0
- package/public/chunk-EWHDFFHL.js +1 -0
- package/public/chunk-F2OGU5FW.js +1 -0
- package/public/chunk-F6QHMWSD.js +1 -0
- package/public/{chunk-QE7DO6J3.js → chunk-FHMZVMZK.js} +2 -2
- package/public/chunk-FPFW7VCW.js +5 -0
- package/public/{chunk-SK5UJRQU.js → chunk-G6GTWDKY.js} +1 -1
- package/public/chunk-GJEQY7FK.js +1 -0
- package/public/chunk-IEOEU3PV.js +1 -0
- package/public/chunk-J75SJ6HL.js +1 -0
- package/public/chunk-JIG56QTE.js +14 -0
- package/public/chunk-JMCN2SQV.js +1 -0
- package/public/chunk-JOBKDXBH.js +1 -0
- package/public/chunk-JPVF3EPM.js +1 -0
- package/public/chunk-JX3E4VFM.js +1 -0
- package/public/chunk-KUE46RRU.js +1 -0
- package/public/chunk-LTDUXFUG.js +1 -0
- package/public/chunk-LXATRDDS.js +1 -0
- package/public/chunk-M6OQT53Y.js +1 -0
- package/public/chunk-N4VWPJ6S.js +1 -0
- package/public/chunk-NKGM5COZ.js +1 -0
- package/public/chunk-OCZ2H4UT.js +1 -0
- package/public/chunk-OGSVTVGE.js +8 -0
- package/public/chunk-OT3IJBCR.js +1 -0
- package/public/chunk-P3A42IW2.js +1 -0
- package/public/chunk-PKP4FSKB.js +1 -0
- package/public/chunk-PTJSEANH.js +1 -0
- package/public/chunk-Q5DVL6Z6.js +1 -0
- package/public/{chunk-CCUID66K.js → chunk-Q7VA22QV.js} +1 -1
- package/public/chunk-QELUTKQF.js +32 -0
- package/public/chunk-QR2DRJ5Q.js +1 -0
- package/public/chunk-QR7L4UUP.js +1 -0
- package/public/chunk-RHYCATQR.js +1 -0
- package/public/chunk-RSIXVZQ5.js +1 -0
- package/public/chunk-S4CZRO5L.js +1 -0
- package/public/chunk-TCKHBFBN.js +1 -0
- package/public/chunk-TCMMHINS.js +1 -0
- package/public/chunk-TJHYTY4K.js +1 -0
- package/public/{chunk-NDNK3KHG.js → chunk-TQNPIZF3.js} +1 -1
- package/public/chunk-TUHGKUZA.js +1 -0
- package/public/chunk-TVF7CAJN.js +1 -0
- package/public/chunk-U4V4ICSI.js +7 -0
- package/public/chunk-U6XLWNAV.js +1 -0
- package/public/{chunk-YP7JWH3J.js → chunk-UOC65WET.js} +1 -1
- package/public/{chunk-WHJSVGC7.js → chunk-UR24V3JB.js} +1 -1
- package/public/chunk-VISSPBAJ.js +1 -0
- package/public/chunk-VWAY3YX4.js +1 -0
- package/public/{chunk-EA5J2VEJ.js → chunk-WM3ZC7RY.js} +1 -1
- package/public/chunk-WNGOTZ3I.js +23 -0
- package/public/{chunk-JZZQRLNW.js → chunk-XZR7OZ6I.js} +1 -1
- package/public/chunk-YHABGXDF.js +5 -0
- package/public/chunk-YRCKAGKJ.js +1 -0
- package/public/chunk-YXEV6KOV.js +7 -0
- package/public/chunk-YZMZPZB3.js +1 -0
- package/public/{chunk-BVNJ63AC.js → chunk-Z2BKSNSC.js} +2 -2
- package/public/chunk-Z4W7FR2B.js +1 -0
- package/public/chunk-ZXXOJAVC.js +1 -0
- package/public/index.html +2 -2
- package/public/main-LJS4FW2X.js +1 -0
- package/public/media/fa-brands-400-Q3XCMWHQ.woff2 +0 -0
- package/public/media/{fa-brands-400-KOKGDU7E.ttf → fa-brands-400-R2XQZCET.ttf} +0 -0
- package/public/media/fa-regular-400-QSNYFYRT.woff2 +0 -0
- package/public/media/{fa-regular-400-IPMAEX5Y.ttf → fa-regular-400-XUOPSR7E.ttf} +0 -0
- package/public/media/fa-solid-900-5ZUYHGA7.woff2 +0 -0
- package/public/media/{fa-solid-900-SRFFQLRM.ttf → fa-solid-900-PJNKLK6W.ttf} +0 -0
- package/public/polyfills-4F4B5XMZ.js +2 -0
- package/public/styles-RBNVUC4M.css +1 -0
- package/scripts/upgrade-install-plugin.sh +1 -1
- package/public/chunk-26EDYJQW.js +0 -1
- package/public/chunk-2JDN5J3P.js +0 -1
- package/public/chunk-2PMXH77A.js +0 -1
- package/public/chunk-3C2OQ2W5.js +0 -1
- package/public/chunk-3IX3CLER.js +0 -1
- package/public/chunk-3JROOWCZ.js +0 -1
- package/public/chunk-4LLA7QYB.js +0 -1
- package/public/chunk-4N3YQA7W.js +0 -1
- package/public/chunk-52L2LAHB.js +0 -1
- package/public/chunk-5KIRKUWH.js +0 -1
- package/public/chunk-6HR4EKFX.js +0 -8
- package/public/chunk-7LUCJVXB.js +0 -1
- package/public/chunk-A4HS5JYI.js +0 -1
- package/public/chunk-A76FDQKF.js +0 -1
- package/public/chunk-AAVBU64J.js +0 -1
- package/public/chunk-AFRS7ZFI.js +0 -1
- package/public/chunk-BKUGARB4.js +0 -7
- package/public/chunk-BPMSJ2VF.js +0 -1
- package/public/chunk-BS2EMJX7.js +0 -1
- package/public/chunk-CJIFFTFC.js +0 -1
- package/public/chunk-CY55AES3.js +0 -1
- package/public/chunk-DAYZQW6Q.js +0 -1
- package/public/chunk-ED5XL3PD.js +0 -1
- package/public/chunk-EJKB2WDE.js +0 -1
- package/public/chunk-FA2N3XXT.js +0 -1
- package/public/chunk-HSJSWZHD.js +0 -1
- package/public/chunk-IB5GZVXD.js +0 -1
- package/public/chunk-IVORLBXB.js +0 -1
- package/public/chunk-IW3HI4LO.js +0 -1
- package/public/chunk-JU4PP2VY.js +0 -32
- package/public/chunk-KHNBODZR.js +0 -14
- package/public/chunk-KQJ7ONUG.js +0 -1
- package/public/chunk-KRNQN3FT.js +0 -1
- package/public/chunk-KVW76M4O.js +0 -1
- package/public/chunk-LMPCXQ23.js +0 -1
- package/public/chunk-LV2VCDOI.js +0 -1
- package/public/chunk-M6SHEAQY.js +0 -1
- package/public/chunk-MDDU475D.js +0 -1
- package/public/chunk-MPVSAJDU.js +0 -5
- package/public/chunk-NV6GUYHV.js +0 -1
- package/public/chunk-NW6AFAD7.js +0 -1
- package/public/chunk-NZNNTHFQ.js +0 -1
- package/public/chunk-OKKTO3UM.js +0 -1
- package/public/chunk-OOHFQB4Z.js +0 -1
- package/public/chunk-ORPWYWCL.js +0 -5
- package/public/chunk-QGDVQDUP.js +0 -20
- package/public/chunk-QHPDGSZ6.js +0 -1
- package/public/chunk-QKWNCNRW.js +0 -1
- package/public/chunk-RDAMEJPR.js +0 -1
- package/public/chunk-TCSXGQNF.js +0 -1
- package/public/chunk-TFEVMIHT.js +0 -23
- package/public/chunk-TXOB7R5K.js +0 -7
- package/public/chunk-U2KJ2IEE.js +0 -1
- package/public/chunk-UAQGK64S.js +0 -1
- package/public/chunk-UG5DK2RQ.js +0 -2
- package/public/chunk-UKAOVQ6N.js +0 -1
- package/public/chunk-UNVMI6CK.js +0 -1
- package/public/chunk-US5QSVJ2.js +0 -1
- package/public/chunk-UWLLEMGO.js +0 -1
- package/public/chunk-V2TYBIZV.js +0 -1
- package/public/chunk-V7D5U2P3.js +0 -1
- package/public/chunk-WHJOLAED.js +0 -1
- package/public/chunk-WNVJPPO7.js +0 -1
- package/public/chunk-WP6BKFEA.js +0 -1
- package/public/chunk-WSYFRV2X.js +0 -1
- package/public/chunk-XLY5QPTN.js +0 -6
- package/public/chunk-XY74TB4S.js +0 -1
- package/public/chunk-ZOKILXR3.js +0 -1
- package/public/chunk-ZT23DWNL.js +0 -1
- package/public/main-6PBYD25D.js +0 -1
- package/public/media/01-RQ3S2L53.png +0 -0
- package/public/media/02-VNCG2I2A.png +0 -0
- package/public/media/03-HI42L4ZG.png +0 -0
- package/public/media/04-FJLL55LZ.png +0 -0
- package/public/media/05-V3EO6SPT.png +0 -0
- package/public/media/06-EOJZCQZN.png +0 -0
- package/public/media/07-KMKB5PBD.png +0 -0
- package/public/media/08-UQJRF6B2.png +0 -0
- package/public/media/09-2DJQFRHH.png +0 -0
- package/public/media/arrow_left-CQT7FZM7.svg +0 -4
- package/public/media/arrow_right-SBUDRR2G.svg +0 -4
- package/public/media/fa-brands-400-6PJPV6JM.woff2 +0 -0
- package/public/media/fa-regular-400-OHB6J4OK.woff2 +0 -0
- package/public/media/fa-solid-900-ABTK6BNK.woff2 +0 -0
- package/public/polyfills-C6JHVXJJ.js +0 -2
- package/public/scripts-6GVLYD7F.js +0 -62
- package/public/styles-EG5MFQEM.css +0 -1
- /package/public/assets/{bootstrap-4 → bootstrap-5}/cssframework/assets.json +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ca as qt,Lc as Ft,Qb as xt,dc as Ut,e as d,ec as Dt,g as He,h as Lt,lb as _t}from"./chunk-U4V4ICSI.js";var zt=d((Dn,kt)=>{kt.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var I=d(P=>{var st,Ve=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];P.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};P.getSymbolTotalCodewords=function(t){return Ve[t]};P.getBCHDigit=function(n){let t=0;for(;n!==0;)t++,n>>>=1;return t};P.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');st=t};P.isKanjiModeEnabled=function(){return typeof st<"u"};P.toSJIS=function(t){return st(t)}});var Q=d(w=>{w.L={bit:1};w.M={bit:0};w.Q={bit:3};w.H={bit:2};function Ke(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return w.L;case"m":case"medium":return w.M;case"q":case"quartile":return w.Q;case"h":case"high":return w.H;default:throw new Error("Unknown EC Level: "+n)}}w.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};w.from=function(t,e){if(w.isValid(t))return t;try{return Ke(t)}catch{return e}}});var Kt=d((zn,Vt)=>{function Ht(){this.buffer=[],this.length=0}Ht.prototype={get:function(n){let t=Math.floor(n/8);return(this.buffer[t]>>>7-n%8&1)===1},put:function(n,t){for(let e=0;e<t;e++)this.putBit((n>>>t-e-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(n){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),n&&(this.buffer[t]|=128>>>this.length%8),this.length++}};Vt.exports=Ht});var Ot=d((Hn,Jt)=>{function k(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n)}k.prototype.set=function(n,t,e,r){let o=n*this.size+t;this.data[o]=e,r&&(this.reservedBit[o]=!0)};k.prototype.get=function(n,t){return this.data[n*this.size+t]};k.prototype.xor=function(n,t,e){this.data[n*this.size+t]^=e};k.prototype.isReserved=function(n,t){return this.reservedBit[n*this.size+t]};Jt.exports=k});var Yt=d(j=>{var Je=I().getSymbolSize;j.getRowColCoords=function(t){if(t===1)return[];let e=Math.floor(t/7)+2,r=Je(t),o=r===145?26:Math.ceil((r-13)/(2*e-2))*2,i=[r-7];for(let s=1;s<e-1;s++)i[s]=i[s-1]-o;return i.push(6),i.reverse()};j.getPositions=function(t){let e=[],r=j.getRowColCoords(t),o=r.length;for(let i=0;i<o;i++)for(let s=0;s<o;s++)i===0&&s===0||i===0&&s===o-1||i===o-1&&s===0||e.push([r[i],r[s]]);return e}});var vt=d(jt=>{var Oe=I().getSymbolSize,Qt=7;jt.getPositions=function(t){let e=Oe(t);return[[0,0],[e-Qt,0],[0,e-Qt]]}});var Gt=d(g=>{g.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var b={N1:3,N2:3,N3:40,N4:10};g.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};g.from=function(t){return g.isValid(t)?parseInt(t,10):void 0};g.getPenaltyN1=function(t){let e=t.size,r=0,o=0,i=0,s=null,u=null;for(let c=0;c<e;c++){o=i=0,s=u=null;for(let l=0;l<e;l++){let a=t.get(c,l);a===s?o++:(o>=5&&(r+=b.N1+(o-5)),s=a,o=1),a=t.get(l,c),a===u?i++:(i>=5&&(r+=b.N1+(i-5)),u=a,i=1)}o>=5&&(r+=b.N1+(o-5)),i>=5&&(r+=b.N1+(i-5))}return r};g.getPenaltyN2=function(t){let e=t.size,r=0;for(let o=0;o<e-1;o++)for(let i=0;i<e-1;i++){let s=t.get(o,i)+t.get(o,i+1)+t.get(o+1,i)+t.get(o+1,i+1);(s===4||s===0)&&r++}return r*b.N2};g.getPenaltyN3=function(t){let e=t.size,r=0,o=0,i=0;for(let s=0;s<e;s++){o=i=0;for(let u=0;u<e;u++)o=o<<1&2047|t.get(s,u),u>=10&&(o===1488||o===93)&&r++,i=i<<1&2047|t.get(u,s),u>=10&&(i===1488||i===93)&&r++}return r*b.N3};g.getPenaltyN4=function(t){let e=0,r=t.data.length;for(let i=0;i<r;i++)e+=t.data[i];return Math.abs(Math.ceil(e*100/r/5)-10)*b.N4};function Ye(n,t,e){switch(n){case g.Patterns.PATTERN000:return(t+e)%2===0;case g.Patterns.PATTERN001:return t%2===0;case g.Patterns.PATTERN010:return e%3===0;case g.Patterns.PATTERN011:return(t+e)%3===0;case g.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2===0;case g.Patterns.PATTERN101:return t*e%2+t*e%3===0;case g.Patterns.PATTERN110:return(t*e%2+t*e%3)%2===0;case g.Patterns.PATTERN111:return(t*e%3+(t+e)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}g.applyMask=function(t,e){let r=e.size;for(let o=0;o<r;o++)for(let i=0;i<r;i++)e.isReserved(i,o)||e.xor(i,o,Ye(t,i,o))};g.getBestMask=function(t,e){let r=Object.keys(g.Patterns).length,o=0,i=1/0;for(let s=0;s<r;s++){e(s),g.applyMask(s,t);let u=g.getPenaltyN1(t)+g.getPenaltyN2(t)+g.getPenaltyN3(t)+g.getPenaltyN4(t);g.applyMask(s,t),u<i&&(i=u,o=s)}return o}});var ct=d(ut=>{var N=Q(),v=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],G=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];ut.getBlocksCount=function(t,e){switch(e){case N.L:return v[(t-1)*4+0];case N.M:return v[(t-1)*4+1];case N.Q:return v[(t-1)*4+2];case N.H:return v[(t-1)*4+3];default:return}};ut.getTotalCodewordsCount=function(t,e){switch(e){case N.L:return G[(t-1)*4+0];case N.M:return G[(t-1)*4+1];case N.Q:return G[(t-1)*4+2];case N.H:return G[(t-1)*4+3];default:return}}});var $t=d(W=>{var z=new Uint8Array(512),$=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)z[e]=t,$[t]=e,t<<=1,t&256&&(t^=285);for(let e=255;e<512;e++)z[e]=z[e-255]})();W.log=function(t){if(t<1)throw new Error("log("+t+")");return $[t]};W.exp=function(t){return z[t]};W.mul=function(t,e){return t===0||e===0?0:z[$[t]+$[e]]}});var Wt=d(H=>{var lt=$t();H.mul=function(t,e){let r=new Uint8Array(t.length+e.length-1);for(let o=0;o<t.length;o++)for(let i=0;i<e.length;i++)r[o+i]^=lt.mul(t[o],e[i]);return r};H.mod=function(t,e){let r=new Uint8Array(t);for(;r.length-e.length>=0;){let o=r[0];for(let s=0;s<e.length;s++)r[s]^=lt.mul(e[s],o);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r};H.generateECPolynomial=function(t){let e=new Uint8Array([1]);for(let r=0;r<t;r++)e=H.mul(e,new Uint8Array([1,lt.exp(r)]));return e}});var te=d((jn,Xt)=>{var Zt=Wt();function at(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}at.prototype.initialize=function(t){this.degree=t,this.genPoly=Zt.generateECPolynomial(this.degree)};at.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let e=new Uint8Array(t.length+this.degree);e.set(t);let r=Zt.mod(e,this.genPoly),o=this.degree-r.length;if(o>0){let i=new Uint8Array(this.degree);return i.set(r,o),i}return r};Xt.exports=at});var ft=d(ee=>{ee.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var dt=d(B=>{var ne="[0-9]+",Qe="[A-Z $%*+\\-./:]+",V="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";V=V.replace(/u/g,"\\u");var je="(?:(?![A-Z0-9 $%*+\\-./:]|"+V+`)(?:.|[\r
|
|
2
2
|
]))+`;B.KANJI=new RegExp(V,"g");B.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");B.BYTE=new RegExp(je,"g");B.NUMERIC=new RegExp(ne,"g");B.ALPHANUMERIC=new RegExp(Qe,"g");var ve=new RegExp("^"+V+"$"),Ge=new RegExp("^"+ne+"$"),$e=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");B.testKanji=function(t){return ve.test(t)};B.testNumeric=function(t){return Ge.test(t)};B.testAlphanumeric=function(t){return $e.test(t)}});var M=d(p=>{var We=ft(),gt=dt();p.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};p.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};p.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};p.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};p.MIXED={bit:-1};p.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!We.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]};p.getBestModeForData=function(t){return gt.testNumeric(t)?p.NUMERIC:gt.testAlphanumeric(t)?p.ALPHANUMERIC:gt.testKanji(t)?p.KANJI:p.BYTE};p.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};p.isValid=function(t){return t&&t.bit&&t.ccBits};function Ze(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return p.NUMERIC;case"alphanumeric":return p.ALPHANUMERIC;case"kanji":return p.KANJI;case"byte":return p.BYTE;default:throw new Error("Unknown mode: "+n)}}p.from=function(t,e){if(p.isValid(t))return t;try{return Ze(t)}catch{return e}}});var ue=d(R=>{var Z=I(),Xe=ct(),re=Q(),S=M(),ht=ft(),ie=7973,oe=Z.getBCHDigit(ie);function tn(n,t,e){for(let r=1;r<=40;r++)if(t<=R.getCapacity(r,e,n))return r}function se(n,t){return S.getCharCountIndicator(n,t)+4}function en(n,t){let e=0;return n.forEach(function(r){let o=se(r.mode,t);e+=o+r.getBitsLength()}),e}function nn(n,t){for(let e=1;e<=40;e++)if(en(n,e)<=R.getCapacity(e,t,S.MIXED))return e}R.from=function(t,e){return ht.isValid(t)?parseInt(t,10):e};R.getCapacity=function(t,e,r){if(!ht.isValid(t))throw new Error("Invalid QR Code version");typeof r>"u"&&(r=S.BYTE);let o=Z.getSymbolTotalCodewords(t),i=Xe.getTotalCodewordsCount(t,e),s=(o-i)*8;if(r===S.MIXED)return s;let u=s-se(r,t);switch(r){case S.NUMERIC:return Math.floor(u/10*3);case S.ALPHANUMERIC:return Math.floor(u/11*2);case S.KANJI:return Math.floor(u/13);case S.BYTE:default:return Math.floor(u/8)}};R.getBestVersionForData=function(t,e){let r,o=re.from(e,re.M);if(Array.isArray(t)){if(t.length>1)return nn(t,o);if(t.length===0)return 1;r=t[0]}else r=t;return tn(r.mode,r.getLength(),o)};R.getEncodedBits=function(t){if(!ht.isValid(t)||t<7)throw new Error("Invalid QR Code version");let e=t<<12;for(;Z.getBCHDigit(e)-oe>=0;)e^=ie<<Z.getBCHDigit(e)-oe;return t<<12|e}});var fe=d(ae=>{var pt=I(),le=1335,rn=21522,ce=pt.getBCHDigit(le);ae.getEncodedBits=function(t,e){let r=t.bit<<3|e,o=r<<10;for(;pt.getBCHDigit(o)-ce>=0;)o^=le<<pt.getBCHDigit(o)-ce;return(r<<10|o)^rn}});var ge=d((Xn,de)=>{var on=M();function _(n){this.mode=on.NUMERIC,this.data=n.toString()}_.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};_.prototype.getLength=function(){return this.data.length};_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)};_.prototype.write=function(t){let e,r,o;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),o=parseInt(r,10),t.put(o,10);let i=this.data.length-e;i>0&&(r=this.data.substr(e),o=parseInt(r,10),t.put(o,i*3+1))};de.exports=_});var pe=d((tr,he)=>{var sn=M(),mt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function x(n){this.mode=sn.ALPHANUMERIC,this.data=n}x.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};x.prototype.getLength=function(){return this.data.length};x.prototype.getBitsLength=function(){return x.getBitsLength(this.data.length)};x.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let r=mt.indexOf(this.data[e])*45;r+=mt.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(mt.indexOf(this.data[e]),6)};he.exports=x});var we=d((er,me)=>{var un=M();function U(n){this.mode=un.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}U.getBitsLength=function(t){return t*8};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(n){for(let t=0,e=this.data.length;t<e;t++)n.put(this.data[t],8)};me.exports=U});var Ee=d((nr,ye)=>{var cn=M(),ln=I();function D(n){this.mode=cn.KANJI,this.data=n}D.getBitsLength=function(t){return t*13};D.prototype.getLength=function(){return this.data.length};D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)};D.prototype.write=function(n){let t;for(t=0;t<this.data.length;t++){let e=ln.toSJIS(this.data[t]);if(e>=33088&&e<=40956)e-=33088;else if(e>=57408&&e<=60351)e-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
3
3
|
Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),n.put(e,13)}};ye.exports=D});var Ce=d((rr,wt)=>{"use strict";var K={single_source_shortest_paths:function(n,t,e){var r={},o={};o[t]=0;var i=K.PriorityQueue.make();i.push(t,0);for(var s,u,c,l,a,m,h,y,A;!i.empty();){s=i.pop(),u=s.value,l=s.cost,a=n[u]||{};for(c in a)a.hasOwnProperty(c)&&(m=a[c],h=l+m,y=o[c],A=typeof o[c]>"u",(A||y>h)&&(o[c]=h,i.push(c,h),r[c]=u))}if(typeof e<"u"&&typeof o[e]>"u"){var T=["Could not find a path from ",t," to ",e,"."].join("");throw new Error(T)}return r},extract_shortest_path_from_predecessor_list:function(n,t){for(var e=[],r=t,o;r;)e.push(r),o=n[r],r=n[r];return e.reverse(),e},find_path:function(n,t,e){var r=K.single_source_shortest_paths(n,t,e);return K.extract_shortest_path_from_predecessor_list(r,e)},PriorityQueue:{make:function(n){var t=K.PriorityQueue,e={},r;n=n||{};for(r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e.queue=[],e.sorter=n.sorter||t.default_sorter,e},default_sorter:function(n,t){return n.cost-t.cost},push:function(n,t){var e={value:n,cost:t};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof wt<"u"&&(wt.exports=K)});var Pe=d(F=>{var f=M(),Te=ge(),Ie=pe(),Ne=we(),Me=Ee(),J=dt(),X=I(),an=Ce();function Be(n){return unescape(encodeURIComponent(n)).length}function O(n,t,e){let r=[],o;for(;(o=n.exec(e))!==null;)r.push({data:o[0],index:o.index,mode:t,length:o[0].length});return r}function Se(n){let t=O(J.NUMERIC,f.NUMERIC,n),e=O(J.ALPHANUMERIC,f.ALPHANUMERIC,n),r,o;return X.isKanjiModeEnabled()?(r=O(J.BYTE,f.BYTE,n),o=O(J.KANJI,f.KANJI,n)):(r=O(J.BYTE_KANJI,f.BYTE,n),o=[]),t.concat(e,r,o).sort(function(s,u){return s.index-u.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}function yt(n,t){switch(t){case f.NUMERIC:return Te.getBitsLength(n);case f.ALPHANUMERIC:return Ie.getBitsLength(n);case f.KANJI:return Me.getBitsLength(n);case f.BYTE:return Ne.getBitsLength(n)}}function fn(n){return n.reduce(function(t,e){let r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}function dn(n){let t=[];for(let e=0;e<n.length;e++){let r=n[e];switch(r.mode){case f.NUMERIC:t.push([r,{data:r.data,mode:f.ALPHANUMERIC,length:r.length},{data:r.data,mode:f.BYTE,length:r.length}]);break;case f.ALPHANUMERIC:t.push([r,{data:r.data,mode:f.BYTE,length:r.length}]);break;case f.KANJI:t.push([r,{data:r.data,mode:f.BYTE,length:Be(r.data)}]);break;case f.BYTE:t.push([{data:r.data,mode:f.BYTE,length:Be(r.data)}])}}return t}function gn(n,t){let e={},r={start:{}},o=["start"];for(let i=0;i<n.length;i++){let s=n[i],u=[];for(let c=0;c<s.length;c++){let l=s[c],a=""+i+c;u.push(a),e[a]={node:l,lastCount:0},r[a]={};for(let m=0;m<o.length;m++){let h=o[m];e[h]&&e[h].node.mode===l.mode?(r[h][a]=yt(e[h].lastCount+l.length,l.mode)-yt(e[h].lastCount,l.mode),e[h].lastCount+=l.length):(e[h]&&(e[h].lastCount=l.length),r[h][a]=yt(l.length,l.mode)+4+f.getCharCountIndicator(l.mode,t))}}o=u}for(let i=0;i<o.length;i++)r[o[i]].end=0;return{map:r,table:e}}function Ae(n,t){let e,r=f.getBestModeForData(n);if(e=f.from(t,r),e!==f.BYTE&&e.bit<r.bit)throw new Error('"'+n+'" cannot be encoded with mode '+f.toString(e)+`.
|
|
4
4
|
Suggested mode is: `+f.toString(r));switch(e===f.KANJI&&!X.isKanjiModeEnabled()&&(e=f.BYTE),e){case f.NUMERIC:return new Te(n);case f.ALPHANUMERIC:return new Ie(n);case f.KANJI:return new Me(n);case f.BYTE:return new Ne(n)}}F.fromArray=function(t){return t.reduce(function(e,r){return typeof r=="string"?e.push(Ae(r,null)):r.data&&e.push(Ae(r.data,r.mode)),e},[])};F.fromString=function(t,e){let r=Se(t,X.isKanjiModeEnabled()),o=dn(r),i=gn(o,e),s=an.find_path(i.map,"start","end"),u=[];for(let c=1;c<s.length-1;c++)u.push(i.table[s[c]].node);return F.fromArray(fn(u))};F.rawSplit=function(t){return F.fromArray(Se(t,X.isKanjiModeEnabled()))}});var Re=d(be=>{var et=I(),Et=Q(),hn=Kt(),pn=Ot(),mn=Yt(),wn=vt(),At=Gt(),Tt=ct(),yn=te(),tt=ue(),En=fe(),Cn=M(),Ct=Pe();function Bn(n,t){let e=n.size,r=wn.getPositions(t);for(let o=0;o<r.length;o++){let i=r[o][0],s=r[o][1];for(let u=-1;u<=7;u++)if(!(i+u<=-1||e<=i+u))for(let c=-1;c<=7;c++)s+c<=-1||e<=s+c||(u>=0&&u<=6&&(c===0||c===6)||c>=0&&c<=6&&(u===0||u===6)||u>=2&&u<=4&&c>=2&&c<=4?n.set(i+u,s+c,!0,!0):n.set(i+u,s+c,!1,!0))}}function An(n){let t=n.size;for(let e=8;e<t-8;e++){let r=e%2===0;n.set(e,6,r,!0),n.set(6,e,r,!0)}}function Tn(n,t){let e=mn.getPositions(t);for(let r=0;r<e.length;r++){let o=e[r][0],i=e[r][1];for(let s=-2;s<=2;s++)for(let u=-2;u<=2;u++)s===-2||s===2||u===-2||u===2||s===0&&u===0?n.set(o+s,i+u,!0,!0):n.set(o+s,i+u,!1,!0)}}function In(n,t){let e=n.size,r=tt.getEncodedBits(t),o,i,s;for(let u=0;u<18;u++)o=Math.floor(u/3),i=u%3+e-8-3,s=(r>>u&1)===1,n.set(o,i,s,!0),n.set(i,o,s,!0)}function Bt(n,t,e){let r=n.size,o=En.getEncodedBits(t,e),i,s;for(i=0;i<15;i++)s=(o>>i&1)===1,i<6?n.set(i,8,s,!0):i<8?n.set(i+1,8,s,!0):n.set(r-15+i,8,s,!0),i<8?n.set(8,r-i-1,s,!0):i<9?n.set(8,15-i-1+1,s,!0):n.set(8,15-i-1,s,!0);n.set(r-8,8,1,!0)}function Nn(n,t){let e=n.size,r=-1,o=e-1,i=7,s=0;for(let u=e-1;u>0;u-=2)for(u===6&&u--;;){for(let c=0;c<2;c++)if(!n.isReserved(o,u-c)){let l=!1;s<t.length&&(l=(t[s]>>>i&1)===1),n.set(o,u-c,l),i--,i===-1&&(s++,i=7)}if(o+=r,o<0||e<=o){o-=r,r=-r;break}}}function Mn(n,t,e){let r=new hn;e.forEach(function(c){r.put(c.mode.bit,4),r.put(c.getLength(),Cn.getCharCountIndicator(c.mode,n)),c.write(r)});let o=et.getSymbolTotalCodewords(n),i=Tt.getTotalCodewordsCount(n,t),s=(o-i)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);let u=(s-r.getLengthInBits())/8;for(let c=0;c<u;c++)r.put(c%2?17:236,8);return Sn(r,n,t)}function Sn(n,t,e){let r=et.getSymbolTotalCodewords(t),o=Tt.getTotalCodewordsCount(t,e),i=r-o,s=Tt.getBlocksCount(t,e),u=r%s,c=s-u,l=Math.floor(r/s),a=Math.floor(i/s),m=a+1,h=l-a,y=new yn(h),A=0,T=new Array(s),bt=new Array(s),rt=0,ze=new Uint8Array(n.buffer);for(let q=0;q<s;q++){let it=q<c?a:m;T[q]=ze.slice(A,A+it),bt[q]=y.encode(T[q]),A+=it,rt=Math.max(rt,it)}let ot=new Uint8Array(r),Rt=0,E,C;for(E=0;E<rt;E++)for(C=0;C<s;C++)E<T[C].length&&(ot[Rt++]=T[C][E]);for(E=0;E<h;E++)for(C=0;C<s;C++)ot[Rt++]=bt[C][E];return ot}function Pn(n,t,e,r){let o;if(Array.isArray(n))o=Ct.fromArray(n);else if(typeof n=="string"){let l=t;if(!l){let a=Ct.rawSplit(n);l=tt.getBestVersionForData(a,e)}o=Ct.fromString(n,l||40)}else throw new Error("Invalid data");let i=tt.getBestVersionForData(o,e);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=i;else if(t<i)throw new Error(`
|
|
5
5
|
The chosen QR Code version cannot contain this amount of data.
|
|
6
6
|
Minimum version required to store current data is: `+i+`.
|
|
7
7
|
`);let s=Mn(t,e,o),u=et.getSymbolSize(t),c=new pn(u);return Bn(c,t),An(c),Tn(c,t),Bt(c,e,0),t>=7&&In(c,t),Nn(c,s),isNaN(r)&&(r=At.getBestMask(c,Bt.bind(null,c,e))),At.applyMask(r,c),Bt(c,e,r),{modules:c,version:t,errorCorrectionLevel:e,maskPattern:r,segments:o}}be.create=function(t,e){if(typeof t>"u"||t==="")throw new Error("No input text");let r=Et.M,o,i;return typeof e<"u"&&(r=Et.from(e.errorCorrectionLevel,Et.M),o=tt.from(e.version),i=At.from(e.maskPattern),e.toSJISFunc&&et.setToSJISFunction(e.toSJISFunc)),Pn(t,o,r,i)}});var It=d(L=>{function Le(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let t=n.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+n);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(r){return[r,r]}))),t.length===6&&t.push("F","F");let e=parseInt(t.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+t.slice(0,6).join("")}}L.getOptions=function(t){t||(t={}),t.color||(t.color={});let e=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:r,scale:r?4:o,margin:e,color:{dark:Le(t.color.dark||"#000000ff"),light:Le(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};L.getScale=function(t,e){return e.width&&e.width>=t+e.margin*2?e.width/(t+e.margin*2):e.scale};L.getImageWidth=function(t,e){let r=L.getScale(t,e);return Math.floor((t+e.margin*2)*r)};L.qrToImageData=function(t,e,r){let o=e.modules.size,i=e.modules.data,s=L.getScale(o,r),u=Math.floor((o+r.margin*2)*s),c=r.margin*s,l=[r.color.light,r.color.dark];for(let a=0;a<u;a++)for(let m=0;m<u;m++){let h=(a*u+m)*4,y=r.color.light;if(a>=c&&m>=c&&a<u-c&&m<u-c){let A=Math.floor((a-c)/s),T=Math.floor((m-c)/s);y=l[i[A*o+T]?1:0]}t[h++]=y.r,t[h++]=y.g,t[h++]=y.b,t[h]=y.a}}});var qe=d(nt=>{var Nt=It();function bn(n,t,e){n.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=e,t.width=e,t.style.height=e+"px",t.style.width=e+"px"}function Rn(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}nt.render=function(t,e,r){let o=r,i=e;typeof o>"u"&&(!e||!e.getContext)&&(o=e,e=void 0),e||(i=Rn()),o=Nt.getOptions(o);let s=Nt.getImageWidth(t.modules.size,o),u=i.getContext("2d"),c=u.createImageData(s,s);return Nt.qrToImageData(c.data,t,o),bn(u,i,s),u.putImageData(c,0,0),i};nt.renderToDataURL=function(t,e,r){let o=r;typeof o>"u"&&(!e||!e.getContext)&&(o=e,e=void 0),o||(o={});let i=nt.render(t,e,o),s=o.type||"image/png",u=o.rendererOpts||{};return i.toDataURL(s,u.quality)}});var Ue=d(xe=>{var Ln=It();function _e(n,t){let e=n.a/255,r=t+'="'+n.hex+'"';return e<1?r+" "+t+'-opacity="'+e.toFixed(2).slice(1)+'"':r}function Mt(n,t,e){let r=n+t;return typeof e<"u"&&(r+=" "+e),r}function qn(n,t,e){let r="",o=0,i=!1,s=0;for(let u=0;u<n.length;u++){let c=Math.floor(u%t),l=Math.floor(u/t);!c&&!i&&(i=!0),n[u]?(s++,u>0&&c>0&&n[u-1]||(r+=i?Mt("M",c+e,.5+l+e):Mt("m",o,0),o=0,i=!1),c+1<t&&n[u+1]||(r+=Mt("h",s),s=0)):o++}return r}xe.render=function(t,e,r){let o=Ln.getOptions(e),i=t.modules.size,s=t.modules.data,u=i+o.margin*2,c=o.color.light.a?"<path "+_e(o.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",l="<path "+_e(o.color.dark,"stroke")+' d="'+qn(s,i,o.margin)+'"/>',a='viewBox="0 0 '+u+" "+u+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+a+' shape-rendering="crispEdges">'+c+l+`</svg>
|
|
8
|
-
`;return typeof r=="function"&&r(null,h),h}});var Fe=d(Y=>{var _n=zt(),St=Re(),De=qe(),xn=Ue();function Pt(n,t,e,r,o){let i=[].slice.call(arguments,1),s=i.length,u=typeof i[s-1]=="function";if(!u&&!_n())throw new Error("Callback required as last argument");if(u){if(s<2)throw new Error("Too few arguments provided");s===2?(o=e,e=t,t=r=void 0):s===3&&(t.getContext&&typeof o>"u"?(o=r,r=void 0):(o=r,r=e,e=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(e=t,t=r=void 0):s===2&&!t.getContext&&(r=e,e=t,t=void 0),new Promise(function(c,l){try{let a=St.create(e,r);c(n(a,t,r))}catch(a){l(a)}})}try{let c=St.create(e,r);o(null,n(c,t,r))}catch(c){o(c)}}Y.create=St.create;Y.toCanvas=Pt.bind(null,De.render);Y.toDataURL=Pt.bind(null,De.renderToDataURL);Y.toString=Pt.bind(null,function(n,t,e){return xn.render(n,e)})});var ke=He(Fe(),1);var Un=["qrcode"],hr=(()=>{class n{data;qrcodeElement=
|
|
8
|
+
`;return typeof r=="function"&&r(null,h),h}});var Fe=d(Y=>{var _n=zt(),St=Re(),De=qe(),xn=Ue();function Pt(n,t,e,r,o){let i=[].slice.call(arguments,1),s=i.length,u=typeof i[s-1]=="function";if(!u&&!_n())throw new Error("Callback required as last argument");if(u){if(s<2)throw new Error("Too few arguments provided");s===2?(o=e,e=t,t=r=void 0):s===3&&(t.getContext&&typeof o>"u"?(o=r,r=void 0):(o=r,r=e,e=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(e=t,t=r=void 0):s===2&&!t.getContext&&(r=e,e=t,t=void 0),new Promise(function(c,l){try{let a=St.create(e,r);c(n(a,t,r))}catch(a){l(a)}})}try{let c=St.create(e,r);o(null,n(c,t,r))}catch(c){o(c)}}Y.create=St.create;Y.toCanvas=Pt.bind(null,De.render);Y.toDataURL=Pt.bind(null,De.renderToDataURL);Y.toString=Pt.bind(null,function(n,t,e){return xn.render(n,e)})});var ke=He(Fe(),1);var Un=["qrcode"],hr=(()=>{class n{data;qrcodeElement=Ft("qrcode");ngOnChanges(){this.renderQrCode()}renderQrCode(){return Lt(this,null,function*(){if(this.data){let e=this.qrcodeElement();e.nativeElement.innerHTML=yield(0,ke.toString)(this.data,{type:"svg",margin:0,color:{light:"#ffffff00",dark:document.body.classList.contains("dark-mode")?"#FFF":"#000"}}),e.nativeElement.querySelector("svg").querySelector("path").classList.add("qr-code-theme-color")}})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=_t({type:n,selectors:[["app-qrcode"]],viewQuery:function(r,o){r&1&&Ut(o.qrcodeElement,Un,5),r&2&&Dt()},inputs:{data:"data"},features:[qt],decls:2,vars:0,consts:[["qrcode",""],[2,"width","100%","height","100%"]],template:function(r,o){r&1&&xt(0,"div",1,0)},encapsulation:2})}return n})();export{hr as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as b}from"./chunk-Q7VA22QV.js";import{a as p,b as w}from"./chunk-YXEV6KOV.js";import{a as c}from"./chunk-G6GTWDKY.js";import{M as i,g as o,ga as m,la as h,n}from"./chunk-U4V4ICSI.js";var d=o(p(),1),a=o(w(),1),l=o(b(),1);var v=(()=>{class e{$ws=h(c);term;io;fitAddon;webLinksAddon;resize;elementResize;constructor(){}destroyTerminal(){this.io.end(),this.term.dispose(),this.resize.complete(),this.elementResize&&this.elementResize.complete()}startTerminal(r,s={},f){this.elementResize=f,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new d.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new a.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new n,this.term.open(r.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(i(200)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
|
|
2
|
+
\r
|
|
3
|
+
\rTerminal disconnected. Is the server running?
|
|
4
|
+
\r
|
|
5
|
+
\r`)}),this.io.socket.on("process-exit",()=>{this.io.socket.emit("end"),this.startSession()}),this.resize.pipe(i(500)).subscribe(t=>{this.io.socket.emit("resize",t)}),this.io.socket.on("stdout",t=>{this.term.write(t)}),this.term.onData(t=>{this.io.socket.emit("stdin",t)}),this.term.onResize(t=>{this.resize.next(t)}),this.elementResize&&this.elementResize.pipe(i(100)).subscribe({next:()=>{this.fitAddon.fit()}})}startSession(){this.term.reset(),this.io.socket.emit("start-session",{cols:this.term.cols,rows:this.term.rows}),this.resize.next({cols:this.term.cols,rows:this.term.rows})}static \u0275fac=function(s){return new(s||e)};static \u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{v as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as pe}from"./chunk-YP7JWH3J.js";import{a as he}from"./chunk-WNVJPPO7.js";import{f as We,ha as ue,k as fe,n as X,na as le}from"./chunk-TXOB7R5K.js";var d=Object.create(null);d.open="0";d.close="1";d.ping="2";d.pong="3";d.message="4";d.upgrade="5";d.noop="6";var S=Object.create(null);Object.keys(d).forEach(r=>{S[d[r]]=r});var O={type:"error",data:"parser error"};var ye=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ge=typeof ArrayBuffer=="function",_e=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,B=({type:r,data:e},t,s)=>ye&&e instanceof Blob?t?s(e):de(e,s):ge&&(e instanceof ArrayBuffer||_e(e))?t?s(e):de(new Blob([e]),s):s(d[r]+(e||"")),de=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)};function me(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var $;function be(r,e){if(ye&&r.data instanceof Blob)return r.data.arrayBuffer().then(me).then(e);if(ge&&(r.data instanceof ArrayBuffer||_e(r.data)))return e(me(r.data));B(r,!1,t=>{$||($=new TextEncoder),e($.encode(t))})}var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<we.length;r++)N[we.charCodeAt(r)]=r;var ke=r=>{let e=r.length*.75,t=r.length,s,i=0,n,o,c,a;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),p=new Uint8Array(m);for(s=0;s<t;s+=4)n=N[r.charCodeAt(s)],o=N[r.charCodeAt(s+1)],c=N[r.charCodeAt(s+2)],a=N[r.charCodeAt(s+3)],p[i++]=n<<2|o>>4,p[i++]=(o&15)<<4|c>>2,p[i++]=(c&3)<<6|a&63;return m};var Ke=typeof ArrayBuffer=="function",L=(r,e)=>{if(typeof r!="string")return{type:"message",data:Ee(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:Ye(r.substring(1),e)}:S[t]?r.length>1?{type:S[t],data:r.substring(1)}:{type:S[t]}:O},Ye=(r,e)=>{if(Ke){let t=ke(r);return Ee(t,e)}else return{base64:!0,data:r}},Ee=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var ve="",xe=(r,e)=>{let t=r.length,s=new Array(t),i=0;r.forEach((n,o)=>{B(n,!1,c=>{s[o]=c,++i===t&&e(s.join(ve))})})},Te=(r,e)=>{let t=r.split(ve),s=[];for(let i=0;i<t.length;i++){let n=L(t[i],e);if(s.push(n),n.type==="error")break}return s};function Ae(){return new TransformStream({transform(r,e){be(r,t=>{let s=t.length,i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);let n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,s)}else{i=new Uint8Array(9);let n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(s))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Q;function U(r){return r.reduce((e,t)=>e+t.length,0)}function V(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),s=0;for(let i=0;i<e;i++)t[i]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),t}function Re(r,e){Q||(Q=new TextDecoder);let t=[],s=0,i=-1,n=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(U(t)<1)break;let a=V(t,1);n=(a[0]&128)===128,i=a[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(U(t)<2)break;let a=V(t,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(U(t)<8)break;let a=V(t,8),m=new DataView(a.buffer,a.byteOffset,a.length),p=m.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(O);break}i=p*Math.pow(2,32)+m.getUint32(4),s=3}else{if(U(t)<i)break;let a=V(t,i);c.enqueue(L(n?a:Q.decode(a),e)),s=0}if(i===0||i>r){c.enqueue(O);break}}}})}var j=4;function f(r){if(r)return Je(r)}function Je(r){for(var e in f.prototype)r[e]=f.prototype[e];return r}f.prototype.on=f.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};f.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};f.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};f.prototype.emitReserved=f.prototype.emit;f.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};f.prototype.hasListeners=function(r){return!!this.listeners(r).length};var y=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),u=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ce="arraybuffer";function M(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var ze=u.setTimeout,Xe=u.clearTimeout;function g(r,e){e.useNativeTimers?(r.setTimeoutFn=ze.bind(u),r.clearTimeoutFn=Xe.bind(u)):(r.setTimeoutFn=u.setTimeout.bind(u),r.clearTimeoutFn=u.clearTimeout.bind(u))}var $e=1.33;function Se(r){return typeof r=="string"?Qe(r):Math.ceil((r.byteLength||r.size)*$e)}function Qe(r){let e=0,t=0;for(let s=0,i=r.length;s<i;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Oe(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Be(r){let e={},t=r.split("&");for(let s=0,i=t.length;s<i;s++){let n=t[s].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var W=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},_=class extends f{constructor(e){super(),this.writable=!1,g(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new W(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=L(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Oe(e);return t.length?"?"+t:""}};var P=class extends _{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Te(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,xe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=H()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var Ne=!1;try{Ne=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Le=Ne;function je(){}var G=class extends P{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},K=(()=>{class r extends f{constructor(t,s,i){super(),this.createRequest=t,g(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;let s=M(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=je,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Pe);else if(typeof addEventListener=="function"){let r="onpagehide"in u?"pagehide":"unload";addEventListener(r,Pe,!1)}}function Pe(){for(let r in K.requests)K.requests.hasOwnProperty(r)&&K.requests[r].abort()}var Ge=function(){let r=qe({xdomain:!1});return r&&r.responseType!==null}(),w=class extends G{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ge&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K(qe,this.uri(),e)}};function qe(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Le))return new XMLHttpRequest}catch{}if(!e)try{return new u[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var De=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ee=class extends _{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=De?{}:M(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;B(s,this.supportsBinary,n=>{try{this.doWrite(s,n)}catch{}i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Z=u.WebSocket||u.MozWebSocket,k=class extends ee{createSocket(e,t,s){return De?new Z(e,t,s):t?new Z(e,t):new Z(e)}doWrite(e,t){this.ws.send(t)}};var v=class extends _{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Re(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ae();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();let n=()=>{s.read().then(({done:c,value:a})=>{c||(this.onPacket(a),n())}).catch(c=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var te={websocket:k,webtransport:v,polling:w};var Ze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,et=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function x(r){if(r.length>8e3)throw"URI too long";let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let i=Ze.exec(r||""),n={},o=14;for(;o--;)n[et[o]]=i[o]||"";return t!=-1&&s!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=tt(n,n.path),n.queryKey=st(n,n.query),n}function tt(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function st(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,n){i&&(t[i]=n)}),t}var se=typeof addEventListener=="function"&&typeof removeEventListener=="function",Y=[];se&&addEventListener("offline",()=>{Y.forEach(r=>r())},!1);var J=(()=>{class r extends f{constructor(t,s){if(super(),this.binaryType=Ce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){let i=x(t);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=x(s.host).host);g(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Be(this.opts.query)),se&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Y.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let s=Object.assign({},this.opts.query);s.EIO=j,s.transport=t,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Se(n)),i>0&&s>this._maxPayload)return this.writeBuffer.slice(0,i);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,y(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,i){return this._sendPacket("message",t,s,i),this}send(t,s,i){return this._sendPacket("message",t,s,i),this}_sendPacket(t,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let o={type:t,data:s,options:i};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),se&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Y.indexOf(this._offlineEventListener);i!==-1&&Y.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=j,r})(),z=class extends J{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;J.priorWebsocketSuccess=!1;let i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let C=new Error("probe error");C.transport=t.name,this.emitReserved("upgradeError",C)}}))};function n(){s||(s=!0,p(),t.close(),t=null)}let o=b=>{let C=new Error("probe error: "+b);C.transport=t.name,n(),this.emitReserved("upgradeError",C)};function c(){o("transport closed")}function a(){o("socket closed")}function m(b){t&&b.name!==t.name&&n()}let p=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",a),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",a),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}},T=class extends z{constructor(e,t={}){let s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>te[i]).filter(i=>!!i)),super(e,s)}};var ds=T.protocol;function Fe(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=x(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(t&&t.port===s.port?"":":"+s.port),s}var ae={};We(ae,{Decoder:()=>oe,Encoder:()=>ne,PacketType:()=>h,protocol:()=>He});var it=typeof ArrayBuffer=="function",nt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ie=Object.prototype.toString,ot=typeof Blob=="function"||typeof Blob<"u"&&Ie.call(Blob)==="[object BlobConstructor]",ct=typeof File=="function"||typeof File<"u"&&Ie.call(File)==="[object FileConstructor]";function D(r){return it&&(r instanceof ArrayBuffer||nt(r))||ot&&r instanceof Blob||ct&&r instanceof File}function q(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(q(r[t]))return!0;return!1}if(D(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return q(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&q(r[t]))return!0;return!1}function Ue(r){let e=[],t=r.data,s=r;return s.data=re(t,e),s.attachments=e.length,{packet:s,buffers:e}}function re(r,e){if(!r)return r;if(D(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=re(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=re(r[s],e));return t}return r}function Ve(r,e){return r.data=ie(r.data,e),delete r.attachments,r}function ie(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ie(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ie(r[t],e));return r}var at=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],He=5,h=function(r){return r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK",r}(h||{}),ne=class{constructor(e){this.replacer=e}encode(e){return(e.type===h.EVENT||e.type===h.ACK)&&q(e)?this.encodeAsBinary({type:e.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Ue(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}};function Me(r){return Object.prototype.toString.call(r)==="[object Object]"}var oe=class r extends f{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===h.BINARY_EVENT;s||t.type===h.BINARY_ACK?(t.type=s?h.EVENT:h.ACK,this.reconstructor=new ce(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(D(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(h[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===h.BINARY_EVENT||s.type===h.BINARY_ACK){let n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(n,t)}else s.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(r.isPayloadValid(s.type,n))s.data=n;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case h.CONNECT:return Me(t);case h.DISCONNECT:return t===void 0;case h.CONNECT_ERROR:return typeof t=="string"||Me(t);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&at.indexOf(t[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ce=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=Ve(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function l(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var ht=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),A=class extends f{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[l(e,"open",this.onopen.bind(this)),l(e,"packet",this.onpacket.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,n;if(ht.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:h.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let p=this.ids++,b=t.pop();this._registerAckCallback(p,b),o.id=p}let c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;let i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(n),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{let n=(o,c)=>o?i(o):s(c);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case h.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(e);break;case h.ACK:case h.BINARY_ACK:this.onack(e);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...i){s||(s=!0,t.packet({type:h.ACK,id:e,data:i}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function E(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}E.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=Math.floor(e*10)&1?r+t:r-t}return Math.min(r,this.max)|0};E.prototype.reset=function(){this.attempts=0};E.prototype.setMin=function(r){this.ms=r};E.prototype.setMax=function(r){this.max=r};E.prototype.setJitter=function(r){this.jitter=r};var R=class extends f{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,g(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new E({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let i=t.parser||ae;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new T(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let i=l(t,"open",function(){s.onopen(),e&&e()}),n=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=l(t,"error",n);if(this._timeout!==!1){let c=this._timeout,a=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},c);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(l(e,"ping",this.onping.bind(this)),l(e,"data",this.ondata.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this)),l(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){y(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new A(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var F={};function I(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Fe(r,e.path||"/socket.io"),s=t.source,i=t.id,n=t.path,o=F[i]&&n in F[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,a;return c?a=new R(s,e):(F[i]||(F[i]=new R(s,e)),a=F[i]),t.query&&!e.query&&(e.query=t.queryKey),a.socket(t.path,e)}Object.assign(I,{Manager:R,Socket:A,io:I,connect:I});var cr=(()=>{class r{$auth=le(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(`${he.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new fe(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=ue({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{cr as a};
|
|
1
|
+
import{c as pe}from"./chunk-UOC65WET.js";import{j as le}from"./chunk-4WTLH2XC.js";import{f as We,ga as fe,k as he,la as ue,n as X}from"./chunk-U4V4ICSI.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={};constructor(){}connectToNamespace(t){if(this.namespaceConnectionCache[t]){let s=this.namespaceConnectionCache[t];return s.connected=new X,setTimeout(()=>{s.socket.connected&&s.connected.next(void 0)}),s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]}else{let s=this.establishConnectionToNamespace(t);return s.connected=new X,s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]=s,s}}getExistingNamespace(t){return this.namespaceConnectionCache[t]}establishConnectionToNamespace(t){let s=I(`${le.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new he(c=>{s.emit(n,o,a=>{typeof a=="object"&&a.error?c.error(a):c.next(a),c.complete()})})}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=fe({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{cr as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ke}from"./chunk-M6OQT53Y.js";import{a as we}from"./chunk-TJHYTY4K.js";import{v as ye}from"./chunk-QELUTKQF.js";import{g as J,m as M,n as he}from"./chunk-YHABGXDF.js";import{b as G,c as oe,e as W,f as le,g as Z,j as D,k as se,l as q,m as de,n as pe,o as ce,p as me,q as ue,r as _e,s as ge,t as be,u as ve,v as fe,y as K,z as xe}from"./chunk-JOBKDXBH.js";import{d as P,e as Ce}from"./chunk-QR7L4UUP.js";import{b as Se}from"./chunk-OT3IJBCR.js";import{h as V,k as R}from"./chunk-4WTLH2XC.js";import{a as F,b as $}from"./chunk-DJKI5XBW.js";import{$a as t,Ac as o,Bc as l,Cc as Y,Gb as x,Hb as b,Ib as v,Kb as A,Lb as N,M as Q,Mb as T,Nb as _,Ob as i,Pb as n,Qb as c,Ub as w,Xa as X,Xb as f,Yb as g,bd as O,gd as j,h as y,jc as r,kc as p,la as C,lb as B,lc as u,qc as ne,ra as S,rc as ae,sa as k,sc as re,w as E,wc as H,xc as I,yc as L}from"./chunk-U4V4ICSI.js";function Te(a,m){a&1&&(i(0,"div",12),c(1,"i",13),n(),i(2,"p",14),r(3),o(4,"translate"),n()),a&2&&(t(3),p(l(4,1,"reset.no_accessories")))}function Me(a,m){a&1&&(i(0,"div",12),c(1,"i",15),n(),i(2,"ul",16)(3,"li"),r(4),o(5,"translate"),n(),i(6,"li"),r(7),o(8,"translate"),n(),i(9,"li"),r(10),o(11,"translate"),n()(),i(12,"ngb-alert",17)(13,"p",18),r(14),o(15,"translate"),n()()),a&2&&(t(4),p(l(5,5,"reset.accessory_all.list_1")),t(3),p(l(8,7,"reset.accessory_all.list_2")),t(3),p(l(11,9,"reset.accessory_all.list_3")),t(2),_("dismissible",!1),t(2),p(l(15,11,"reset.action_is_irreversible")))}function Fe(a,m){if(a&1){let e=w();i(0,"button",19),o(1,"translate"),f("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(2),o(3,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),x("aria-label",l(1,3,"form.button_close")),t(2),u(" ",l(3,5,"form.button_close")," ")}}function Ve(a,m){if(a&1){let e=w();i(0,"button",20),o(1,"translate"),f("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(2),o(3,"translate"),n()}a&2&&(x("aria-label",l(1,2,"form.button_close")),t(2),u(" ",l(3,4,"form.button_close")," "))}function Re(a,m){a&1&&(r(0),o(1,"translate")),a&2&&u(" ",l(1,1,"form.button_remove")," ")}function De(a,m){a&1&&c(0,"i",22)}function Pe(a,m){if(a&1){let e=w();i(0,"button",21),f("click",function(){S(e);let s=g();return k(s.onResetCachedAccessoriesClick())}),b(1,Re,2,3),b(2,De,1,0,"i",22),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),v(e.clicked?-1:1),t(),v(e.clicked?2:-1)}}var Ee=(()=>{class a{$activeModal=C(M);$api=C(R);$router=C(P);$toastr=C(V);$translate=C(F);clicked=!1;cachedAccessories=[];constructor(){}ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return y(this,null,function*(){try{this.cachedAccessories=yield E(this.$api.get("/server/cached-accessories"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}onResetCachedAccessoriesClick(){return this.clicked=!0,this.$api.put("/server/reset-cached-accessories",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.delete_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),n(),i(5,"button",3),o(6,"translate"),f("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),b(8,Te,5,3),b(9,Me,16,13),n(),i(10,"div",5)(11,"div",6),b(12,Fe,4,7,"button",7),n(),i(13,"div",8),b(14,Ve,4,6,"button",9),n(),i(15,"div",10),b(16,Pe,3,3,"button",11),n()()()),d&2&&(t(3),p(l(4,8,"reset.accessory_all.title")),t(2),_("disabled",s.clicked),x("aria-label",l(6,10,"form.button_close")),t(3),v(s.cachedAccessories.length===0?8:-1),t(),v(s.cachedAccessories.length>0?9:-1),t(3),v(s.cachedAccessories.length>0?12:-1),t(2),v(s.cachedAccessories.length===0?14:-1),t(2),v(s.cachedAccessories.length>0?16:-1))},dependencies:[J,$],encapsulation:2})}return a})();var He=(a,m)=>({"green-text":a,"grey-text":m}),Le=(a,m)=>({"btn-danger":a,"btn-elegant":m}),Oe=(a,m,e)=>({"fa-broom":a,"fa-undo":m,"fa-spinner fa-pulse":e});function Ue(a,m){a&1&&(i(0,"div",12),c(1,"i",13),n(),i(2,"p",14),r(3),o(4,"translate"),n()),a&2&&(t(3),p(l(4,1,"reset.bridge_accessories.empty")))}function ze(a,m){if(a&1){let e=w();i(0,"li",18)(1,"span"),r(2),c(3,"br"),i(4,"small",19),c(5,"i",20),r(6),o(7,"translate"),i(8,"span",21),r(9),n()()(),i(10,"button",22),o(11,"translate"),f("click",function(){let s=S(e).$implicit,h=g(2);return k(h.toggleList(s._id))}),c(12,"i",23),n()()}if(a&2){let e=m.$implicit,d=g(2);t(2),u(" ",e.name," "),t(3),_("ngClass",I(12,He,e._isPaired,!e._isPaired)),t(),u(" ",l(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),_("disabled",d.clicked)("ngClass",I(15,Le,!d.toDelete.includes(e._id),d.toDelete.includes(e._id))),x("aria-label",l(11,10,"form.button_delete")),t(2),_("ngClass",L(18,Oe,!d.toDelete.includes(e._id),d.toDelete.includes(e._id)&&!d.clicked,d.toDelete.includes(e._id)&&d.clicked))}}function je(a,m){if(a&1&&(i(0,"div",12),c(1,"i",15),n(),i(2,"ul",16)(3,"li"),r(4),o(5,"translate"),n(),i(6,"li"),r(7),o(8,"translate"),n(),i(9,"li"),r(10),o(11,"translate"),n()(),i(12,"ul",17),N(13,ze,13,22,"li",18,A),n()),a&2){let e=g();t(4),p(l(5,3,"reset.bridge_accessories.list_1")),t(3),p(l(8,5,"reset.clear_cache_single.list_3")),t(3),p(l(11,7,"reset.bridge_accessories.list_2")),t(3),T(e.pairings)}}function Ge(a,m){if(a&1){let e=w();i(0,"button",24),f("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),u(" ",l(2,2,"form.button_close")," ")}}function We(a,m){if(a&1){let e=w();i(0,"button",25),f("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),n()}a&2&&(t(),u(" ",l(2,1,"form.button_close")," "))}function qe(a,m){if(a&1&&r(0),a&2){let e=g(3);u(" (",e.toDelete.length,") ")}}function Ke(a,m){if(a&1&&(r(0),o(1,"translate"),b(2,qe,1,1)),a&2){let e=g(2);u(" ",l(1,2,"form.button_remove")," "),t(2),v(e.toDelete.length>0?2:-1)}}function Je(a,m){a&1&&c(0,"i",27)}function Qe(a,m){if(a&1){let e=w();i(0,"button",26),f("click",function(){S(e);let s=g();return k(s.cleanBridges())}),b(1,Ke,3,4),b(2,Je,1,0,"i",27),n()}if(a&2){let e=g();_("disabled",!e.toDelete.length||e.clicked),t(),v(e.clicked?-1:1),t(),v(e.clicked?2:-1)}}var Be=(()=>{class a{$activeModal=C(M);$api=C(R);$router=C(P);$toastr=C(V);$translate=C(F);clicked=!1;pairings=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{this.pairings=(yield E(this.$api.get("/server/pairings"))).filter(e=>e._category==="bridge"&&!e._main).sort((e,d)=>e.name.localeCompare(d.name))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e){this.toDelete.includes(e)?this.toDelete=this.toDelete.filter(d=>d!==e):this.toDelete.push(e)}cleanBridges(){return this.clicked=!0,this.$api.delete("/server/pairings/accessories",{body:this.toDelete.map(e=>({id:e}))}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-broom","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),n(),i(5,"button",3),o(6,"translate"),f("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),b(8,Ue,5,3),b(9,je,15,9),n(),i(10,"div",5)(11,"div",6),b(12,Ge,3,4,"button",7),n(),i(13,"div",8),b(14,We,3,3,"button",9),n(),i(15,"div",10),b(16,Qe,3,3,"button",11),n()()()),d&2&&(t(3),p(l(4,8,"reset.bridge_accessories.title")),t(2),_("disabled",s.clicked),x("aria-label",l(6,10,"form.button_close")),t(3),v(s.pairings.length===0?8:-1),t(),v(s.pairings.length>0?9:-1),t(3),v(s.pairings.length>0?12:-1),t(2),v(s.pairings.length===0?14:-1),t(2),v(s.pairings.length>0?16:-1))},dependencies:[O,$],encapsulation:2})}return a})();function Xe(a,m){a&1&&(r(0),o(1,"translate")),a&2&&u(" ",l(1,1,"form.button_reset")," ")}function Ye(a,m){a&1&&c(0,"i",16)}var Ie=(()=>{class a{$activeModal=C(M);$api=C(R);$route=C(P);$toastr=C(V);$translate=C(F);clicked;constructor(){}onResetHomebridgeAccessoryClick(){return this.clicked=!0,this.$api.put("/server/reset-homebridge-accessory",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_reset"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$route.navigate(["/restart"])},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:38,vars:33,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),n(),i(5,"button",3),o(6,"translate"),f("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4)(8,"div",5),c(9,"i",6),n(),i(10,"ul",7)(11,"li"),r(12),o(13,"translate"),n(),i(14,"li"),r(15),o(16,"translate"),n(),i(17,"li"),r(18),o(19,"translate"),n(),i(20,"li"),r(21),o(22,"translate"),n()(),i(23,"ngb-alert",8)(24,"p",9),r(25),o(26,"translate"),n()()(),i(27,"div",10)(28,"div",11)(29,"button",12),o(30,"translate"),f("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(31),o(32,"translate"),n()(),c(33,"div",13),i(34,"div",14)(35,"button",15),f("click",function(){return s.onResetHomebridgeAccessoryClick()}),b(36,Xe,2,3),b(37,Ye,1,0,"i",16),n()()()()),d&2&&(t(3),p(l(4,15,"reset.bridge_all.title")),t(2),_("disabled",s.clicked),x("aria-label",l(6,17,"form.button_close")),t(7),p(l(13,19,"reset.bridge_all.list_1")),t(3),p(l(16,21,"reset.bridge_all.list_2")),t(3),p(l(19,23,"reset.bridge_all.list_3")),t(3),p(l(22,25,"reset.bridge_all.list_4")),t(2),_("dismissible",!1),t(2),p(l(26,27,"reset.action_is_irreversible")),t(4),_("disabled",s.clicked),x("aria-label",l(30,29,"form.button_close")),t(2),u(" ",l(32,31,"form.button_close")," "),t(4),_("disabled",s.clicked),t(),v(s.clicked?-1:36),t(),v(s.clicked?37:-1))},dependencies:[J,$],encapsulation:2})}return a})();var ee=(a,m)=>({"green-text":a,"grey-text":m}),te=(a,m)=>({"btn-danger":a,"btn-elegant":m}),$e=(a,m,e)=>({"fa-refresh":a,"fa-undo":m,"fa-spinner fa-pulse":e}),Ze=(a,m,e)=>({"fa-trash":a,"fa-undo":m,"fa-spinner fa-pulse":e});function et(a,m){a&1&&(i(0,"div",12),c(1,"i",13),n(),i(2,"p",14),r(3),o(4,"translate"),n()),a&2&&(t(3),p(l(4,1,"reset.bridges.empty")))}function tt(a,m){if(a&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),n(),r(10),o(11,"titlecase"),n()(),i(12,"button",24),o(13,"translate"),f("click",function(){let s=S(e).$implicit,h=g(3);return k(h.toggleList(s._id,!1))}),c(14,"i",25),n()()}if(a&2){let e=m.$implicit,d=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",I(15,ee,e._isPaired,!e._isPaired)),t(),u(" ",l(7,9,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),u(" \xB7 ",e._main?"Homebridge":l(11,11,e._category)," "),t(2),_("disabled",d.clicked)("ngClass",I(18,te,!d.isInList(e._id),d.isInList(e._id))),x("aria-label",l(13,13,"form.button_unpair")),t(2),_("ngClass",L(21,$e,!d.isInList(e._id),d.isInList(e._id)&&!d.clicked,d.isInList(e._id)&&d.clicked))}}function it(a,m){if(a&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),n(),i(5,"p",19),r(6),o(7,"translate"),n()(),N(8,tt,15,25,"li",20,A),n()),a&2){let e=g(2);t(3),p(l(4,2,"reset.bridge_ind.head_non_child")),t(3),p(l(7,4,"reset.bridge_ind.desc_non_child")),t(2),T(e.pairingsNonChild)}}function nt(a,m){if(a&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),n()()(),i(10,"button",24),o(11,"translate"),f("click",function(){let s=S(e).$implicit,h=g(3);return k(h.toggleList(s._id,!0))}),c(12,"i",25),n()()}if(a&2){let e=m.$implicit,d=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",I(12,ee,e._isPaired,!e._isPaired)),t(),u(" ",l(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),_("disabled",d.clicked)("ngClass",I(15,te,!d.isInList(e._id),d.isInList(e._id))),x("aria-label",l(11,10,"form.button_unpair")),t(2),_("ngClass",L(18,$e,!d.isInList(e._id),d.isInList(e._id)&&!d.clicked,d.isInList(e._id)&&d.clicked))}}function at(a,m){if(a&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),n(),i(5,"p",19),r(6),o(7,"translate"),n()(),N(8,nt,13,22,"li",20,A),n()),a&2){let e=g(2);t(3),p(l(4,2,"reset.bridge_ind.head_child_active")),t(3),p(l(7,4,"reset.bridge_ind.desc_child_active")),t(2),T(e.pairingsChildActive)}}function rt(a,m){if(a&1){let e=w();i(0,"li",20)(1,"span"),r(2),c(3,"br"),i(4,"small",21),c(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),n()()(),i(10,"button",24),o(11,"translate"),f("click",function(){let s=S(e).$implicit,h=g(3);return k(h.toggleList(s._id,!1))}),c(12,"i",25),n()()}if(a&2){let e=m.$implicit,d=g(3);t(2),u(" ",e.name," "),t(3),_("ngClass",I(12,ee,e._isPaired,!e._isPaired)),t(),u(" ",l(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),_("disabled",d.clicked)("ngClass",I(15,te,!d.isInList(e._id),d.isInList(e._id))),x("aria-label",l(11,10,"form.button_unpair")),t(2),_("ngClass",L(18,Ze,!d.isInList(e._id),d.isInList(e._id)&&!d.clicked,d.isInList(e._id)&&d.clicked))}}function ot(a,m){if(a&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),n(),i(5,"p",19),r(6),o(7,"translate"),n()(),N(8,rt,13,22,"li",20,A),n()),a&2){let e=g(2);t(3),p(l(4,2,"reset.bridge_ind.head_child_stale")),t(3),p(l(7,4,"reset.bridge_ind.desc_child_stale")),t(2),T(e.pairingsChildStale)}}function lt(a,m){if(a&1&&(i(0,"div",12),c(1,"i",15),n(),b(2,it,10,6,"ul",16),b(3,at,10,6,"ul",16),b(4,ot,10,6,"ul",16)),a&2){let e=g();t(2),v(e.pairingsNonChild.length>0?2:-1),t(),v(e.pairingsChildActive.length>0?3:-1),t(),v(e.pairingsChildStale.length>0?4:-1)}}function st(a,m){if(a&1){let e=w();i(0,"button",26),f("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),n()}if(a&2){let e=g();_("disabled",e.clicked),t(),u(" ",l(2,2,"form.button_close")," ")}}function dt(a,m){if(a&1){let e=w();i(0,"button",27),f("click",function(){S(e);let s=g();return k(s.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),n()}a&2&&(t(),u(" ",l(2,1,"form.button_close")," "))}function pt(a,m){if(a&1&&r(0),a&2){let e=g(3);u(" (",e.toDelete.length,") ")}}function ct(a,m){if(a&1&&(r(0),o(1,"translate"),b(2,pt,1,1)),a&2){let e=g(2);u(" ",l(1,2,"form.button_reset")," "),t(2),v(e.toDelete.length>0?2:-1)}}function mt(a,m){a&1&&c(0,"i",29)}function ut(a,m){if(a&1){let e=w();i(0,"button",28),f("click",function(){S(e);let s=g();return k(s.removeBridges())}),b(1,ct,3,4),b(2,mt,1,0,"i",29),n()}if(a&2){let e=g();_("disabled",!e.toDelete.length||e.clicked),t(),v(e.clicked?-1:1),t(),v(e.clicked?2:-1)}}var Ae=(()=>{class a{$activeModal=C(M);$api=C(R);$router=C(P);$toastr=C(V);$translate=C(F);clicked=!1;pairingsNonChild=[];pairingsChildActive=[];pairingsChildStale=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{let e=(yield E(this.$api.get("/server/pairings"))).filter(d=>!d._main).sort((d,s)=>d.name.localeCompare(s.name));this.pairingsChildActive=e.filter(d=>d._category==="bridge"&&!d._couldBeStale),this.pairingsNonChild=e.filter(d=>d._category!=="bridge"),this.pairingsChildStale=e.filter(d=>d._category==="bridge"&&d._couldBeStale)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e,d=!1){this.toDelete.some(s=>s.id===e)?this.toDelete=this.toDelete.filter(s=>s.id!==e):this.toDelete.push({id:e,resetPairingInfo:d})}isInList(e){return this.toDelete.some(d=>d.id===e)}removeBridges(){return this.clicked=!0,this.$api.delete("/server/pairings",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.bridge_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.bridge_ind.fail"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"text-center","mb-0"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"list-group-item"],[1,"mb-1","text-center"],[1,"mb-0","small","grey-text","text-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),n(),i(5,"button",3),o(6,"translate"),f("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4),b(8,et,5,3),b(9,lt,5,3),n(),i(10,"div",5)(11,"div",6),b(12,st,3,4,"button",7),n(),i(13,"div",8),b(14,dt,3,3,"button",9),n(),i(15,"div",10),b(16,ut,3,3,"button",11),n()()()),d&2&&(t(3),p(l(4,8,"reset.bridge_ind.title")),t(2),_("disabled",s.clicked),x("aria-label",l(6,10,"form.button_close")),t(3),v(s.pairingsChildActive.length===0&&s.pairingsChildStale.length===0&&s.pairingsNonChild.length===0?8:-1),t(),v(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?9:-1),t(3),v(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?12:-1),t(2),v(s.pairingsChildActive.length===0&&s.pairingsChildStale.length===0&&s.pairingsNonChild.length===0?14:-1),t(2),v(s.pairingsChildActive.length>0||s.pairingsChildStale.length>0||s.pairingsNonChild.length>0?16:-1))},dependencies:[O,j,$],encapsulation:2})}return a})();function gt(a,m){if(a&1){let e=w();i(0,"li",10)(1,"span")(2,"label",17)(3,"input",18),re("ngModelChange",function(s){let h=S(e).$implicit;return ae(h.selected,s)||(h.selected=s),k(s)}),n(),i(4,"span"),r(5),n(),c(6,"span",19),n()(),i(7,"span",20),r(8),n()()}if(a&2){let e=m.$implicit;t(2),_("for","adapter"+e.iface),t(),_("id","adapter"+e.iface),ne("ngModel",e.selected),t(2),p(e.iface),t(3),p(e.ip4||e.ip6)}}var Ne=(()=>{class a{$activeModal=C(M);availableNetworkAdapters=[];bridgeNetworkAdapters=[];constructor(){}submit(){this.$activeModal.close(this.availableNetworkAdapters.filter(e=>e.selected).map(e=>e.iface))}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],inputs:{availableNetworkAdapters:"availableNetworkAdapters",bridgeNetworkAdapters:"bridgeNetworkAdapters"},decls:35,vars:24,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-ethernet","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","flex-row","justify-content-between"],[1,"list-group-item","d-flex","flex-row","flex-wrap","justify-content-between"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"],[1,"hb-uix-switch","d-inline","pe-3",3,"for"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"hb-uix-slider","hb-uix-round"],[1,"font-monospace"]],template:function(d,s){d&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),n(),i(5,"button",3),o(6,"translate"),f("click",function(){return s.$activeModal.dismiss("Dismiss")}),n()(),i(7,"div",4)(8,"div",5),c(9,"i",6),n(),i(10,"ul",7)(11,"li"),r(12),o(13,"translate"),n()(),i(14,"ul",8)(15,"li",9)(16,"strong"),r(17),o(18,"translate"),n(),i(19,"strong"),r(20),o(21,"translate"),n()(),N(22,gt,9,5,"li",10,A),n()(),i(24,"div",11)(25,"div",12)(26,"button",13),o(27,"translate"),f("click",function(){return s.$activeModal.dismiss("Dismiss")}),r(28),o(29,"translate"),n()(),c(30,"div",14),i(31,"div",15)(32,"button",16),f("click",function(){return s.submit()}),r(33),o(34,"translate"),n()()()()),d&2&&(t(3),p(l(4,8,"settings.network.title_network_interfaces")),t(2),x("aria-label",l(6,10,"form.button_close")),t(7),p(l(13,12,"settings.network.message_network_interface")),t(5),p(l(18,14,"settings.network.label_interface_name")),t(3),p(l(21,16,"settings.network.label_ip_address")),t(2),T(s.availableNetworkAdapters),t(4),x("aria-label",l(27,18,"form.button_close")),t(2),u(" ",l(29,20,"form.button_close")," "),t(5),u(" ",l(34,22,"form.button_save")," "))},dependencies:[K,G,W,q,$],encapsulation:2})}return a})();var ie=a=>({"is-invalid":a}),bt=a=>({file:a}),vt=a=>({link:a}),ft=a=>({"fa-pulse":a}),xt=(a,m)=>({"badge-danger":a,"badge-info":m});function ht(a,m){a&1&&(i(0,"li",22)(1,"small",23),r(2),o(3,"translate"),n(),i(4,"button",24),o(5,"translate"),r(6),o(7,"translate"),n()()),a&2&&(t(2),p(l(3,3,"settings.changes.saved")),t(2),x("aria-label",l(5,5,"menu.tooltip_restart")),t(2),u(" ",l(7,7,"menu.tooltip_restart")," "))}function Ct(a,m){if(a&1){let e=w();i(0,"ul",5)(1,"li",14)(2,"span"),r(3," Homebridge Name "),n(),i(4,"div",15),c(5,"input",16),o(6,"translate"),n()(),i(7,"li",17)(8,"span",18),r(9),o(10,"translate"),n(),i(11,"button",19),o(12,"translate"),f("click",function(){S(e);let s=g();return k(s.openUiSettings())}),c(13,"i",20),n()(),i(14,"li",17)(15,"span",18),r(16),o(17,"translate"),n(),i(18,"button",19),o(19,"translate"),f("click",function(){S(e);let s=g();return k(s.openBackupModal())}),c(20,"i",20),n()(),i(21,"li",17)(22,"span",18),r(23),o(24,"translate"),n(),i(25,"a",21),o(26,"translate"),c(27,"i",20),n()(),b(28,ht,8,9,"li",22),n()}if(a&2){let e=g();t(5),_("formControl",e.hbNameFormControl)("ngClass",H(24,ie,e.isInvalidHbName)),x("aria-label",l(6,10,"settings.network.port_ui")),t(4),u(" ",l(10,12,"menu.label_settings_advanced")," "),t(2),x("aria-label",l(12,14,"menu.label_settings_advanced")),t(5),u(" ",l(17,16,"backup.title_backup")," "),t(2),x("aria-label",l(19,18,"backup.title_backup")),t(5),u(" ",l(24,20,"menu.tooltip_user_accounts")," "),t(2),x("aria-label",l(26,22,"menu.tooltip_user_accounts")),t(3),v(e.hasChangedHbName&&!e.isInvalidHbName?28:-1)}}function St(a,m){a&1&&(i(0,"li",22)(1,"small",23),r(2),o(3,"translate"),n(),i(4,"button",24),o(5,"translate"),r(6),o(7,"translate"),n()()),a&2&&(t(2),p(l(3,3,"settings.changes.saved")),t(2),x("aria-label",l(5,5,"menu.tooltip_restart")),t(2),u(" ",l(7,7,"menu.tooltip_restart")," "))}function kt(a,m){if(a&1){let e=w();i(0,"ul",6)(1,"li",14),r(2),o(3,"translate"),i(4,"div",25)(5,"select",26),f("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("lang",s))}),i(6,"option",27),r(7),o(8,"translate"),n(),i(9,"option",28),r(10,"Bulgarian (bg)"),n(),i(11,"option",29),r(12,"Catalan (ca)"),n(),i(13,"option",30),r(14,"Chinese - Simplified (zh-CN)"),n(),i(15,"option",31),r(16,"Chinese - Traditional (zh-TW)"),n(),i(17,"option",32),r(18,"Czech (cs)"),n(),i(19,"option",33),r(20,"Dutch (nl)"),n(),i(21,"option",34),r(22,"English (en)"),n(),i(23,"option",35),r(24,"Finnish (fi)"),n(),i(25,"option",36),r(26,"French (fr)"),n(),i(27,"option",37),r(28,"German (de)"),n(),i(29,"option",38),r(30,"Hebrew (he)"),n(),i(31,"option",39),r(32,"Hungarian (hu)"),n(),i(33,"option",40),r(34,"Indonesian (id)"),n(),i(35,"option",41),r(36,"Italian (it)"),n(),i(37,"option",42),r(38,"Japanese (ja)"),n(),i(39,"option",43),r(40,"Korean (ko)"),n(),i(41,"option",44),r(42,"Macedonian (mk)"),n(),i(43,"option",45),r(44,"Norwegian (no)"),n(),i(45,"option",46),r(46,"Polish (pl)"),n(),i(47,"option",47),r(48,"Portuguese (Brazil)"),n(),i(49,"option",48),r(50,"Portuguese (Portugal)"),n(),i(51,"option",49),r(52,"Russian (ru)"),n(),i(53,"option",50),r(54,"Slovenian (sl)"),n(),i(55,"option",51),r(56,"Spanish (es)"),n(),i(57,"option",52),r(58,"Swedish (sv)"),n(),i(59,"option",53),r(60,"Thai (th)"),n(),i(61,"option",54),r(62,"Turkish (tr)"),n(),i(63,"option",55),r(64,"Ukrainian (uk)"),n()()()(),i(65,"li",14),r(66),o(67,"translate"),i(68,"div",25)(69,"select",26),f("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("theme",s))}),i(70,"option",56),r(71),o(72,"translate"),n(),i(73,"option",57),r(74),o(75,"translate"),n(),i(76,"option",58),r(77),o(78,"translate"),n(),i(79,"option",59),r(80),o(81,"translate"),n(),i(82,"option",60),r(83),o(84,"translate"),n(),i(85,"option",61),r(86),o(87,"translate"),n(),i(88,"option",62),r(89),o(90,"translate"),n(),i(91,"option",63),r(92),o(93,"translate"),n(),i(94,"option",64),r(95),o(96,"translate"),n(),i(97,"option",65),r(98),o(99,"translate"),n(),i(100,"option",66),r(101),o(102,"translate"),n(),i(103,"option",67),r(104),o(105,"translate"),n(),i(106,"option",68),r(107),o(108,"translate"),n()()()(),i(109,"li",14),r(110),o(111,"translate"),i(112,"div",25)(113,"select",26),f("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("lightingMode",s))}),i(114,"option",27),r(115),o(116,"translate"),n(),i(117,"option",69),r(118),o(119,"translate"),n(),i(120,"option",70),r(121),o(122,"translate"),n()()()(),i(123,"li",14),r(124),o(125,"translate"),i(126,"div",25)(127,"select",26),f("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("menuMode",s))}),i(128,"option",71),r(129),o(130,"translate"),n(),i(131,"option",72),r(132),o(133,"translate"),n()()()(),i(134,"li",14)(135,"span"),r(136),o(137,"translate"),c(138,"br")(139,"small",73),o(140,"translate"),n(),i(141,"div",25)(142,"input",74),f("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("loginWallpaper",s))}),n()()(),i(143,"li",14),r(144),o(145,"translate"),i(146,"div",25)(147,"select",26),f("ngModelChange",function(s){S(e);let h=g();return k(h.saveUiSettingChange("tempUnits",s))}),i(148,"option",75),r(149),o(150,"translate"),n(),i(151,"option",76),r(152),o(153,"translate"),n()()()(),b(154,St,8,9,"li",22),n()}if(a&2){let e=g();t(2),u(" ",l(3,35,"settings.display.lang")," "),t(3),_("ngModel",e.$settings.env.lang),t(2),p(l(8,37,"form.select.auto")),t(59),u(" ",l(67,39,"settings.display.theme")," "),t(3),_("ngModel",e.$settings.theme),t(2),p(l(72,41,"settings.display.orange")),t(3),p(l(75,43,"settings.display.red")),t(3),p(l(78,45,"settings.display.pink")),t(3),p(l(81,47,"settings.display.purple")),t(3),p(l(84,49,"settings.display.deep_purple")),t(3),p(l(87,51,"settings.display.indigo")),t(3),p(l(90,53,"settings.display.blue")),t(3),p(l(93,55,"settings.display.bluegrey")),t(3),p(l(96,57,"settings.display.cyan")),t(3),p(l(99,59,"settings.display.green")),t(3),p(l(102,61,"settings.display.teal")),t(3),p(l(105,63,"settings.display.grey")),t(3),p(l(108,65,"settings.display.brown")),t(3),u(" ",l(111,67,"settings.display.lighting_mode")," "),t(3),_("ngModel",e.$settings.lightingMode),t(2),p(l(116,69,"form.select.auto")),t(3),p(l(119,71,"settings.display.light")),t(3),p(l(122,73,"settings.display.dark")),t(3),u(" ",l(125,75,"settings.display.menu_mode")," "),t(3),_("ngModel",e.$settings.menuMode),t(2),p(l(130,77,"settings.display.menu_default")),t(3),p(l(133,79,"settings.display.menu_freeze")),t(4),u(" ",l(137,81,"settings.display.login_wallpaper")),t(3),_("innerHTML",Y(140,83,"settings.display.login_wallpaper_desc",H(92,bt,e.file)),X),t(3),_("ngModel",e.$settings.loginWallpaper),t(2),u(" ",l(145,86,"settings.display.temp_units")," "),t(3),_("ngModel",e.$settings.env.temperatureUnits),t(2),p(l(150,88,"settings.display.temp_units.c")),t(3),p(l(153,90,"settings.display.temp_units.f")),t(2),v(e.hasChangedLoginWallpaper?154:-1)}}function wt(a,m){a&1&&(i(0,"li",17)(1,"span"),r(2),o(3,"translate"),c(4,"br"),i(5,"small",77),r(6),o(7,"translate"),n()(),i(8,"a",87),o(9,"translate"),c(10,"i",20),n()()),a&2&&(t(2),u(" ",l(3,3,"menu.docker.startup_script")),t(4),p(l(7,5,"platform.docker.script_help")),t(2),x("aria-label",l(9,7,"menu.docker.startup_script")))}function yt(a,m){a&1&&(i(0,"li",22)(1,"small",23),r(2),o(3,"translate"),n(),i(4,"button",24),o(5,"translate"),r(6),o(7,"translate"),n()()),a&2&&(t(2),p(l(3,3,"settings.changes.saved")),t(2),x("aria-label",l(5,5,"menu.tooltip_restart")),t(2),u(" ",l(7,7,"menu.tooltip_restart")," "))}function Et(a,m){if(a&1&&(i(0,"ul",8)(1,"li",17)(2,"span"),r(3),o(4,"translate"),i(5,"code"),r(6,"-D"),n(),c(7,"br"),i(8,"small",77),r(9),o(10,"translate"),n()(),c(11,"input",78),o(12,"translate"),c(13,"label",79),n(),i(14,"li",17)(15,"span"),r(16),o(17,"translate"),i(18,"code"),r(19,"-I"),n(),c(20,"br"),i(21,"small",77),r(22),o(23,"translate"),n()(),c(24,"input",80),o(25,"translate"),c(26,"label",81),n(),i(27,"li",17)(28,"span"),r(29),o(30,"translate"),i(31,"code"),r(32,"-K"),n(),c(33,"br"),i(34,"small",77),r(35),o(36,"translate"),n()(),c(37,"input",82),o(38,"translate"),c(39,"label",83),n(),i(40,"li",14)(41,"span")(42,"span",84),r(43,"DEBUG"),n(),c(44,"br")(45,"small",73),o(46,"translate"),n(),i(47,"div",25),c(48,"input",85),n()(),i(49,"li",14)(50,"span")(51,"span",84),r(52,"NODE_OPTIONS"),n(),c(53,"br"),i(54,"small",77),r(55),o(56,"translate"),n()(),i(57,"div",25),c(58,"input",86),n()(),b(59,wt,11,9,"li",17),b(60,yt,8,9,"li",22),n()),a&2){let e=g();t(3),u(" ",l(4,13,"settings.startup.debug")," "),t(6),u(" ",l(10,15,e.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),t(2),x("aria-label",l(12,17,"settings.startup.debug")),t(5),u(" ",l(17,19,"settings.startup.insecure")," "),t(6),p(l(23,21,"settings.startup.insecure_desc")),t(2),x("aria-label",l(25,23,"settings.startup.insecure")),t(5),u(" ",l(30,25,"settings.startup.keep_accessories")," "),t(6),p(l(36,27,"settings.startup.keep_accessories_desc")),t(2),x("aria-label",l(38,29,"settings.startup.keep_accessories")),t(8),_("innerHTML",Y(46,31,"settings.service.debug_tooltip",H(36,vt,e.linkDebug)),X),t(10),p(l(56,34,"settings.service.node_tooltip")),t(4),v(e.$settings.env.runningInDocker?59:-1),t(),v(e.hasChangedService?60:-1)}}function Bt(a,m){a&1&&c(0,"i",99)}function It(a,m){if(a&1&&(i(0,"span",89),b(1,Bt,1,0,"i",99),r(2),i(3,"span",100),r(4),o(5,"translate"),n()()),a&2){let e=m.$implicit;_("ngClass",I(6,xt,e.missing,!e.missing)),t(),v(e.missing?1:-1),t(),u(" ",e.iface,": "),t(2),p(e.missing?l(5,4,"settings.mdns_advertiser_not_connected"):e.ip4||e.ip6)}}function $t(a,m){a&1&&(i(0,"option",93),r(1),o(2,"translate"),n()),a&2&&(t(),u("Avahi (",l(2,1,"settings.mdns_advertiser_rec"),")"))}function At(a,m){a&1&&(i(0,"option",96),r(1),o(2,"translate"),n()),a&2&&(t(),u("systemd-resolved (",l(2,1,"settings.mdns_advertiser_exp"),")"))}function Nt(a,m){a&1&&(i(0,"li",22)(1,"small",23),r(2),o(3,"translate"),n(),i(4,"button",24),o(5,"translate"),r(6),o(7,"translate"),n()()),a&2&&(t(2),p(l(3,3,"settings.changes.saved")),t(2),x("aria-label",l(5,5,"menu.tooltip_restart")),t(2),u(" ",l(7,7,"menu.tooltip_restart")," "))}function Tt(a,m){if(a&1){let e=w();i(0,"ul",9)(1,"li",17)(2,"span",18),r(3),o(4,"translate"),c(5,"br"),i(6,"div",88),r(7),o(8,"translate"),n(),N(9,It,6,9,"span",89,A),n(),i(11,"button",90),o(12,"translate"),f("click",function(){S(e);let s=g();return k(s.selectNetworkInterfaces())}),c(13,"i",91),n()(),i(14,"li",14)(15,"span"),r(16),o(17,"translate"),c(18,"br"),i(19,"small",77),r(20),o(21,"translate"),n()(),i(22,"div",25)(23,"select",92),o(24,"translate"),b(25,$t,3,3,"option",93),i(26,"option",94),r(27),o(28,"translate"),n(),i(29,"option",95),r(30,"Bonjour HAP"),n(),b(31,At,3,3,"option",96),n()()(),i(32,"li",14)(33,"span"),r(34),o(35,"translate"),c(36,"br"),i(37,"small",77),r(38),o(39,"translate"),n()(),i(40,"div",25),c(41,"input",97),o(42,"translate"),n()(),i(43,"li",14)(44,"span"),r(45),o(46,"translate"),c(47,"br"),i(48,"small",77),r(49),o(50,"translate"),n()(),i(51,"div",25),c(52,"input",98),o(53,"translate"),n()(),b(54,Nt,8,9,"li",22),n()}if(a&2){let e=g();t(3),u(" ",l(4,22,"settings.network.title_network_interfaces")),t(4),p(l(8,24,"settings.network.message_network_interface")),t(2),T(e.bridgeNetworkAdapters),t(2),_("disabled",!e.availableNetworkAdapters.length),x("aria-label",l(12,26,"settings.network.title_network_interfaces")),t(2),_("ngClass",H(48,ft,!e.availableNetworkAdapters.length)),t(3),u(" ",l(17,28,"settings.mdns_advertiser")),t(4),p(l(21,30,"settings.mdns_advertiser_help")),t(3),_("formControl",e.legacyMdnsFormControl),x("aria-label",l(24,32,"settings.mdns_advertiser")),t(2),v(e.showAvahiMdnsOption?25:-1),t(2),u(" Ciao ",e.showAvahiMdnsOption?"":"("+l(28,34,"settings.mdns_advertiser_rec")+")"," "),t(4),v(e.showResolvedMdnsOption?31:-1),t(3),u(" ",l(35,36,"settings.network.port_hb")),t(4),p(l(39,38,"settings.network.port_hb_desc")),t(3),_("formControl",e.hbPortFormControl)("ngClass",H(50,ie,e.isInvalidHbPort)),x("aria-label",l(42,40,"settings.network.port_ui")),t(4),u(" ",l(46,42,"settings.network.port_ui")),t(4),p(l(50,44,"settings.network.port_ui_desc")),t(3),_("ngClass",H(52,ie,e.isInvalidHbUiPort)),x("aria-label",l(53,46,"settings.network.port_ui")),t(2),v(e.hasChangedHbPort&&!e.isInvalidHbPort||e.hasChangedUiSettings||e.hasChangedMdns||e.hasChangedBridgeNetworkAdapters?54:-1)}}function Mt(a,m){a&1&&(i(0,"p",10),r(1),o(2,"translate"),n()),a&2&&(t(),p(l(2,1,"settings.cache.desc")))}function Ft(a,m){if(a&1){let e=w();i(0,"ul",11)(1,"li",17)(2,"span",18),r(3),o(4,"translate"),c(5,"br"),i(6,"small",77),r(7),o(8,"translate"),n()(),i(9,"button",19),o(10,"translate"),f("click",function(){S(e);let s=g();return k(s.removeSingleCachedAccessories())}),c(11,"i",20),n()(),i(12,"li",17)(13,"span",18),r(14),o(15,"translate"),c(16,"br"),i(17,"small",77),r(18),o(19,"translate"),n()(),i(20,"button",19),o(21,"translate"),f("click",function(){S(e);let s=g();return k(s.removeBridgeAccessories())}),c(22,"i",20),n()(),i(23,"li",17)(24,"span",18),r(25),o(26,"translate"),c(27,"br"),i(28,"small",77),r(29),o(30,"translate"),n()(),i(31,"button",19),o(32,"translate"),f("click",function(){S(e);let s=g();return k(s.removeAllCachedAccessories())}),c(33,"i",20),n()()()}a&2&&(t(3),u(" ",l(4,9,"reset.accessory_ind.title")),t(4),p(l(8,11,"reset.accessory_ind.desc")),t(2),x("aria-label",l(10,13,"reset.accessory_ind.title")),t(5),u(" ",l(15,15,"reset.bridge_accessories.title")),t(4),p(l(19,17,"reset.bridge_accessories.desc")),t(2),x("aria-label",l(21,19,"reset.accessory_all.title")),t(5),u(" ",l(26,21,"reset.accessory_all.title")),t(4),p(l(30,23,"reset.accessory_all.desc")),t(2),x("aria-label",l(32,25,"reset.accessory_all.title")))}function Vt(a,m){a&1&&(i(0,"p",10),r(1),o(2,"translate"),n()),a&2&&(t(),p(l(2,1,"reset.bridges.desc")))}function Rt(a,m){if(a&1){let e=w();i(0,"ul",12)(1,"li",17)(2,"span",18),r(3),o(4,"translate"),c(5,"br"),i(6,"small",77),r(7),o(8,"translate"),n()(),i(9,"button",19),o(10,"translate"),f("click",function(){S(e);let s=g();return k(s.unpairAccessory())}),c(11,"i",20),n()(),i(12,"li",17)(13,"span",18),r(14),o(15,"translate"),o(16,"titlecase"),c(17,"br"),i(18,"small",77),r(19),o(20,"translate"),n()(),i(21,"button",19),o(22,"translate"),f("click",function(){S(e);let s=g();return k(s.resetHomebridgeState())}),c(23,"i",20),n()()()}a&2&&(t(3),u(" ",l(4,6,"reset.bridge_ind.title")),t(4),p(l(8,8,"reset.bridge_ind.desc")),t(2),x("aria-label",l(10,10,"reset.bridge_ind.title")),t(5),u(" ",l(16,14,l(15,12,"reset.bridge_all.title"))),t(5),p(l(20,16,"reset.bridge_all.desc")),t(2),x("aria-label",l(22,18,"reset.bridge_all.title")))}var Qi=(()=>{class a{$api=C(R);$modal=C(he);$plugin=C(ye);$settings=C(Se);$toastr=C(V);$translate=C(F);originalServiceForm={HOMEBRIDGE_DEBUG:!1,HOMEBRIDGE_KEEP_ORPHANS:!1,HOMEBRIDGE_INSECURE:!0,ENV_DEBUG:"",ENV_NODE_OPTIONS:""};originalUiSettingsForm={port:0};originalLoginWallpaper="";originalMdnsSetting="";originalBridgeNetworkAdapters=[];originalHbPort=0;originalHbName="";hasChangedService=!1;hasChangedUiSettings=!1;hasChangedMdns=!1;hasChangedBridgeNetworkAdapters=!1;hasChangedHbPort=!1;hasChangedHbName=!1;hasChangedLoginWallpaper=!1;isInvalidHbPort=!1;isInvalidHbName=!1;isInvalidHbUiPort=!1;serviceForm=new Z({HOMEBRIDGE_DEBUG:new D(!1),HOMEBRIDGE_KEEP_ORPHANS:new D(!1),HOMEBRIDGE_INSECURE:new D(!0),ENV_DEBUG:new D(""),ENV_NODE_OPTIONS:new D("")});uiSettingsForm=new Z({port:new D(0)});loginWallpaper="";legacyMdnsFormControl=new se(!1);showAvahiMdnsOption=!1;showResolvedMdnsOption=!1;availableNetworkAdapters=[];bridgeNetworkAdapters=[];hbPortFormControl=new D(0);hbNameFormControl=new D("");isHbV2=!1;showFields={general:!0,display:!0,startup:!0,network:!0,reset:!0,cache:!0};file='<span class="font-monospace">ui-wallpaper.jpg</span>';linkDebug='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Debug-Common-Values" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){}ngOnInit(){this.isHbV2=this.$settings.env.homebridgeVersion.startsWith("2"),this.hbNameFormControl.patchValue(this.$settings.env.homebridgeInstanceName),this.hbNameFormControl.valueChanges.subscribe(e=>this.setHomebridgeName(e)),this.originalHbName=this.$settings.env.homebridgeInstanceName,this.initUiSettingsForm(),this.initDisplaySettingsForm(),this.initNetworkingOptions(),this.initStartupSettingsForm()}initUiSettingsForm(){this.originalUiSettingsForm={port:this.$settings.env.port},this.uiSettingsForm.patchValue({port:this.$settings.env.port}),this.uiSettingsForm.valueChanges.pipe(Q(500)).subscribe(e=>{let d=!1;Object.keys(e).forEach(s=>{this.originalUiSettingsForm[s]!==e[s]&&(this.saveUiSettingChange(s,e[s]),d=!0)}),this.hasChangedUiSettings=d})}initStartupSettingsForm(){this.$api.get("/platform-tools/hb-service/homebridge-startup-settings").subscribe({next:e=>{Object.keys(e).forEach(d=>{this.originalServiceForm[d]=e[d]}),this.serviceForm.patchValue(e),this.serviceForm.valueChanges.pipe(Q(500)).subscribe(this.saveStartupSettingsSettings.bind(this))},error:e=>{console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}initDisplaySettingsForm(){this.originalLoginWallpaper=this.$settings.loginWallpaper,this.loginWallpaper=this.$settings.loginWallpaper}saveUiSettingChange(e,d){switch(e){case"lang":this.$settings.setLang(d);break;case"lightingMode":this.$settings.setLightingMode(d,"user");break;case"menuMode":this.$settings.setMenuMode(d),window.location.reload();break;case"theme":this.$settings.setTheme(d);break;case"tempUnits":this.$settings.setEnvItem("temperatureUnits",d);break;case"loginWallpaper":this.$settings.setEnvItem("loginWallpaper",d),this.hasChangedLoginWallpaper=d!==this.originalLoginWallpaper;break;case"port":if(!d||typeof d!="number"||d<1025||d>65533||Number.isInteger(d)===!1||d===this.hbPortFormControl.value){this.isInvalidHbUiPort=!0;return}this.$settings.setEnvItem("port",d),this.isInvalidHbUiPort=!1;break}E(this.$api.put("/config-editor/ui",{key:e,value:d})).catch(s=>{console.error(s),this.$toastr.error(s.message,this.$translate.instant("toast.title_error"))})}openUiSettings(){this.$plugin.settings({name:"homebridge-config-ui-x",displayName:"Homebridge UI",settingsSchema:!0,links:{}})}openBackupModal(){this.$modal.open(ke,{size:"lg",backdrop:"static"})}saveStartupSettingsSettings(e=this.serviceForm.value){this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",e).subscribe({next:()=>{this.hasChangedService=JSON.stringify(e)!==JSON.stringify(this.originalServiceForm)},error:d=>{console.error(d),this.$toastr.error(d.message,this.$translate.instant("toast.title_error"))}})}resetHomebridgeState(){this.$modal.open(Ie,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(Ae,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open(Ee,{size:"lg",backdrop:"static"})}removeSingleCachedAccessories(){this.$modal.open(we,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open(Be,{size:"lg",backdrop:"static"})}initNetworkingOptions(){return y(this,null,function*(){try{this.getNetworkSettings(),(this.$settings.env.runningInLinux||this.$settings.env.runningInDocker||this.$settings.env.runningInSynologyPackage||this.$settings.env.runningInPackageMode)&&(this.showAvahiMdnsOption=!0,this.showResolvedMdnsOption=!0)}catch{}})}getNetworkSettings(){return y(this,null,function*(){return Promise.all([E(this.$api.get("/server/network-interfaces/system")),E(this.$api.get("/server/network-interfaces/bridge")),E(this.$api.get("/server/mdns-advertiser")),E(this.$api.get("/server/port"))]).then(([e,d,s,h])=>{this.availableNetworkAdapters=e,this.buildBridgeNetworkAdapterList(d),this.legacyMdnsFormControl.patchValue(s.advertiser),this.originalMdnsSetting=s.advertiser,this.originalBridgeNetworkAdapters=this.bridgeNetworkAdapters.map(U=>U.iface),this.legacyMdnsFormControl.valueChanges.subscribe(U=>{this.setHomebridgeMdnsSetting(U)}),this.hbPortFormControl.patchValue(h.port),this.hbPortFormControl.valueChanges.subscribe(U=>this.setHomebridgePort(U)),this.originalHbPort=h.port})})}setHomebridgeMdnsSetting(e){return y(this,null,function*(){this.$api.put("/server/mdns-advertiser",{advertiser:e}).subscribe({next:()=>{this.hasChangedMdns=e!==this.originalMdnsSetting},error:d=>{console.error(d),this.$toastr.error(d.message,this.$translate.instant("toast.title_error"))}})})}setNetworkInterfaces(e){return y(this,null,function*(){this.$api.put("/server/network-interfaces/bridge",{adapters:e}).subscribe({next:()=>{this.hasChangedBridgeNetworkAdapters=this.originalBridgeNetworkAdapters.join(",")!==e.join(",")},error:d=>{console.error(d),this.$toastr.error(d.message,this.$translate.instant("toast.title_error"))}})})}setHomebridgeName(e){return y(this,null,function*(){if(!e||!/^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u.test(e)){this.isInvalidHbName=!0;return}this.$api.put("/server/name",{name:e}).subscribe({next:()=>{this.hasChangedHbName=this.originalHbName!==e,this.$settings.setEnvItem("homebridgeInstanceName",e),this.isInvalidHbName=!1},error:()=>{this.isInvalidHbName=!0}})})}setHomebridgePort(e){return y(this,null,function*(){if(e===this.uiSettingsForm.get("port").value){this.isInvalidHbPort=!0;return}this.$api.put("/server/port",{port:e}).subscribe({next:()=>{this.hasChangedHbPort=this.originalHbPort!==e,this.isInvalidHbPort=!1},error:()=>{this.isInvalidHbPort=!0}})})}buildBridgeNetworkAdapterList(e){if(!e.length){this.bridgeNetworkAdapters=[];return}this.bridgeNetworkAdapters=e.map(d=>{let s=this.availableNetworkAdapters.find(h=>h.iface===d);return s?(s.selected=!0,s.missing=!1,s):{iface:d,missing:!0}})}selectNetworkInterfaces(){let e=this.$modal.open(Ne,{size:"lg",backdrop:"static"});e.componentInstance.availableNetworkAdapters=this.availableNetworkAdapters,e.componentInstance.bridgeNetworkAdapters=this.bridgeNetworkAdapters,e.result.then(d=>{this.buildBridgeNetworkAdapterList(d),this.setNetworkInterfaces(d)}).catch(()=>{})}toggleSection(e){this.showFields[e]=!this.showFields[e]}static \u0275fac=function(d){return new(d||a)};static \u0275cmp=B({type:a,selectors:[["ng-component"]],decls:48,vars:49,consts:[[1,"primary-text","m-0"],[1,"my-4"],["role","button","tabindex","0",1,"mt-3","hover-pointer",3,"click"],[1,"primary-text"],[1,"fa","fa-fw",3,"ngClass"],["id","fieldsGeneral",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsDisplay",1,"list-group","list-group-box","mt-2","mx-0"],["novalidate","",1,"my-4",3,"formGroup"],["id","fieldsStartup",1,"list-group","list-group-box","mb-4","mx-0"],["id","fieldsNetwork",1,"list-group","list-group-box","mt-2","mx-0"],[1,"small","grey-text","mb-2","mx-0"],["id","fieldsCache",1,"list-group","list-group-box","mb-4","mx-0"],["id","fieldsReset",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],[1,"list-group-item","d-block","d-md-flex","justify-content-between","align-items-center"],[1,"my-3","my-md-0","pl-0","pl-md-5","w-auto"],["type","text",1,"form-control","custom-input","resp-input",3,"formControl","ngClass"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pe-2"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["routerLink","/users",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"list-group-item","d-flex","flex-column","align-items-center"],[1,"grey-text","my-2"],["routerLink","/restart",1,"btn","btn-primary","waves-effect","my-2"],[1,"my-3","my-md-0","ps-0","ps-md-5","w-auto"],[1,"custom-select","resp-select",3,"ngModelChange","ngModel"],["value","auto"],["value","bg"],["value","ca"],["value","zh-CN"],["value","zh-TW"],["value","cs"],["value","nl"],["value","en"],["value","fi"],["value","fr"],["value","de"],["value","he"],["value","hu"],["value","id"],["value","it"],["value","ja"],["value","ko"],["value","mk"],["value","no"],["value","pl"],["value","pt-BR"],["value","pt"],["value","ru"],["value","sl"],["value","es"],["value","sv"],["value","th"],["value","tr"],["value","uk"],["value","orange"],["value","red"],["value","pink"],["value","purple"],["value","deep-purple"],["value","indigo"],["value","blue"],["value","blue-grey"],["value","cyan"],["value","green"],["value","teal"],["value","grey"],["value","brown"],["value","light"],["value","dark"],["value","default"],["value","freeze"],[1,"grey-text","pe-2",3,"innerHTML"],["name","search_wallpaper","autocomplete","off","type","text","placeholder","/path-to/image.png",1,"form-control","custom-input","resp-input",3,"ngModelChange","ngModel"],["value","c"],["value","f"],[1,"grey-text","pe-2"],["type","checkbox","id","homebridgeDebugMode","formControlName","HOMEBRIDGE_DEBUG",1,"rendux-input"],["for","homebridgeDebugMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeInsecureMode","formControlName","HOMEBRIDGE_INSECURE",1,"rendux-input"],["for","homebridgeInsecureMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeKeepOrphans","formControlName","HOMEBRIDGE_KEEP_ORPHANS",1,"rendux-input"],["for","homebridgeKeepOrphans",1,"rendux-label","ms-3",2,"min-width","50px"],[1,"font-monospace"],["formControlName","ENV_DEBUG","type","text","placeholder","HAP-NodeJS:Advertiser,HAP-NodeJS:Service",1,"form-control","custom-input","resp-input"],["formControlName","ENV_NODE_OPTIONS","type","text","placeholder","--max-old-space-size=512 --max-http-header-size=8192",1,"form-control","custom-input","resp-input"],["routerLink","/platform-tools/docker/startup-script",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"small","grey-text","pe-2"],[1,"badge","badge-primary","me-1",3,"ngClass"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right",3,"ngClass"],[1,"custom-select","resp-select",3,"formControl"],["value","avahi"],["value","ciao"],["value","bonjour-hap"],["value","resolved"],["type","number","min","1025","max","65533",1,"form-control","custom-input","resp-input",3,"formControl","ngClass"],["type","number","min","1025","max","65533","placeholder","8581","formControlName","port",1,"form-control","custom-input","resp-input",3,"ngClass"],[1,"fas","fa-fw","fa-exclamation-triangle"],[1,"fw-normal"]],template:function(d,s){d&1&&(i(0,"h3",0),r(1),o(2,"translate"),n(),i(3,"div",1)(4,"div",2),f("click",function(){return s.toggleSection("general")}),i(5,"h5",3),c(6,"i",4),r(7),o(8,"translate"),n()(),b(9,Ct,29,26,"ul",5),n(),i(10,"div",1)(11,"div",2),f("click",function(){return s.toggleSection("display")}),i(12,"h5",3),c(13,"i",4),r(14),o(15,"translate"),n()(),b(16,kt,155,94,"ul",6),n(),i(17,"form",7)(18,"div",2),f("click",function(){return s.toggleSection("startup")}),i(19,"h5",3),c(20,"i",4),r(21),o(22,"translate"),n()(),b(23,Et,61,38,"ul",8),n(),i(24,"form",7)(25,"div",2),f("click",function(){return s.toggleSection("network")}),i(26,"h5",3),c(27,"i",4),r(28),o(29,"translate"),n()(),b(30,Tt,55,54,"ul",9),n(),i(31,"div",1)(32,"div",2),f("click",function(){return s.toggleSection("cache")}),i(33,"h5",3),c(34,"i",4),r(35),o(36,"translate"),n()(),b(37,Mt,3,3,"p",10),b(38,Ft,34,27,"ul",11),n(),i(39,"div",1)(40,"div",2),f("click",function(){return s.toggleSection("reset")}),i(41,"h5",3),c(42,"i",4),r(43),o(44,"translate"),n()(),b(45,Vt,3,3,"p",10),b(46,Rt,24,20,"ul",12),n(),c(47,"div",13)),d&2&&(t(),p(l(2,35,"menu.settings.title")),t(3),x("aria-expanded",s.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),t(2),_("ngClass",s.showFields.general?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(8,37,"settings.general.title_general")," "),t(2),v(s.showFields.general?9:-1),t(2),x("aria-expanded",s.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),t(2),_("ngClass",s.showFields.display?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(15,39,"settings.general.title_display")," "),t(2),v(s.showFields.display?16:-1),t(),_("formGroup",s.serviceForm),t(),x("aria-expanded",s.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),t(2),_("ngClass",s.showFields.startup?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(22,41,"settings.title_startup_options")," "),t(2),v(s.showFields.startup?23:-1),t(),_("formGroup",s.uiSettingsForm),t(),x("aria-expanded",s.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),t(2),_("ngClass",s.showFields.network?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(29,43,"settings.network.title_network")," "),t(2),v(s.showFields.network?30:-1),t(2),x("aria-expanded",s.showFields.cache?"true":"false")("aria-controls","fieldsCache"),t(2),_("ngClass",s.showFields.cache?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(36,45,"settings.cache.title")," "),t(2),v(s.showFields.cache?37:-1),t(),v(s.showFields.cache?38:-1),t(2),x("aria-expanded",s.showFields.reset?"true":"false")("aria-controls","fieldsReset"),t(2),_("ngClass",s.showFields.reset?"fa-chevron-down":"fa-chevron-right"),t(),u(" ",l(44,47,"reset.bridges.title")," "),t(2),v(s.showFields.reset?45:-1),t(),v(s.showFields.reset?46:-1))},dependencies:[O,Ce,K,de,ge,be,oe,pe,G,_e,W,le,fe,ve,q,xe,ce,me,ue,j,$],encapsulation:2})}return a})();export{Ee as a,Ie as b,Ne as c,Qi as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as T}from"./chunk-G6GTWDKY.js";import{d as y}from"./chunk-QR7L4UUP.js";import{b as S}from"./chunk-OT3IJBCR.js";import{h as $,k as C}from"./chunk-4WTLH2XC.js";import{a as _,b as g}from"./chunk-DJKI5XBW.js";import{$a as i,Ac as p,Bc as c,Hb as l,Ib as m,Ob as r,Pb as n,Qb as x,Yb as v,jc as o,kc as s,la as a,lb as h}from"./chunk-U4V4ICSI.js";function w(t,f){t&1&&(r(0,"p",7),o(1),p(2,"translate"),n()),t&2&&(i(),s(c(2,1,"restart.please_wait_while_server_restarts")))}function k(t,f){if(t&1&&(r(0,"div",8),o(1),n()),t&2){let e=v();i(),s(e.error)}}function b(t,f){t&1&&(r(0,"div",9)(1,"div",11),x(2,"i",12),n()())}function E(t,f){t&1&&(r(0,"div",10),o(1),p(2,"translate"),n()),t&2&&(i(),s(c(2,1,"platform.linux.long_time")))}var A=(()=>{class t{$api=a(C);$router=a(y);$settings=a(S);$toastr=a($);$translate=a(_);$ws=a(T);checkTimeout;checkDelay;resp={};timeout=!1;error=!1;io;constructor(){}ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/linux/restart-host",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{console.error(e),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.server_restart_error"),this.$translate.instant("toast.title_error"))}})}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.linux.server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},3e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("platform.linux.server_taking_long_time"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},12e4)}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=h({type:t,selectors:[["ng-component"]],decls:15,vars:10,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"grey-text"],[1,"alert","alert-error","my-4"],[1,"justify-content-center","my-4"],[1,"alert","alert-warning","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"]],template:function(d,u){d&1&&(r(0,"div",0)(1,"h3",1),o(2),p(3,"translate"),n()(),r(4,"div",2)(5,"div",3),x(6,"i",4),n(),r(7,"div",5)(8,"h4",6),o(9),p(10,"translate"),n(),l(11,w,3,3,"p",7),l(12,k,2,1,"div",8),l(13,b,3,0,"div",9),l(14,E,3,3,"div",10),n()()),d&2&&(i(2),s(c(3,6,"menu.restart.title")),i(7),s(c(10,8,"platform.linux.restarting_server")),i(2),m(u.error?-1:11),i(),m(u.error?12:-1),i(),m(u.error?-1:13),i(),m(u.timeout?14:-1))},dependencies:[g],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-AK4S37TG.js";import"./chunk-G6GTWDKY.js";import"./chunk-QR7L4UUP.js";import"./chunk-UOC65WET.js";import"./chunk-OT3IJBCR.js";import"./chunk-4WTLH2XC.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as RestartComponent};
|