homebridge-config-ui-x 5.0.0-beta.7 → 5.0.0-beta.8
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/package.json +1 -1
- package/public/chunk-32ZJLZS4.js +1 -0
- package/public/{chunk-52L2LAHB.js → chunk-34G5YV5T.js} +1 -1
- package/public/{chunk-ED5XL3PD.js → chunk-37PRYZH6.js} +1 -1
- package/public/{chunk-US5QSVJ2.js → chunk-3NB33IBB.js} +1 -1
- package/public/{chunk-QGDVQDUP.js → chunk-5ABW4ZKF.js} +1 -1
- package/public/chunk-5KSPDTFH.js +1 -0
- package/public/{chunk-KRNQN3FT.js → chunk-5OHKMFXO.js} +1 -1
- package/public/{chunk-KHNBODZR.js → chunk-656LQTVE.js} +1 -1
- package/public/{chunk-LV2VCDOI.js → chunk-7T234PWV.js} +1 -1
- package/public/{chunk-A4HS5JYI.js → chunk-AZC7XCGC.js} +1 -1
- package/public/{chunk-CY55AES3.js → chunk-BY2TSVEY.js} +1 -1
- package/public/{chunk-UNVMI6CK.js → chunk-C7QJOHXE.js} +1 -1
- package/public/{chunk-RDAMEJPR.js → chunk-CKR46AVL.js} +1 -1
- package/public/{chunk-NDNK3KHG.js → chunk-D2D564LE.js} +1 -1
- package/public/{chunk-3C2OQ2W5.js → chunk-DLMGGPRM.js} +1 -1
- package/public/{chunk-NV6GUYHV.js → chunk-DXZ6DCYP.js} +1 -1
- package/public/{chunk-V7D5U2P3.js → chunk-EP66JAAV.js} +1 -1
- package/public/{chunk-WP6BKFEA.js → chunk-FJF4WNUO.js} +1 -1
- package/public/{chunk-XY74TB4S.js → chunk-FQYNC4RH.js} +1 -1
- package/public/{chunk-KVW76M4O.js → chunk-HHG6WMVF.js} +1 -1
- package/public/{chunk-5KIRKUWH.js → chunk-HHIHVUCL.js} +1 -1
- package/public/{chunk-XLY5QPTN.js → chunk-II2UAWC2.js} +1 -1
- package/public/{chunk-6HR4EKFX.js → chunk-IMOTYOKQ.js} +1 -1
- package/public/{chunk-IVORLBXB.js → chunk-JDQ5PHOU.js} +1 -1
- package/public/{chunk-M6SHEAQY.js → chunk-KG3DHJZY.js} +1 -1
- package/public/chunk-LLGTFHIT.js +1 -0
- package/public/chunk-M346UY2G.js +1 -0
- package/public/{chunk-WSYFRV2X.js → chunk-MNBUOV7P.js} +1 -1
- package/public/chunk-NI664X6I.js +1 -0
- package/public/{chunk-OKKTO3UM.js → chunk-P5FZV27L.js} +1 -1
- package/public/chunk-PS4KQKK7.js +1 -0
- package/public/chunk-Q5YFESZW.js +1 -0
- package/public/{chunk-UWLLEMGO.js → chunk-QAEUHAL6.js} +1 -1
- package/public/{chunk-UKAOVQ6N.js → chunk-QBDPVXMM.js} +1 -1
- package/public/{chunk-IW3HI4LO.js → chunk-QJYLB6LD.js} +1 -1
- package/public/{chunk-JU4PP2VY.js → chunk-R2W5BRWY.js} +1 -1
- package/public/{chunk-CJIFFTFC.js → chunk-RIN5QMTV.js} +1 -1
- package/public/{chunk-AAVBU64J.js → chunk-RKC5OBYP.js} +1 -1
- package/public/{chunk-MPVSAJDU.js → chunk-RT7V3UYQ.js} +1 -1
- package/public/chunk-SCR7PUV7.js +1 -0
- package/public/chunk-SOEXENDP.js +1 -0
- package/public/{chunk-TFEVMIHT.js → chunk-TH2G22O2.js} +1 -1
- package/public/{chunk-WNVJPPO7.js → chunk-TMD6JYTR.js} +1 -1
- package/public/chunk-TO5O6L7A.js +1 -0
- package/public/{chunk-YP7JWH3J.js → chunk-TSZZQKYF.js} +1 -1
- package/public/{chunk-BVNJ63AC.js → chunk-TZS4WGUK.js} +1 -1
- package/public/{chunk-DAYZQW6Q.js → chunk-UYLV5ENO.js} +1 -1
- package/public/{chunk-EJKB2WDE.js → chunk-VPSLX47Z.js} +1 -1
- package/public/{chunk-7LUCJVXB.js → chunk-VVGJ5MFU.js} +1 -1
- package/public/chunk-WAUGELUM.js +1 -0
- package/public/{chunk-4N3YQA7W.js → chunk-WXTR3AXD.js} +1 -1
- package/public/{chunk-2JDN5J3P.js → chunk-X2AWRY46.js} +1 -1
- package/public/chunk-X3GZMTJ5.js +1 -0
- package/public/chunk-X7YNKLZW.js +1 -0
- package/public/{chunk-UAQGK64S.js → chunk-XRPL3VU7.js} +1 -1
- package/public/{chunk-2PMXH77A.js → chunk-Y3RRGTUL.js} +1 -1
- package/public/{chunk-QKWNCNRW.js → chunk-YD5MPMXA.js} +1 -1
- package/public/{chunk-A76FDQKF.js → chunk-YJB6Y76M.js} +1 -1
- package/public/{chunk-SK5UJRQU.js → chunk-YRSHLHYL.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-6PBYD25D.js → main-35ZSDHG6.js} +1 -1
- package/public/chunk-26EDYJQW.js +0 -1
- package/public/chunk-3JROOWCZ.js +0 -1
- package/public/chunk-4LLA7QYB.js +0 -1
- package/public/chunk-AFRS7ZFI.js +0 -1
- package/public/chunk-BS2EMJX7.js +0 -1
- package/public/chunk-FA2N3XXT.js +0 -1
- package/public/chunk-IB5GZVXD.js +0 -1
- package/public/chunk-LMPCXQ23.js +0 -1
- package/public/chunk-MDDU475D.js +0 -1
- package/public/chunk-OOHFQB4Z.js +0 -1
- package/public/chunk-U2KJ2IEE.js +0 -1
- package/public/chunk-V2TYBIZV.js +0 -1
- package/public/chunk-ZOKILXR3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as dt,m as pt}from"./chunk-UG5DK2RQ.js";import{$b as U,Ca as H,Db as k,Fb as O,Ga as z,Kb as S,Lb as E,Mb as l,Nb as F,Pb as p,Sc as K,Wb as h,Xb as m,Yb as j,Zb as q,_b as G,a as u,b as T,bc as ht,cb as lt,cc as R,cd as Q,db as L,dc as c,e as It,ha as C,ia as ot,ib as r,jb as v,ka as rt,ma as w,mb as ct,n as g,na as _,nc as f,pc as y,qa as at,rb as Z,sb as ut,xa as $,ya as V}from"./chunk-TXOB7R5K.js";var mt=It((Gt,xt)=>{xt.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.0.0-beta.7",description:"A web based management, configuration and control platform for Homebridge.",author:"oznu <dev@oz.nu>",license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/oznu"},{type:"paypal",url:"https://paypal.me/oznu"}],repository:{type:"git",url:"git+https://github.com/homebridge/homebridge-config-ui-x.git"},bugs:{url:"https://github.com/homebridge/homebridge-config-ui-x/issues"},keywords:["homebridge-plugin","ui","gui","web","homebridge","homebridge-config-ui-x","ui-x","config-ui-x","homebridge-x","homebridge server","homebridge ui","homebridge-ui","homebridge gui","homebridge-gui","web interface","config ui","management","config editor","linux","macOS","osx","windows","raspberry pi","accessory control","smart home","hb-service"],main:"./dist/index.js",bin:{"homebridge-config-ui-x":"dist/bin/standalone.js","hb-service":"dist/bin/hb-service.js"},engines:{node:"^18 || ^20 || ^22",homebridge:"^1.8.0 || ^2.0.0-beta.0"},scripts:{build:"npm run build:server && npm run build:ui","build:server":"rimraf dist && tsc -p tsconfig.build.json","build:ui":"npm run build --prefix ui",check:"npm run check:server && npm run check:ui","check:server":"npm install && npm outdated","check:ui":"npm install --prefix ui && npm outdated --prefix ui","lang-sync":"ts-node scripts/lang-sync.ts",lint:"eslint . --max-warnings=0","lint:fix":"npm run lint -- --fix",prepublishOnly:"npm i --package-lock-only && npm run lint && npm run build",start:"ts-node -r tsconfig-paths/register src/main.ts",test:"vitest run","test-coverage":"npm run test -- --coverage","upgrade-install":"./scripts/upgrade-install.sh",watch:'concurrently "npm run watch:ui" "npm run watch:server"',"watch:server":"nodemon","watch:ui":"npm run start --prefix ui"},dependencies:{"@fastify/helmet":"11.1.1","@fastify/multipart":"8.3.0","@fastify/static":"7.0.4","@homebridge/hap-client":"2.0.5-beta.0","@homebridge/node-pty-prebuilt-multiarch":"0.12.0-beta.2","@nestjs/axios":"3.1.2","@nestjs/common":"10.4.8","@nestjs/core":"10.4.8","@nestjs/jwt":"10.2.0","@nestjs/passport":"10.0.3","@nestjs/platform-fastify":"10.4.8","@nestjs/platform-socket.io":"10.4.8","@nestjs/swagger":"8.0.7","@nestjs/websockets":"10.4.8",axios:"1.7.7","bash-color":"0.0.4","buffer-shims":"1.0.0","class-transformer":"0.5.1","class-validator":"0.14.1",commander:"12.1.0",dayjs:"1.11.13",fastify:"4.28.1","fs-extra":"11.2.0",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"5.4.1",otplib:"12.0.1","p-limit":"3.1.0",passport:"0.7.0","passport-jwt":"4.0.1","reflect-metadata":"0.2.2",rxjs:"7.8.1",semver:"7.6.3",systeminformation:"5.23.5",tail:"2.2.6",tar:"6.2.1","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^3.9.2","@nestjs/testing":"^10.4.8","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.13","@types/node":"^22.9.3","@types/node-schedule":"^2.1.7","@types/passport-jwt":"^4.0.1","@types/semver":"^7.5.8","@types/tail":"^2.2.3","@types/tar":"^6.1.13","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.10","@vitest/coverage-v8":"^2.1.5",concurrently:"^9.1.0","eslint-plugin-format":"^0.1.2","form-data":"^4.0.1",nodemon:"^3.1.7",rimraf:"^6.0.1","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.7.2","unplugin-swc":"^1.5.1",vitest:"^2.1.5"},maintainers:[{email:"bwp91@icloud.com",name:"bwp91"},{email:"dev@oz.nu",name:"oznu"},{email:"northern.man1@gmail.com",name:"northernman"},{email:"mail@anderl-bauer.de",name:"supereg"},{email:"khaos.tian@gmail.com",name:"khaost"},{email:"erik.baauw@xs4all.nl",name:"ebaauw"},{email:"donavan.becker@icloud.com",name:"donavanbecker"},{email:"dustin.greif@gmail.com",name:"dustin.greif"},{email:"nfarina@gmail.com",name:"nfarina"}]}});var D={serverTarget:mt().version,production:!0,socket:"",api:{base:"/api",socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[`${window.location.protocol}//${document.location.host}/api/auth/login`]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Wt=(()=>{class i{$http=_(dt);get(t,e){return this.$http.get(`${D.api.base}${t}`,e)}post(t,e,n){return this.$http.post(`${D.api.base}${t}`,e,n)}put(t,e,n){return this.$http.put(`${D.api.base}${t}`,e,n)}patch(t,e,n){return this.$http.patch(`${D.api.base}${t}`,e,n)}delete(t,e){return this.$http.delete(`${D.api.base}${t}`,e)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var b=function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i}(b||{}),te="*";function _t(i,s){return{type:b.Trigger,name:i,definitions:s,options:{}}}function Y(i,s=null){return{type:b.Animate,styles:s,timings:i}}function ee(i,s=null){return{type:b.Sequence,steps:i,options:s}}function N(i){return{type:b.Style,styles:i,offset:null}}function M(i,s,t){return{type:b.State,name:i,styles:s,options:t}}function J(i,s,t=null){return{type:b.Transition,expr:i,animation:s,options:t}}var ft=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(s=0,t=0){this.totalTime=s+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}onStart(s){this._originalOnStartFns.push(s),this._onStartFns.push(s)}onDone(s){this._originalOnDoneFns.push(s),this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(s=>s()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(s){this._position=this.totalTime?s*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},gt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(s){this.players=s;let t=0,e=0,n=0,o=this.players.length;o==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++t==o&&this._onFinish()}),a.onDestroy(()=>{++e==o&&this._onDestroy()}),a.onStart(()=>{++n==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,d)=>Math.max(a,d.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}init(){this.players.forEach(s=>s.init())}onStart(s){this._onStartFns.push(s)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(s=>s()),this._onStartFns=[])}onDone(s){this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(s=>s.play())}pause(){this.players.forEach(s=>s.pause())}restart(){this.players.forEach(s=>s.restart())}finish(){this._onFinish(),this.players.forEach(s=>s.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(s=>s.destroy()),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this.players.forEach(s=>s.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(s){let t=s*this.totalTime;this.players.forEach(e=>{let n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}getPosition(){let s=this.players.reduce((t,e)=>t===null||e.totalTime>t.totalTime?e:t,null);return s!=null?s.getPosition():0}beforeDestroy(){this.players.forEach(s=>{s.beforeDestroy&&s.beforeDestroy()})}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},ie="!";var vt=["toast-component",""];function St(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function Et(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Ft(i,s){if(i&1&&(h(0,"div"),f(1),S(2,Et,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function jt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Rt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function At(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}function Ht(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function kt(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Nt(i,s){if(i&1&&(h(0,"div"),f(1),S(2,kt,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function Mt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Pt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function Bt(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}var W=class{_attachedHost;component;viewContainerRef;injector;constructor(s,t){this.component=s,this.injector=t}attach(s,t){return this._attachedHost=s,s.attach(this,t)}detach(){let s=this._attachedHost;if(s)return this._attachedHost=void 0,s.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(s){this._attachedHost=s}},X=class{_attachedPortal;_disposeFn;attach(s,t){return this._attachedPortal=s,this.attachComponentPortal(s,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(s){this._disposeFn=s}},tt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new g;_activate=new g;_manualClose=new g;_resetTimeout=new g;_countDuplicate=new g;constructor(s){this._overlayRef=s}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(s,t){s&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},I=class{toastId;config;message;title;toastType;toastRef;_onTap=new g;_onAction=new g;constructor(s,t,e,n,o,a){this.toastId=s,this.config=t,this.message=e,this.title=n,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(s){this._onAction.next(s)}onAction(){return this._onAction.asObservable()}},yt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},bt=new rt("ToastConfig"),et=class extends X{_hostDomElement;_componentFactoryResolver;_appRef;constructor(s,t,e){super(),this._hostDomElement=s,this._componentFactoryResolver=t,this._appRef=e}attachComponentPortal(s,t){let e=this._componentFactoryResolver.resolveComponentFactory(s.component),n;return n=e.create(s.injector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(n),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(n)),n}_getComponentRootNode(s){return s.hostView.rootNodes[0]}},$t=(()=>{class i{_document=_(K);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),it=class{_portalHost;constructor(s){this._portalHost=s}attach(s,t=!0){return this._portalHost.attach(s,t)}detach(){return this._portalHost.detach()}},Vt=(()=>{class i{_overlayContainer=_($t);_componentFactoryResolver=_(ct);_appRef=_(k);_document=_(K);_paneElements=new Map;create(t,e){return this._createOverlayRef(this.getPaneElement(t,e))}getPaneElement(t="",e){return this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]}_createPaneElement(t,e){let n=this._document.createElement("div");return n.id="toast-container",n.classList.add(t),n.classList.add("toast-container"),e?e.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(t){return new et(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new it(this._createPortalHost(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Tt=(()=>{class i{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,e,n,o,a){this.overlay=e,this._injector=n,this.sanitizer=o,this.ngZone=a,this.toastrConfig=u(u({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},t.default.iconClasses),t.config.iconClasses))}show(t,e,n={},o=""){return this._preBuildNotification(o,t,e,this.applyConfig(n))}success(t,e,n={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}error(t,e,n={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}info(t,e,n={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}warning(t,e,n={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}clear(t){for(let e of this.toasts)if(t!==void 0){if(e.toastId===t){e.toastRef.manualClose();return}}else e.toastRef.manualClose()}remove(t){let e=this._findToast(t);if(!e||(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let n=this.toasts[this.currentlyActive].toastRef;n.isInactive()||(this.currentlyActive=this.currentlyActive+1,n.activate())}return!0}findDuplicate(t="",e="",n,o){let{includeTitleDuplicates:a}=this.toastrConfig;for(let d of this.toasts){let A=a&&d.title===t;if((!a||A)&&d.message===e)return d.toastRef.onDuplicate(n,o),d}return null}applyConfig(t={}){return u(u({},this.toastrConfig),t)}_findToast(t){for(let e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null}_preBuildNotification(t,e,n,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,e,n,o)):this._buildNotification(t,e,n,o)}_buildNotification(t,e,n,o){if(!o.toastComponent)throw new Error("toastComponent required");let a=this.findDuplicate(n,e,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||e)&&this.toastrConfig.preventDuplicates&&a!==null)return a;this.previousToastMessage=e;let d=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(d=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let A=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let st=e;e&&o.enableHtml&&(st=this.sanitizer.sanitize(lt.HTML,e));let x=new tt(A),P=new I(this.index,o,st,n,t,x),Ct=[{provide:I,useValue:P}],wt=H.create({providers:Ct,parent:this._injector}),Dt=new W(o.toastComponent,wt),nt=A.attach(Dt,o.newestOnTop);x.componentInstance=nt.instance;let B={toastId:this.index,title:n||"",message:e||"",toastRef:x,onShown:x.afterActivate(),onHidden:x.afterClosed(),onTap:P.onTap(),onAction:P.onAction(),portal:nt};return d||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{B.toastRef.activate()})),this.toasts.push(B),B}static \u0275fac=function(e){return new(e||i)(w(bt),w(Vt),w(H),w(pt),w(z))};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),zt=(()=>{class i{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.ngZone=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=O({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>T(u({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>T(u({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>T(u({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),e)):this.timeout=setTimeout(()=>t(),e)}outsideInterval(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),e)):this.intervalId=setInterval(()=>t(),e)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(e){return new(e||i)(v(Tt),v(I),v(z))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(ht("@flyInOut",n._state),p(n.toastClasses),F("display",n.displayStyle))},attrs:vt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,St,3,0,"button",0)(1,Ft,3,5,"div",1)(2,jt,1,3,"div",2)(3,Rt,2,4,"div",3)(4,At,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,data:{animation:[_t("flyInOut",[M("inactive",N({opacity:0})),M("active",N({opacity:1})),M("removed",N({opacity:0})),J("inactive => active",Y("{{ easeTime }}ms {{ easing }}")),J("active => removed",Y("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return i})(),Lt=T(u({},yt),{toastComponent:zt}),Zt=(i={})=>at([{provide:bt,useValue:{default:Lt,config:i}}]),ye=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[Zt(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=ut({type:i});static \u0275inj=ot({})}return i})();var qt=(()=>{class i{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=O("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.appRef=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(e){return new(e||i)(v(Tt),v(I),v(k))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(p(n.toastClasses),F("display",n.displayStyle))},attrs:vt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,Ht,3,0,"button",0)(1,Nt,3,5,"div",1)(2,Mt,1,3,"div",2)(3,Pt,2,4,"div",3)(4,Bt,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,changeDetection:0})}return i})(),be=T(u({},yt),{toastComponent:qt});export{D as a,Wt as b,b as c,te as d,ee as e,N as f,ft as g,gt as h,ie as i,Tt as j,ye as k};
|
|
1
|
+
import{e as dt,m as pt}from"./chunk-UG5DK2RQ.js";import{$b as U,Ca as H,Db as k,Fb as O,Ga as z,Kb as S,Lb as E,Mb as l,Nb as F,Pb as p,Sc as K,Wb as h,Xb as m,Yb as j,Zb as q,_b as G,a as u,b as T,bc as ht,cb as lt,cc as R,cd as Q,db as L,dc as c,e as It,ha as C,ia as ot,ib as r,jb as v,ka as rt,ma as w,mb as ct,n as g,na as _,nc as f,pc as y,qa as at,rb as Z,sb as ut,xa as $,ya as V}from"./chunk-TXOB7R5K.js";var mt=It((Gt,xt)=>{xt.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.0.0-beta.8",description:"A web based management, configuration and control platform for Homebridge.",author:"oznu <dev@oz.nu>",license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/oznu"},{type:"paypal",url:"https://paypal.me/oznu"}],repository:{type:"git",url:"git+https://github.com/homebridge/homebridge-config-ui-x.git"},bugs:{url:"https://github.com/homebridge/homebridge-config-ui-x/issues"},keywords:["homebridge-plugin","ui","gui","web","homebridge","homebridge-config-ui-x","ui-x","config-ui-x","homebridge-x","homebridge server","homebridge ui","homebridge-ui","homebridge gui","homebridge-gui","web interface","config ui","management","config editor","linux","macOS","osx","windows","raspberry pi","accessory control","smart home","hb-service"],main:"./dist/index.js",bin:{"homebridge-config-ui-x":"dist/bin/standalone.js","hb-service":"dist/bin/hb-service.js"},engines:{node:"^18 || ^20 || ^22",homebridge:"^1.8.0 || ^2.0.0-beta.0"},scripts:{build:"npm run build:server && npm run build:ui","build:server":"rimraf dist && tsc -p tsconfig.build.json","build:ui":"npm run build --prefix ui",check:"npm run check:server && npm run check:ui","check:server":"npm install && npm outdated","check:ui":"npm install --prefix ui && npm outdated --prefix ui","lang-sync":"ts-node scripts/lang-sync.ts",lint:"eslint . --max-warnings=0","lint:fix":"npm run lint -- --fix",prepublishOnly:"npm i --package-lock-only && npm run lint && npm run build",start:"ts-node -r tsconfig-paths/register src/main.ts",test:"vitest run","test-coverage":"npm run test -- --coverage","upgrade-install":"./scripts/upgrade-install.sh",watch:'concurrently "npm run watch:ui" "npm run watch:server"',"watch:server":"nodemon","watch:ui":"npm run start --prefix ui"},dependencies:{"@fastify/helmet":"11.1.1","@fastify/multipart":"8.3.0","@fastify/static":"7.0.4","@homebridge/hap-client":"2.0.5-beta.0","@homebridge/node-pty-prebuilt-multiarch":"0.12.0-beta.2","@nestjs/axios":"3.1.2","@nestjs/common":"10.4.8","@nestjs/core":"10.4.8","@nestjs/jwt":"10.2.0","@nestjs/passport":"10.0.3","@nestjs/platform-fastify":"10.4.8","@nestjs/platform-socket.io":"10.4.8","@nestjs/swagger":"8.0.7","@nestjs/websockets":"10.4.8",axios:"1.7.7","bash-color":"0.0.4","buffer-shims":"1.0.0","class-transformer":"0.5.1","class-validator":"0.14.1",commander:"12.1.0",dayjs:"1.11.13",fastify:"4.28.1","fs-extra":"11.2.0",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"5.4.1",otplib:"12.0.1","p-limit":"3.1.0",passport:"0.7.0","passport-jwt":"4.0.1","reflect-metadata":"0.2.2",rxjs:"7.8.1",semver:"7.6.3",systeminformation:"5.23.5",tail:"2.2.6",tar:"6.2.1","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^3.9.2","@nestjs/testing":"^10.4.8","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.13","@types/node":"^22.9.3","@types/node-schedule":"^2.1.7","@types/passport-jwt":"^4.0.1","@types/semver":"^7.5.8","@types/tail":"^2.2.3","@types/tar":"^6.1.13","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.10","@vitest/coverage-v8":"^2.1.5",concurrently:"^9.1.0","eslint-plugin-format":"^0.1.2","form-data":"^4.0.1",nodemon:"^3.1.7",rimraf:"^6.0.1","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.7.2","unplugin-swc":"^1.5.1",vitest:"^2.1.5"},maintainers:[{email:"bwp91@icloud.com",name:"bwp91"},{email:"dev@oz.nu",name:"oznu"},{email:"northern.man1@gmail.com",name:"northernman"},{email:"mail@anderl-bauer.de",name:"supereg"},{email:"khaos.tian@gmail.com",name:"khaost"},{email:"erik.baauw@xs4all.nl",name:"ebaauw"},{email:"donavan.becker@icloud.com",name:"donavanbecker"},{email:"dustin.greif@gmail.com",name:"dustin.greif"},{email:"nfarina@gmail.com",name:"nfarina"}]}});var D={serverTarget:mt().version,production:!0,socket:"",api:{base:"/api",socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[`${window.location.protocol}//${document.location.host}/api/auth/login`]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Wt=(()=>{class i{$http=_(dt);get(t,e){return this.$http.get(`${D.api.base}${t}`,e)}post(t,e,n){return this.$http.post(`${D.api.base}${t}`,e,n)}put(t,e,n){return this.$http.put(`${D.api.base}${t}`,e,n)}patch(t,e,n){return this.$http.patch(`${D.api.base}${t}`,e,n)}delete(t,e){return this.$http.delete(`${D.api.base}${t}`,e)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var b=function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i}(b||{}),te="*";function _t(i,s){return{type:b.Trigger,name:i,definitions:s,options:{}}}function Y(i,s=null){return{type:b.Animate,styles:s,timings:i}}function ee(i,s=null){return{type:b.Sequence,steps:i,options:s}}function N(i){return{type:b.Style,styles:i,offset:null}}function M(i,s,t){return{type:b.State,name:i,styles:s,options:t}}function J(i,s,t=null){return{type:b.Transition,expr:i,animation:s,options:t}}var ft=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(s=0,t=0){this.totalTime=s+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}onStart(s){this._originalOnStartFns.push(s),this._onStartFns.push(s)}onDone(s){this._originalOnDoneFns.push(s),this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(s=>s()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(s){this._position=this.totalTime?s*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},gt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(s){this.players=s;let t=0,e=0,n=0,o=this.players.length;o==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++t==o&&this._onFinish()}),a.onDestroy(()=>{++e==o&&this._onDestroy()}),a.onStart(()=>{++n==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,d)=>Math.max(a,d.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}init(){this.players.forEach(s=>s.init())}onStart(s){this._onStartFns.push(s)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(s=>s()),this._onStartFns=[])}onDone(s){this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(s=>s.play())}pause(){this.players.forEach(s=>s.pause())}restart(){this.players.forEach(s=>s.restart())}finish(){this._onFinish(),this.players.forEach(s=>s.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(s=>s.destroy()),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this.players.forEach(s=>s.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(s){let t=s*this.totalTime;this.players.forEach(e=>{let n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}getPosition(){let s=this.players.reduce((t,e)=>t===null||e.totalTime>t.totalTime?e:t,null);return s!=null?s.getPosition():0}beforeDestroy(){this.players.forEach(s=>{s.beforeDestroy&&s.beforeDestroy()})}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},ie="!";var vt=["toast-component",""];function St(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function Et(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Ft(i,s){if(i&1&&(h(0,"div"),f(1),S(2,Et,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function jt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Rt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function At(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}function Ht(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function kt(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Nt(i,s){if(i&1&&(h(0,"div"),f(1),S(2,kt,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function Mt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Pt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function Bt(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}var W=class{_attachedHost;component;viewContainerRef;injector;constructor(s,t){this.component=s,this.injector=t}attach(s,t){return this._attachedHost=s,s.attach(this,t)}detach(){let s=this._attachedHost;if(s)return this._attachedHost=void 0,s.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(s){this._attachedHost=s}},X=class{_attachedPortal;_disposeFn;attach(s,t){return this._attachedPortal=s,this.attachComponentPortal(s,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(s){this._disposeFn=s}},tt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new g;_activate=new g;_manualClose=new g;_resetTimeout=new g;_countDuplicate=new g;constructor(s){this._overlayRef=s}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(s,t){s&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},I=class{toastId;config;message;title;toastType;toastRef;_onTap=new g;_onAction=new g;constructor(s,t,e,n,o,a){this.toastId=s,this.config=t,this.message=e,this.title=n,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(s){this._onAction.next(s)}onAction(){return this._onAction.asObservable()}},yt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},bt=new rt("ToastConfig"),et=class extends X{_hostDomElement;_componentFactoryResolver;_appRef;constructor(s,t,e){super(),this._hostDomElement=s,this._componentFactoryResolver=t,this._appRef=e}attachComponentPortal(s,t){let e=this._componentFactoryResolver.resolveComponentFactory(s.component),n;return n=e.create(s.injector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(n),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(n)),n}_getComponentRootNode(s){return s.hostView.rootNodes[0]}},$t=(()=>{class i{_document=_(K);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),it=class{_portalHost;constructor(s){this._portalHost=s}attach(s,t=!0){return this._portalHost.attach(s,t)}detach(){return this._portalHost.detach()}},Vt=(()=>{class i{_overlayContainer=_($t);_componentFactoryResolver=_(ct);_appRef=_(k);_document=_(K);_paneElements=new Map;create(t,e){return this._createOverlayRef(this.getPaneElement(t,e))}getPaneElement(t="",e){return this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]}_createPaneElement(t,e){let n=this._document.createElement("div");return n.id="toast-container",n.classList.add(t),n.classList.add("toast-container"),e?e.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(t){return new et(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new it(this._createPortalHost(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Tt=(()=>{class i{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,e,n,o,a){this.overlay=e,this._injector=n,this.sanitizer=o,this.ngZone=a,this.toastrConfig=u(u({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},t.default.iconClasses),t.config.iconClasses))}show(t,e,n={},o=""){return this._preBuildNotification(o,t,e,this.applyConfig(n))}success(t,e,n={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}error(t,e,n={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}info(t,e,n={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}warning(t,e,n={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}clear(t){for(let e of this.toasts)if(t!==void 0){if(e.toastId===t){e.toastRef.manualClose();return}}else e.toastRef.manualClose()}remove(t){let e=this._findToast(t);if(!e||(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let n=this.toasts[this.currentlyActive].toastRef;n.isInactive()||(this.currentlyActive=this.currentlyActive+1,n.activate())}return!0}findDuplicate(t="",e="",n,o){let{includeTitleDuplicates:a}=this.toastrConfig;for(let d of this.toasts){let A=a&&d.title===t;if((!a||A)&&d.message===e)return d.toastRef.onDuplicate(n,o),d}return null}applyConfig(t={}){return u(u({},this.toastrConfig),t)}_findToast(t){for(let e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null}_preBuildNotification(t,e,n,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,e,n,o)):this._buildNotification(t,e,n,o)}_buildNotification(t,e,n,o){if(!o.toastComponent)throw new Error("toastComponent required");let a=this.findDuplicate(n,e,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||e)&&this.toastrConfig.preventDuplicates&&a!==null)return a;this.previousToastMessage=e;let d=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(d=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let A=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let st=e;e&&o.enableHtml&&(st=this.sanitizer.sanitize(lt.HTML,e));let x=new tt(A),P=new I(this.index,o,st,n,t,x),Ct=[{provide:I,useValue:P}],wt=H.create({providers:Ct,parent:this._injector}),Dt=new W(o.toastComponent,wt),nt=A.attach(Dt,o.newestOnTop);x.componentInstance=nt.instance;let B={toastId:this.index,title:n||"",message:e||"",toastRef:x,onShown:x.afterActivate(),onHidden:x.afterClosed(),onTap:P.onTap(),onAction:P.onAction(),portal:nt};return d||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{B.toastRef.activate()})),this.toasts.push(B),B}static \u0275fac=function(e){return new(e||i)(w(bt),w(Vt),w(H),w(pt),w(z))};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),zt=(()=>{class i{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.ngZone=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=O({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>T(u({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>T(u({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>T(u({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),e)):this.timeout=setTimeout(()=>t(),e)}outsideInterval(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),e)):this.intervalId=setInterval(()=>t(),e)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(e){return new(e||i)(v(Tt),v(I),v(z))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(ht("@flyInOut",n._state),p(n.toastClasses),F("display",n.displayStyle))},attrs:vt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,St,3,0,"button",0)(1,Ft,3,5,"div",1)(2,jt,1,3,"div",2)(3,Rt,2,4,"div",3)(4,At,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,data:{animation:[_t("flyInOut",[M("inactive",N({opacity:0})),M("active",N({opacity:1})),M("removed",N({opacity:0})),J("inactive => active",Y("{{ easeTime }}ms {{ easing }}")),J("active => removed",Y("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return i})(),Lt=T(u({},yt),{toastComponent:zt}),Zt=(i={})=>at([{provide:bt,useValue:{default:Lt,config:i}}]),ye=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[Zt(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=ut({type:i});static \u0275inj=ot({})}return i})();var qt=(()=>{class i{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=O("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.appRef=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(e){return new(e||i)(v(Tt),v(I),v(k))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(p(n.toastClasses),F("display",n.displayStyle))},attrs:vt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,Ht,3,0,"button",0)(1,Nt,3,5,"div",1)(2,Mt,1,3,"div",2)(3,Pt,2,4,"div",3)(4,Bt,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,changeDetection:0})}return i})(),be=T(u({},yt),{toastComponent:qt});export{D as a,Wt as b,b as c,te as d,ee as e,N as f,ft as g,gt as h,ie as i,Tt as j,ye as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-P5FZV27L.js";import"./chunk-YRSHLHYL.js";import"./chunk-NZNNTHFQ.js";import"./chunk-TSZZQKYF.js";import"./chunk-EP66JAAV.js";import"./chunk-TMD6JYTR.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as RestartLinuxComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _,b as D}from"./chunk-
|
|
1
|
+
import{a as _,b as D}from"./chunk-EP66JAAV.js";import{a as l,b as S}from"./chunk-TMD6JYTR.js";import{f as x}from"./chunk-UG5DK2RQ.js";import{C as v,Sc as I,g as O,h as a,ha as h,ia as E,ka as y,ma as c,na as f,r as p,sb as j,w as d,x as T,z as w}from"./chunk-TXOB7R5K.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(c(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(c(g),c(m),c(I))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(c(r,12))},r.\u0275mod=j({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(l.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(l.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(l.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(l.jwt.tokenKey);e&&this.validateToken(e)})}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(l.jwt.tokenKey),this.token=null,!1}}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{m as a,F as b,q as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as O}from"./chunk-7EUQWCP5.js";import{a as L}from"./chunk-JZZQRLNW.js";import{c as P,e as I,l as D,y as H}from"./chunk-QHPDGSZ6.js";import{b as T}from"./chunk-NZNNTHFQ.js";import{b as $}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-7EUQWCP5.js";import{a as L}from"./chunk-JZZQRLNW.js";import{c as P,e as I,l as D,y as H}from"./chunk-QHPDGSZ6.js";import{b as T}from"./chunk-NZNNTHFQ.js";import{b as $}from"./chunk-EP66JAAV.js";import{b as y,j as k}from"./chunk-TMD6JYTR.js";import{a as E}from"./chunk-3IX3CLER.js";import{$b as g,Kb as h,Mb as f,Rb as d,Wb as m,Xb as l,Yb as w,cc as _,dc as a,h as S,ib as s,na as r,nc as v,rb as x,sc as b,tc as M,uc as V,w as C,xa as c,ya as p}from"./chunk-TXOB7R5K.js";function z(i,u){i&1&&w(0,"i",6)}function A(i,u){i&1&&w(0,"i",7)}function F(i,u){if(i&1){let t=g();m(0,"ngx-monaco-editor",10),_("onInit",function(e){c(t);let o=a();return p(o.onEditorInit(e))})("keydown.control.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())})("keydown.meta.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())}),l()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,u){if(i&1){let t=g();m(0,"textarea",11),V("ngModelChange",function(e){c(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),p(e)}),v(1," "),l()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(y);$md=r(L);$route=r(T);$settings=r($);$toastr=r(k);$translate=r(E);startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0},this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
|
|
2
2
|
`)[0].trim())){this.$toastr.error(this.$translate.instant("platform.docker.must_use_hashbang"),this.$translate.instant("toast.title_error")),this.startupScript=`#!/bin/sh
|
|
3
3
|
|
|
4
4
|
${this.startupScript}`,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),this.saveInProgress=!1;return}try{yield C(this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript})),this.$toastr.success(this.$translate.instant("platform.docker.restart_required"),this.$translate.instant("platform.docker.script_saved"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:5,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","text-monospace"],[1,"col-6","text-right"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-fw","fa-floppy-disk"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","my-2",3,"options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModel"],[1,"flex-grow-1","h-100","w-100","my-2",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModelChange","ngModel"]],template:function(n,e){n&1&&(m(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),l()(),m(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),h(7,z,1,0,"i",6)(8,A,1,0,"i",7),l()()(),h(9,F,1,2,"ngx-monaco-editor",8)(10,W,2,1,"textarea",9),l()),n&2&&(s(6),f("disabled",e.saveInProgress),s(),d(e.saveInProgress?-1:7),s(),d(e.saveInProgress?8:-1),s(),d(e.isMobile?-1:9),s(),d(e.isMobile?10:-1))},dependencies:[O,H,P,I,D],encapsulation:2})}return i})();export{tt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{a as R}from"./chunk-TZS4WGUK.js";import"./chunk-FJF4WNUO.js";import{c as g}from"./chunk-7EUQWCP5.js";import"./chunk-JZZQRLNW.js";import{q as C}from"./chunk-ORPWYWCL.js";import{y as S,z as v}from"./chunk-QHPDGSZ6.js";import"./chunk-YRSHLHYL.js";import{d as h,g as n}from"./chunk-NZNNTHFQ.js";import"./chunk-TSZZQKYF.js";import"./chunk-EP66JAAV.js";import{b as f,j as M}from"./chunk-TMD6JYTR.js";import"./chunk-UG5DK2RQ.js";import{a as u,c as d}from"./chunk-3IX3CLER.js";import{h as p,ha as c,ia as i,md as l,na as e,sb as a,w as s}from"./chunk-TXOB7R5K.js";var m=(()=>{class t{$api=e(f);$router=e(h);$toastr=e(M);$translate=e(u);resolve(){return p(this,null,function*(){try{return yield s(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var j=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-32ZJLZS4.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:m}},{path:"restart-container",loadComponent:()=>import("./chunk-WAUGELUM.js").then(t=>t.ContainerRestartComponent)}],$=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[n.forChild(j),n]})}return t})();var Q=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[m],imports:[l,S,v,g,C,d.forChild(),$,R]})}return t})();export{Q as DockerModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as X}from"./chunk-KRNQN3FT.js";import{n as Q}from"./chunk-ORPWYWCL.js";import{c as D,d as C,e as G,f as j,g as H,j as F,m as A,p as q,q as L,y as K,z as J}from"./chunk-QHPDGSZ6.js";import{e as N}from"./chunk-NZNNTHFQ.js";import{c as W}from"./chunk-YP7JWH3J.js";import{b as R}from"./chunk-V7D5U2P3.js";import{a as z,b as B,j as O}from"./chunk-WNVJPPO7.js";import{l as M}from"./chunk-UG5DK2RQ.js";import{a as P,b as V}from"./chunk-3IX3CLER.js";import{$b as y,Bc as s,Cc as l,Kb as I,Mb as _,Rb as f,Wb as i,Xb as o,Yb as c,ad as E,cc as b,dc as m,h as w,ib as t,na as g,nc as a,oc as d,pc as v,rb as T,w as S,xa as x,xc as $,ya as h,yc as k}from"./chunk-TXOB7R5K.js";var U=(n,u)=>({"is-valid":n,"is-invalid":u}),Z=n=>({"button-loading":n});function ee(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",3),i(2,"h3",4),a(3),s(4,"translate"),o(),i(5,"button",5),b("click",function(){x(e);let p=m();return h(p.onClickGettingStarted())}),a(6),s(7,"translate"),o(),i(8,"small",6)(9,"a",7),b("click",function(){x(e);let p=m();return h(p.onClickRestoreBackup())}),a(10),s(11,"translate"),o()()()}n&2&&(t(3),d(l(4,3,"setup.welcome_to_homebridge")),t(3),v(" ",l(7,5,"setup.button_get_started")," "),t(4),d(l(11,7,"setup_wizard_message_restore")))}function te(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),o(),i(5,"div",9)(6,"p"),a(7),s(8,"translate"),o(),i(9,"form",10),b("ngSubmit",function(){x(e);let p=m();return h(p.createFirstUser())}),i(10,"div",11),c(11,"i",12)(12,"input",13),i(13,"label",14),a(14),s(15,"translate"),o()(),i(16,"div",11),c(17,"i",15)(18,"input",16),i(19,"label",17),a(20),s(21,"translate"),o()(),i(22,"div",11),c(23,"i",15)(24,"input",18),i(25,"label",19),a(26),s(27,"translate"),o()(),i(28,"div",20)(29,"button",21),a(30),s(31,"translate"),c(32,"i",22),o()()()()()}if(n&2){let e=m();t(3),d(l(4,15,"setup.create_account")),t(4),d(l(8,17,"setup.create_account_reason")),t(2),_("formGroup",e.createUserForm),t(3),_("readonly",e.loading)("ngClass",k(27,U,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid)),t(2),d(l(15,19,"users.label_username")),t(4),_("readonly",e.loading)("ngClass",k(30,U,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors)),t(2),d(l(21,21,"users.label_password")),t(4),_("readonly",e.loading)("ngClass",k(33,U,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors)),t(2),d(l(27,23,"users.label_confirm_password")),t(3),_("disabled",e.createUserForm.invalid||e.loading)("ngClass",$(36,Z,e.loading)),t(),v(" ",l(31,25,"setup.create_account")," ")}}function ie(n,u){n&1&&(i(0,"span"),c(1,"i",29),a(2),s(3,"translate"),o()),n&2&&(t(2),v(" ",l(3,1,"backup.label_uploading")," "))}function ne(n,u){n&1&&(i(0,"span"),a(1),s(2,"translate"),o()),n&2&&(t(),d(l(2,1,"backup.button_restore_backup")))}function oe(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),o(),i(5,"p"),a(6),s(7,"translate"),o(),i(8,"div",23)(9,"input",24),b("change",function(p){x(e);let Y=m();return h(Y.handleRestoreFileInput(p.target.files))}),o(),i(10,"label",25),a(11),s(12,"translate"),o()(),i(13,"div",26)(14,"button",27),b("click",function(){x(e);let p=m();return h(p.onClickCancelRestore())}),a(15),s(16,"translate"),o(),i(17,"button",28),b("click",function(){x(e);let p=m();return h(p.onRestoreBackupClick())}),I(18,ie,4,3,"span")(19,ne,3,3,"span"),o()()()}if(n&2){let e=m();t(3),d(l(4,8,"form.button_restore")),t(3),d(l(7,10,"backup.restore_help_one")),t(5),v(" ",l(12,12,(e.selectedFile==null?null:e.selectedFile.name)||"backup.label_choose_backup_file_to_restore")," "),t(3),_("disabled",e.restoreUploadStarted),t(),v(" ",l(16,14,"form.button_cancel")," "),t(2),_("disabled",e.restoreUploading||!e.selectedFile),t(),f(e.restoreUploading?18:-1),t(),f(e.restoreUploading?-1:19)}}function re(n,u){n&1&&(i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),o(),i(5,"h1"),c(6,"i",29),o()()),n&2&&(t(3),d(l(4,1,"restart.title_restart")))}function ae(n,u){n&1&&(i(0,"div",2),c(1,"img",8),i(2,"h3",30),a(3),s(4,"translate"),o(),i(5,"p",31),a(6),s(7,"translate"),o(),i(8,"a",32),a(9),s(10,"translate"),o()()),n&2&&(t(3),d(l(4,3,"setup_wizard_message_complete_title")),t(3),d(l(7,5,"setup_wizard_message_complete_message")),t(3),d(l(10,7,"setup.open_dashboard")))}var ye=(()=>{class n{$api=g(B);$auth=g(W);$modal=g(Q);$settings=g(R);$title=g(M);$toastr=g(O);$translate=g(P);previousTitle;step="welcome";createUserForm=new H({username:new F("",[C.required]),password:new F("",[C.compose([C.required,C.minLength(4)])]),passwordConfirm:new F("",[C.required])},this.matchPassword);loading=!1;selectedFile;restoreUploading=!1;ngOnInit(){this.previousTitle=this.$title.getTitle(),this.$title.setTitle("Setup Homebridge")}matchPassword(e){let r=e.get("password").value,p=e.get("passwordConfirm").value;if(r!==p)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}ngOnDestroy(){this.$title.setTitle(this.previousTitle)}onClickGettingStarted(){this.step="create-account"}onClickRestoreBackup(){this.step="restore-backup"}onClickCancelRestore(){this.selectedFile=null,this.step="welcome"}createFirstUser(){this.loading=!0;let e=this.createUserForm.getRawValue();e.name=e.username,this.$api.post("/setup-wizard/create-first-user",e).subscribe({next:()=>w(this,null,function*(){this.$settings.env.setupWizardComplete=!0,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}),error: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(e){e.length?this.selectedFile=e[0]:delete this.selectedFile}onRestoreBackupClick(){this.restoreUploading=!0,this.uploadHomebridgeArchive()}uploadHomebridgeArchive(){return w(this,null,function*(){try{let e=yield S(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(z.jwt.tokenKey,e.access_token),this.$auth.token=e.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(e){this.restoreUploading=!1,console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}openRestoreModal(){let e=this.$modal.open(X,{size:"lg",backdrop:"static"});e.componentInstance.setupWizardRestore=!0,e.result.then(r=>{r===!0&&this.waitForHomebridgeToRestart()})}waitForHomebridgeToRestart(){return w(this,null,function*(){this.step="restarting",window.localStorage.removeItem(z.jwt.tokenKey),this.$auth.token=null,yield new Promise(r=>setTimeout(r,15e3));let e=setInterval(()=>w(this,null,function*(){try{yield S(this.$api.get("/auth/settings")),clearInterval(e),location.reload()}catch{}}),1e3)})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=T({type:n,selectors:[["ng-component"]],decls:7,vars:5,consts:[[1,"setup-container","d-flex","align-items-center","justify-content-center"],[1,"w-100","setup-card","d-flex","py-5"],[1,"w-100","d-flex","flex-column","align-items-center"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","mx-auto"],[1,"pt-4","pb-3","text-center"],["type","button",1,"btn","btn-lg","btn-primary",3,"click"],[1,"mt-3"],["href","javascript:void(0)",1,"grey-text",3,"click"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","homebridge-logo-small","mx-auto"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"md-form"],[1,"fas","fa-fw","fa-user","prefix","grey-text"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-username"],[1,"fas","fa-fw","fa-lock","prefix","grey-text"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass-confirm"],[1,"w-100","text-center"],["type","submit",1,"btn","btn-primary",3,"disabled","ngClass"],[1,"button-loading-overlay","fas","fa-fw","fa-spinner","fa-pulse"],[1,"custom-file"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"custom-file-input",3,"change"],["for","restoreFileUpload",1,"custom-file-label"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ml-0",3,"click","disabled"],["type","button",1,"btn","btn-primary","mr-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"pt-4","pb-3"],[1,"text-center"],["routerLink","/",1,"btn","btn-lg","btn-primary","mt-3"]],template:function(r,p){r&1&&(i(0,"div",0)(1,"div",1),I(2,ee,12,9,"div",2)(3,te,33,38,"div",2)(4,oe,20,16,"div",2)(5,re,7,3,"div",2)(6,ae,11,9,"div",2),o()()),r&2&&(t(2),f(p.step==="welcome"?2:-1),t(),f(p.step==="create-account"?3:-1),t(),f(p.step==="restore-backup"?4:-1),t(),f(p.step==="restarting"?5:-1),t(),f(p.step==="setup-complete"?6:-1))},dependencies:[K,A,D,G,j,J,q,L,E,N,V],styles:[".setup-container[_ngcontent-%COMP%]{background-size:cover;z-index:-1;padding-top:1em;padding-bottom:1em}@media screen and (min-height: 500px) and (min-width: 600px){.setup-container[_ngcontent-%COMP%]{padding-top:4em}}.setup-card[_ngcontent-%COMP%]{max-width:600px;border-radius:15px;background-color:#fff;padding-right:25px;padding-left:25px}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 600px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.homebridge-logo[_ngcontent-%COMP%]{margin-right:10px;height:200px}@media screen and (max-height: 500px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}@media screen and (max-width: 600px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}.homebridge-logo-small[_ngcontent-%COMP%]{height:50px}.button-loading[_ngcontent-%COMP%]{position:relative;color:#0000}.button-loading[_ngcontent-%COMP%] .button-loading-overlay[_ngcontent-%COMP%]{display:block;color:#fff}.button-loading-overlay[_ngcontent-%COMP%]{display:none;position:absolute;top:9px;left:0;right:0}small[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})}return n})();export{ye as a};
|
|
1
|
+
import{a as X}from"./chunk-5OHKMFXO.js";import{n as Q}from"./chunk-ORPWYWCL.js";import{c as D,d as C,e as G,f as j,g as H,j as F,m as A,p as q,q as L,y as K,z as J}from"./chunk-QHPDGSZ6.js";import{e as N}from"./chunk-NZNNTHFQ.js";import{c as W}from"./chunk-TSZZQKYF.js";import{b as R}from"./chunk-EP66JAAV.js";import{a as z,b as B,j as O}from"./chunk-TMD6JYTR.js";import{l as M}from"./chunk-UG5DK2RQ.js";import{a as P,b as V}from"./chunk-3IX3CLER.js";import{$b as y,Bc as s,Cc as l,Kb as I,Mb as _,Rb as f,Wb as i,Xb as o,Yb as c,ad as E,cc as b,dc as m,h as w,ib as t,na as g,nc as a,oc as d,pc as v,rb as T,w as S,xa as x,xc as $,ya as h,yc as k}from"./chunk-TXOB7R5K.js";var U=(n,u)=>({"is-valid":n,"is-invalid":u}),Z=n=>({"button-loading":n});function ee(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",3),i(2,"h3",4),a(3),s(4,"translate"),o(),i(5,"button",5),b("click",function(){x(e);let p=m();return h(p.onClickGettingStarted())}),a(6),s(7,"translate"),o(),i(8,"small",6)(9,"a",7),b("click",function(){x(e);let p=m();return h(p.onClickRestoreBackup())}),a(10),s(11,"translate"),o()()()}n&2&&(t(3),d(l(4,3,"setup.welcome_to_homebridge")),t(3),v(" ",l(7,5,"setup.button_get_started")," "),t(4),d(l(11,7,"setup_wizard_message_restore")))}function te(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),o(),i(5,"div",9)(6,"p"),a(7),s(8,"translate"),o(),i(9,"form",10),b("ngSubmit",function(){x(e);let p=m();return h(p.createFirstUser())}),i(10,"div",11),c(11,"i",12)(12,"input",13),i(13,"label",14),a(14),s(15,"translate"),o()(),i(16,"div",11),c(17,"i",15)(18,"input",16),i(19,"label",17),a(20),s(21,"translate"),o()(),i(22,"div",11),c(23,"i",15)(24,"input",18),i(25,"label",19),a(26),s(27,"translate"),o()(),i(28,"div",20)(29,"button",21),a(30),s(31,"translate"),c(32,"i",22),o()()()()()}if(n&2){let e=m();t(3),d(l(4,15,"setup.create_account")),t(4),d(l(8,17,"setup.create_account_reason")),t(2),_("formGroup",e.createUserForm),t(3),_("readonly",e.loading)("ngClass",k(27,U,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid)),t(2),d(l(15,19,"users.label_username")),t(4),_("readonly",e.loading)("ngClass",k(30,U,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors)),t(2),d(l(21,21,"users.label_password")),t(4),_("readonly",e.loading)("ngClass",k(33,U,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors)),t(2),d(l(27,23,"users.label_confirm_password")),t(3),_("disabled",e.createUserForm.invalid||e.loading)("ngClass",$(36,Z,e.loading)),t(),v(" ",l(31,25,"setup.create_account")," ")}}function ie(n,u){n&1&&(i(0,"span"),c(1,"i",29),a(2),s(3,"translate"),o()),n&2&&(t(2),v(" ",l(3,1,"backup.label_uploading")," "))}function ne(n,u){n&1&&(i(0,"span"),a(1),s(2,"translate"),o()),n&2&&(t(),d(l(2,1,"backup.button_restore_backup")))}function oe(n,u){if(n&1){let e=y();i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),o(),i(5,"p"),a(6),s(7,"translate"),o(),i(8,"div",23)(9,"input",24),b("change",function(p){x(e);let Y=m();return h(Y.handleRestoreFileInput(p.target.files))}),o(),i(10,"label",25),a(11),s(12,"translate"),o()(),i(13,"div",26)(14,"button",27),b("click",function(){x(e);let p=m();return h(p.onClickCancelRestore())}),a(15),s(16,"translate"),o(),i(17,"button",28),b("click",function(){x(e);let p=m();return h(p.onRestoreBackupClick())}),I(18,ie,4,3,"span")(19,ne,3,3,"span"),o()()()}if(n&2){let e=m();t(3),d(l(4,8,"form.button_restore")),t(3),d(l(7,10,"backup.restore_help_one")),t(5),v(" ",l(12,12,(e.selectedFile==null?null:e.selectedFile.name)||"backup.label_choose_backup_file_to_restore")," "),t(3),_("disabled",e.restoreUploadStarted),t(),v(" ",l(16,14,"form.button_cancel")," "),t(2),_("disabled",e.restoreUploading||!e.selectedFile),t(),f(e.restoreUploading?18:-1),t(),f(e.restoreUploading?-1:19)}}function re(n,u){n&1&&(i(0,"div",2),c(1,"img",8),i(2,"h3",4),a(3),s(4,"translate"),o(),i(5,"h1"),c(6,"i",29),o()()),n&2&&(t(3),d(l(4,1,"restart.title_restart")))}function ae(n,u){n&1&&(i(0,"div",2),c(1,"img",8),i(2,"h3",30),a(3),s(4,"translate"),o(),i(5,"p",31),a(6),s(7,"translate"),o(),i(8,"a",32),a(9),s(10,"translate"),o()()),n&2&&(t(3),d(l(4,3,"setup_wizard_message_complete_title")),t(3),d(l(7,5,"setup_wizard_message_complete_message")),t(3),d(l(10,7,"setup.open_dashboard")))}var ye=(()=>{class n{$api=g(B);$auth=g(W);$modal=g(Q);$settings=g(R);$title=g(M);$toastr=g(O);$translate=g(P);previousTitle;step="welcome";createUserForm=new H({username:new F("",[C.required]),password:new F("",[C.compose([C.required,C.minLength(4)])]),passwordConfirm:new F("",[C.required])},this.matchPassword);loading=!1;selectedFile;restoreUploading=!1;ngOnInit(){this.previousTitle=this.$title.getTitle(),this.$title.setTitle("Setup Homebridge")}matchPassword(e){let r=e.get("password").value,p=e.get("passwordConfirm").value;if(r!==p)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}ngOnDestroy(){this.$title.setTitle(this.previousTitle)}onClickGettingStarted(){this.step="create-account"}onClickRestoreBackup(){this.step="restore-backup"}onClickCancelRestore(){this.selectedFile=null,this.step="welcome"}createFirstUser(){this.loading=!0;let e=this.createUserForm.getRawValue();e.name=e.username,this.$api.post("/setup-wizard/create-first-user",e).subscribe({next:()=>w(this,null,function*(){this.$settings.env.setupWizardComplete=!0,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}),error: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(e){e.length?this.selectedFile=e[0]:delete this.selectedFile}onRestoreBackupClick(){this.restoreUploading=!0,this.uploadHomebridgeArchive()}uploadHomebridgeArchive(){return w(this,null,function*(){try{let e=yield S(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(z.jwt.tokenKey,e.access_token),this.$auth.token=e.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(e){this.restoreUploading=!1,console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}openRestoreModal(){let e=this.$modal.open(X,{size:"lg",backdrop:"static"});e.componentInstance.setupWizardRestore=!0,e.result.then(r=>{r===!0&&this.waitForHomebridgeToRestart()})}waitForHomebridgeToRestart(){return w(this,null,function*(){this.step="restarting",window.localStorage.removeItem(z.jwt.tokenKey),this.$auth.token=null,yield new Promise(r=>setTimeout(r,15e3));let e=setInterval(()=>w(this,null,function*(){try{yield S(this.$api.get("/auth/settings")),clearInterval(e),location.reload()}catch{}}),1e3)})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=T({type:n,selectors:[["ng-component"]],decls:7,vars:5,consts:[[1,"setup-container","d-flex","align-items-center","justify-content-center"],[1,"w-100","setup-card","d-flex","py-5"],[1,"w-100","d-flex","flex-column","align-items-center"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","mx-auto"],[1,"pt-4","pb-3","text-center"],["type","button",1,"btn","btn-lg","btn-primary",3,"click"],[1,"mt-3"],["href","javascript:void(0)",1,"grey-text",3,"click"],["src","/assets/homebridge-color-round.svg","alt","hb logo",1,"homebridge-logo","homebridge-logo-small","mx-auto"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"md-form"],[1,"fas","fa-fw","fa-user","prefix","grey-text"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-username"],[1,"fas","fa-fw","fa-lock","prefix","grey-text"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2",1,"form-control","px-0",3,"readonly","ngClass"],["for","form-pass-confirm"],[1,"w-100","text-center"],["type","submit",1,"btn","btn-primary",3,"disabled","ngClass"],[1,"button-loading-overlay","fas","fa-fw","fa-spinner","fa-pulse"],[1,"custom-file"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"custom-file-input",3,"change"],["for","restoreFileUpload",1,"custom-file-label"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ml-0",3,"click","disabled"],["type","button",1,"btn","btn-primary","mr-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"pt-4","pb-3"],[1,"text-center"],["routerLink","/",1,"btn","btn-lg","btn-primary","mt-3"]],template:function(r,p){r&1&&(i(0,"div",0)(1,"div",1),I(2,ee,12,9,"div",2)(3,te,33,38,"div",2)(4,oe,20,16,"div",2)(5,re,7,3,"div",2)(6,ae,11,9,"div",2),o()()),r&2&&(t(2),f(p.step==="welcome"?2:-1),t(),f(p.step==="create-account"?3:-1),t(),f(p.step==="restore-backup"?4:-1),t(),f(p.step==="restarting"?5:-1),t(),f(p.step==="setup-complete"?6:-1))},dependencies:[K,A,D,G,j,J,q,L,E,N,V],styles:[".setup-container[_ngcontent-%COMP%]{background-size:cover;z-index:-1;padding-top:1em;padding-bottom:1em}@media screen and (min-height: 500px) and (min-width: 600px){.setup-container[_ngcontent-%COMP%]{padding-top:4em}}.setup-card[_ngcontent-%COMP%]{max-width:600px;border-radius:15px;background-color:#fff;padding-right:25px;padding-left:25px}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 600px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.homebridge-logo[_ngcontent-%COMP%]{margin-right:10px;height:200px}@media screen and (max-height: 500px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}@media screen and (max-width: 600px){.homebridge-logo[_ngcontent-%COMP%]{height:100px}}.homebridge-logo-small[_ngcontent-%COMP%]{height:50px}.button-loading[_ngcontent-%COMP%]{position:relative;color:#0000}.button-loading[_ngcontent-%COMP%] .button-loading-overlay[_ngcontent-%COMP%]{display:block;color:#fff}.button-loading-overlay[_ngcontent-%COMP%]{display:none;position:absolute;top:9px;left:0;right:0}small[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})}return n})();export{ye as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as G}from"./chunk-WHJSVGC7.js";import{a as W}from"./chunk-BPMSJ2VF.js";import{a as Z}from"./chunk-WHJOLAED.js";import{a as X}from"./chunk-JZZQRLNW.js";import{a as H}from"./chunk-KQJ7ONUG.js";import{n as B}from"./chunk-ORPWYWCL.js";import"./chunk-QHPDGSZ6.js";import{a as R}from"./chunk-SK5UJRQU.js";import{a as q,c as N,d as T,e as D,f as j}from"./chunk-NZNNTHFQ.js";import{c as $}from"./chunk-YP7JWH3J.js";import{b as L}from"./chunk-V7D5U2P3.js";import{a as P}from"./chunk-WNVJPPO7.js";import"./chunk-UG5DK2RQ.js";import{a as M,b as U}from"./chunk-3IX3CLER.js";import{$b as y,Bc as d,Cc as l,Kb as E,Lb as u,Mb as m,Rb as w,Wb as n,Xb as a,Yb as p,ad as V,cc as _,dc as C,g as Y,h as z,ib as o,na as c,nc as f,oc as v,pb as F,rb as O,sd as K,w as A,wc as g,xa as b,xc as k,ya as x}from"./chunk-TXOB7R5K.js";var Q=Y(Z(),1);var I=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/accessories"],re=()=>["/support"],ae=()=>["/power-options"],se=()=>["/plugins"],de=()=>["/logs"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"];function me(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",19),d(2,"translate"),d(3,"translate"),_("click",function(){b(e);let t=C();return x(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",20),a(),n(6,"div",14),f(7),d(8,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),o(6),v(l(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",21),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,se))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_plugins")),o(5),v(l(7,6,"menu.label_plugins")))}function _e(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,de))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_logs")),o(5),v(l(7,6,"menu.linux.label_logs")))}function fe(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,le))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),o(5),v(l(7,6,"menu.linux.label_terminal")))}function ge(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),o(5),v(l(7,6,"menu.config_json_editor")))}function ve(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),o(5),v(l(7,6,"menu.label_settings")))}function he(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){b(e);let t=C();return x(t.$auth.logout())})("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.tooltip_logout")),o(5),v(l(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{router=c(T);translate=c(M);$auth=c($);$settings=c(L);$md=c(X);$modal=c(B);$notification=c(G);$translate=c(M);renderer=c(F);isExpanded=!1;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;constructor(){let e=this.router;this.isMobile=this.$md.detect.mobile(),e.events.subscribe(s=>{s instanceof q&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},500))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)});let e=document.querySelector(".sidebar"),s=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!s.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),s.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),s.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.renderer.setStyle(e,"opacity","20%"),this.renderer.setStyle(e,"pointer-events","none"),this.renderer.setStyle(e,"overflow","hidden")):(this.renderer.removeStyle(e,"opacity"),this.renderer.removeStyle(e,"pointer-events"),this.renderer.removeStyle(e,"overflow"))}openUnderVoltageModal(){let e=this.$modal.open(W,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let s=e.target;["menuitem","button"].includes(s.getAttribute("role"))&&s.click()}}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:60,vars:66,consts:[["tabindex","0","role","button",1,"m-header","text-right",3,"click","keydown"],[1,"mr-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"fa","fa-fw","fa-power-off"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(s,t){s&1&&(n(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(h){return t.handleKeydown(h)}),p(2,"span",1),n(3,"a",2),d(4,"translate"),p(5,"img",3),n(6,"div",4),f(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(h){return t.handleKeydown(h)}),n(15,"a",2),d(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),d(28,"translate"),a()()(),E(29,me,9,8,"div",10)(30,ue,8,9,"div",10),n(31,"div",10)(32,"div",15),d(33,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(34,"div",12),p(35,"i",16),a(),n(36,"div",14),f(37),d(38,"translate"),a()()(),E(39,_e,8,9,"div",10)(40,fe,8,9,"div",10)(41,ge,8,9,"div",10)(42,ve,8,9,"div",10),n(43,"div",10)(44,"div",15),d(45,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(46,"div",12),p(47,"i",17),a(),n(48,"div",14),f(49),d(50,"translate"),a()()(),n(51,"div",10)(52,"div",15),d(53,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(54,"div",12),p(55,"i",18),a(),n(56,"div",14),f(57),d(58,"translate"),a()()(),E(59,he,8,6,"div",10),a()()),s&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,33,"menu.sidebar.aria_menu")),o(3),m("routerLink",g(55,I)),u("aria-label",l(4,35,"menu.label_status")),o(5),m("ngClass",k(56,te,t.isExpanded)),o(5),m("ngClass",k(58,ne,t.isExpanded)),o(2),m("routerLink",g(60,I)),u("aria-label",l(16,37,"menu.label_status")),o(7),m("routerLink",g(61,I))("routerLinkActive","active")("routerLinkActiveOptions",g(62,ie)),u("aria-label",l(23,39,"menu.label_status")),o(5),v(l(28,41,"menu.label_status")),o(2),w(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(),w(t.$auth.user.admin?30:-1),o(2),m("routerLink",g(63,oe))("routerLinkActive","active"),u("aria-label",l(33,43,"menu.label_accessories")),o(5),v(l(38,45,"menu.label_accessories")),o(2),w(t.$auth.user.admin?39:-1),o(),w(t.$settings.env.enableTerminalAccess&&t.$auth.user.admin?40:-1),o(),w(t.$auth.user.admin?41:-1),o(),w(t.$auth.user.admin?42:-1),o(2),m("routerLink",g(64,re))("routerLinkActive","active"),u("aria-label",l(45,47,"support.title")),o(5),v(l(50,49,"support.title")),o(3),m("routerLink",g(65,ae))("routerLinkActive","active"),u("aria-label",l(53,51,"menu.restart.title")),o(5),v(l(58,53,"menu.restart.title")),o(2),w(t.$settings.formAuth?59:-1))},dependencies:[K,V,D,j,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var be=i=>({sidebarExpanded:i}),He=(()=>{class i{$auth=c($);$modal=c(B);$router=c(T);$settings=c(L);$translate=c(M);$ws=c(R);sidebarExpanded=!1;io;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return z(this,null,function*(){if(this.$settings.settingsLoaded||(yield A(this.$settings.onSettingsLoaded)),(0,Q.lt)(this.$settings.uiVersion,P.serverTarget)){console.log(`Server restart required. UI Version: ${P.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:P.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-fw-power-off",e.result.then(()=>{this.$router.navigate(["/restart"])}).catch(()=>{})}})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(s,t){s&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),s&2&&(m("isExpanded",t.sidebarExpanded),o(),m("ngClass",k(2,be,t.sidebarExpanded)))},dependencies:[J,V,N],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{He as LayoutComponent};
|
|
1
|
+
import{a as G}from"./chunk-WHJSVGC7.js";import{a as W}from"./chunk-BPMSJ2VF.js";import{a as Z}from"./chunk-WHJOLAED.js";import{a as X}from"./chunk-JZZQRLNW.js";import{a as H}from"./chunk-KQJ7ONUG.js";import{n as B}from"./chunk-ORPWYWCL.js";import"./chunk-QHPDGSZ6.js";import{a as R}from"./chunk-YRSHLHYL.js";import{a as q,c as N,d as T,e as D,f as j}from"./chunk-NZNNTHFQ.js";import{c as $}from"./chunk-TSZZQKYF.js";import{b as L}from"./chunk-EP66JAAV.js";import{a as P}from"./chunk-TMD6JYTR.js";import"./chunk-UG5DK2RQ.js";import{a as M,b as U}from"./chunk-3IX3CLER.js";import{$b as y,Bc as d,Cc as l,Kb as E,Lb as u,Mb as m,Rb as w,Wb as n,Xb as a,Yb as p,ad as V,cc as _,dc as C,g as Y,h as z,ib as o,na as c,nc as f,oc as v,pb as F,rb as O,sd as K,w as A,wc as g,xa as b,xc as k,ya as x}from"./chunk-TXOB7R5K.js";var Q=Y(Z(),1);var I=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/accessories"],re=()=>["/support"],ae=()=>["/power-options"],se=()=>["/plugins"],de=()=>["/logs"],le=()=>["/platform-tools/terminal"],pe=()=>["/config"],ce=()=>["/settings"];function me(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",19),d(2,"translate"),d(3,"translate"),_("click",function(){b(e);let t=C();return x(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",20),a(),n(6,"div",14),f(7),d(8,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),o(6),v(l(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",21),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,se))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_plugins")),o(5),v(l(7,6,"menu.label_plugins")))}function _e(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,de))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_logs")),o(5),v(l(7,6,"menu.linux.label_logs")))}function fe(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,le))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),o(5),v(l(7,6,"menu.linux.label_terminal")))}function ge(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),o(5),v(l(7,6,"menu.config_json_editor")))}function ve(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),m("routerLink",g(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),o(5),v(l(7,6,"menu.label_settings")))}function he(i,S){if(i&1){let e=y();n(0,"div",10)(1,"div",19),d(2,"translate"),_("click",function(){b(e);let t=C();return x(t.$auth.logout())})("keydown",function(t){b(e);let r=C();return x(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),f(6),d(7,"translate"),a()()()}i&2&&(o(),u("aria-label",l(2,2,"menu.tooltip_logout")),o(5),v(l(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{router=c(T);translate=c(M);$auth=c($);$settings=c(L);$md=c(X);$modal=c(B);$notification=c(G);$translate=c(M);renderer=c(F);isExpanded=!1;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;constructor(){let e=this.router;this.isMobile=this.$md.detect.mobile(),e.events.subscribe(s=>{s instanceof q&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},500))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)});let e=document.querySelector(".sidebar"),s=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!s.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),s.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),s.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.renderer.setStyle(e,"opacity","20%"),this.renderer.setStyle(e,"pointer-events","none"),this.renderer.setStyle(e,"overflow","hidden")):(this.renderer.removeStyle(e,"opacity"),this.renderer.removeStyle(e,"pointer-events"),this.renderer.removeStyle(e,"overflow"))}openUnderVoltageModal(){let e=this.$modal.open(W,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-fw fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let s=e.target;["menuitem","button"].includes(s.getAttribute("role"))&&s.click()}}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:60,vars:66,consts:[["tabindex","0","role","button",1,"m-header","text-right",3,"click","keydown"],[1,"mr-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-fw","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-fw","fa-lightbulb"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"fa","fa-fw","fa-power-off"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-fw","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-fw","fa-plug"],[1,"fa","fa-fw","fa-wave-square"],[1,"fa","fa-fw","fa-terminal"],[1,"fa","fa-fw","fa-code"],[1,"fa","fa-fw","fa-cog"],[1,"fa","fa-fw","fa-right-from-bracket"]],template:function(s,t){s&1&&(n(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(h){return t.handleKeydown(h)}),p(2,"span",1),n(3,"a",2),d(4,"translate"),p(5,"img",3),n(6,"div",4),f(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(h){return t.handleKeydown(h)}),n(15,"a",2),d(16,"translate"),p(17,"img",3),n(18,"div",8),f(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),f(27),d(28,"translate"),a()()(),E(29,me,9,8,"div",10)(30,ue,8,9,"div",10),n(31,"div",10)(32,"div",15),d(33,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(34,"div",12),p(35,"i",16),a(),n(36,"div",14),f(37),d(38,"translate"),a()()(),E(39,_e,8,9,"div",10)(40,fe,8,9,"div",10)(41,ge,8,9,"div",10)(42,ve,8,9,"div",10),n(43,"div",10)(44,"div",15),d(45,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(46,"div",12),p(47,"i",17),a(),n(48,"div",14),f(49),d(50,"translate"),a()()(),n(51,"div",10)(52,"div",15),d(53,"translate"),_("keydown",function(h){return t.handleKeydown(h)}),n(54,"div",12),p(55,"i",18),a(),n(56,"div",14),f(57),d(58,"translate"),a()()(),E(59,he,8,6,"div",10),a()()),s&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,33,"menu.sidebar.aria_menu")),o(3),m("routerLink",g(55,I)),u("aria-label",l(4,35,"menu.label_status")),o(5),m("ngClass",k(56,te,t.isExpanded)),o(5),m("ngClass",k(58,ne,t.isExpanded)),o(2),m("routerLink",g(60,I)),u("aria-label",l(16,37,"menu.label_status")),o(7),m("routerLink",g(61,I))("routerLinkActive","active")("routerLinkActiveOptions",g(62,ie)),u("aria-label",l(23,39,"menu.label_status")),o(5),v(l(28,41,"menu.label_status")),o(2),w(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(),w(t.$auth.user.admin?30:-1),o(2),m("routerLink",g(63,oe))("routerLinkActive","active"),u("aria-label",l(33,43,"menu.label_accessories")),o(5),v(l(38,45,"menu.label_accessories")),o(2),w(t.$auth.user.admin?39:-1),o(),w(t.$settings.env.enableTerminalAccess&&t.$auth.user.admin?40:-1),o(),w(t.$auth.user.admin?41:-1),o(),w(t.$auth.user.admin?42:-1),o(2),m("routerLink",g(64,re))("routerLinkActive","active"),u("aria-label",l(45,47,"support.title")),o(5),v(l(50,49,"support.title")),o(3),m("routerLink",g(65,ae))("routerLinkActive","active"),u("aria-label",l(53,51,"menu.restart.title")),o(5),v(l(58,53,"menu.restart.title")),o(2),w(t.$settings.formAuth?59:-1))},dependencies:[K,V,D,j,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var be=i=>({sidebarExpanded:i}),He=(()=>{class i{$auth=c($);$modal=c(B);$router=c(T);$settings=c(L);$translate=c(M);$ws=c(R);sidebarExpanded=!1;io;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return z(this,null,function*(){if(this.$settings.settingsLoaded||(yield A(this.$settings.onSettingsLoaded)),(0,Q.lt)(this.$settings.uiVersion,P.serverTarget)){console.log(`Server restart required. UI Version: ${P.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:P.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-fw-power-off",e.result.then(()=>{this.$router.navigate(["/restart"])}).catch(()=>{})}})}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=O({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(s,t){s&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),s&2&&(m("isExpanded",t.sidebarExpanded),o(),m("ngClass",k(2,be,t.sidebarExpanded)))},dependencies:[J,V,N],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{He as LayoutComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-FJF4WNUO.js";import"./chunk-YRSHLHYL.js";import"./chunk-NZNNTHFQ.js";import"./chunk-TSZZQKYF.js";import"./chunk-EP66JAAV.js";import"./chunk-TMD6JYTR.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as ContainerRestartComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as se}from"./chunk-QE7DO6J3.js";import{g as re,m as A,n as ae}from"./chunk-ORPWYWCL.js";import{b as P,c as T,d as C,e as D,f as z,g as F,j as x,m as R,o as Q,p as L,q as O,w as ne,y as I,z as M}from"./chunk-QHPDGSZ6.js";import{b as ie}from"./chunk-NZNNTHFQ.js";import{c as j}from"./chunk-YP7JWH3J.js";import{a as ve}from"./chunk-V7D5U2P3.js";import{b as S,j as U}from"./chunk-WNVJPPO7.js";import{a as $,b as E}from"./chunk-3IX3CLER.js";import{$b as G,Bc as s,Cc as o,Dc as te,Gb as K,Kb as B,Lb as f,Mb as u,Rb as g,Tb as W,Ub as X,Vb as Y,Wb as i,Xb as l,Yb as m,ad as q,cc as _,dc as h,g as be,ib as e,kc as Z,lc as ee,na as d,nc as p,oc as v,pc as c,rb as y,xa as N,xc as w,ya as V}from"./chunk-TXOB7R5K.js";function Ce(r,k){r&1&&(i(0,"p",8)(1,"small"),p(2),s(3,"translate"),l()()),r&2&&(e(2),v(o(3,1,"login.invalid_credentials")))}var oe=(()=>{class r{$activeModal=d(A);$api=d(S);$toastr=d(U);$translate=d($);formGroup=new F({password:new x("",[C.required])});invalidCredentials=!1;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}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,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"],[1,"red-text"],[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"]],template:function(a,n){a&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),p(3),s(4,"translate"),l(),i(5,"button",3),s(6,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),i(7,"span",4),p(8,"\xD7"),l()()(),i(9,"div",5)(10,"p"),p(11),s(12,"translate"),l(),i(13,"div",6),m(14,"input",7),s(15,"translate"),l(),B(16,Ce,4,3,"p",8),l(),i(17,"div",9)(18,"div",10)(19,"button",11),s(20,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),p(21),s(22,"translate"),l()(),m(23,"div",12),i(24,"div",13)(25,"button",14),_("click",function(){return n.disable2fa()}),p(26),s(27,"translate"),l()()()()),a&2&&(e(3),v(o(4,10,"users.setup_2fa_disable")),e(2),f("aria-label",o(6,12,"form.button_close")),e(6),v(o(12,14,"users.setup_2fa_disable_current_password")),e(3),u("formControl",n.formGroup.controls.password)("placeholder",o(15,16,"users.label_password")),e(2),g(n.invalidCredentials?16:-1),e(3),f("aria-label",o(20,18,"form.button_close")),e(2),c(" ",o(22,20,"form.button_close")," "),e(4),u("disabled",n.formGroup.invalid),e(),c(" ",o(27,22,"form.button_disable")," "))},dependencies:[I,T,D,M,Q,E],encapsulation:2})}return r})();var le=be(ve(),1);var xe=["qrcode"],he=r=>({timeDiffError:r});function we(r,k){if(r&1&&(i(0,"div",6)(1,"h3"),p(2),s(3,"translate"),l(),i(4,"p"),p(5),s(6,"translate"),l()()),r&2){let t=h();e(2),v(o(3,2,"users.setup_2fa_cannot_setup_2fa")),e(3),v(te(6,4,"users.setup_2fa_server_time_out",w(7,he,t.timeDiffError)))}}function ge(r,k){r&1&&(i(0,"div")(1,"p"),p(2),s(3,"translate"),l()()),r&2&&(e(2),v(o(3,1,"users.setup_2fa_scan_qr_code")))}function ye(r,k){if(r&1&&(i(0,"div",10)(1,"p"),p(2),s(3,"translate"),l(),i(4,"div",16),m(5,"input",17),l()()),r&2){let t=h();e(2),v(o(3,2,"users.setup_2fa_enter_code")),e(3),u("formControl",t.formGroup.controls.code)}}function Se(r,k){if(r&1){let t=G();i(0,"button",18),_("click",function(){N(t);let n=h();return V(n.enable2fa())}),p(1),s(2,"translate"),l()}if(r&2){let t=h();u("disabled",t.formGroup.invalid),e(),c(" ",o(2,2,"form.button_enable")," ")}}var pe=(()=>{class r{$activeModal=d(A);$api=d(S);$toastr=d(U);$translate=d($);user;qrcodeElement=K("qrcode");timeDiffError=null;otpString;formGroup=new F({code:new x("",[C.required,C.minLength(6),C.maxLength(6)])});ngOnInit(){this.$api.post("/users/otp/setup",{}).subscribe({next:t=>{this.checkTimeDiff(t.timestamp),this.timeDiffError||(this.otpString=t.otpauth)},error:t=>{this.$activeModal.dismiss(),console.error(t),this.$toastr.error(this.$translate.instant("users.setup_2fa_enable_error"),this.$translate.instant("toast.title_error"))}})}checkTimeDiff(t){let a=(0,le.default)(t).diff(new Date,"millisecond");if(a<-5e3||a>5e3){this.timeDiffError=a;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:t=>{console.error(t),this.$toastr.error(this.$translate.instant("users.setup_2fa_activate_error"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],viewQuery:function(a,n){a&1&&Z(n.qrcodeElement,xe,5),a&2&&ee()},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"],[1,"text-center"],["type","warning",3,"dismissible"],[1,"text-center","w-100","d-flex","justify-content-center"],[1,"mx-auto","my-2",2,"width","180px","height","180px",3,"data"],[1,"mt-4"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"disabled"],[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(a,n){a&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),p(3),s(4,"translate"),l(),i(5,"button",3),s(6,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),i(7,"span",4),p(8,"\xD7"),l()()(),i(9,"div",5),B(10,we,7,9,"div",6),i(11,"ngb-alert",7),p(12),s(13,"translate"),l(),B(14,ge,4,3,"div"),i(15,"div",8),m(16,"app-qrcode",9),l(),B(17,ye,6,4,"div",10),l(),i(18,"div",11)(19,"div",12)(20,"button",13),s(21,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),p(22),s(23,"translate"),l()(),m(24,"div",6),i(25,"div",14),B(26,Se,3,4,"button",15),l()()()),a&2&&(e(3),v(o(4,11,"users.setup_2fa")),e(2),f("aria-label",o(6,13,"form.button_close")),e(5),g(n.timeDiffError?10:-1),e(),u("dismissible",!1),e(),c(" ",o(13,15,"users.setup_2fa_warning")," "),e(2),g(n.timeDiffError?-1:14),e(2),u("data",n.otpString),e(),g(n.timeDiffError?-1:17),e(3),f("aria-label",o(21,17,"form.button_close")),e(2),c(" ",o(23,19,"form.button_close")," "),e(4),g(n.timeDiffError?-1:26))},dependencies:[re,se,I,T,D,ne,M,Q,E],encapsulation:2})}return r})();var me=r=>({active:r}),de=r=>({"is-invalid":r}),ce=(()=>{class r{$activeModal=d(A);$api=d(S);$toastr=d(U);$translate=d($);form=new F({username:new x("",[C.required]),name:new x("",[C.required]),password:new x("",[C.compose([C.required,C.minLength(4)])]),passwordConfirm:new x("",[C.required]),admin:new x(!0)},this.matchPassword);page={title:"users.title_add_user",save:"users.button_add_new_user",password:"users.label_password"};matchPassword(t){let a=t.get("password").value,n=t.get("passwordConfirm").value;if(a!==n)t.get("passwordConfirm").setErrors({matchPassword:!0});else return null}onSubmit({value:t}){this.$api.post("/users",t).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_added_new_user"),this.$translate.instant("toast.title_success"))},error:a=>{this.$toastr.error(a.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,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(a,n){a&1&&(i(0,"div",0)(1,"form",1),_("ngSubmit",function(){return n.onSubmit(n.form)}),i(2,"div",2)(3,"h5",3),p(4),s(5,"translate"),l(),i(6,"button",4),s(7,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),i(8,"span",5),p(9,"\xD7"),l()()(),i(10,"div",6)(11,"div",7)(12,"div",8),m(13,"input",9),s(14,"translate"),i(15,"label",10),m(16,"i",11),p(17),s(18,"translate"),l()(),i(19,"div",8),m(20,"input",12),s(21,"translate"),i(22,"label",13),m(23,"i",14),p(24),s(25,"translate"),l()(),i(26,"div",8),m(27,"input",15),s(28,"translate"),i(29,"label",16),m(30,"i",17),p(31),s(32,"translate"),l()(),i(33,"div",8),m(34,"input",18),s(35,"translate"),i(36,"label",19),m(37,"i",17),p(38),s(39,"translate"),l()(),i(40,"div",20)(41,"label",21),m(42,"i",22),p(43),s(44,"translate"),l(),i(45,"div",23),m(46,"input",24),s(47,"translate"),m(48,"label",25),l()()()(),i(49,"div",26)(50,"div",27)(51,"button",28),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),p(52),s(53,"translate"),l()(),m(54,"div",29),i(55,"div",30)(56,"button",31),p(57),s(58,"translate"),l()()()()()),a&2&&(e(),u("formGroup",n.form),e(3),v(o(5,21,"users.title_add_user")),e(2),f("aria-label",o(7,23,"form.button_close")),e(7),f("disabled",n.page.title==="users.title_edit_user"?!0:null)("aria-label",o(14,25,"users.label_username")),e(2),u("ngClass",w(49,me,n.page.title==="users.title_edit_user")),e(2),c(" ",o(18,27,"users.label_username")," "),e(3),f("aria-label",o(21,29,"users.label_full_name")),e(2),u("ngClass",w(51,me,n.page.title==="users.title_edit_user")),e(2),c(" ",o(25,31,"users.label_full_name")," "),e(3),u("ngClass",w(53,de,n.form.controls.password.dirty&&n.form.controls.password.errors)),f("aria-label",o(28,33,n.page.password)),e(4),c(" ",o(32,35,n.page.password)," "),e(3),u("ngClass",w(55,de,n.form.controls.passwordConfirm.dirty&&n.form.controls.passwordConfirm.errors)),f("aria-label",o(35,37,"users.label_confirm_password")),e(4),c(" ",o(39,39,"users.label_confirm_password")," "),e(5),c(" ",o(44,41,"users.label_admin_user")," "),e(3),f("aria-label",o(47,43,"users.label_admin_user")),e(6),c(" ",o(53,45,"form.button_close")," "),e(4),u("disabled",!n.form.valid),e(),c(" ",o(58,47,"form.button_save")," "))},dependencies:[I,R,T,P,D,z,M,L,O,q,E],encapsulation:2})}return r})();var ue=r=>({active:r}),fe=r=>({"is-invalid":r}),_e=(()=>{class r{$activeModal=d(A);$api=d(S);$auth=d(j);$toastr=d(U);$translate=d($);user;form=new F({username:new x("",[C.required]),name:new x("",[C.required]),password:new x(""),passwordConfirm:new x(""),admin:new x(!0)},this.matchPassword);page={title:"users.title_edit_user",save:"form.button_save",password:"users.label_new_password"};isCurrentUser=!1;ngOnInit(){this.isCurrentUser=this.$auth.user.username===this.user.username,this.form.patchValue(this.user)}matchPassword(t){let a=t.get("password").value,n=t.get("passwordConfirm").value;if(a!==n)t.get("passwordConfirm").setErrors({matchPassword:!0});else return null}onSubmit({value:t}){this.$api.patch(`/users/${this.user.id}`,t).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_updated_user"),this.$translate.instant("toast.title_success")),this.isCurrentUser&&t.username!==this.$auth.user.username&&this.$auth.logout()},error:a=>{console.error(a),this.$toastr.error(a.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,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(a,n){a&1&&(i(0,"div",0)(1,"form",1),_("ngSubmit",function(){return n.onSubmit(n.form)}),i(2,"div",2)(3,"h5",3),p(4),s(5,"translate"),l(),i(6,"button",4),s(7,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),i(8,"span",5),p(9,"\xD7"),l()()(),i(10,"div",6)(11,"div",7)(12,"div",8),m(13,"input",9),s(14,"translate"),i(15,"label",10),m(16,"i",11),p(17),s(18,"translate"),l()(),i(19,"div",8),m(20,"input",12),s(21,"translate"),i(22,"label",13),m(23,"i",14),p(24),s(25,"translate"),l()(),i(26,"div",8),m(27,"input",15),s(28,"translate"),i(29,"label",16),m(30,"i",17),p(31),s(32,"translate"),l()(),i(33,"div",8),m(34,"input",18),s(35,"translate"),i(36,"label",19),m(37,"i",17),p(38),s(39,"translate"),l()(),i(40,"div",20)(41,"label",21),m(42,"i",22),p(43),s(44,"translate"),l(),i(45,"div",23),m(46,"input",24),s(47,"translate"),m(48,"label",25),l()()()(),i(49,"div",26)(50,"div",27)(51,"button",28),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),p(52),s(53,"translate"),l()(),m(54,"div",29),i(55,"div",30)(56,"button",31),p(57),s(58,"translate"),l()()()()()),a&2&&(e(),u("formGroup",n.form),e(3),v(o(5,20,"users.title_edit_user")),e(2),f("aria-label",o(7,22,"form.button_close")),e(7),f("aria-label",o(14,24,"users.label_username")),e(2),u("ngClass",w(48,ue,n.page.title==="users.title_edit_user")),e(2),c(" ",o(18,26,"users.label_username")," "),e(3),f("aria-label",o(21,28,"users.label_full_name")),e(2),u("ngClass",w(50,ue,n.page.title==="users.title_edit_user")),e(2),c(" ",o(25,30,"users.label_full_name")," "),e(3),u("ngClass",w(52,fe,n.form.controls.password.dirty&&n.form.controls.password.errors)),f("aria-label",o(28,32,n.page.password)),e(4),c(" ",o(32,34,n.page.password)," "),e(3),u("ngClass",w(54,fe,n.form.controls.passwordConfirm.dirty&&n.form.controls.passwordConfirm.errors)),f("aria-label",o(35,36,"users.label_confirm_password")),e(4),c(" ",o(39,38,"users.label_confirm_password")," "),e(5),c(" ",o(44,40,"users.label_admin_user")," "),e(3),f("aria-label",o(47,42,"users.label_admin_user")),e(6),c(" ",o(53,44,"form.button_close")," "),e(4),u("disabled",!n.form.valid),e(),c(" ",o(58,46,"form.button_save")," "))},dependencies:[I,R,T,P,D,z,M,L,O,q,E],encapsulation:2})}return r})();function $e(r,k){if(r&1){let t=G();i(0,"button",19),_("click",function(){N(t);let n=h().$implicit,b=h();return V(b.deleteUser(n.id))}),p(1),s(2,"translate"),l()}r&2&&(e(),c(" ",o(2,1,"form.button_delete")," "))}function Ee(r,k){if(r&1){let t=G();i(0,"button",20),_("click",function(){N(t);let n=h().$implicit,b=h();return V(b.setup2fa(n))}),p(1),s(2,"translate"),l()}r&2&&(e(),v(o(2,1,"users.setup_2fa")))}function Ue(r,k){if(r&1){let t=G();i(0,"button",18),_("click",function(){N(t);let n=h().$implicit,b=h();return V(b.disable2fa(n))}),p(1),s(2,"translate"),l()}r&2&&(e(),c(" ",o(2,1,"users.setup_2fa_disable")," "))}function ke(r,k){if(r&1){let t=G();i(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10)(4,"span",11),m(5,"h4",12)(6,"h5",13),l()(),i(7,"div",14),B(8,$e,3,3,"button",15)(9,Ee,3,3,"button",16)(10,Ue,3,3,"button",17),i(11,"button",18),_("click",function(){let n=N(t).$implicit,b=h();return V(b.openEditUser(n))}),p(12),s(13,"translate"),l()()()()()}if(r&2){let t=k.$implicit,a=h();e(5),u("innerText",t.name),e(),u("innerText",t.username),e(2),g(a.$auth.user.username!==t.username?8:-1),e(),g(a.$auth.user.username===t.username&&!t.otpActive?9:-1),e(),g(a.$auth.user.username===t.username&&t.otpActive?10:-1),e(2),v(o(13,6,"form.button_edit"))}}var $t=(()=>{class r{$api=d(S);$auth=d(j);$modal=d(ae);$route=d(ie);$toastr=d(U);$translate=d($);homebridgeUsers;ngOnInit(){this.$route.data.subscribe(t=>{this.homebridgeUsers=t.homebridgeUsers})}reloadUsers(){return this.$api.get("/users").subscribe(t=>{this.homebridgeUsers=t})}openAddNewUser(){this.$modal.open(ce,{size:"lg",backdrop:"static"}).result.finally(()=>{this.reloadUsers()})}openEditUser(t){let a=this.$modal.open(_e,{size:"lg",backdrop:"static"});a.componentInstance.user=t,a.result.finally(()=>{this.reloadUsers()})}deleteUser(t){this.$api.delete(`/users/${t}`).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.toast_user_deleted"),this.$translate.instant("toast.title_success")),this.reloadUsers()},error:a=>{console.error(a),this.$toastr.error(a.error.message||this.$translate.instant("users.toast_failed_to_delete_user"),this.$translate.instant("toast.title_error"))}})}setup2fa(t){let a=this.$modal.open(pe,{size:"lg",backdrop:"static"});a.componentInstance.user=t,a.result.finally(()=>{this.reloadUsers()})}disable2fa(t){let a=this.$modal.open(oe,{size:"lg",backdrop:"static"});a.componentInstance.user=t,a.result.finally(()=>{this.reloadUsers()})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,selectors:[["app-users"]],decls:12,vars:6,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"],[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"],[1,"btn","btn-elegant","btn-sml","m-0"],[1,"btn","btn-primary","mt-0","m-0"],[1,"btn","btn-primary","m-0"],[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(a,n){a&1&&(i(0,"div",0)(1,"div",1)(2,"h3",2),p(3),s(4,"translate"),l()(),i(5,"div",3)(6,"button",4),s(7,"translate"),_("click",function(){return n.openAddNewUser()}),m(8,"i",5),l()()(),i(9,"div",6),X(10,ke,14,8,"div",7,W),l()),a&2&&(e(3),v(o(4,2,"users.title_users")),e(3),f("aria-label",o(7,4,"users.button_add_user")),e(4),Y(n.homebridgeUsers))},dependencies:[E],encapsulation:2})}return r})();export{oe as a,pe as b,ce as c,_e as d,$t as e};
|
|
1
|
+
import{a as se}from"./chunk-QE7DO6J3.js";import{g as re,m as A,n as ae}from"./chunk-ORPWYWCL.js";import{b as P,c as T,d as C,e as D,f as z,g as F,j as x,m as R,o as Q,p as L,q as O,w as ne,y as I,z as M}from"./chunk-QHPDGSZ6.js";import{b as ie}from"./chunk-NZNNTHFQ.js";import{c as j}from"./chunk-TSZZQKYF.js";import{a as ve}from"./chunk-EP66JAAV.js";import{b as S,j as U}from"./chunk-TMD6JYTR.js";import{a as $,b as E}from"./chunk-3IX3CLER.js";import{$b as G,Bc as s,Cc as o,Dc as te,Gb as K,Kb as B,Lb as f,Mb as u,Rb as g,Tb as W,Ub as X,Vb as Y,Wb as i,Xb as l,Yb as m,ad as q,cc as _,dc as h,g as be,ib as e,kc as Z,lc as ee,na as d,nc as p,oc as v,pc as c,rb as y,xa as N,xc as w,ya as V}from"./chunk-TXOB7R5K.js";function Ce(r,k){r&1&&(i(0,"p",8)(1,"small"),p(2),s(3,"translate"),l()()),r&2&&(e(2),v(o(3,1,"login.invalid_credentials")))}var oe=(()=>{class r{$activeModal=d(A);$api=d(S);$toastr=d(U);$translate=d($);formGroup=new F({password:new x("",[C.required])});invalidCredentials=!1;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}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,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"],[1,"red-text"],[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"]],template:function(a,n){a&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),p(3),s(4,"translate"),l(),i(5,"button",3),s(6,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),i(7,"span",4),p(8,"\xD7"),l()()(),i(9,"div",5)(10,"p"),p(11),s(12,"translate"),l(),i(13,"div",6),m(14,"input",7),s(15,"translate"),l(),B(16,Ce,4,3,"p",8),l(),i(17,"div",9)(18,"div",10)(19,"button",11),s(20,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),p(21),s(22,"translate"),l()(),m(23,"div",12),i(24,"div",13)(25,"button",14),_("click",function(){return n.disable2fa()}),p(26),s(27,"translate"),l()()()()),a&2&&(e(3),v(o(4,10,"users.setup_2fa_disable")),e(2),f("aria-label",o(6,12,"form.button_close")),e(6),v(o(12,14,"users.setup_2fa_disable_current_password")),e(3),u("formControl",n.formGroup.controls.password)("placeholder",o(15,16,"users.label_password")),e(2),g(n.invalidCredentials?16:-1),e(3),f("aria-label",o(20,18,"form.button_close")),e(2),c(" ",o(22,20,"form.button_close")," "),e(4),u("disabled",n.formGroup.invalid),e(),c(" ",o(27,22,"form.button_disable")," "))},dependencies:[I,T,D,M,Q,E],encapsulation:2})}return r})();var le=be(ve(),1);var xe=["qrcode"],he=r=>({timeDiffError:r});function we(r,k){if(r&1&&(i(0,"div",6)(1,"h3"),p(2),s(3,"translate"),l(),i(4,"p"),p(5),s(6,"translate"),l()()),r&2){let t=h();e(2),v(o(3,2,"users.setup_2fa_cannot_setup_2fa")),e(3),v(te(6,4,"users.setup_2fa_server_time_out",w(7,he,t.timeDiffError)))}}function ge(r,k){r&1&&(i(0,"div")(1,"p"),p(2),s(3,"translate"),l()()),r&2&&(e(2),v(o(3,1,"users.setup_2fa_scan_qr_code")))}function ye(r,k){if(r&1&&(i(0,"div",10)(1,"p"),p(2),s(3,"translate"),l(),i(4,"div",16),m(5,"input",17),l()()),r&2){let t=h();e(2),v(o(3,2,"users.setup_2fa_enter_code")),e(3),u("formControl",t.formGroup.controls.code)}}function Se(r,k){if(r&1){let t=G();i(0,"button",18),_("click",function(){N(t);let n=h();return V(n.enable2fa())}),p(1),s(2,"translate"),l()}if(r&2){let t=h();u("disabled",t.formGroup.invalid),e(),c(" ",o(2,2,"form.button_enable")," ")}}var pe=(()=>{class r{$activeModal=d(A);$api=d(S);$toastr=d(U);$translate=d($);user;qrcodeElement=K("qrcode");timeDiffError=null;otpString;formGroup=new F({code:new x("",[C.required,C.minLength(6),C.maxLength(6)])});ngOnInit(){this.$api.post("/users/otp/setup",{}).subscribe({next:t=>{this.checkTimeDiff(t.timestamp),this.timeDiffError||(this.otpString=t.otpauth)},error:t=>{this.$activeModal.dismiss(),console.error(t),this.$toastr.error(this.$translate.instant("users.setup_2fa_enable_error"),this.$translate.instant("toast.title_error"))}})}checkTimeDiff(t){let a=(0,le.default)(t).diff(new Date,"millisecond");if(a<-5e3||a>5e3){this.timeDiffError=a;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:t=>{console.error(t),this.$toastr.error(this.$translate.instant("users.setup_2fa_activate_error"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],viewQuery:function(a,n){a&1&&Z(n.qrcodeElement,xe,5),a&2&&ee()},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"],[1,"text-center"],["type","warning",3,"dismissible"],[1,"text-center","w-100","d-flex","justify-content-center"],[1,"mx-auto","my-2",2,"width","180px","height","180px",3,"data"],[1,"mt-4"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-primary",3,"disabled"],[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(a,n){a&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),p(3),s(4,"translate"),l(),i(5,"button",3),s(6,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),i(7,"span",4),p(8,"\xD7"),l()()(),i(9,"div",5),B(10,we,7,9,"div",6),i(11,"ngb-alert",7),p(12),s(13,"translate"),l(),B(14,ge,4,3,"div"),i(15,"div",8),m(16,"app-qrcode",9),l(),B(17,ye,6,4,"div",10),l(),i(18,"div",11)(19,"div",12)(20,"button",13),s(21,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),p(22),s(23,"translate"),l()(),m(24,"div",6),i(25,"div",14),B(26,Se,3,4,"button",15),l()()()),a&2&&(e(3),v(o(4,11,"users.setup_2fa")),e(2),f("aria-label",o(6,13,"form.button_close")),e(5),g(n.timeDiffError?10:-1),e(),u("dismissible",!1),e(),c(" ",o(13,15,"users.setup_2fa_warning")," "),e(2),g(n.timeDiffError?-1:14),e(2),u("data",n.otpString),e(),g(n.timeDiffError?-1:17),e(3),f("aria-label",o(21,17,"form.button_close")),e(2),c(" ",o(23,19,"form.button_close")," "),e(4),g(n.timeDiffError?-1:26))},dependencies:[re,se,I,T,D,ne,M,Q,E],encapsulation:2})}return r})();var me=r=>({active:r}),de=r=>({"is-invalid":r}),ce=(()=>{class r{$activeModal=d(A);$api=d(S);$toastr=d(U);$translate=d($);form=new F({username:new x("",[C.required]),name:new x("",[C.required]),password:new x("",[C.compose([C.required,C.minLength(4)])]),passwordConfirm:new x("",[C.required]),admin:new x(!0)},this.matchPassword);page={title:"users.title_add_user",save:"users.button_add_new_user",password:"users.label_password"};matchPassword(t){let a=t.get("password").value,n=t.get("passwordConfirm").value;if(a!==n)t.get("passwordConfirm").setErrors({matchPassword:!0});else return null}onSubmit({value:t}){this.$api.post("/users",t).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_added_new_user"),this.$translate.instant("toast.title_success"))},error:a=>{this.$toastr.error(a.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,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(a,n){a&1&&(i(0,"div",0)(1,"form",1),_("ngSubmit",function(){return n.onSubmit(n.form)}),i(2,"div",2)(3,"h5",3),p(4),s(5,"translate"),l(),i(6,"button",4),s(7,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),i(8,"span",5),p(9,"\xD7"),l()()(),i(10,"div",6)(11,"div",7)(12,"div",8),m(13,"input",9),s(14,"translate"),i(15,"label",10),m(16,"i",11),p(17),s(18,"translate"),l()(),i(19,"div",8),m(20,"input",12),s(21,"translate"),i(22,"label",13),m(23,"i",14),p(24),s(25,"translate"),l()(),i(26,"div",8),m(27,"input",15),s(28,"translate"),i(29,"label",16),m(30,"i",17),p(31),s(32,"translate"),l()(),i(33,"div",8),m(34,"input",18),s(35,"translate"),i(36,"label",19),m(37,"i",17),p(38),s(39,"translate"),l()(),i(40,"div",20)(41,"label",21),m(42,"i",22),p(43),s(44,"translate"),l(),i(45,"div",23),m(46,"input",24),s(47,"translate"),m(48,"label",25),l()()()(),i(49,"div",26)(50,"div",27)(51,"button",28),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),p(52),s(53,"translate"),l()(),m(54,"div",29),i(55,"div",30)(56,"button",31),p(57),s(58,"translate"),l()()()()()),a&2&&(e(),u("formGroup",n.form),e(3),v(o(5,21,"users.title_add_user")),e(2),f("aria-label",o(7,23,"form.button_close")),e(7),f("disabled",n.page.title==="users.title_edit_user"?!0:null)("aria-label",o(14,25,"users.label_username")),e(2),u("ngClass",w(49,me,n.page.title==="users.title_edit_user")),e(2),c(" ",o(18,27,"users.label_username")," "),e(3),f("aria-label",o(21,29,"users.label_full_name")),e(2),u("ngClass",w(51,me,n.page.title==="users.title_edit_user")),e(2),c(" ",o(25,31,"users.label_full_name")," "),e(3),u("ngClass",w(53,de,n.form.controls.password.dirty&&n.form.controls.password.errors)),f("aria-label",o(28,33,n.page.password)),e(4),c(" ",o(32,35,n.page.password)," "),e(3),u("ngClass",w(55,de,n.form.controls.passwordConfirm.dirty&&n.form.controls.passwordConfirm.errors)),f("aria-label",o(35,37,"users.label_confirm_password")),e(4),c(" ",o(39,39,"users.label_confirm_password")," "),e(5),c(" ",o(44,41,"users.label_admin_user")," "),e(3),f("aria-label",o(47,43,"users.label_admin_user")),e(6),c(" ",o(53,45,"form.button_close")," "),e(4),u("disabled",!n.form.valid),e(),c(" ",o(58,47,"form.button_save")," "))},dependencies:[I,R,T,P,D,z,M,L,O,q,E],encapsulation:2})}return r})();var ue=r=>({active:r}),fe=r=>({"is-invalid":r}),_e=(()=>{class r{$activeModal=d(A);$api=d(S);$auth=d(j);$toastr=d(U);$translate=d($);user;form=new F({username:new x("",[C.required]),name:new x("",[C.required]),password:new x(""),passwordConfirm:new x(""),admin:new x(!0)},this.matchPassword);page={title:"users.title_edit_user",save:"form.button_save",password:"users.label_new_password"};isCurrentUser=!1;ngOnInit(){this.isCurrentUser=this.$auth.user.username===this.user.username,this.form.patchValue(this.user)}matchPassword(t){let a=t.get("password").value,n=t.get("passwordConfirm").value;if(a!==n)t.get("passwordConfirm").setErrors({matchPassword:!0});else return null}onSubmit({value:t}){this.$api.patch(`/users/${this.user.id}`,t).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_updated_user"),this.$translate.instant("toast.title_success")),this.isCurrentUser&&t.username!==this.$auth.user.username&&this.$auth.logout()},error:a=>{console.error(a),this.$toastr.error(a.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,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(a,n){a&1&&(i(0,"div",0)(1,"form",1),_("ngSubmit",function(){return n.onSubmit(n.form)}),i(2,"div",2)(3,"h5",3),p(4),s(5,"translate"),l(),i(6,"button",4),s(7,"translate"),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),i(8,"span",5),p(9,"\xD7"),l()()(),i(10,"div",6)(11,"div",7)(12,"div",8),m(13,"input",9),s(14,"translate"),i(15,"label",10),m(16,"i",11),p(17),s(18,"translate"),l()(),i(19,"div",8),m(20,"input",12),s(21,"translate"),i(22,"label",13),m(23,"i",14),p(24),s(25,"translate"),l()(),i(26,"div",8),m(27,"input",15),s(28,"translate"),i(29,"label",16),m(30,"i",17),p(31),s(32,"translate"),l()(),i(33,"div",8),m(34,"input",18),s(35,"translate"),i(36,"label",19),m(37,"i",17),p(38),s(39,"translate"),l()(),i(40,"div",20)(41,"label",21),m(42,"i",22),p(43),s(44,"translate"),l(),i(45,"div",23),m(46,"input",24),s(47,"translate"),m(48,"label",25),l()()()(),i(49,"div",26)(50,"div",27)(51,"button",28),_("click",function(){return n.$activeModal.dismiss("Dismiss")}),p(52),s(53,"translate"),l()(),m(54,"div",29),i(55,"div",30)(56,"button",31),p(57),s(58,"translate"),l()()()()()),a&2&&(e(),u("formGroup",n.form),e(3),v(o(5,20,"users.title_edit_user")),e(2),f("aria-label",o(7,22,"form.button_close")),e(7),f("aria-label",o(14,24,"users.label_username")),e(2),u("ngClass",w(48,ue,n.page.title==="users.title_edit_user")),e(2),c(" ",o(18,26,"users.label_username")," "),e(3),f("aria-label",o(21,28,"users.label_full_name")),e(2),u("ngClass",w(50,ue,n.page.title==="users.title_edit_user")),e(2),c(" ",o(25,30,"users.label_full_name")," "),e(3),u("ngClass",w(52,fe,n.form.controls.password.dirty&&n.form.controls.password.errors)),f("aria-label",o(28,32,n.page.password)),e(4),c(" ",o(32,34,n.page.password)," "),e(3),u("ngClass",w(54,fe,n.form.controls.passwordConfirm.dirty&&n.form.controls.passwordConfirm.errors)),f("aria-label",o(35,36,"users.label_confirm_password")),e(4),c(" ",o(39,38,"users.label_confirm_password")," "),e(5),c(" ",o(44,40,"users.label_admin_user")," "),e(3),f("aria-label",o(47,42,"users.label_admin_user")),e(6),c(" ",o(53,44,"form.button_close")," "),e(4),u("disabled",!n.form.valid),e(),c(" ",o(58,46,"form.button_save")," "))},dependencies:[I,R,T,P,D,z,M,L,O,q,E],encapsulation:2})}return r})();function $e(r,k){if(r&1){let t=G();i(0,"button",19),_("click",function(){N(t);let n=h().$implicit,b=h();return V(b.deleteUser(n.id))}),p(1),s(2,"translate"),l()}r&2&&(e(),c(" ",o(2,1,"form.button_delete")," "))}function Ee(r,k){if(r&1){let t=G();i(0,"button",20),_("click",function(){N(t);let n=h().$implicit,b=h();return V(b.setup2fa(n))}),p(1),s(2,"translate"),l()}r&2&&(e(),v(o(2,1,"users.setup_2fa")))}function Ue(r,k){if(r&1){let t=G();i(0,"button",18),_("click",function(){N(t);let n=h().$implicit,b=h();return V(b.disable2fa(n))}),p(1),s(2,"translate"),l()}r&2&&(e(),c(" ",o(2,1,"users.setup_2fa_disable")," "))}function ke(r,k){if(r&1){let t=G();i(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10)(4,"span",11),m(5,"h4",12)(6,"h5",13),l()(),i(7,"div",14),B(8,$e,3,3,"button",15)(9,Ee,3,3,"button",16)(10,Ue,3,3,"button",17),i(11,"button",18),_("click",function(){let n=N(t).$implicit,b=h();return V(b.openEditUser(n))}),p(12),s(13,"translate"),l()()()()()}if(r&2){let t=k.$implicit,a=h();e(5),u("innerText",t.name),e(),u("innerText",t.username),e(2),g(a.$auth.user.username!==t.username?8:-1),e(),g(a.$auth.user.username===t.username&&!t.otpActive?9:-1),e(),g(a.$auth.user.username===t.username&&t.otpActive?10:-1),e(2),v(o(13,6,"form.button_edit"))}}var $t=(()=>{class r{$api=d(S);$auth=d(j);$modal=d(ae);$route=d(ie);$toastr=d(U);$translate=d($);homebridgeUsers;ngOnInit(){this.$route.data.subscribe(t=>{this.homebridgeUsers=t.homebridgeUsers})}reloadUsers(){return this.$api.get("/users").subscribe(t=>{this.homebridgeUsers=t})}openAddNewUser(){this.$modal.open(ce,{size:"lg",backdrop:"static"}).result.finally(()=>{this.reloadUsers()})}openEditUser(t){let a=this.$modal.open(_e,{size:"lg",backdrop:"static"});a.componentInstance.user=t,a.result.finally(()=>{this.reloadUsers()})}deleteUser(t){this.$api.delete(`/users/${t}`).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.toast_user_deleted"),this.$translate.instant("toast.title_success")),this.reloadUsers()},error:a=>{console.error(a),this.$toastr.error(a.error.message||this.$translate.instant("users.toast_failed_to_delete_user"),this.$translate.instant("toast.title_error"))}})}setup2fa(t){let a=this.$modal.open(pe,{size:"lg",backdrop:"static"});a.componentInstance.user=t,a.result.finally(()=>{this.reloadUsers()})}disable2fa(t){let a=this.$modal.open(oe,{size:"lg",backdrop:"static"});a.componentInstance.user=t,a.result.finally(()=>{this.reloadUsers()})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=y({type:r,selectors:[["app-users"]],decls:12,vars:6,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"],[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"],[1,"btn","btn-elegant","btn-sml","m-0"],[1,"btn","btn-primary","mt-0","m-0"],[1,"btn","btn-primary","m-0"],[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(a,n){a&1&&(i(0,"div",0)(1,"div",1)(2,"h3",2),p(3),s(4,"translate"),l()(),i(5,"div",3)(6,"button",4),s(7,"translate"),_("click",function(){return n.openAddNewUser()}),m(8,"i",5),l()()(),i(9,"div",6),X(10,ke,14,8,"div",7,W),l()),a&2&&(e(3),v(o(4,2,"users.title_users")),e(3),f("aria-label",o(7,4,"users.button_add_user")),e(4),Y(n.homebridgeUsers))},dependencies:[E],encapsulation:2})}return r})();export{oe as a,pe as b,ce as c,_e as d,$t as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-DLMGGPRM.js";import{q as s}from"./chunk-ORPWYWCL.js";import{z as p}from"./chunk-QHPDGSZ6.js";import{g as i}from"./chunk-NZNNTHFQ.js";import"./chunk-EP66JAAV.js";import"./chunk-TMD6JYTR.js";import"./chunk-UG5DK2RQ.js";import{c as m}from"./chunk-3IX3CLER.js";import{ia as t,md as n,sb as r}from"./chunk-TXOB7R5K.js";var a=[{path:"",loadComponent:()=>import("./chunk-QJYLB6LD.js").then(o=>o.PowerOptionsComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(a),i]})}return o})();var j=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,u,s,p,m]})}return o})();export{j as PowerOptionsModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-KG3DHJZY.js";import"./chunk-QHPDGSZ6.js";import"./chunk-NZNNTHFQ.js";import"./chunk-TSZZQKYF.js";import"./chunk-EP66JAAV.js";import"./chunk-TMD6JYTR.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as LoginComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-YJB6Y76M.js";import"./chunk-ZT23DWNL.js";import"./chunk-6TCHCTXZ.js";import"./chunk-R2W5BRWY.js";import"./chunk-656LQTVE.js";import"./chunk-7EUQWCP5.js";import"./chunk-WNWWUCCZ.js";import"./chunk-IMOTYOKQ.js";import"./chunk-CCUID66K.js";import"./chunk-QE7DO6J3.js";import"./chunk-BKUGARB4.js";import"./chunk-BPMSJ2VF.js";import"./chunk-WHJOLAED.js";import"./chunk-JZZQRLNW.js";import"./chunk-KQJ7ONUG.js";import"./chunk-ORPWYWCL.js";import"./chunk-QHPDGSZ6.js";import"./chunk-YRSHLHYL.js";import"./chunk-NZNNTHFQ.js";import"./chunk-TSZZQKYF.js";import"./chunk-EP66JAAV.js";import"./chunk-TMD6JYTR.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as PluginsComponent};
|