homebridge-config-ui-x 4.62.1-beta.9 → 5.0.0-beta.0
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 +43 -6
- package/README.md +4 -58
- package/config.schema.json +1 -0
- package/dist/bin/platforms/darwin.js +2 -0
- package/dist/bin/platforms/darwin.js.map +1 -1
- package/dist/modules/server/server.service.d.ts +1 -0
- package/dist/modules/server/server.service.js +1 -0
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/status/status.gateway.d.ts +3 -5
- package/dist/modules/status/status.gateway.js +2 -28
- package/dist/modules/status/status.gateway.js.map +1 -1
- package/dist/modules/status/status.service.d.ts +2 -0
- package/dist/modules/status/status.service.js +8 -7
- package/dist/modules/status/status.service.js.map +1 -1
- package/package.json +19 -24
- package/public/3rdpartylicenses.txt +9 -1
- package/public/assets/hap-icons/smokesensor.svg +1 -1
- package/public/{chunk-TOPONS2G.js → chunk-2PWJQ3JG.js} +1 -1
- package/public/{chunk-SDRXNK54.js → chunk-2XSSTW65.js} +1 -1
- package/public/chunk-3MMTBP3D.js +1 -0
- package/public/{chunk-3TR6KNS2.js → chunk-3PUISAM4.js} +1 -1
- package/public/{chunk-3OURKZJE.js → chunk-3SUL4N2K.js} +1 -1
- package/public/{chunk-3DLNWL2R.js → chunk-47MGIKRX.js} +1 -1
- package/public/{chunk-BUGNOBXC.js → chunk-4R6MSI5I.js} +1 -1
- package/public/{chunk-YAU2KWBZ.js → chunk-6QEO3BTW.js} +1 -1
- package/public/chunk-6SZTMLNK.js +1 -0
- package/public/{chunk-IIFIWJYC.js → chunk-6T267MJT.js} +1 -1
- package/public/{chunk-D6UUGEUB.js → chunk-B6C32ZRK.js} +1 -1
- package/public/{chunk-RPL6HWN2.js → chunk-BROUJ7PT.js} +1 -1
- package/public/{chunk-S5FRWQPT.js → chunk-C4VKSYGU.js} +1 -1
- package/public/chunk-CKS7IGEQ.js +1 -0
- package/public/chunk-CTWXFHBK.js +20 -0
- package/public/{chunk-CU3OXDK7.js → chunk-DLVT4K74.js} +1 -1
- package/public/{chunk-KO2RPNXD.js → chunk-DPQR4EUP.js} +1 -1
- package/public/chunk-F22FMU37.js +1 -0
- package/public/{chunk-RF5R32OJ.js → chunk-GNQUXZMN.js} +1 -1
- package/public/{chunk-VNQPH3K2.js → chunk-GUXB6V7U.js} +1 -1
- package/public/{chunk-ZRQZU5HN.js → chunk-HPRZRVV7.js} +1 -1
- package/public/{chunk-RTI2NE3Q.js → chunk-HXKR7RPF.js} +1 -1
- package/public/chunk-IGUSDGD6.js +8 -0
- package/public/{chunk-EX6EQLNK.js → chunk-JM7QCDMZ.js} +1 -1
- package/public/{chunk-UEPF2U5Q.js → chunk-JQO6VAZ5.js} +1 -1
- package/public/{chunk-BGBOW4TZ.js → chunk-K5UREZLG.js} +4 -4
- package/public/{chunk-W7JQ7WHZ.js → chunk-LM3J4EYP.js} +1 -1
- package/public/chunk-NTTD35IF.js +1 -0
- package/public/chunk-PSLVYKAC.js +1 -0
- package/public/{chunk-BROJRIZL.js → chunk-Q7MYZYMQ.js} +1 -1
- package/public/{chunk-AM3VWXMR.js → chunk-SI3MSSTT.js} +1 -1
- package/public/{chunk-WOJ7C5HX.js → chunk-SJTXTMYT.js} +1 -1
- package/public/{chunk-VZFXQGAN.js → chunk-TBJQ2Y3M.js} +1 -1
- package/public/{chunk-VYUN5WLM.js → chunk-THFLPY67.js} +1 -1
- package/public/{chunk-QOPI77FO.js → chunk-TTLBPD7L.js} +1 -1
- package/public/{chunk-RDIMXMJ5.js → chunk-UEBRERJ6.js} +1 -1
- package/public/{chunk-FBJAWKJ3.js → chunk-WCDFKYP6.js} +1 -1
- package/public/{chunk-WD7T2C7Z.js → chunk-XLAWLJES.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-DTWXJAMM.js +6 -0
- package/public/{styles-RKZUK2BG.css → styles-7ETWN6DQ.css} +1 -1
- package/public/chunk-4GFUJV7Q.js +0 -1
- package/public/chunk-7SIWB246.js +0 -1
- package/public/chunk-ATNSCCKX.js +0 -1
- package/public/chunk-BZRYP3UV.js +0 -1
- package/public/chunk-FJK4IAO5.js +0 -1
- package/public/chunk-IKFLHM2X.js +0 -8
- package/public/chunk-J6XB3JBO.js +0 -1
- package/public/chunk-LKWF73XA.js +0 -20
- package/public/main-VFMNBLEO.js +0 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-config-ui-x",
|
|
3
3
|
"displayName": "Homebridge UI",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-beta.0",
|
|
5
5
|
"description": "A web based management, configuration and control platform for Homebridge.",
|
|
6
6
|
"author": "oznu <dev@oz.nu>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -82,17 +82,17 @@
|
|
|
82
82
|
"@fastify/helmet": "11.1.1",
|
|
83
83
|
"@fastify/multipart": "8.3.0",
|
|
84
84
|
"@fastify/static": "7.0.4",
|
|
85
|
-
"@homebridge/hap-client": "
|
|
86
|
-
"@homebridge/node-pty-prebuilt-multiarch": "0.
|
|
87
|
-
"@nestjs/axios": "3.1.
|
|
88
|
-
"@nestjs/common": "10.4.
|
|
89
|
-
"@nestjs/core": "10.4.
|
|
85
|
+
"@homebridge/hap-client": "2.0.4",
|
|
86
|
+
"@homebridge/node-pty-prebuilt-multiarch": "0.12.0-beta.1",
|
|
87
|
+
"@nestjs/axios": "3.1.2",
|
|
88
|
+
"@nestjs/common": "10.4.8",
|
|
89
|
+
"@nestjs/core": "10.4.8",
|
|
90
90
|
"@nestjs/jwt": "10.2.0",
|
|
91
91
|
"@nestjs/passport": "10.0.3",
|
|
92
|
-
"@nestjs/platform-fastify": "10.4.
|
|
93
|
-
"@nestjs/platform-socket.io": "10.4.
|
|
94
|
-
"@nestjs/swagger": "
|
|
95
|
-
"@nestjs/websockets": "10.4.
|
|
92
|
+
"@nestjs/platform-fastify": "10.4.8",
|
|
93
|
+
"@nestjs/platform-socket.io": "10.4.8",
|
|
94
|
+
"@nestjs/swagger": "8.0.7",
|
|
95
|
+
"@nestjs/websockets": "10.4.8",
|
|
96
96
|
"axios": "1.7.7",
|
|
97
97
|
"bash-color": "0.0.4",
|
|
98
98
|
"buffer-shims": "1.0.0",
|
|
@@ -121,11 +121,11 @@
|
|
|
121
121
|
"unzipper": "0.12.3"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@antfu/eslint-config": "^3.
|
|
125
|
-
"@nestjs/testing": "^10.4.
|
|
124
|
+
"@antfu/eslint-config": "^3.9.1",
|
|
125
|
+
"@nestjs/testing": "^10.4.8",
|
|
126
126
|
"@types/fs-extra": "^11.0.4",
|
|
127
|
-
"@types/lodash": "^4.17.
|
|
128
|
-
"@types/node": "^22.
|
|
127
|
+
"@types/lodash": "^4.17.13",
|
|
128
|
+
"@types/node": "^22.9.0",
|
|
129
129
|
"@types/node-schedule": "^2.1.7",
|
|
130
130
|
"@types/passport-jwt": "^4.0.1",
|
|
131
131
|
"@types/semver": "^7.5.8",
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
"@types/tar": "^6.1.13",
|
|
134
134
|
"@types/tcp-port-used": "^1.0.4",
|
|
135
135
|
"@types/unzipper": "^0.10.10",
|
|
136
|
-
"@vitest/coverage-v8": "^2.1.
|
|
137
|
-
"concurrently": "^9.0
|
|
138
|
-
"eslint": "^9.
|
|
136
|
+
"@vitest/coverage-v8": "^2.1.5",
|
|
137
|
+
"concurrently": "^9.1.0",
|
|
138
|
+
"eslint": "^9.15.0",
|
|
139
139
|
"eslint-plugin-format": "^0.1.2",
|
|
140
140
|
"form-data": "^4.0.1",
|
|
141
141
|
"nodemon": "^3.1.7",
|
|
@@ -145,12 +145,7 @@
|
|
|
145
145
|
"tsconfig-paths": "^4.2.0",
|
|
146
146
|
"typescript": "^5.6.3",
|
|
147
147
|
"unplugin-swc": "^1.5.1",
|
|
148
|
-
"vitest": "^2.1.
|
|
149
|
-
},
|
|
150
|
-
"overrides": {
|
|
151
|
-
"@homebridge/hap-client": {
|
|
152
|
-
"axios": "1.7.7"
|
|
153
|
-
}
|
|
148
|
+
"vitest": "^2.1.5"
|
|
154
149
|
},
|
|
155
150
|
"maintainers": [
|
|
156
151
|
{
|
|
@@ -162,7 +157,7 @@
|
|
|
162
157
|
"name": "oznu"
|
|
163
158
|
},
|
|
164
159
|
{
|
|
165
|
-
"email": "
|
|
160
|
+
"email": "northern.man1@gmail.com",
|
|
166
161
|
"name": "northernman"
|
|
167
162
|
},
|
|
168
163
|
{
|
|
@@ -1263,8 +1263,16 @@ SOFTWARE.
|
|
|
1263
1263
|
|
|
1264
1264
|
--------------------------------------------------------------------------------
|
|
1265
1265
|
Package: @ngx-translate/core
|
|
1266
|
-
License: "
|
|
1266
|
+
License: "MIT"
|
|
1267
|
+
|
|
1268
|
+
Copyright (c) 2018 Olivier Combe
|
|
1269
|
+
Copyright (c) 2024 Andreas Löw / CodeAndWeb GmbH
|
|
1270
|
+
|
|
1271
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1267
1272
|
|
|
1273
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1274
|
+
|
|
1275
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1268
1276
|
|
|
1269
1277
|
--------------------------------------------------------------------------------
|
|
1270
1278
|
Package: rxjs
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<g transform="matrix(1 0 0 1 250 125)" id="Ly0Zljdh6uDT129kqPq2c" opacity="1" fill="#fc861d" fill-opacity="1" class="smoke_sensor_box" >
|
|
8
8
|
<path style="stroke: rgb(183,90,243); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-222.5, -100)" d="M 0 0 L 445 0 L 445 124.6137 L 402.96864 124.6137 L 350.9804 200 L 88.48046 200 L 36.492219999999996 124.6137 L 0.0011099999999970578 124.6137 z M 94.73049 185.04636 L 149.73026 185.04636 L 149.73026 130.21633 L 94.73048999999999 130.21633 z M 289.72949 184.04945 L 343.72913 184.04945 L 343.72913 130.21633 L 289.72949 130.21633 z M 224.72945 185.04636 L 279.72922 185.04636 L 279.72922 130.21633 L 224.72944999999999 130.21633 z M 159.73052 185.04636 L 214.73029000000002 185.04636 L 214.73029000000002 130.21633 L 159.73052 130.21633 z" stroke-linecap="round" />
|
|
9
9
|
</g>
|
|
10
|
-
<g transform="matrix(1 0 0 1 249.09 329.19)" id="1bkxD90ICefRta9rtUGNo"
|
|
10
|
+
<g transform="matrix(1 0 0 1 249.09 329.19)" id="1bkxD90ICefRta9rtUGNo" opacity="1" fill="#fb0000" fill-opacity="1" class="smoke_sensor_trigger_lines" >
|
|
11
11
|
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-155.85, -60.81)" d="M 171.76478 114.74011 C 171.76478 118.53511 167.28498 121.61471 161.76478 121.61471 C 156.24458 121.61471 151.76478 118.53511 151.76478 114.74011 C 151.76478 98.11741 151.76478 55.11191 151.76478 38.48931 C 151.76478 34.69431 156.24458 31.614710000000002 161.76478 31.614710000000002 C 167.28498 31.614710000000002 171.76478 34.69431 171.76478 38.48931 C 171.76478 55.11201 171.76478 98.11751000000001 171.76478 114.74011 z M 16.50458 73.14822 C 14.0652 76.05536 8.653950000000002 75.53491 4.425230000000001 71.98658999999999 C 0.19651000000000085 68.43826999999999 -1.2556899999999995 63.19959999999999 1.1836900000000008 60.29245999999999 C 11.86856 47.55872999999999 39.51196 14.614609999999992 50.19676 1.8809599999999946 C 52.63614 -1.0261800000000054 58.04739 -0.5057300000000056 62.276109999999996 3.0425899999999944 C 66.50483 6.590909999999994 67.95703 11.829579999999993 65.51764999999999 14.736719999999995 C 54.832779999999985 27.470449999999992 27.189379999999986 60.41457 16.50457999999999 73.14822 z M 246.18369 14.73671 C 243.74431 11.82957 245.19651000000002 6.5908999999999995 249.42523 3.042580000000001 C 253.65395 -0.505739999999999 259.0652 -1.0261899999999988 261.50458 1.880950000000001 C 272.18944999999997 14.61468 299.83285 47.5588 310.51765 60.292449999999995 C 312.95703000000003 63.19958999999999 311.50483 68.43826 307.27611 71.98657999999999 C 303.04739 75.5349 297.63614 76.05534999999999 295.19676000000004 73.14820999999999 C 284.51189000000005 60.41447999999999 256.86849000000007 27.470359999999992 246.18369000000004 14.736709999999995 z" stroke-linecap="round" />
|
|
12
12
|
</g>
|
|
13
13
|
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as Se}from"./chunk-ZRQZU5HN.js";import{b as ye}from"./chunk-3DLNWL2R.js";import"./chunk-7SIWB246.js";import"./chunk-EX6EQLNK.js";import{c as H}from"./chunk-QOPI77FO.js";import{G as we,M as N,N as Ce,Q as $e,b as J,c as B,d as w,e as D,f as K,g as M,j as C,m as W,o as X,p as Y,q as Z,w as he,y as ge,z as xe}from"./chunk-FBJAWKJ3.js";import{a as Ge,c as I,k as E}from"./chunk-FJK4IAO5.js";import{a as S,b as T,c as ve}from"./chunk-J6XB3JBO.js";import{$ as k,$b as fe,Ab as ce,Ga as U,Ka as h,La as u,Pb as L,Qb as ue,Rb as G,Ua as s,Va as m,W as le,Wa as c,X as Q,Z as q,Za as V,aa as R,ab as g,bb as $,fb as pe,g as Ae,gb as me,h as o,ha as j,hb as de,i as se,ia as F,jb as d,kb as x,lb as b,qc as be,sc as _e,t as oe,ub as y,vc as ne,wa as t,xa as f,yb as l,zb as p}from"./chunk-IKFLHM2X.js";function qe(n,a){n&1&&(s(0,"p",15)(1,"small"),d(2),l(3,"translate"),m()()),n&2&&(t(2),x(p(3,1,"login.invalid_credentials")))}var Ie=(()=>{let a=class a{constructor(r,e,i,_){o(this,"$activeModal");o(this,"$api");o(this,"$toastr");o(this,"$translate");o(this,"formGroup",new M({password:new C("",[w.required])}));o(this,"invalidCredentials",!1);this.$activeModal=r,this.$api=e,this.$toastr=i,this.$translate=_}disable2fa(){this.invalidCredentials=!1,this.$api.post("/users/otp/deactivate",this.formGroup.value).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.setup_2fa_disable_success"),this.$translate.instant("toast.title_success"))},error:()=>{this.formGroup.setValue({password:""}),this.invalidCredentials=!0}})}};o(a,"\u0275fac",function(e){return new(e||a)(f(N),f(I),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["ng-component"]],decls:28,vars:24,consts:[[1,"modal-content",2,"min-height","300px"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],["type","password","autocomplete","current-password",1,"form-control",3,"formControl","placeholder"],["class","red-text",4,"ngIf"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"red-text"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h5",2),d(3),l(4,"translate"),m(),s(5,"button",3),l(6,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),s(7,"span",4),d(8,"\xD7"),m()()(),s(9,"div",5)(10,"p"),d(11),l(12,"translate"),m(),s(13,"div",6),c(14,"input",7),l(15,"translate"),m(),U(16,qe,4,3,"p",8),m(),s(17,"div",9)(18,"div",10)(19,"button",11),l(20,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(21),l(22,"translate"),m()(),c(23,"div",12),s(24,"div",13)(25,"button",14),g("click",function(){return i.disable2fa()}),d(26),l(27,"translate"),m()()()()),e&2&&(t(3),x(p(4,10,"users.setup_2fa_disable")),t(2),h("aria-label",p(6,12,"form.button_close")),t(6),x(p(12,14,"users.setup_2fa_disable_current_password")),t(3),u("formControl",i.formGroup.controls.password)("placeholder",p(15,16,"users.label_password")),t(2),u("ngIf",i.invalidCredentials),t(3),h("aria-label",p(20,18,"form.button_close")),t(2),b(" ",p(22,20,"form.button_close")," "),t(4),u("disabled",i.formGroup.invalid),t(),b(" ",p(27,22,"form.button_disable")," "))},dependencies:[G,B,D,X,T],encapsulation:2}));let n=a;return n})();var Ee=Ae(Ge(),1);var Pe=["qrcode"],ze=n=>({timeDiffError:n});function Oe(n,a){if(n&1&&(s(0,"div",15)(1,"h3"),d(2),l(3,"translate"),m(),s(4,"p"),d(5),l(6,"translate"),m()()),n&2){let v=$();t(2),x(p(3,2,"users.setup_2fa_cannot_setup_2fa")),t(3),x(ce(6,4,"users.setup_2fa_server_time_out",y(7,ze,v.timeDiffError)))}}function Qe(n,a){n&1&&(s(0,"div")(1,"p"),d(2),l(3,"translate"),m()()),n&2&&(t(2),x(p(3,1,"users.setup_2fa_scan_qr_code")))}function Re(n,a){if(n&1&&(s(0,"div",18)(1,"p"),d(2),l(3,"translate"),m(),s(4,"div",19),c(5,"input",20),m()()),n&2){let v=$();t(2),x(p(3,2,"users.setup_2fa_enter_code")),t(3),u("formControl",v.formGroup.controls.code)}}function Le(n,a){if(n&1){let v=V();s(0,"button",21),g("click",function(){j(v);let e=$();return F(e.enable2fa())}),d(1),l(2,"translate"),m()}if(n&2){let v=$();u("disabled",v.formGroup.invalid),t(),b(" ",p(2,2,"form.button_enable")," ")}}var ke=(()=>{let a=class a{constructor(r,e,i,_){o(this,"$activeModal");o(this,"$api");o(this,"$toastr");o(this,"$translate");o(this,"user");o(this,"qrcodeElement");o(this,"timeDiffError",null);o(this,"otpString");o(this,"formGroup",new M({code:new C("",[w.required,w.minLength(6),w.maxLength(6)])}));this.$activeModal=r,this.$api=e,this.$toastr=i,this.$translate=_}ngOnInit(){this.$api.post("/users/otp/setup",{}).subscribe({next:r=>{this.checkTimeDiff(r.timestamp),this.timeDiffError||(this.otpString=r.otpauth)},error:r=>{this.$activeModal.dismiss(),console.error(r),this.$toastr.error(this.$translate.instant("users.setup_2fa_enable_error"),this.$translate.instant("toast.title_error"))}})}checkTimeDiff(r){let e=(0,Ee.default)(r).diff(new Date,"millisecond");if(e<-5e3||e>5e3){this.timeDiffError=e;return}this.timeDiffError=null}enable2fa(){this.$api.post("/users/otp/activate",this.formGroup.value).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.setup_2fa_enabled_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close()},error:r=>{console.error(r),this.$toastr.error(this.$translate.instant("users.setup_2fa_activate_error"),this.$translate.instant("toast.title_error"))}})}};o(a,"\u0275fac",function(e){return new(e||a)(f(N),f(I),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["ng-component"]],viewQuery:function(e,i){if(e&1&&pe(Pe,7),e&2){let _;me(_=de())&&(i.qrcodeElement=_.first)}},inputs:{user:"user"},decls:27,vars:21,consts:[[1,"modal-content","setup2fa"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],["class","text-center",4,"ngIf"],["type","warning",3,"dismissible"],[4,"ngIf"],[1,"text-center","w-100","d-flex","justify-content-center"],[1,"mx-auto","my-2",2,"width","180px","height","180px",3,"data"],["class","mt-4",4,"ngIf"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button","class","btn btn-primary","data-dismiss","modal",3,"disabled","click",4,"ngIf"],[1,"mt-4"],[1,"form-group"],["type","text","placeholder","eg. 123456","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*",1,"form-control",3,"formControl"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h5",2),d(3),l(4,"translate"),m(),s(5,"button",3),l(6,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),s(7,"span",4),d(8,"\xD7"),m()()(),s(9,"div",5),U(10,Oe,7,9,"div",6),s(11,"ngb-alert",7),d(12),l(13,"translate"),m(),U(14,Qe,4,3,"div",8),s(15,"div",9),c(16,"app-qrcode",10),m(),U(17,Re,6,4,"div",11),m(),s(18,"div",12)(19,"div",13)(20,"button",14),l(21,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(22),l(23,"translate"),m()(),c(24,"div",15),s(25,"div",16),U(26,Le,3,4,"button",17),m()()()),e&2&&(t(3),x(p(4,11,"users.setup_2fa")),t(2),h("aria-label",p(6,13,"form.button_close")),t(5),u("ngIf",i.timeDiffError),t(),u("dismissible",!1),t(),b(" ",p(13,15,"users.setup_2fa_warning")," "),t(2),u("ngIf",!i.timeDiffError),t(2),u("data",i.otpString),t(),u("ngIf",!i.timeDiffError),t(3),h("aria-label",p(21,17,"form.button_close")),t(2),b(" ",p(23,19,"form.button_close")," "),t(4),u("ngIf",!i.timeDiffError))},dependencies:[G,B,D,he,X,we,ye,T],encapsulation:2}));let n=a;return n})();var Ue=n=>({active:n}),Te=n=>({"is-invalid":n}),Be=(()=>{let a=class a{constructor(r,e,i,_){o(this,"$activeModal");o(this,"$api");o(this,"$toastr");o(this,"$translate");o(this,"form",new M({username:new C("",[w.required]),name:new C("",[w.required]),password:new C("",[w.compose([w.required,w.minLength(4)])]),passwordConfirm:new C("",[w.required]),admin:new C(!0)},this.matchPassword));o(this,"page",{title:"users.title_add_user",save:"users.button_add_new_user",password:"users.label_password"});this.$activeModal=r,this.$api=e,this.$toastr=i,this.$translate=_}matchPassword(r){let e=r.get("password").value,i=r.get("passwordConfirm").value;if(e!==i)r.get("passwordConfirm").setErrors({matchPassword:!0});else return null}onSubmit({value:r}){this.$api.post("/users",r).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_added_new_user"),this.$translate.instant("toast.title_success"))},error:e=>{this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}};o(a,"\u0275fac",function(e){return new(e||a)(f(N),f(I),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["ng-component"]],decls:59,vars:57,consts:[[1,"modal-content"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"container","px-1"],[1,"md-form"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none",1,"form-control","px-0"],["for","form-username",3,"ngClass"],[1,"fas","fa-fw","fa-user-shield"],["formControlName","name","type","text","id","form-name","autocomplete","name",1,"form-control","px-0"],["for","form-name",3,"ngClass"],[1,"fas","fa-fw","fa-user"],["formControlName","password","type","password","autocomplete","new-password","id","form-pass",1,"form-control","px-0",3,"ngClass"],["for","form-pass"],[1,"fas","fa-fw","fa-lock"],["formControlName","passwordConfirm","type","password","autocomplete","new-password","id","form-pass-confirm",1,"form-control","px-0",3,"ngClass"],["for","form-pass-confirm"],[1,"form-group","row","align-items-center"],[1,"col-6","col-form-label","grey-text"],[1,"fas","fa-fw","fa-user-secret"],[1,"col-6","text-right"],["type","checkbox","formControlName","admin","id","isAdmin",1,"rendux-input"],["for","isAdmin",1,"rendux-label","ml-3",2,"min-width","50px"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"form",1),g("ngSubmit",function(){return i.onSubmit(i.form)}),s(2,"div",2)(3,"h5",3),d(4),l(5,"translate"),m(),s(6,"button",4),l(7,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),s(8,"span",5),d(9,"\xD7"),m()()(),s(10,"div",6)(11,"div",7)(12,"div",8),c(13,"input",9),l(14,"translate"),s(15,"label",10),c(16,"i",11),d(17),l(18,"translate"),m()(),s(19,"div",8),c(20,"input",12),l(21,"translate"),s(22,"label",13),c(23,"i",14),d(24),l(25,"translate"),m()(),s(26,"div",8),c(27,"input",15),l(28,"translate"),s(29,"label",16),c(30,"i",17),d(31),l(32,"translate"),m()(),s(33,"div",8),c(34,"input",18),l(35,"translate"),s(36,"label",19),c(37,"i",17),d(38),l(39,"translate"),m()(),s(40,"div",20)(41,"label",21),c(42,"i",22),d(43),l(44,"translate"),m(),s(45,"div",23),c(46,"input",24),l(47,"translate"),c(48,"label",25),m()()()(),s(49,"div",26)(50,"div",27)(51,"button",28),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(52),l(53,"translate"),m()(),c(54,"div",29),s(55,"div",30)(56,"button",31),d(57),l(58,"translate"),m()()()()()),e&2&&(t(),u("formGroup",i.form),t(3),x(p(5,21,"users.title_add_user")),t(2),h("aria-label",p(7,23,"form.button_close")),t(7),h("disabled",i.page.title==="users.title_edit_user"?!0:null)("aria-label",p(14,25,"users.label_username")),t(2),u("ngClass",y(49,Ue,i.page.title==="users.title_edit_user")),t(2),b(" ",p(18,27,"users.label_username")," "),t(3),h("aria-label",p(21,29,"users.label_full_name")),t(2),u("ngClass",y(51,Ue,i.page.title==="users.title_edit_user")),t(2),b(" ",p(25,31,"users.label_full_name")," "),t(3),u("ngClass",y(53,Te,i.form.controls.password.dirty&&i.form.controls.password.errors)),h("aria-label",p(28,33,i.page.password)),t(4),b(" ",p(32,35,i.page.password)," "),t(3),u("ngClass",y(55,Te,i.form.controls.passwordConfirm.dirty&&i.form.controls.passwordConfirm.errors)),h("aria-label",p(35,37,"users.label_confirm_password")),t(4),b(" ",p(39,39,"users.label_confirm_password")," "),t(5),b(" ",p(44,41,"users.label_admin_user")," "),t(3),h("aria-label",p(47,43,"users.label_admin_user")),t(6),b(" ",p(53,45,"form.button_close")," "),t(4),u("disabled",!i.form.valid),t(),b(" ",p(58,47,"form.button_save")," "))},dependencies:[L,W,B,J,D,K,Y,Z,T],encapsulation:2}));let n=a;return n})();var De=n=>({active:n}),Me=n=>({"is-invalid":n}),Ne=(()=>{let a=class a{constructor(r,e,i,_,re){o(this,"$activeModal");o(this,"$api");o(this,"$auth");o(this,"$toastr");o(this,"$translate");o(this,"user");o(this,"form",new M({username:new C("",[w.required]),name:new C("",[w.required]),password:new C(""),passwordConfirm:new C(""),admin:new C(!0)},this.matchPassword));o(this,"page",{title:"users.title_edit_user",save:"form.button_save",password:"users.label_new_password"});o(this,"isCurrentUser",!1);this.$activeModal=r,this.$api=e,this.$auth=i,this.$toastr=_,this.$translate=re}ngOnInit(){this.isCurrentUser=this.$auth.user.username===this.user.username,this.form.patchValue(this.user)}matchPassword(r){let e=r.get("password").value,i=r.get("passwordConfirm").value;if(e!==i)r.get("passwordConfirm").setErrors({matchPassword:!0});else return null}onSubmit({value:r}){this.$api.patch(`/users/${this.user.id}`,r).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_updated_user"),this.$translate.instant("toast.title_success")),this.isCurrentUser&&r.username!==this.$auth.user.username&&this.$auth.logout()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}};o(a,"\u0275fac",function(e){return new(e||a)(f(N),f(I),f(H),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["ng-component"]],inputs:{user:"user"},decls:59,vars:56,consts:[[1,"modal-content"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"container","px-1"],[1,"md-form"],["formControlName","username","type","text","id","form-username","autocomplete","off","autocapitalize","none",1,"form-control","px-0"],["for","form-username",3,"ngClass"],[1,"fas","fa-fw","fa-user-shield"],["formControlName","name","type","text","id","form-name","autocomplete","name",1,"form-control","px-0"],["for","form-name",3,"ngClass"],[1,"fas","fa-fw","fa-user"],["formControlName","password","type","password","autocomplete","new-password","id","form-pass",1,"form-control","px-0",3,"ngClass"],["for","form-pass"],[1,"fas","fa-fw","fa-lock"],["formControlName","passwordConfirm","type","password","autocomplete","new-password","id","form-pass-confirm",1,"form-control","px-0",3,"ngClass"],["for","form-pass-confirm"],[1,"form-group","row","align-items-center"],[1,"col-6","col-form-label","grey-text"],[1,"fas","fa-fw","fa-user-secret"],[1,"col-6","text-right"],["type","checkbox","formControlName","admin","id","isAdmin",1,"rendux-input"],["for","isAdmin",1,"rendux-label","ml-3",2,"min-width","50px"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"form",1),g("ngSubmit",function(){return i.onSubmit(i.form)}),s(2,"div",2)(3,"h5",3),d(4),l(5,"translate"),m(),s(6,"button",4),l(7,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),s(8,"span",5),d(9,"\xD7"),m()()(),s(10,"div",6)(11,"div",7)(12,"div",8),c(13,"input",9),l(14,"translate"),s(15,"label",10),c(16,"i",11),d(17),l(18,"translate"),m()(),s(19,"div",8),c(20,"input",12),l(21,"translate"),s(22,"label",13),c(23,"i",14),d(24),l(25,"translate"),m()(),s(26,"div",8),c(27,"input",15),l(28,"translate"),s(29,"label",16),c(30,"i",17),d(31),l(32,"translate"),m()(),s(33,"div",8),c(34,"input",18),l(35,"translate"),s(36,"label",19),c(37,"i",17),d(38),l(39,"translate"),m()(),s(40,"div",20)(41,"label",21),c(42,"i",22),d(43),l(44,"translate"),m(),s(45,"div",23),c(46,"input",24),l(47,"translate"),c(48,"label",25),m()()()(),s(49,"div",26)(50,"div",27)(51,"button",28),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(52),l(53,"translate"),m()(),c(54,"div",29),s(55,"div",30)(56,"button",31),d(57),l(58,"translate"),m()()()()()),e&2&&(t(),u("formGroup",i.form),t(3),x(p(5,20,"users.title_edit_user")),t(2),h("aria-label",p(7,22,"form.button_close")),t(7),h("aria-label",p(14,24,"users.label_username")),t(2),u("ngClass",y(48,De,i.page.title==="users.title_edit_user")),t(2),b(" ",p(18,26,"users.label_username")," "),t(3),h("aria-label",p(21,28,"users.label_full_name")),t(2),u("ngClass",y(50,De,i.page.title==="users.title_edit_user")),t(2),b(" ",p(25,30,"users.label_full_name")," "),t(3),u("ngClass",y(52,Me,i.form.controls.password.dirty&&i.form.controls.password.errors)),h("aria-label",p(28,32,i.page.password)),t(4),b(" ",p(32,34,i.page.password)," "),t(3),u("ngClass",y(54,Me,i.form.controls.passwordConfirm.dirty&&i.form.controls.passwordConfirm.errors)),h("aria-label",p(35,36,"users.label_confirm_password")),t(4),b(" ",p(39,38,"users.label_confirm_password")," "),t(5),b(" ",p(44,40,"users.label_admin_user")," "),t(3),h("aria-label",p(47,42,"users.label_admin_user")),t(6),b(" ",p(53,44,"form.button_close")," "),t(4),u("disabled",!i.form.valid),t(),b(" ",p(58,46,"form.button_save")," "))},dependencies:[L,W,B,J,D,K,Y,Z,T],encapsulation:2}));let n=a;return n})();function Ke(n,a){if(n&1){let v=V();s(0,"button",20),g("click",function(){j(v);let e=$().$implicit,i=$();return F(i.deleteUser(e.id))}),d(1),l(2,"translate"),m()}n&2&&(t(),b(" ",p(2,1,"form.button_delete")," "))}function We(n,a){if(n&1){let v=V();s(0,"button",21),g("click",function(){j(v);let e=$().$implicit,i=$();return F(i.setup2fa(e))}),d(1),l(2,"translate"),m()}n&2&&(t(),b(" ",p(2,1,"users.setup_2fa")," "))}function Xe(n,a){if(n&1){let v=V();s(0,"button",19),g("click",function(){j(v);let e=$().$implicit,i=$();return F(i.disable2fa(e))}),d(1),l(2,"translate"),m()}n&2&&(t(),b(" ",p(2,1,"users.setup_2fa_disable")," "))}function Ye(n,a){if(n&1){let v=V();s(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"span",12),c(5,"h4",13)(6,"h5",14),m()(),s(7,"div",15),U(8,Ke,3,3,"button",16)(9,We,3,3,"button",17)(10,Xe,3,3,"button",18),s(11,"button",19),g("click",function(){let e=j(v).$implicit,i=$();return F(i.openEditUser(e))}),d(12),l(13,"translate"),m()()()()()}if(n&2){let v=a.$implicit,r=$();t(5),u("innerText",v.name),t(),u("innerText",v.username),t(2),u("ngIf",r.$auth.user.username!==v.username),t(),u("ngIf",r.$auth.user.username===v.username&&!v.otpActive),t(),u("ngIf",r.$auth.user.username===v.username&&v.otpActive),t(2),x(p(13,6,"form.button_edit"))}}var je=(()=>{let a=class a{constructor(r,e,i,_,re,Ve){o(this,"$api");o(this,"$auth");o(this,"$modal");o(this,"$route");o(this,"$toastr");o(this,"$translate");o(this,"homebridgeUsers");this.$api=r,this.$auth=e,this.$modal=i,this.$route=_,this.$toastr=re,this.$translate=Ve}ngOnInit(){this.$route.data.subscribe(r=>{this.homebridgeUsers=r.homebridgeUsers})}reloadUsers(){return this.$api.get("/users").subscribe(r=>{this.homebridgeUsers=r})}openAddNewUser(){this.$modal.open(Be,{size:"lg",backdrop:"static"}).result.finally(()=>{this.reloadUsers()})}openEditUser(r){let e=this.$modal.open(Ne,{size:"lg",backdrop:"static"});e.componentInstance.user=r,e.result.finally(()=>{this.reloadUsers()})}deleteUser(r){this.$api.delete(`/users/${r}`).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.toast_user_deleted"),this.$translate.instant("toast.title_success")),this.reloadUsers()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_delete_user"),this.$translate.instant("toast.title_error"))}})}setup2fa(r){let e=this.$modal.open(ke,{size:"lg",backdrop:"static"});e.componentInstance.user=r,e.result.finally(()=>{this.reloadUsers()})}disable2fa(r){let e=this.$modal.open(Ie,{size:"lg",backdrop:"static"});e.componentInstance.user=r,e.result.finally(()=>{this.reloadUsers()})}};o(a,"\u0275fac",function(e){return new(e||a)(f(I),f(H),f(Ce),f(be),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["app-users"]],decls:11,vars:7,consts:[[1,"row","mb-3"],[1,"col-9"],[1,"primary-text","m-0"],[1,"col-3","text-right"],[1,"btn","btn-elegant","waves-effect","m-0",3,"click"],[1,"fas","fa-fw","fa-plus"],[1,"row"],["class","col-md-6 mb-4",4,"ngFor","ngForOf"],[1,"col-md-6","mb-4"],[1,"card","card-body"],[1,"d-flex","flex-column"],[1,"d-flex","flex-row","mb-3"],[1,"me-auto","my-0"],[3,"innerText"],[1,"small","text-truncate","primary-text",3,"innerText"],[1,"d-flex","flex-row","justify-content-between",2,"gap","10px"],["class","btn btn-elegant btn-sml m-0",3,"click",4,"ngIf"],["class","btn btn-primary mt-0 m-0",3,"click",4,"ngIf"],["class","btn btn-primary m-0",3,"click",4,"ngIf"],[1,"btn","btn-primary","m-0",3,"click"],[1,"btn","btn-elegant","btn-sml","m-0",3,"click"],[1,"btn","btn-primary","mt-0","m-0",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h3",2),d(3),l(4,"translate"),m()(),s(5,"div",3)(6,"button",4),l(7,"translate"),g("click",function(){return i.openAddNewUser()}),c(8,"i",5),m()()(),s(9,"div",6),U(10,Ye,14,8,"div",7),m()),e&2&&(t(3),x(p(4,3,"users.title_users")),t(3),h("aria-label",p(7,5,"users.button_add_user")),t(4),u("ngForOf",i.homebridgeUsers))},dependencies:[ue,G,T],encapsulation:2}));let n=a;return n})();var ie=(()=>{let a=class a{constructor(r,e,i,_){o(this,"$api");o(this,"$router");o(this,"$toastr");o(this,"$translate");this.$api=r,this.$router=e,this.$toastr=i,this.$translate=_}resolve(){return se(this,null,function*(){try{return yield oe(this.$api.get("/users"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}};o(a,"\u0275fac",function(e){return new(e||a)(q(I),q(_e),q(E),q(S))}),o(a,"\u0275prov",le({token:a,factory:a.\u0275fac}));let n=a;return n})();var Ze=[{path:"",component:je,resolve:{homebridgeUsers:ie}}],Fe=(()=>{let a=class a{};o(a,"\u0275fac",function(e){return new(e||a)}),o(a,"\u0275mod",R({type:a})),o(a,"\u0275inj",Q({imports:[ne.forChild(Ze),ne]}));let n=a;return n})();var Qt=(()=>{let a=class a{};o(a,"\u0275fac",function(e){return new(e||a)}),o(a,"\u0275mod",R({type:a})),o(a,"\u0275inj",Q({providers:[ie],imports:[fe,ge,xe,ve.forChild(),$e,Se,Fe]}));let n=a;return n})();export{Qt as UsersModule};
|
|
1
|
+
import{f as Se}from"./chunk-HPRZRVV7.js";import{b as ye}from"./chunk-47MGIKRX.js";import"./chunk-CKS7IGEQ.js";import"./chunk-JM7QCDMZ.js";import{c as H}from"./chunk-TTLBPD7L.js";import{G as we,M as N,N as Ce,Q as $e,b as J,c as B,d as w,e as D,f as K,g as M,j as C,m as W,o as X,p as Y,q as Z,w as he,y as ge,z as xe}from"./chunk-WCDFKYP6.js";import{a as Ge,c as I,k as E}from"./chunk-PSLVYKAC.js";import{a as S,b as T,c as ve}from"./chunk-F22FMU37.js";import{$ as k,$b as fe,Ab as ce,Ga as U,Ka as h,La as u,Pb as L,Qb as ue,Rb as G,Ua as s,Va as m,W as le,Wa as c,X as Q,Z as q,Za as V,aa as R,ab as g,bb as $,fb as pe,g as Ae,gb as me,h as o,ha as j,hb as de,i as se,ia as F,jb as d,kb as x,lb as b,qc as be,sc as _e,t as oe,ub as y,vc as ne,wa as t,xa as f,yb as l,zb as p}from"./chunk-IGUSDGD6.js";function qe(n,a){n&1&&(s(0,"p",15)(1,"small"),d(2),l(3,"translate"),m()()),n&2&&(t(2),x(p(3,1,"login.invalid_credentials")))}var Ie=(()=>{let a=class a{constructor(r,e,i,_){o(this,"$activeModal");o(this,"$api");o(this,"$toastr");o(this,"$translate");o(this,"formGroup",new M({password:new C("",[w.required])}));o(this,"invalidCredentials",!1);this.$activeModal=r,this.$api=e,this.$toastr=i,this.$translate=_}disable2fa(){this.invalidCredentials=!1,this.$api.post("/users/otp/deactivate",this.formGroup.value).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.setup_2fa_disable_success"),this.$translate.instant("toast.title_success"))},error:()=>{this.formGroup.setValue({password:""}),this.invalidCredentials=!0}})}};o(a,"\u0275fac",function(e){return new(e||a)(f(N),f(I),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["ng-component"]],decls:28,vars:24,consts:[[1,"modal-content",2,"min-height","300px"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],["type","password","autocomplete","current-password",1,"form-control",3,"formControl","placeholder"],["class","red-text",4,"ngIf"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"red-text"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h5",2),d(3),l(4,"translate"),m(),s(5,"button",3),l(6,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),s(7,"span",4),d(8,"\xD7"),m()()(),s(9,"div",5)(10,"p"),d(11),l(12,"translate"),m(),s(13,"div",6),c(14,"input",7),l(15,"translate"),m(),U(16,qe,4,3,"p",8),m(),s(17,"div",9)(18,"div",10)(19,"button",11),l(20,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(21),l(22,"translate"),m()(),c(23,"div",12),s(24,"div",13)(25,"button",14),g("click",function(){return i.disable2fa()}),d(26),l(27,"translate"),m()()()()),e&2&&(t(3),x(p(4,10,"users.setup_2fa_disable")),t(2),h("aria-label",p(6,12,"form.button_close")),t(6),x(p(12,14,"users.setup_2fa_disable_current_password")),t(3),u("formControl",i.formGroup.controls.password)("placeholder",p(15,16,"users.label_password")),t(2),u("ngIf",i.invalidCredentials),t(3),h("aria-label",p(20,18,"form.button_close")),t(2),b(" ",p(22,20,"form.button_close")," "),t(4),u("disabled",i.formGroup.invalid),t(),b(" ",p(27,22,"form.button_disable")," "))},dependencies:[G,B,D,X,T],encapsulation:2}));let n=a;return n})();var Ee=Ae(Ge(),1);var Pe=["qrcode"],ze=n=>({timeDiffError:n});function Oe(n,a){if(n&1&&(s(0,"div",15)(1,"h3"),d(2),l(3,"translate"),m(),s(4,"p"),d(5),l(6,"translate"),m()()),n&2){let v=$();t(2),x(p(3,2,"users.setup_2fa_cannot_setup_2fa")),t(3),x(ce(6,4,"users.setup_2fa_server_time_out",y(7,ze,v.timeDiffError)))}}function Qe(n,a){n&1&&(s(0,"div")(1,"p"),d(2),l(3,"translate"),m()()),n&2&&(t(2),x(p(3,1,"users.setup_2fa_scan_qr_code")))}function Re(n,a){if(n&1&&(s(0,"div",18)(1,"p"),d(2),l(3,"translate"),m(),s(4,"div",19),c(5,"input",20),m()()),n&2){let v=$();t(2),x(p(3,2,"users.setup_2fa_enter_code")),t(3),u("formControl",v.formGroup.controls.code)}}function Le(n,a){if(n&1){let v=V();s(0,"button",21),g("click",function(){j(v);let e=$();return F(e.enable2fa())}),d(1),l(2,"translate"),m()}if(n&2){let v=$();u("disabled",v.formGroup.invalid),t(),b(" ",p(2,2,"form.button_enable")," ")}}var ke=(()=>{let a=class a{constructor(r,e,i,_){o(this,"$activeModal");o(this,"$api");o(this,"$toastr");o(this,"$translate");o(this,"user");o(this,"qrcodeElement");o(this,"timeDiffError",null);o(this,"otpString");o(this,"formGroup",new M({code:new C("",[w.required,w.minLength(6),w.maxLength(6)])}));this.$activeModal=r,this.$api=e,this.$toastr=i,this.$translate=_}ngOnInit(){this.$api.post("/users/otp/setup",{}).subscribe({next:r=>{this.checkTimeDiff(r.timestamp),this.timeDiffError||(this.otpString=r.otpauth)},error:r=>{this.$activeModal.dismiss(),console.error(r),this.$toastr.error(this.$translate.instant("users.setup_2fa_enable_error"),this.$translate.instant("toast.title_error"))}})}checkTimeDiff(r){let e=(0,Ee.default)(r).diff(new Date,"millisecond");if(e<-5e3||e>5e3){this.timeDiffError=e;return}this.timeDiffError=null}enable2fa(){this.$api.post("/users/otp/activate",this.formGroup.value).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.setup_2fa_enabled_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close()},error:r=>{console.error(r),this.$toastr.error(this.$translate.instant("users.setup_2fa_activate_error"),this.$translate.instant("toast.title_error"))}})}};o(a,"\u0275fac",function(e){return new(e||a)(f(N),f(I),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["ng-component"]],viewQuery:function(e,i){if(e&1&&pe(Pe,7),e&2){let _;me(_=de())&&(i.qrcodeElement=_.first)}},inputs:{user:"user"},decls:27,vars:21,consts:[[1,"modal-content","setup2fa"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],["class","text-center",4,"ngIf"],["type","warning",3,"dismissible"],[4,"ngIf"],[1,"text-center","w-100","d-flex","justify-content-center"],[1,"mx-auto","my-2",2,"width","180px","height","180px",3,"data"],["class","mt-4",4,"ngIf"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button","class","btn btn-primary","data-dismiss","modal",3,"disabled","click",4,"ngIf"],[1,"mt-4"],[1,"form-group"],["type","text","placeholder","eg. 123456","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*",1,"form-control",3,"formControl"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h5",2),d(3),l(4,"translate"),m(),s(5,"button",3),l(6,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),s(7,"span",4),d(8,"\xD7"),m()()(),s(9,"div",5),U(10,Oe,7,9,"div",6),s(11,"ngb-alert",7),d(12),l(13,"translate"),m(),U(14,Qe,4,3,"div",8),s(15,"div",9),c(16,"app-qrcode",10),m(),U(17,Re,6,4,"div",11),m(),s(18,"div",12)(19,"div",13)(20,"button",14),l(21,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(22),l(23,"translate"),m()(),c(24,"div",15),s(25,"div",16),U(26,Le,3,4,"button",17),m()()()),e&2&&(t(3),x(p(4,11,"users.setup_2fa")),t(2),h("aria-label",p(6,13,"form.button_close")),t(5),u("ngIf",i.timeDiffError),t(),u("dismissible",!1),t(),b(" ",p(13,15,"users.setup_2fa_warning")," "),t(2),u("ngIf",!i.timeDiffError),t(2),u("data",i.otpString),t(),u("ngIf",!i.timeDiffError),t(3),h("aria-label",p(21,17,"form.button_close")),t(2),b(" ",p(23,19,"form.button_close")," "),t(4),u("ngIf",!i.timeDiffError))},dependencies:[G,B,D,he,X,we,ye,T],encapsulation:2}));let n=a;return n})();var Ue=n=>({active:n}),Te=n=>({"is-invalid":n}),Be=(()=>{let a=class a{constructor(r,e,i,_){o(this,"$activeModal");o(this,"$api");o(this,"$toastr");o(this,"$translate");o(this,"form",new M({username:new C("",[w.required]),name:new C("",[w.required]),password:new C("",[w.compose([w.required,w.minLength(4)])]),passwordConfirm:new C("",[w.required]),admin:new C(!0)},this.matchPassword));o(this,"page",{title:"users.title_add_user",save:"users.button_add_new_user",password:"users.label_password"});this.$activeModal=r,this.$api=e,this.$toastr=i,this.$translate=_}matchPassword(r){let e=r.get("password").value,i=r.get("passwordConfirm").value;if(e!==i)r.get("passwordConfirm").setErrors({matchPassword:!0});else return null}onSubmit({value:r}){this.$api.post("/users",r).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_added_new_user"),this.$translate.instant("toast.title_success"))},error:e=>{this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}};o(a,"\u0275fac",function(e){return new(e||a)(f(N),f(I),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["ng-component"]],decls:59,vars:57,consts:[[1,"modal-content"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"container","px-1"],[1,"md-form"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none",1,"form-control","px-0"],["for","form-username",3,"ngClass"],[1,"fas","fa-fw","fa-user-shield"],["formControlName","name","type","text","id","form-name","autocomplete","name",1,"form-control","px-0"],["for","form-name",3,"ngClass"],[1,"fas","fa-fw","fa-user"],["formControlName","password","type","password","autocomplete","new-password","id","form-pass",1,"form-control","px-0",3,"ngClass"],["for","form-pass"],[1,"fas","fa-fw","fa-lock"],["formControlName","passwordConfirm","type","password","autocomplete","new-password","id","form-pass-confirm",1,"form-control","px-0",3,"ngClass"],["for","form-pass-confirm"],[1,"form-group","row","align-items-center"],[1,"col-6","col-form-label","grey-text"],[1,"fas","fa-fw","fa-user-secret"],[1,"col-6","text-right"],["type","checkbox","formControlName","admin","id","isAdmin",1,"rendux-input"],["for","isAdmin",1,"rendux-label","ml-3",2,"min-width","50px"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"form",1),g("ngSubmit",function(){return i.onSubmit(i.form)}),s(2,"div",2)(3,"h5",3),d(4),l(5,"translate"),m(),s(6,"button",4),l(7,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),s(8,"span",5),d(9,"\xD7"),m()()(),s(10,"div",6)(11,"div",7)(12,"div",8),c(13,"input",9),l(14,"translate"),s(15,"label",10),c(16,"i",11),d(17),l(18,"translate"),m()(),s(19,"div",8),c(20,"input",12),l(21,"translate"),s(22,"label",13),c(23,"i",14),d(24),l(25,"translate"),m()(),s(26,"div",8),c(27,"input",15),l(28,"translate"),s(29,"label",16),c(30,"i",17),d(31),l(32,"translate"),m()(),s(33,"div",8),c(34,"input",18),l(35,"translate"),s(36,"label",19),c(37,"i",17),d(38),l(39,"translate"),m()(),s(40,"div",20)(41,"label",21),c(42,"i",22),d(43),l(44,"translate"),m(),s(45,"div",23),c(46,"input",24),l(47,"translate"),c(48,"label",25),m()()()(),s(49,"div",26)(50,"div",27)(51,"button",28),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(52),l(53,"translate"),m()(),c(54,"div",29),s(55,"div",30)(56,"button",31),d(57),l(58,"translate"),m()()()()()),e&2&&(t(),u("formGroup",i.form),t(3),x(p(5,21,"users.title_add_user")),t(2),h("aria-label",p(7,23,"form.button_close")),t(7),h("disabled",i.page.title==="users.title_edit_user"?!0:null)("aria-label",p(14,25,"users.label_username")),t(2),u("ngClass",y(49,Ue,i.page.title==="users.title_edit_user")),t(2),b(" ",p(18,27,"users.label_username")," "),t(3),h("aria-label",p(21,29,"users.label_full_name")),t(2),u("ngClass",y(51,Ue,i.page.title==="users.title_edit_user")),t(2),b(" ",p(25,31,"users.label_full_name")," "),t(3),u("ngClass",y(53,Te,i.form.controls.password.dirty&&i.form.controls.password.errors)),h("aria-label",p(28,33,i.page.password)),t(4),b(" ",p(32,35,i.page.password)," "),t(3),u("ngClass",y(55,Te,i.form.controls.passwordConfirm.dirty&&i.form.controls.passwordConfirm.errors)),h("aria-label",p(35,37,"users.label_confirm_password")),t(4),b(" ",p(39,39,"users.label_confirm_password")," "),t(5),b(" ",p(44,41,"users.label_admin_user")," "),t(3),h("aria-label",p(47,43,"users.label_admin_user")),t(6),b(" ",p(53,45,"form.button_close")," "),t(4),u("disabled",!i.form.valid),t(),b(" ",p(58,47,"form.button_save")," "))},dependencies:[L,W,B,J,D,K,Y,Z,T],encapsulation:2}));let n=a;return n})();var De=n=>({active:n}),Me=n=>({"is-invalid":n}),Ne=(()=>{let a=class a{constructor(r,e,i,_,re){o(this,"$activeModal");o(this,"$api");o(this,"$auth");o(this,"$toastr");o(this,"$translate");o(this,"user");o(this,"form",new M({username:new C("",[w.required]),name:new C("",[w.required]),password:new C(""),passwordConfirm:new C(""),admin:new C(!0)},this.matchPassword));o(this,"page",{title:"users.title_edit_user",save:"form.button_save",password:"users.label_new_password"});o(this,"isCurrentUser",!1);this.$activeModal=r,this.$api=e,this.$auth=i,this.$toastr=_,this.$translate=re}ngOnInit(){this.isCurrentUser=this.$auth.user.username===this.user.username,this.form.patchValue(this.user)}matchPassword(r){let e=r.get("password").value,i=r.get("passwordConfirm").value;if(e!==i)r.get("passwordConfirm").setErrors({matchPassword:!0});else return null}onSubmit({value:r}){this.$api.patch(`/users/${this.user.id}`,r).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_updated_user"),this.$translate.instant("toast.title_success")),this.isCurrentUser&&r.username!==this.$auth.user.username&&this.$auth.logout()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}};o(a,"\u0275fac",function(e){return new(e||a)(f(N),f(I),f(H),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["ng-component"]],inputs:{user:"user"},decls:59,vars:56,consts:[[1,"modal-content"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"container","px-1"],[1,"md-form"],["formControlName","username","type","text","id","form-username","autocomplete","off","autocapitalize","none",1,"form-control","px-0"],["for","form-username",3,"ngClass"],[1,"fas","fa-fw","fa-user-shield"],["formControlName","name","type","text","id","form-name","autocomplete","name",1,"form-control","px-0"],["for","form-name",3,"ngClass"],[1,"fas","fa-fw","fa-user"],["formControlName","password","type","password","autocomplete","new-password","id","form-pass",1,"form-control","px-0",3,"ngClass"],["for","form-pass"],[1,"fas","fa-fw","fa-lock"],["formControlName","passwordConfirm","type","password","autocomplete","new-password","id","form-pass-confirm",1,"form-control","px-0",3,"ngClass"],["for","form-pass-confirm"],[1,"form-group","row","align-items-center"],[1,"col-6","col-form-label","grey-text"],[1,"fas","fa-fw","fa-user-secret"],[1,"col-6","text-right"],["type","checkbox","formControlName","admin","id","isAdmin",1,"rendux-input"],["for","isAdmin",1,"rendux-label","ml-3",2,"min-width","50px"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"form",1),g("ngSubmit",function(){return i.onSubmit(i.form)}),s(2,"div",2)(3,"h5",3),d(4),l(5,"translate"),m(),s(6,"button",4),l(7,"translate"),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),s(8,"span",5),d(9,"\xD7"),m()()(),s(10,"div",6)(11,"div",7)(12,"div",8),c(13,"input",9),l(14,"translate"),s(15,"label",10),c(16,"i",11),d(17),l(18,"translate"),m()(),s(19,"div",8),c(20,"input",12),l(21,"translate"),s(22,"label",13),c(23,"i",14),d(24),l(25,"translate"),m()(),s(26,"div",8),c(27,"input",15),l(28,"translate"),s(29,"label",16),c(30,"i",17),d(31),l(32,"translate"),m()(),s(33,"div",8),c(34,"input",18),l(35,"translate"),s(36,"label",19),c(37,"i",17),d(38),l(39,"translate"),m()(),s(40,"div",20)(41,"label",21),c(42,"i",22),d(43),l(44,"translate"),m(),s(45,"div",23),c(46,"input",24),l(47,"translate"),c(48,"label",25),m()()()(),s(49,"div",26)(50,"div",27)(51,"button",28),g("click",function(){return i.$activeModal.dismiss("Dismiss")}),d(52),l(53,"translate"),m()(),c(54,"div",29),s(55,"div",30)(56,"button",31),d(57),l(58,"translate"),m()()()()()),e&2&&(t(),u("formGroup",i.form),t(3),x(p(5,20,"users.title_edit_user")),t(2),h("aria-label",p(7,22,"form.button_close")),t(7),h("aria-label",p(14,24,"users.label_username")),t(2),u("ngClass",y(48,De,i.page.title==="users.title_edit_user")),t(2),b(" ",p(18,26,"users.label_username")," "),t(3),h("aria-label",p(21,28,"users.label_full_name")),t(2),u("ngClass",y(50,De,i.page.title==="users.title_edit_user")),t(2),b(" ",p(25,30,"users.label_full_name")," "),t(3),u("ngClass",y(52,Me,i.form.controls.password.dirty&&i.form.controls.password.errors)),h("aria-label",p(28,32,i.page.password)),t(4),b(" ",p(32,34,i.page.password)," "),t(3),u("ngClass",y(54,Me,i.form.controls.passwordConfirm.dirty&&i.form.controls.passwordConfirm.errors)),h("aria-label",p(35,36,"users.label_confirm_password")),t(4),b(" ",p(39,38,"users.label_confirm_password")," "),t(5),b(" ",p(44,40,"users.label_admin_user")," "),t(3),h("aria-label",p(47,42,"users.label_admin_user")),t(6),b(" ",p(53,44,"form.button_close")," "),t(4),u("disabled",!i.form.valid),t(),b(" ",p(58,46,"form.button_save")," "))},dependencies:[L,W,B,J,D,K,Y,Z,T],encapsulation:2}));let n=a;return n})();function Ke(n,a){if(n&1){let v=V();s(0,"button",20),g("click",function(){j(v);let e=$().$implicit,i=$();return F(i.deleteUser(e.id))}),d(1),l(2,"translate"),m()}n&2&&(t(),b(" ",p(2,1,"form.button_delete")," "))}function We(n,a){if(n&1){let v=V();s(0,"button",21),g("click",function(){j(v);let e=$().$implicit,i=$();return F(i.setup2fa(e))}),d(1),l(2,"translate"),m()}n&2&&(t(),b(" ",p(2,1,"users.setup_2fa")," "))}function Xe(n,a){if(n&1){let v=V();s(0,"button",19),g("click",function(){j(v);let e=$().$implicit,i=$();return F(i.disable2fa(e))}),d(1),l(2,"translate"),m()}n&2&&(t(),b(" ",p(2,1,"users.setup_2fa_disable")," "))}function Ye(n,a){if(n&1){let v=V();s(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"span",12),c(5,"h4",13)(6,"h5",14),m()(),s(7,"div",15),U(8,Ke,3,3,"button",16)(9,We,3,3,"button",17)(10,Xe,3,3,"button",18),s(11,"button",19),g("click",function(){let e=j(v).$implicit,i=$();return F(i.openEditUser(e))}),d(12),l(13,"translate"),m()()()()()}if(n&2){let v=a.$implicit,r=$();t(5),u("innerText",v.name),t(),u("innerText",v.username),t(2),u("ngIf",r.$auth.user.username!==v.username),t(),u("ngIf",r.$auth.user.username===v.username&&!v.otpActive),t(),u("ngIf",r.$auth.user.username===v.username&&v.otpActive),t(2),x(p(13,6,"form.button_edit"))}}var je=(()=>{let a=class a{constructor(r,e,i,_,re,Ve){o(this,"$api");o(this,"$auth");o(this,"$modal");o(this,"$route");o(this,"$toastr");o(this,"$translate");o(this,"homebridgeUsers");this.$api=r,this.$auth=e,this.$modal=i,this.$route=_,this.$toastr=re,this.$translate=Ve}ngOnInit(){this.$route.data.subscribe(r=>{this.homebridgeUsers=r.homebridgeUsers})}reloadUsers(){return this.$api.get("/users").subscribe(r=>{this.homebridgeUsers=r})}openAddNewUser(){this.$modal.open(Be,{size:"lg",backdrop:"static"}).result.finally(()=>{this.reloadUsers()})}openEditUser(r){let e=this.$modal.open(Ne,{size:"lg",backdrop:"static"});e.componentInstance.user=r,e.result.finally(()=>{this.reloadUsers()})}deleteUser(r){this.$api.delete(`/users/${r}`).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.toast_user_deleted"),this.$translate.instant("toast.title_success")),this.reloadUsers()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_delete_user"),this.$translate.instant("toast.title_error"))}})}setup2fa(r){let e=this.$modal.open(ke,{size:"lg",backdrop:"static"});e.componentInstance.user=r,e.result.finally(()=>{this.reloadUsers()})}disable2fa(r){let e=this.$modal.open(Ie,{size:"lg",backdrop:"static"});e.componentInstance.user=r,e.result.finally(()=>{this.reloadUsers()})}};o(a,"\u0275fac",function(e){return new(e||a)(f(I),f(H),f(Ce),f(be),f(E),f(S))}),o(a,"\u0275cmp",k({type:a,selectors:[["app-users"]],decls:11,vars:7,consts:[[1,"row","mb-3"],[1,"col-9"],[1,"primary-text","m-0"],[1,"col-3","text-right"],[1,"btn","btn-elegant","waves-effect","m-0",3,"click"],[1,"fas","fa-fw","fa-plus"],[1,"row"],["class","col-md-6 mb-4",4,"ngFor","ngForOf"],[1,"col-md-6","mb-4"],[1,"card","card-body"],[1,"d-flex","flex-column"],[1,"d-flex","flex-row","mb-3"],[1,"me-auto","my-0"],[3,"innerText"],[1,"small","text-truncate","primary-text",3,"innerText"],[1,"d-flex","flex-row","justify-content-between",2,"gap","10px"],["class","btn btn-elegant btn-sml m-0",3,"click",4,"ngIf"],["class","btn btn-primary mt-0 m-0",3,"click",4,"ngIf"],["class","btn btn-primary m-0",3,"click",4,"ngIf"],[1,"btn","btn-primary","m-0",3,"click"],[1,"btn","btn-elegant","btn-sml","m-0",3,"click"],[1,"btn","btn-primary","mt-0","m-0",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h3",2),d(3),l(4,"translate"),m()(),s(5,"div",3)(6,"button",4),l(7,"translate"),g("click",function(){return i.openAddNewUser()}),c(8,"i",5),m()()(),s(9,"div",6),U(10,Ye,14,8,"div",7),m()),e&2&&(t(3),x(p(4,3,"users.title_users")),t(3),h("aria-label",p(7,5,"users.button_add_user")),t(4),u("ngForOf",i.homebridgeUsers))},dependencies:[ue,G,T],encapsulation:2}));let n=a;return n})();var ie=(()=>{let a=class a{constructor(r,e,i,_){o(this,"$api");o(this,"$router");o(this,"$toastr");o(this,"$translate");this.$api=r,this.$router=e,this.$toastr=i,this.$translate=_}resolve(){return se(this,null,function*(){try{return yield oe(this.$api.get("/users"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}};o(a,"\u0275fac",function(e){return new(e||a)(q(I),q(_e),q(E),q(S))}),o(a,"\u0275prov",le({token:a,factory:a.\u0275fac}));let n=a;return n})();var Ze=[{path:"",component:je,resolve:{homebridgeUsers:ie}}],Fe=(()=>{let a=class a{};o(a,"\u0275fac",function(e){return new(e||a)}),o(a,"\u0275mod",R({type:a})),o(a,"\u0275inj",Q({imports:[ne.forChild(Ze),ne]}));let n=a;return n})();var Qt=(()=>{let a=class a{};o(a,"\u0275fac",function(e){return new(e||a)}),o(a,"\u0275mod",R({type:a})),o(a,"\u0275inj",Q({providers:[ie],imports:[fe,ge,xe,ve.forChild(),$e,Se,Fe]}));let n=a;return n})();export{Qt as UsersModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-AM3VWXMR.js";import{f as ae}from"./chunk-ZRQZU5HN.js";import{a as se}from"./chunk-BROJRIZL.js";import"./chunk-VYUN5WLM.js";import"./chunk-S5FRWQPT.js";import"./chunk-3DLNWL2R.js";import"./chunk-7SIWB246.js";import"./chunk-EX6EQLNK.js";import{c as L}from"./chunk-QOPI77FO.js";import{N as ne,Q as oe,c as K,d as C,e as J,f as Q,g as X,j as M,m as Y,p as Z,q as ee,y as te,z as ie}from"./chunk-FBJAWKJ3.js";import{b as U,c as H,k as A,m as q}from"./chunk-FJK4IAO5.js";import{a as W,b as G,c as D}from"./chunk-J6XB3JBO.js";import{$ as B,$b as R,Ga as z,La as m,Pb as V,Rb as O,Ua as o,Va as l,Wa as f,X as k,Za as I,aa as F,ab as b,bb as _,h as s,ha as v,i as y,ia as x,jb as p,kb as u,lb as w,nc as j,t as S,tc as N,ub as P,vb as $,vc as T,wa as n,xa as h,yb as c,zb as d}from"./chunk-IKFLHM2X.js";var E=(e,a)=>({"is-valid":e,"is-invalid":a}),ge=e=>({"button-loading":e});function _e(e,a){if(e&1){let t=I();o(0,"div",3),f(1,"img",4),o(2,"h3",5),p(3),c(4,"translate"),l(),o(5,"button",6),b("click",function(){v(t);let r=_();return x(r.onClickGettingStarted())}),p(6),c(7,"translate"),l(),o(8,"small",7)(9,"a",8),b("click",function(){v(t);let r=_();return x(r.onClickRestoreBackup())}),p(10),c(11,"translate"),l()()()}e&2&&(n(3),u(d(4,3,"setup.welcome_to_homebridge")),n(3),w(" ",d(7,5,"setup.button_get_started")," "),n(4),u(d(11,7,"setup_wizard_message_restore")))}function he(e,a){if(e&1){let t=I();o(0,"div",3),f(1,"img",9),o(2,"h3",5),p(3),c(4,"translate"),l(),o(5,"div",10)(6,"p"),p(7),c(8,"translate"),l(),o(9,"form",11),b("ngSubmit",function(){v(t);let r=_();return x(r.createFirstUser())}),o(10,"div",12),f(11,"i",13)(12,"input",14),o(13,"label",15),p(14),c(15,"translate"),l()(),o(16,"div",12),f(17,"i",16)(18,"input",17),o(19,"label",18),p(20),c(21,"translate"),l()(),o(22,"div",12),f(23,"i",16)(24,"input",19),o(25,"label",20),p(26),c(27,"translate"),l()(),o(28,"div",21)(29,"button",22),p(30),c(31,"translate"),f(32,"i",23),l()()()()()}if(e&2){let t=_();n(3),u(d(4,15,"setup.create_account")),n(4),u(d(8,17,"setup.create_account_reason")),n(2),m("formGroup",t.createUserForm),n(3),m("readonly",t.loading)("ngClass",$(27,E,t.createUserForm.controls.username.dirty&&t.createUserForm.controls.username.valid,t.createUserForm.controls.username.dirty&&t.createUserForm.controls.username.invalid)),n(2),u(d(15,19,"users.label_username")),n(4),m("readonly",t.loading)("ngClass",$(30,E,t.createUserForm.controls.password.dirty&&t.createUserForm.controls.password.valid,t.createUserForm.controls.password.dirty&&t.createUserForm.controls.password.errors)),n(2),u(d(21,21,"users.label_password")),n(4),m("readonly",t.loading)("ngClass",$(33,E,t.createUserForm.controls.passwordConfirm.dirty&&t.createUserForm.controls.passwordConfirm.valid,t.createUserForm.controls.passwordConfirm.dirty&&t.createUserForm.controls.passwordConfirm.errors)),n(2),u(d(27,23,"users.label_confirm_password")),n(3),m("disabled",t.createUserForm.invalid||t.loading)("ngClass",P(36,ge,t.loading)),n(),w(" ",d(31,25,"setup.create_account")," ")}}function ve(e,a){e&1&&(o(0,"span"),f(1,"i",31),p(2),c(3,"translate"),l()),e&2&&(n(2),w(" ",d(3,1,"backup.label_uploading")," "))}function xe(e,a){e&1&&(o(0,"span"),p(1),c(2,"translate"),l()),e&2&&(n(),u(d(2,1,"backup.button_restore_backup")))}function be(e,a){if(e&1){let t=I();o(0,"div",3),f(1,"img",9),o(2,"h3",5),p(3),c(4,"translate"),l(),o(5,"p"),p(6),c(7,"translate"),l(),o(8,"div",24)(9,"input",25),b("change",function(r){v(t);let g=_();return x(g.handleRestoreFileInput(r.target.files))}),l(),o(10,"label",26),p(11),c(12,"translate"),l()(),o(13,"div",27)(14,"button",28),b("click",function(){v(t);let r=_();return x(r.onClickCancelRestore())}),p(15),c(16,"translate"),l(),o(17,"button",29),b("click",function(){v(t);let r=_();return x(r.onRestoreBackupClick())}),z(18,ve,4,3,"span",30)(19,xe,3,3,"span",30),l()()()}if(e&2){let t=_();n(3),u(d(4,8,"form.button_restore")),n(3),u(d(7,10,"backup.restore_help_one")),n(5),w(" ",d(12,12,(t.selectedFile==null?null:t.selectedFile.name)||"backup.label_choose_backup_file_to_restore")," "),n(3),m("disabled",t.restoreUploadStarted),n(),w(" ",d(16,14,"form.button_cancel")," "),n(2),m("disabled",t.restoreUploading||!t.selectedFile),n(),m("ngIf",t.restoreUploading),n(),m("ngIf",!t.restoreUploading)}}function we(e,a){e&1&&(o(0,"div",3),f(1,"img",9),o(2,"h3",5),p(3),c(4,"translate"),l(),o(5,"h1"),f(6,"i",31),l()()),e&2&&(n(3),u(d(4,1,"restart.title_restart")))}function Ce(e,a){e&1&&(o(0,"div",3),f(1,"img",9),o(2,"h3",32),p(3),c(4,"translate"),l(),o(5,"p",33),p(6),c(7,"translate"),l(),o(8,"a",34),p(9),c(10,"translate"),l()()),e&2&&(n(3),u(d(4,3,"setup_wizard_message_complete_title")),n(3),u(d(7,5,"setup_wizard_message_complete_message")),n(3),u(d(10,7,"setup.open_dashboard")))}var pe=(()=>{let a=class a{constructor(i,r,g,de,me,ue,fe){s(this,"$api");s(this,"$auth");s(this,"$modal");s(this,"$settings");s(this,"$title");s(this,"$toastr");s(this,"$translate");s(this,"previousTitle");s(this,"step","welcome");s(this,"createUserForm",new X({username:new M("",[C.required]),password:new M("",[C.compose([C.required,C.minLength(4)])]),passwordConfirm:new M("",[C.required])},this.matchPassword));s(this,"loading",!1);s(this,"selectedFile");s(this,"restoreUploading",!1);this.$api=i,this.$auth=r,this.$modal=g,this.$settings=de,this.$title=me,this.$toastr=ue,this.$translate=fe}ngOnInit(){this.previousTitle=this.$title.getTitle(),this.$title.setTitle("Setup Homebridge")}matchPassword(i){let r=i.get("password").value,g=i.get("passwordConfirm").value;if(r!==g)i.get("passwordConfirm").setErrors({matchPassword:!0});else return null}ngOnDestroy(){this.$title.setTitle(this.previousTitle)}onClickGettingStarted(){this.step="create-account"}onClickRestoreBackup(){this.step="restore-backup"}onClickCancelRestore(){this.selectedFile=null,this.step="welcome"}createFirstUser(){this.loading=!0;let i=this.createUserForm.getRawValue();i.name=i.username,this.$api.post("/setup-wizard/create-first-user",i).subscribe({next:()=>y(this,null,function*(){this.$settings.env.setupWizardComplete=!0,yield this.$auth.login({username:i.username,password:i.password}),this.step="setup-complete"}),error:r=>{this.loading=!1,console.error(r),this.$toastr.error(r.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(i){i.length?this.selectedFile=i[0]:delete this.selectedFile}onRestoreBackupClick(){this.restoreUploading=!0,this.uploadHomebridgeArchive()}uploadHomebridgeArchive(){return y(this,null,function*(){try{let i=yield S(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,i.access_token),this.$auth.token=i.access_token;let r=new FormData;r.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield S(this.$api.post("/backup/restore",r)),this.openRestoreModal(),this.restoreUploading=!1}catch(i){this.restoreUploading=!1,console.error(i),this.$toastr.error(i.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}openRestoreModal(){let i=this.$modal.open(se,{size:"lg",backdrop:"static"});i.componentInstance.setupWizardRestore=!0,i.result.then(r=>{r===!0&&this.waitForHomebridgeToRestart()})}waitForHomebridgeToRestart(){return y(this,null,function*(){this.step="restarting",window.localStorage.removeItem(U.jwt.tokenKey),this.$auth.token=null,yield new Promise(r=>setTimeout(r,15e3));let i=setInterval(()=>y(this,null,function*(){try{yield S(this.$api.get("/auth/settings")),clearInterval(i),location.reload()}catch{}}),1e3)})}};s(a,"\u0275fac",function(r){return new(r||a)(h(H),h(L),h(ne),h(q),h(j),h(A),h(W))}),s(a,"\u0275cmp",B({type:a,selectors:[["ng-component"]],decls:7,vars:5,consts:[[1,"setup-container","d-flex","align-items-center","justify-content-center"],[1,"w-100","setup-card","d-flex","py-5"],["class","w-100 d-flex flex-column align-items-center",4,"ngIf"],[1,"w-100","d-flex","flex-column","align-items-center"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","mx-auto"],[1,"pt-4","pb-3","text-center"],["type","button",1,"btn","btn-lg","btn-primary",3,"click"],[1,"mt-3"],["href","javascript:void(0)",1,"grey-text",3,"click"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","homebridge-logo-small","mx-auto"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"md-form"],[1,"fas","fa-fw","fa-user","prefix","grey-text"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-username"],[1,"fas","fa-fw","fa-lock","prefix","grey-text"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass-confirm"],[1,"w-100","text-center"],["type","submit",1,"btn","btn-primary",3,"disabled","ngClass"],[1,"button-loading-overlay","fas","fa-fw","fa-spinner","fa-pulse"],[1,"custom-file"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"custom-file-input",3,"change"],["for","restoreFileUpload",1,"custom-file-label"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ml-0",3,"click","disabled"],["type","button",1,"btn","btn-primary","mr-0",3,"click","disabled"],[4,"ngIf"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"pt-4","pb-3"],[1,"text-center"],["routerLink","/",1,"btn","btn-lg","btn-primary","mt-3"]],template:function(r,g){r&1&&(o(0,"div",0)(1,"div",1),z(2,_e,12,9,"div",2)(3,he,33,38,"div",2)(4,be,20,16,"div",2)(5,we,7,3,"div",2)(6,Ce,11,9,"div",2),l()()),r&2&&(n(2),m("ngIf",g.step==="welcome"),n(),m("ngIf",g.step==="create-account"),n(),m("ngIf",g.step==="restore-backup"),n(),m("ngIf",g.step==="restarting"),n(),m("ngIf",g.step==="setup-complete"))},dependencies:[V,O,Y,K,J,Q,Z,ee,N,G],styles:[".setup-container[_ngcontent-%COMP%]{background-size:cover;z-index:-1;padding-top:1em;padding-bottom:1em}@media screen and (min-height: 500px) and (min-width: 600px){.setup-container[_ngcontent-%COMP%]{padding-top:4em}}.setup-card[_ngcontent-%COMP%]{max-width:600px;border-radius:15px;background-color:#fff;padding-right:25px;padding-left:25px}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 600px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.homebridge-logo[_ngcontent-%COMP%]{margin-right:10px;height:200px}@media screen and (max-height: 500px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}@media screen and (max-width: 600px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}.homebridge-logo-small[_ngcontent-%COMP%]{height:50px}.button-loading[_ngcontent-%COMP%]{position:relative;color:#0000}.button-loading[_ngcontent-%COMP%] .button-loading-overlay[_ngcontent-%COMP%]{display:block;color:#fff}.button-loading-overlay[_ngcontent-%COMP%]{display:none;position:absolute;top:9px;left:0;right:0}small[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}"]}));let e=a;return e})();var ye=[{path:"",component:pe}],ce=(()=>{let a=class a{};s(a,"\u0275fac",function(r){return new(r||a)}),s(a,"\u0275mod",F({type:a})),s(a,"\u0275inj",k({imports:[T.forChild(ye),T]}));let e=a;return e})();var Ze=(()=>{let a=class a{};s(a,"\u0275fac",function(r){return new(r||a)}),s(a,"\u0275mod",F({type:a})),s(a,"\u0275inj",k({providers:[re],imports:[R,te,ie,D,oe,ae,ce]}));let e=a;return e})();export{Ze as SetupWizardModule};
|
|
1
|
+
import{a as re}from"./chunk-SI3MSSTT.js";import{f as ae}from"./chunk-HPRZRVV7.js";import{a as se}from"./chunk-Q7MYZYMQ.js";import"./chunk-THFLPY67.js";import"./chunk-C4VKSYGU.js";import"./chunk-47MGIKRX.js";import"./chunk-CKS7IGEQ.js";import"./chunk-JM7QCDMZ.js";import{c as L}from"./chunk-TTLBPD7L.js";import{N as ne,Q as oe,c as K,d as C,e as J,f as Q,g as X,j as M,m as Y,p as Z,q as ee,y as te,z as ie}from"./chunk-WCDFKYP6.js";import{b as U,c as H,k as A,m as q}from"./chunk-PSLVYKAC.js";import{a as W,b as G,c as D}from"./chunk-F22FMU37.js";import{$ as B,$b as R,Ga as z,La as m,Pb as V,Rb as O,Ua as o,Va as l,Wa as f,X as k,Za as I,aa as F,ab as b,bb as _,h as s,ha as v,i as y,ia as x,jb as p,kb as u,lb as w,nc as j,t as S,tc as N,ub as P,vb as $,vc as T,wa as n,xa as h,yb as c,zb as d}from"./chunk-IGUSDGD6.js";var E=(e,a)=>({"is-valid":e,"is-invalid":a}),ge=e=>({"button-loading":e});function _e(e,a){if(e&1){let t=I();o(0,"div",3),f(1,"img",4),o(2,"h3",5),p(3),c(4,"translate"),l(),o(5,"button",6),b("click",function(){v(t);let r=_();return x(r.onClickGettingStarted())}),p(6),c(7,"translate"),l(),o(8,"small",7)(9,"a",8),b("click",function(){v(t);let r=_();return x(r.onClickRestoreBackup())}),p(10),c(11,"translate"),l()()()}e&2&&(n(3),u(d(4,3,"setup.welcome_to_homebridge")),n(3),w(" ",d(7,5,"setup.button_get_started")," "),n(4),u(d(11,7,"setup_wizard_message_restore")))}function he(e,a){if(e&1){let t=I();o(0,"div",3),f(1,"img",9),o(2,"h3",5),p(3),c(4,"translate"),l(),o(5,"div",10)(6,"p"),p(7),c(8,"translate"),l(),o(9,"form",11),b("ngSubmit",function(){v(t);let r=_();return x(r.createFirstUser())}),o(10,"div",12),f(11,"i",13)(12,"input",14),o(13,"label",15),p(14),c(15,"translate"),l()(),o(16,"div",12),f(17,"i",16)(18,"input",17),o(19,"label",18),p(20),c(21,"translate"),l()(),o(22,"div",12),f(23,"i",16)(24,"input",19),o(25,"label",20),p(26),c(27,"translate"),l()(),o(28,"div",21)(29,"button",22),p(30),c(31,"translate"),f(32,"i",23),l()()()()()}if(e&2){let t=_();n(3),u(d(4,15,"setup.create_account")),n(4),u(d(8,17,"setup.create_account_reason")),n(2),m("formGroup",t.createUserForm),n(3),m("readonly",t.loading)("ngClass",$(27,E,t.createUserForm.controls.username.dirty&&t.createUserForm.controls.username.valid,t.createUserForm.controls.username.dirty&&t.createUserForm.controls.username.invalid)),n(2),u(d(15,19,"users.label_username")),n(4),m("readonly",t.loading)("ngClass",$(30,E,t.createUserForm.controls.password.dirty&&t.createUserForm.controls.password.valid,t.createUserForm.controls.password.dirty&&t.createUserForm.controls.password.errors)),n(2),u(d(21,21,"users.label_password")),n(4),m("readonly",t.loading)("ngClass",$(33,E,t.createUserForm.controls.passwordConfirm.dirty&&t.createUserForm.controls.passwordConfirm.valid,t.createUserForm.controls.passwordConfirm.dirty&&t.createUserForm.controls.passwordConfirm.errors)),n(2),u(d(27,23,"users.label_confirm_password")),n(3),m("disabled",t.createUserForm.invalid||t.loading)("ngClass",P(36,ge,t.loading)),n(),w(" ",d(31,25,"setup.create_account")," ")}}function ve(e,a){e&1&&(o(0,"span"),f(1,"i",31),p(2),c(3,"translate"),l()),e&2&&(n(2),w(" ",d(3,1,"backup.label_uploading")," "))}function xe(e,a){e&1&&(o(0,"span"),p(1),c(2,"translate"),l()),e&2&&(n(),u(d(2,1,"backup.button_restore_backup")))}function be(e,a){if(e&1){let t=I();o(0,"div",3),f(1,"img",9),o(2,"h3",5),p(3),c(4,"translate"),l(),o(5,"p"),p(6),c(7,"translate"),l(),o(8,"div",24)(9,"input",25),b("change",function(r){v(t);let g=_();return x(g.handleRestoreFileInput(r.target.files))}),l(),o(10,"label",26),p(11),c(12,"translate"),l()(),o(13,"div",27)(14,"button",28),b("click",function(){v(t);let r=_();return x(r.onClickCancelRestore())}),p(15),c(16,"translate"),l(),o(17,"button",29),b("click",function(){v(t);let r=_();return x(r.onRestoreBackupClick())}),z(18,ve,4,3,"span",30)(19,xe,3,3,"span",30),l()()()}if(e&2){let t=_();n(3),u(d(4,8,"form.button_restore")),n(3),u(d(7,10,"backup.restore_help_one")),n(5),w(" ",d(12,12,(t.selectedFile==null?null:t.selectedFile.name)||"backup.label_choose_backup_file_to_restore")," "),n(3),m("disabled",t.restoreUploadStarted),n(),w(" ",d(16,14,"form.button_cancel")," "),n(2),m("disabled",t.restoreUploading||!t.selectedFile),n(),m("ngIf",t.restoreUploading),n(),m("ngIf",!t.restoreUploading)}}function we(e,a){e&1&&(o(0,"div",3),f(1,"img",9),o(2,"h3",5),p(3),c(4,"translate"),l(),o(5,"h1"),f(6,"i",31),l()()),e&2&&(n(3),u(d(4,1,"restart.title_restart")))}function Ce(e,a){e&1&&(o(0,"div",3),f(1,"img",9),o(2,"h3",32),p(3),c(4,"translate"),l(),o(5,"p",33),p(6),c(7,"translate"),l(),o(8,"a",34),p(9),c(10,"translate"),l()()),e&2&&(n(3),u(d(4,3,"setup_wizard_message_complete_title")),n(3),u(d(7,5,"setup_wizard_message_complete_message")),n(3),u(d(10,7,"setup.open_dashboard")))}var pe=(()=>{let a=class a{constructor(i,r,g,de,me,ue,fe){s(this,"$api");s(this,"$auth");s(this,"$modal");s(this,"$settings");s(this,"$title");s(this,"$toastr");s(this,"$translate");s(this,"previousTitle");s(this,"step","welcome");s(this,"createUserForm",new X({username:new M("",[C.required]),password:new M("",[C.compose([C.required,C.minLength(4)])]),passwordConfirm:new M("",[C.required])},this.matchPassword));s(this,"loading",!1);s(this,"selectedFile");s(this,"restoreUploading",!1);this.$api=i,this.$auth=r,this.$modal=g,this.$settings=de,this.$title=me,this.$toastr=ue,this.$translate=fe}ngOnInit(){this.previousTitle=this.$title.getTitle(),this.$title.setTitle("Setup Homebridge")}matchPassword(i){let r=i.get("password").value,g=i.get("passwordConfirm").value;if(r!==g)i.get("passwordConfirm").setErrors({matchPassword:!0});else return null}ngOnDestroy(){this.$title.setTitle(this.previousTitle)}onClickGettingStarted(){this.step="create-account"}onClickRestoreBackup(){this.step="restore-backup"}onClickCancelRestore(){this.selectedFile=null,this.step="welcome"}createFirstUser(){this.loading=!0;let i=this.createUserForm.getRawValue();i.name=i.username,this.$api.post("/setup-wizard/create-first-user",i).subscribe({next:()=>y(this,null,function*(){this.$settings.env.setupWizardComplete=!0,yield this.$auth.login({username:i.username,password:i.password}),this.step="setup-complete"}),error:r=>{this.loading=!1,console.error(r),this.$toastr.error(r.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(i){i.length?this.selectedFile=i[0]:delete this.selectedFile}onRestoreBackupClick(){this.restoreUploading=!0,this.uploadHomebridgeArchive()}uploadHomebridgeArchive(){return y(this,null,function*(){try{let i=yield S(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,i.access_token),this.$auth.token=i.access_token;let r=new FormData;r.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield S(this.$api.post("/backup/restore",r)),this.openRestoreModal(),this.restoreUploading=!1}catch(i){this.restoreUploading=!1,console.error(i),this.$toastr.error(i.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}openRestoreModal(){let i=this.$modal.open(se,{size:"lg",backdrop:"static"});i.componentInstance.setupWizardRestore=!0,i.result.then(r=>{r===!0&&this.waitForHomebridgeToRestart()})}waitForHomebridgeToRestart(){return y(this,null,function*(){this.step="restarting",window.localStorage.removeItem(U.jwt.tokenKey),this.$auth.token=null,yield new Promise(r=>setTimeout(r,15e3));let i=setInterval(()=>y(this,null,function*(){try{yield S(this.$api.get("/auth/settings")),clearInterval(i),location.reload()}catch{}}),1e3)})}};s(a,"\u0275fac",function(r){return new(r||a)(h(H),h(L),h(ne),h(q),h(j),h(A),h(W))}),s(a,"\u0275cmp",B({type:a,selectors:[["ng-component"]],decls:7,vars:5,consts:[[1,"setup-container","d-flex","align-items-center","justify-content-center"],[1,"w-100","setup-card","d-flex","py-5"],["class","w-100 d-flex flex-column align-items-center",4,"ngIf"],[1,"w-100","d-flex","flex-column","align-items-center"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","mx-auto"],[1,"pt-4","pb-3","text-center"],["type","button",1,"btn","btn-lg","btn-primary",3,"click"],[1,"mt-3"],["href","javascript:void(0)",1,"grey-text",3,"click"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","homebridge-logo-small","mx-auto"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"md-form"],[1,"fas","fa-fw","fa-user","prefix","grey-text"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-username"],[1,"fas","fa-fw","fa-lock","prefix","grey-text"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass-confirm"],[1,"w-100","text-center"],["type","submit",1,"btn","btn-primary",3,"disabled","ngClass"],[1,"button-loading-overlay","fas","fa-fw","fa-spinner","fa-pulse"],[1,"custom-file"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"custom-file-input",3,"change"],["for","restoreFileUpload",1,"custom-file-label"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ml-0",3,"click","disabled"],["type","button",1,"btn","btn-primary","mr-0",3,"click","disabled"],[4,"ngIf"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"pt-4","pb-3"],[1,"text-center"],["routerLink","/",1,"btn","btn-lg","btn-primary","mt-3"]],template:function(r,g){r&1&&(o(0,"div",0)(1,"div",1),z(2,_e,12,9,"div",2)(3,he,33,38,"div",2)(4,be,20,16,"div",2)(5,we,7,3,"div",2)(6,Ce,11,9,"div",2),l()()),r&2&&(n(2),m("ngIf",g.step==="welcome"),n(),m("ngIf",g.step==="create-account"),n(),m("ngIf",g.step==="restore-backup"),n(),m("ngIf",g.step==="restarting"),n(),m("ngIf",g.step==="setup-complete"))},dependencies:[V,O,Y,K,J,Q,Z,ee,N,G],styles:[".setup-container[_ngcontent-%COMP%]{background-size:cover;z-index:-1;padding-top:1em;padding-bottom:1em}@media screen and (min-height: 500px) and (min-width: 600px){.setup-container[_ngcontent-%COMP%]{padding-top:4em}}.setup-card[_ngcontent-%COMP%]{max-width:600px;border-radius:15px;background-color:#fff;padding-right:25px;padding-left:25px}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 600px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.homebridge-logo[_ngcontent-%COMP%]{margin-right:10px;height:200px}@media screen and (max-height: 500px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}@media screen and (max-width: 600px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}.homebridge-logo-small[_ngcontent-%COMP%]{height:50px}.button-loading[_ngcontent-%COMP%]{position:relative;color:#0000}.button-loading[_ngcontent-%COMP%] .button-loading-overlay[_ngcontent-%COMP%]{display:block;color:#fff}.button-loading-overlay[_ngcontent-%COMP%]{display:none;position:absolute;top:9px;left:0;right:0}small[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}"]}));let e=a;return e})();var ye=[{path:"",component:pe}],ce=(()=>{let a=class a{};s(a,"\u0275fac",function(r){return new(r||a)}),s(a,"\u0275mod",F({type:a})),s(a,"\u0275inj",k({imports:[T.forChild(ye),T]}));let e=a;return e})();var Ze=(()=>{let a=class a{};s(a,"\u0275fac",function(r){return new(r||a)}),s(a,"\u0275mod",F({type:a})),s(a,"\u0275inj",k({providers:[re],imports:[R,te,ie,D,oe,ae,ce]}));let e=a;return e})();export{Ze as SetupWizardModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$b as m,X as i,aa as o,h as r,vc as a}from"./chunk-IGUSDGD6.js";var l=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-XLAWLJES.js").then(e=>e.DockerModule)},{path:"linux",loadChildren:()=>import("./chunk-HXKR7RPF.js").then(e=>e.LinuxModule)},{path:"terminal",loadChildren:()=>import("./chunk-DLVT4K74.js").then(e=>e.TerminalModule)}],c=(()=>{let t=class t{};r(t,"\u0275fac",function(n){return new(n||t)}),r(t,"\u0275mod",o({type:t})),r(t,"\u0275inj",i({imports:[a.forChild(l),a]}));let e=t;return e})();var C=(()=>{let t=class t{};r(t,"\u0275fac",function(n){return new(n||t)}),r(t,"\u0275mod",o({type:t})),r(t,"\u0275inj",i({imports:[m,c]}));let e=t;return e})();export{C as PlatformToolsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as D,Q as F,z as R}from"./chunk-
|
|
1
|
+
import{O as D,Q as F,z as R}from"./chunk-WCDFKYP6.js";import{c as N,k as O,m as H}from"./chunk-PSLVYKAC.js";import{a as M,b as P,c as B}from"./chunk-F22FMU37.js";import{$ as S,$b as V,Ga as I,La as _,Rb as j,Ua as s,Va as a,Wa as k,X as g,Za as h,aa as x,ab as d,bb as y,h as r,ha as b,ia as w,jb as l,kb as T,lb as f,sc as E,vc as $,wa as o,xa as u,yb as p,zb as c}from"./chunk-IGUSDGD6.js";function J(e,t){if(e&1){let v=h();s(0,"p",5)(1,"button",6),d("click",function(){b(v);let i=y();return w(i.restartServer())}),l(2),p(3,"translate"),a()()}e&2&&(o(2),f(" ",c(3,1,"menu.linux.label_restart_server")," "))}function K(e,t){if(e&1){let v=h();s(0,"p",5)(1,"button",6),d("click",function(){b(v);let i=y();return w(i.shutdownServer())}),l(2),p(3,"translate"),a()()}e&2&&(o(2),f(" ",c(3,1,"menu.linux.label_shutdown_server")," "))}function L(e,t){if(e&1){let v=h();s(0,"p",5)(1,"button",6),d("click",function(){b(v);let i=y();return w(i.dockerRestartContainer())}),l(2),p(3,"translate"),a()()}e&2&&(o(2),f(" ",c(3,1,"menu.docker.restart_container")," "))}var A=(()=>{let t=class t{constructor(n,i,m,C,G){r(this,"$api");r(this,"$router");r(this,"$settings");r(this,"$toastr");r(this,"$translate");this.$api=n,this.$router=i,this.$settings=m,this.$toastr=C,this.$translate=G}restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}};r(t,"\u0275fac",function(i){return new(i||t)(u(N),u(E),u(H),u(O),u(M))}),r(t,"\u0275cmp",S({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"],["class","w-100 text-center my-5",4,"ngIf"]],template:function(i,m){i&1&&(s(0,"div",0)(1,"h3",1),l(2),p(3,"translate"),a()(),s(4,"div",2)(5,"div",3),k(6,"i",4),a(),s(7,"p",5)(8,"button",6),d("click",function(){return m.restartHomebridge()}),l(9),p(10,"translate"),a()(),s(11,"p",5)(12,"button",7),p(13,"translate"),d("click",function(){return m.restartHomebridgeService()}),l(14),p(15,"translate"),a()(),I(16,J,4,3,"p",8)(17,K,4,3,"p",8)(18,L,4,3,"p",8),a()),i&2&&(o(2),T(c(3,7,"menu.restart.title")),o(7),f(" ",c(10,9,"menu.hbrestart.confirm_hb")," "),o(3),_("ngbTooltip",c(13,11,"reset.force_restart_hb_help_text")),o(2),f(" ",c(15,13,"menu.hbrestart.confirm_ui")," "),o(2),_("ngIf",m.$settings.env.canShutdownRestartHost),o(),_("ngIf",m.$settings.env.canShutdownRestartHost),o(),_("ngIf",m.$settings.env.runningInDocker))},dependencies:[j,D,P],encapsulation:2}));let e=t;return e})();var Q=[{path:"",component:A}],q=(()=>{let t=class t{};r(t,"\u0275fac",function(i){return new(i||t)}),r(t,"\u0275mod",x({type:t})),r(t,"\u0275inj",g({imports:[$.forChild(Q),$]}));let e=t;return e})();var vt=(()=>{let t=class t{};r(t,"\u0275fac",function(i){return new(i||t)}),r(t,"\u0275mod",x({type:t})),r(t,"\u0275inj",g({imports:[V,q,F,R,B]}));let e=t;return e})();export{vt as PowerOptionsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R,b as K}from"./chunk-
|
|
1
|
+
import{a as R,b as K}from"./chunk-6T267MJT.js";import"./chunk-GNQUXZMN.js";import"./chunk-THFLPY67.js";import"./chunk-C4VKSYGU.js";import{a as I}from"./chunk-JM7QCDMZ.js";import"./chunk-TTLBPD7L.js";import{N as Q,O as q,Q as O}from"./chunk-WCDFKYP6.js";import{c as D,k as H}from"./chunk-PSLVYKAC.js";import{a as E,b as F,c as V}from"./chunk-F22FMU37.js";import{$ as x,$b as N,Ka as y,La as $,Ua as p,Va as d,Wa as b,X as f,Za as S,aa as u,ab as h,fb as j,g as G,gb as B,h as i,ha as w,hb as k,i as C,ia as v,jb as z,kb as M,l as T,va as L,vc as _,wa as g,xa as a,yb as l,zb as c}from"./chunk-IGUSDGD6.js";var A=G(K(),1);var U=["logoutput"],J=(()=>{let t=class t{constructor(o,e,r,s,m){i(this,"$api");i(this,"$log");i(this,"$modal");i(this,"$toastr");i(this,"$translate");i(this,"termTarget");i(this,"resizeEvent",new T);this.$api=o,this.$log=e,this.$modal=r,this.$toastr=s,this.$translate=m}onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget,{},this.resizeEvent)}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}downloadLogFile(){let o=this.$modal.open(I,{size:"lg",backdrop:"static"});o.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),o.componentInstance.message=this.$translate.instant("logs.download_warning"),o.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),o.componentInstance.faIconClass="fas fa-fw fa-user-secret primary-text",o.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,A.saveAs)(e.body,"homebridge.log.txt")},error:e=>C(this,null,function*(){let r;try{r=JSON.parse(yield e.error.text()).message}catch(s){console.error(s)}this.$toastr.error(r||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let o=this.$modal.open(I,{size:"lg",backdrop:"static"});o.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),o.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),o.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),o.componentInstance.confirmButtonClass="btn-danger",o.componentInstance.faIconClass="fas fa-fw fa-circle-exclamation primary-text",o.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}};i(t,"\u0275fac",function(e){return new(e||t)(a(D),a(R),a(Q),a(H),a(E))}),i(t,"\u0275cmp",x({type:t,selectors:[["ng-component"]],viewQuery:function(e,r){if(e&1&&j(U,7),e&2){let s;B(s=k())&&(r.termTarget=s.first)}},hostBindings:function(e,r){e&1&&h("resize",function(m){return r.onWindowResize(m)},!1,L)},decls:17,vars:15,consts:[["logoutput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-right"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","mr-0",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-trash-alt"],[1,"flex-column","d-flex","align-items-stretch","adjust-for-mobile"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"]],template:function(e,r){if(e&1){let s=S();p(0,"div",1)(1,"div",2)(2,"h3",3),z(3),l(4,"translate"),d()(),p(5,"div",4)(6,"button",5),l(7,"translate"),l(8,"translate"),h("click",function(){return w(s),v(r.downloadLogFile())}),b(9,"i",6),d(),p(10,"button",7),l(11,"translate"),l(12,"translate"),h("click",function(){return w(s),v(r.truncateLogFile())}),b(13,"i",8),d()()(),p(14,"div",9),b(15,"div",10,0),d()}e&2&&(g(3),M(c(4,5,"menu.linux.label_logs")),g(3),$("ngbTooltip",c(7,7,"form.button_download")),y("aria-label",c(8,9,"form.button_download")),g(4),$("ngbTooltip",c(11,11,"form.button_delete")),y("aria-label",c(12,13,"form.button_delete")))},dependencies:[q,F],encapsulation:2}));let n=t;return n})();var X=[{path:"",component:J}],P=(()=>{let t=class t{};i(t,"\u0275fac",function(e){return new(e||t)}),i(t,"\u0275mod",u({type:t})),i(t,"\u0275inj",f({imports:[_.forChild(X),_]}));let n=t;return n})();var ht=(()=>{let t=class t{};i(t,"\u0275fac",function(e){return new(e||t)}),i(t,"\u0275mod",u({type:t})),i(t,"\u0275inj",f({imports:[N,P,O,V.forChild()]}));let n=t;return n})();export{ht as LogsModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as Bo,a as po,b as Co,c as jD,e as Of,f as mo,h as Eo,i as ho,k as go,m as bo,o as Tf,r as yo,s as T1,t as P1,x as _o,y as k1,z as N1}from"./chunk-
|
|
1
|
+
import{M as Bo,a as po,b as Co,c as jD,e as Of,f as mo,h as Eo,i as ho,k as go,m as bo,o as Tf,r as yo,s as T1,t as P1,x as _o,y as k1,z as N1}from"./chunk-WCDFKYP6.js";import{c as lo,k as co,m as Fo}from"./chunk-PSLVYKAC.js";import{a as ao,b as so}from"./chunk-F22FMU37.js";import{$ as ue,$b as qD,Ca as ND,Fb as io,Ga as V,Ka as Y,La as g,Ma as uu,Na as Af,Oa as T,Qb as gu,R as At,Rb as ve,Ua as O,V as uo,Va as $,W as ff,Wa as j,X as $D,Xa as Do,Ya as ro,Z as OD,Za as Ae,a as k,aa as TD,ab as pe,b as Ee,ba as xf,bb as A,e as c,fb as If,g as du,ga as tf,gb as Sf,h as G,ha as _e,hb as $f,hc as oo,i as cu,ia as Be,jb as fu,k as J0,ka as fo,kb as Df,l as wf,lb as O1,na as ke,o as Q0,oa as to,pa as PD,rb as no,s as Z0,t as Y0,ta as ae,tb as tu,u as X0,wa as x,xa as M,y as eo,yb as rf,za as kD,zb as nf}from"./chunk-IGUSDGD6.js";var wo=c((EN,vo)=>{vo.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Pu=c(of=>{var q1,cC=[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];of.getSymbolSize=function(u){if(!u)throw new Error('"version" cannot be null or undefined');if(u<1||u>40)throw new Error('"version" should be in range from 1 to 40');return u*4+17};of.getSymbolTotalCodewords=function(u){return cC[u]};of.getBCHDigit=function(e){let u=0;for(;e!==0;)u++,e>>>=1;return u};of.setToSJISFunction=function(u){if(typeof u!="function")throw new Error('"toSJISFunc" is not a valid function.');q1=u};of.isKanjiModeEnabled=function(){return typeof q1<"u"};of.toSJIS=function(u){return q1(u)}});var MD=c(Ge=>{Ge.L={bit:1};Ge.M={bit:0};Ge.Q={bit:3};Ge.H={bit:2};function FC(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return Ge.L;case"m":case"medium":return Ge.M;case"q":case"quartile":return Ge.Q;case"h":case"high":return Ge.H;default:throw new Error("Unknown EC Level: "+e)}}Ge.isValid=function(u){return u&&typeof u.bit<"u"&&u.bit>=0&&u.bit<4};Ge.from=function(u,f){if(Ge.isValid(u))return u;try{return FC(u)}catch{return f}}});var Io=c((bN,Ao)=>{function xo(){this.buffer=[],this.length=0}xo.prototype={get:function(e){let u=Math.floor(e/8);return(this.buffer[u]>>>7-e%8&1)===1},put:function(e,u){for(let f=0;f<u;f++)this.putBit((e>>>u-f-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){let u=Math.floor(this.length/8);this.buffer.length<=u&&this.buffer.push(0),e&&(this.buffer[u]|=128>>>this.length%8),this.length++}};Ao.exports=xo});var $o=c((yN,So)=>{function It(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}It.prototype.set=function(e,u,f,t){let D=e*this.size+u;this.data[D]=f,t&&(this.reservedBit[D]=!0)};It.prototype.get=function(e,u){return this.data[e*this.size+u]};It.prototype.xor=function(e,u,f){this.data[e*this.size+u]^=f};It.prototype.isReserved=function(e,u){return this.reservedBit[e*this.size+u]};So.exports=It});var Oo=c(RD=>{var pC=Pu().getSymbolSize;RD.getRowColCoords=function(u){if(u===1)return[];let f=Math.floor(u/7)+2,t=pC(u),D=t===145?26:Math.ceil((t-13)/(2*f-2))*2,r=[t-7];for(let n=1;n<f-1;n++)r[n]=r[n-1]-D;return r.push(6),r.reverse()};RD.getPositions=function(u){let f=[],t=RD.getRowColCoords(u),D=t.length;for(let r=0;r<D;r++)for(let n=0;n<D;n++)r===0&&n===0||r===0&&n===D-1||r===D-1&&n===0||f.push([t[r],t[n]]);return f}});var ko=c(Po=>{var CC=Pu().getSymbolSize,To=7;Po.getPositions=function(u){let f=CC(u);return[[0,0],[f-To,0],[0,f-To]]}});var No=c(ne=>{ne.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var af={N1:3,N2:3,N3:40,N4:10};ne.isValid=function(u){return u!=null&&u!==""&&!isNaN(u)&&u>=0&&u<=7};ne.from=function(u){return ne.isValid(u)?parseInt(u,10):void 0};ne.getPenaltyN1=function(u){let f=u.size,t=0,D=0,r=0,n=null,i=null;for(let o=0;o<f;o++){D=r=0,n=i=null;for(let a=0;a<f;a++){let s=u.get(o,a);s===n?D++:(D>=5&&(t+=af.N1+(D-5)),n=s,D=1),s=u.get(a,o),s===i?r++:(r>=5&&(t+=af.N1+(r-5)),i=s,r=1)}D>=5&&(t+=af.N1+(D-5)),r>=5&&(t+=af.N1+(r-5))}return t};ne.getPenaltyN2=function(u){let f=u.size,t=0;for(let D=0;D<f-1;D++)for(let r=0;r<f-1;r++){let n=u.get(D,r)+u.get(D,r+1)+u.get(D+1,r)+u.get(D+1,r+1);(n===4||n===0)&&t++}return t*af.N2};ne.getPenaltyN3=function(u){let f=u.size,t=0,D=0,r=0;for(let n=0;n<f;n++){D=r=0;for(let i=0;i<f;i++)D=D<<1&2047|u.get(n,i),i>=10&&(D===1488||D===93)&&t++,r=r<<1&2047|u.get(i,n),i>=10&&(r===1488||r===93)&&t++}return t*af.N3};ne.getPenaltyN4=function(u){let f=0,t=u.data.length;for(let r=0;r<t;r++)f+=u.data[r];return Math.abs(Math.ceil(f*100/t/5)-10)*af.N4};function mC(e,u,f){switch(e){case ne.Patterns.PATTERN000:return(u+f)%2===0;case ne.Patterns.PATTERN001:return u%2===0;case ne.Patterns.PATTERN010:return f%3===0;case ne.Patterns.PATTERN011:return(u+f)%3===0;case ne.Patterns.PATTERN100:return(Math.floor(u/2)+Math.floor(f/3))%2===0;case ne.Patterns.PATTERN101:return u*f%2+u*f%3===0;case ne.Patterns.PATTERN110:return(u*f%2+u*f%3)%2===0;case ne.Patterns.PATTERN111:return(u*f%3+(u+f)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}ne.applyMask=function(u,f){let t=f.size;for(let D=0;D<t;D++)for(let r=0;r<t;r++)f.isReserved(r,D)||f.xor(r,D,mC(u,r,D))};ne.getBestMask=function(u,f){let t=Object.keys(ne.Patterns).length,D=0,r=1/0;for(let n=0;n<t;n++){f(n),ne.applyMask(n,u);let i=ne.getPenaltyN1(u)+ne.getPenaltyN2(u)+ne.getPenaltyN3(u)+ne.getPenaltyN4(u);ne.applyMask(n,u),i<r&&(r=i,D=n)}return D}});var M1=c(j1=>{var ku=MD(),LD=[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],VD=[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];j1.getBlocksCount=function(u,f){switch(f){case ku.L:return LD[(u-1)*4+0];case ku.M:return LD[(u-1)*4+1];case ku.Q:return LD[(u-1)*4+2];case ku.H:return LD[(u-1)*4+3];default:return}};j1.getTotalCodewordsCount=function(u,f){switch(f){case ku.L:return VD[(u-1)*4+0];case ku.M:return VD[(u-1)*4+1];case ku.Q:return VD[(u-1)*4+2];case ku.H:return VD[(u-1)*4+3];default:return}}});var qo=c(UD=>{var St=new Uint8Array(512),zD=new Uint8Array(256);(function(){let u=1;for(let f=0;f<255;f++)St[f]=u,zD[u]=f,u<<=1,u&256&&(u^=285);for(let f=255;f<512;f++)St[f]=St[f-255]})();UD.log=function(u){if(u<1)throw new Error("log("+u+")");return zD[u]};UD.exp=function(u){return St[u]};UD.mul=function(u,f){return u===0||f===0?0:St[zD[u]+zD[f]]}});var jo=c($t=>{var R1=qo();$t.mul=function(u,f){let t=new Uint8Array(u.length+f.length-1);for(let D=0;D<u.length;D++)for(let r=0;r<f.length;r++)t[D+r]^=R1.mul(u[D],f[r]);return t};$t.mod=function(u,f){let t=new Uint8Array(u);for(;t.length-f.length>=0;){let D=t[0];for(let n=0;n<f.length;n++)t[n]^=R1.mul(f[n],D);let r=0;for(;r<t.length&&t[r]===0;)r++;t=t.slice(r)}return t};$t.generateECPolynomial=function(u){let f=new Uint8Array([1]);for(let t=0;t<u;t++)f=$t.mul(f,new Uint8Array([1,R1.exp(t)]));return f}});var Lo=c((IN,Ro)=>{var Mo=jo();function L1(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}L1.prototype.initialize=function(u){this.degree=u,this.genPoly=Mo.generateECPolynomial(this.degree)};L1.prototype.encode=function(u){if(!this.genPoly)throw new Error("Encoder not initialized");let f=new Uint8Array(u.length+this.degree);f.set(u);let t=Mo.mod(f,this.genPoly),D=this.degree-t.length;if(D>0){let r=new Uint8Array(this.degree);return r.set(t,D),r}return t};Ro.exports=L1});var V1=c(Vo=>{Vo.isValid=function(u){return!isNaN(u)&&u>=1&&u<=40}});var z1=c(bu=>{var zo="[0-9]+",EC="[A-Z $%*+\\-./:]+",Ot="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ot=Ot.replace(/u/g,"\\u");var hC="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ot+`)(?:.|[\r
|
|
2
2
|
]))+`;bu.KANJI=new RegExp(Ot,"g");bu.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");bu.BYTE=new RegExp(hC,"g");bu.NUMERIC=new RegExp(zo,"g");bu.ALPHANUMERIC=new RegExp(EC,"g");var gC=new RegExp("^"+Ot+"$"),bC=new RegExp("^"+zo+"$"),yC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");bu.testKanji=function(u){return gC.test(u)};bu.testNumeric=function(u){return bC.test(u)};bu.testAlphanumeric=function(u){return yC.test(u)}});var Nu=c(ge=>{var _C=V1(),U1=z1();ge.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};ge.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};ge.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};ge.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};ge.MIXED={bit:-1};ge.getCharCountIndicator=function(u,f){if(!u.ccBits)throw new Error("Invalid mode: "+u);if(!_C.isValid(f))throw new Error("Invalid version: "+f);return f>=1&&f<10?u.ccBits[0]:f<27?u.ccBits[1]:u.ccBits[2]};ge.getBestModeForData=function(u){return U1.testNumeric(u)?ge.NUMERIC:U1.testAlphanumeric(u)?ge.ALPHANUMERIC:U1.testKanji(u)?ge.KANJI:ge.BYTE};ge.toString=function(u){if(u&&u.id)return u.id;throw new Error("Invalid mode")};ge.isValid=function(u){return u&&u.bit&&u.ccBits};function BC(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return ge.NUMERIC;case"alphanumeric":return ge.ALPHANUMERIC;case"kanji":return ge.KANJI;case"byte":return ge.BYTE;default:throw new Error("Unknown mode: "+e)}}ge.from=function(u,f){if(ge.isValid(u))return u;try{return BC(u)}catch{return f}}});var Wo=c(sf=>{var HD=Pu(),vC=M1(),Uo=MD(),qu=Nu(),H1=V1(),Ko=7973,Ho=HD.getBCHDigit(Ko);function wC(e,u,f){for(let t=1;t<=40;t++)if(u<=sf.getCapacity(t,f,e))return t}function Go(e,u){return qu.getCharCountIndicator(e,u)+4}function xC(e,u){let f=0;return e.forEach(function(t){let D=Go(t.mode,u);f+=D+t.getBitsLength()}),f}function AC(e,u){for(let f=1;f<=40;f++)if(xC(e,f)<=sf.getCapacity(f,u,qu.MIXED))return f}sf.from=function(u,f){return H1.isValid(u)?parseInt(u,10):f};sf.getCapacity=function(u,f,t){if(!H1.isValid(u))throw new Error("Invalid QR Code version");typeof t>"u"&&(t=qu.BYTE);let D=HD.getSymbolTotalCodewords(u),r=vC.getTotalCodewordsCount(u,f),n=(D-r)*8;if(t===qu.MIXED)return n;let i=n-Go(t,u);switch(t){case qu.NUMERIC:return Math.floor(i/10*3);case qu.ALPHANUMERIC:return Math.floor(i/11*2);case qu.KANJI:return Math.floor(i/13);case qu.BYTE:default:return Math.floor(i/8)}};sf.getBestVersionForData=function(u,f){let t,D=Uo.from(f,Uo.M);if(Array.isArray(u)){if(u.length>1)return AC(u,D);if(u.length===0)return 1;t=u[0]}else t=u;return wC(t.mode,t.getLength(),D)};sf.getEncodedBits=function(u){if(!H1.isValid(u)||u<7)throw new Error("Invalid QR Code version");let f=u<<12;for(;HD.getBCHDigit(f)-Ho>=0;)f^=Ko<<HD.getBCHDigit(f)-Ho;return u<<12|f}});var Yo=c(Zo=>{var K1=Pu(),Qo=1335,IC=21522,Jo=K1.getBCHDigit(Qo);Zo.getEncodedBits=function(u,f){let t=u.bit<<3|f,D=t<<10;for(;K1.getBCHDigit(D)-Jo>=0;)D^=Qo<<K1.getBCHDigit(D)-Jo;return(t<<10|D)^IC}});var ea=c((kN,Xo)=>{var SC=Nu();function Pf(e){this.mode=SC.NUMERIC,this.data=e.toString()}Pf.getBitsLength=function(u){return 10*Math.floor(u/3)+(u%3?u%3*3+1:0)};Pf.prototype.getLength=function(){return this.data.length};Pf.prototype.getBitsLength=function(){return Pf.getBitsLength(this.data.length)};Pf.prototype.write=function(u){let f,t,D;for(f=0;f+3<=this.data.length;f+=3)t=this.data.substr(f,3),D=parseInt(t,10),u.put(D,10);let r=this.data.length-f;r>0&&(t=this.data.substr(f),D=parseInt(t,10),u.put(D,r*3+1))};Xo.exports=Pf});var fa=c((NN,ua)=>{var $C=Nu(),G1=["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 kf(e){this.mode=$C.ALPHANUMERIC,this.data=e}kf.getBitsLength=function(u){return 11*Math.floor(u/2)+6*(u%2)};kf.prototype.getLength=function(){return this.data.length};kf.prototype.getBitsLength=function(){return kf.getBitsLength(this.data.length)};kf.prototype.write=function(u){let f;for(f=0;f+2<=this.data.length;f+=2){let t=G1.indexOf(this.data[f])*45;t+=G1.indexOf(this.data[f+1]),u.put(t,11)}this.data.length%2&&u.put(G1.indexOf(this.data[f]),6)};ua.exports=kf});var Da=c((qN,ta)=>{var OC=Nu();function Nf(e){this.mode=OC.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}Nf.getBitsLength=function(u){return u*8};Nf.prototype.getLength=function(){return this.data.length};Nf.prototype.getBitsLength=function(){return Nf.getBitsLength(this.data.length)};Nf.prototype.write=function(e){for(let u=0,f=this.data.length;u<f;u++)e.put(this.data[u],8)};ta.exports=Nf});var na=c((jN,ra)=>{var TC=Nu(),PC=Pu();function qf(e){this.mode=TC.KANJI,this.data=e}qf.getBitsLength=function(u){return u*13};qf.prototype.getLength=function(){return this.data.length};qf.prototype.getBitsLength=function(){return qf.getBitsLength(this.data.length)};qf.prototype.write=function(e){let u;for(u=0;u<this.data.length;u++){let f=PC.toSJIS(this.data[u]);if(f>=33088&&f<=40956)f-=33088;else if(f>=57408&&f<=60351)f-=49472;else throw new Error("Invalid SJIS character: "+this.data[u]+`
|
|
3
3
|
Make sure your charset is UTF-8`);f=(f>>>8&255)*192+(f&255),e.put(f,13)}};ra.exports=qf});var ia=c((MN,W1)=>{"use strict";var Tt={single_source_shortest_paths:function(e,u,f){var t={},D={};D[u]=0;var r=Tt.PriorityQueue.make();r.push(u,0);for(var n,i,o,a,s,d,l,F,p;!r.empty();){n=r.pop(),i=n.value,a=n.cost,s=e[i]||{};for(o in s)s.hasOwnProperty(o)&&(d=s[o],l=a+d,F=D[o],p=typeof D[o]>"u",(p||F>l)&&(D[o]=l,r.push(o,l),t[o]=i))}if(typeof f<"u"&&typeof D[f]>"u"){var C=["Could not find a path from ",u," to ",f,"."].join("");throw new Error(C)}return t},extract_shortest_path_from_predecessor_list:function(e,u){for(var f=[],t=u,D;t;)f.push(t),D=e[t],t=e[t];return f.reverse(),f},find_path:function(e,u,f){var t=Tt.single_source_shortest_paths(e,u,f);return Tt.extract_shortest_path_from_predecessor_list(t,f)},PriorityQueue:{make:function(e){var u=Tt.PriorityQueue,f={},t;e=e||{};for(t in u)u.hasOwnProperty(t)&&(f[t]=u[t]);return f.queue=[],f.sorter=e.sorter||u.default_sorter,f},default_sorter:function(e,u){return e.cost-u.cost},push:function(e,u){var f={value:e,cost:u};this.queue.push(f),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof W1<"u"&&(W1.exports=Tt)});var pa=c(jf=>{var X=Nu(),sa=ea(),la=fa(),da=Da(),ca=na(),Pt=z1(),KD=Pu(),kC=ia();function oa(e){return unescape(encodeURIComponent(e)).length}function kt(e,u,f){let t=[],D;for(;(D=e.exec(f))!==null;)t.push({data:D[0],index:D.index,mode:u,length:D[0].length});return t}function Fa(e){let u=kt(Pt.NUMERIC,X.NUMERIC,e),f=kt(Pt.ALPHANUMERIC,X.ALPHANUMERIC,e),t,D;return KD.isKanjiModeEnabled()?(t=kt(Pt.BYTE,X.BYTE,e),D=kt(Pt.KANJI,X.KANJI,e)):(t=kt(Pt.BYTE_KANJI,X.BYTE,e),D=[]),u.concat(f,t,D).sort(function(n,i){return n.index-i.index}).map(function(n){return{data:n.data,mode:n.mode,length:n.length}})}function J1(e,u){switch(u){case X.NUMERIC:return sa.getBitsLength(e);case X.ALPHANUMERIC:return la.getBitsLength(e);case X.KANJI:return ca.getBitsLength(e);case X.BYTE:return da.getBitsLength(e)}}function NC(e){return e.reduce(function(u,f){let t=u.length-1>=0?u[u.length-1]:null;return t&&t.mode===f.mode?(u[u.length-1].data+=f.data,u):(u.push(f),u)},[])}function qC(e){let u=[];for(let f=0;f<e.length;f++){let t=e[f];switch(t.mode){case X.NUMERIC:u.push([t,{data:t.data,mode:X.ALPHANUMERIC,length:t.length},{data:t.data,mode:X.BYTE,length:t.length}]);break;case X.ALPHANUMERIC:u.push([t,{data:t.data,mode:X.BYTE,length:t.length}]);break;case X.KANJI:u.push([t,{data:t.data,mode:X.BYTE,length:oa(t.data)}]);break;case X.BYTE:u.push([{data:t.data,mode:X.BYTE,length:oa(t.data)}])}}return u}function jC(e,u){let f={},t={start:{}},D=["start"];for(let r=0;r<e.length;r++){let n=e[r],i=[];for(let o=0;o<n.length;o++){let a=n[o],s=""+r+o;i.push(s),f[s]={node:a,lastCount:0},t[s]={};for(let d=0;d<D.length;d++){let l=D[d];f[l]&&f[l].node.mode===a.mode?(t[l][s]=J1(f[l].lastCount+a.length,a.mode)-J1(f[l].lastCount,a.mode),f[l].lastCount+=a.length):(f[l]&&(f[l].lastCount=a.length),t[l][s]=J1(a.length,a.mode)+4+X.getCharCountIndicator(a.mode,u))}}D=i}for(let r=0;r<D.length;r++)t[D[r]].end=0;return{map:t,table:f}}function aa(e,u){let f,t=X.getBestModeForData(e);if(f=X.from(u,t),f!==X.BYTE&&f.bit<t.bit)throw new Error('"'+e+'" cannot be encoded with mode '+X.toString(f)+`.
|
|
4
4
|
Suggested mode is: `+X.toString(t));switch(f===X.KANJI&&!KD.isKanjiModeEnabled()&&(f=X.BYTE),f){case X.NUMERIC:return new sa(e);case X.ALPHANUMERIC:return new la(e);case X.KANJI:return new ca(e);case X.BYTE:return new da(e)}}jf.fromArray=function(u){return u.reduce(function(f,t){return typeof t=="string"?f.push(aa(t,null)):t.data&&f.push(aa(t.data,t.mode)),f},[])};jf.fromString=function(u,f){let t=Fa(u,KD.isKanjiModeEnabled()),D=qC(t),r=jC(D,f),n=kC.find_path(r.map,"start","end"),i=[];for(let o=1;o<n.length-1;o++)i.push(r.table[n[o]].node);return jf.fromArray(NC(i))};jf.rawSplit=function(u){return jf.fromArray(Fa(u,KD.isKanjiModeEnabled()))}});var ma=c(Ca=>{var WD=Pu(),Q1=MD(),MC=Io(),RC=$o(),LC=Oo(),VC=ko(),X1=No(),en=M1(),zC=Lo(),GD=Wo(),UC=Yo(),HC=Nu(),Z1=pa();function KC(e,u){let f=e.size,t=VC.getPositions(u);for(let D=0;D<t.length;D++){let r=t[D][0],n=t[D][1];for(let i=-1;i<=7;i++)if(!(r+i<=-1||f<=r+i))for(let o=-1;o<=7;o++)n+o<=-1||f<=n+o||(i>=0&&i<=6&&(o===0||o===6)||o>=0&&o<=6&&(i===0||i===6)||i>=2&&i<=4&&o>=2&&o<=4?e.set(r+i,n+o,!0,!0):e.set(r+i,n+o,!1,!0))}}function GC(e){let u=e.size;for(let f=8;f<u-8;f++){let t=f%2===0;e.set(f,6,t,!0),e.set(6,f,t,!0)}}function WC(e,u){let f=LC.getPositions(u);for(let t=0;t<f.length;t++){let D=f[t][0],r=f[t][1];for(let n=-2;n<=2;n++)for(let i=-2;i<=2;i++)n===-2||n===2||i===-2||i===2||n===0&&i===0?e.set(D+n,r+i,!0,!0):e.set(D+n,r+i,!1,!0)}}function JC(e,u){let f=e.size,t=GD.getEncodedBits(u),D,r,n;for(let i=0;i<18;i++)D=Math.floor(i/3),r=i%3+f-8-3,n=(t>>i&1)===1,e.set(D,r,n,!0),e.set(r,D,n,!0)}function Y1(e,u,f){let t=e.size,D=UC.getEncodedBits(u,f),r,n;for(r=0;r<15;r++)n=(D>>r&1)===1,r<6?e.set(r,8,n,!0):r<8?e.set(r+1,8,n,!0):e.set(t-15+r,8,n,!0),r<8?e.set(8,t-r-1,n,!0):r<9?e.set(8,15-r-1+1,n,!0):e.set(8,15-r-1,n,!0);e.set(t-8,8,1,!0)}function QC(e,u){let f=e.size,t=-1,D=f-1,r=7,n=0;for(let i=f-1;i>0;i-=2)for(i===6&&i--;;){for(let o=0;o<2;o++)if(!e.isReserved(D,i-o)){let a=!1;n<u.length&&(a=(u[n]>>>r&1)===1),e.set(D,i-o,a),r--,r===-1&&(n++,r=7)}if(D+=t,D<0||f<=D){D-=t,t=-t;break}}}function ZC(e,u,f){let t=new MC;f.forEach(function(o){t.put(o.mode.bit,4),t.put(o.getLength(),HC.getCharCountIndicator(o.mode,e)),o.write(t)});let D=WD.getSymbolTotalCodewords(e),r=en.getTotalCodewordsCount(e,u),n=(D-r)*8;for(t.getLengthInBits()+4<=n&&t.put(0,4);t.getLengthInBits()%8!==0;)t.putBit(0);let i=(n-t.getLengthInBits())/8;for(let o=0;o<i;o++)t.put(o%2?17:236,8);return YC(t,e,u)}function YC(e,u,f){let t=WD.getSymbolTotalCodewords(u),D=en.getTotalCodewordsCount(u,f),r=t-D,n=en.getBlocksCount(u,f),i=t%n,o=n-i,a=Math.floor(t/n),s=Math.floor(r/n),d=s+1,l=a-s,F=new zC(l),p=0,C=new Array(n),m=new Array(n),h=0,B=new Uint8Array(e.buffer);for(let re=0;re<n;re++){let eu=re<o?s:d;C[re]=B.slice(p,p+eu),m[re]=F.encode(C[re]),p+=eu,h=Math.max(h,eu)}let w=new Uint8Array(t),I=0,_,L;for(_=0;_<h;_++)for(L=0;L<n;L++)_<C[L].length&&(w[I++]=C[L][_]);for(_=0;_<l;_++)for(L=0;L<n;L++)w[I++]=m[L][_];return w}function XC(e,u,f,t){let D;if(Array.isArray(e))D=Z1.fromArray(e);else if(typeof e=="string"){let a=u;if(!a){let s=Z1.rawSplit(e);a=GD.getBestVersionForData(s,f)}D=Z1.fromString(e,a||40)}else throw new Error("Invalid data");let r=GD.getBestVersionForData(D,f);if(!r)throw new Error("The amount of data is too big to be stored in a QR Code");if(!u)u=r;else if(u<r)throw new Error(`
|