homebridge-config-ui-x 5.4.2-beta.28 → 5.4.2-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/public/{chunk-UOPTK3F2.js → chunk-2D7HQVKR.js} +1 -1
- package/public/{chunk-QCNC2ZRO.js → chunk-3BBGBKFR.js} +1 -1
- package/public/{chunk-4MQAOKKO.js → chunk-3OFFDT3E.js} +1 -1
- package/public/chunk-3PZPX5LT.js +49 -0
- package/public/{chunk-ADEXJEN2.js → chunk-3WOR7HY4.js} +1 -1
- package/public/{chunk-CS6YJNF2.js → chunk-4NGXWZXZ.js} +1 -1
- package/public/{chunk-STNZ2QMW.js → chunk-4VGD3WI7.js} +1 -1
- package/public/{chunk-HXF2NTZ6.js → chunk-53UVZ2PI.js} +1 -1
- package/public/{chunk-XRZCTNNI.js → chunk-5XL6YEVR.js} +1 -1
- package/public/{chunk-BQWL4A33.js → chunk-74TLD7UE.js} +1 -1
- package/public/{chunk-ZXOWQUDO.js → chunk-7CFZRR4O.js} +1 -1
- package/public/{chunk-G67KYACP.js → chunk-7KLW5GIG.js} +1 -1
- package/public/{chunk-WKIRD776.js → chunk-A3VTDTFF.js} +1 -1
- package/public/{chunk-G4GYETZL.js → chunk-A45G2U3K.js} +1 -1
- package/public/{chunk-3SJ3SX5O.js → chunk-AHD4KF6Z.js} +1 -1
- package/public/{chunk-AHF265FC.js → chunk-AP6Z5Y4X.js} +1 -1
- package/public/{chunk-EUY6V2SE.js → chunk-B5QBG6FX.js} +1 -1
- package/public/{chunk-DWC2MBWX.js → chunk-BD4L4MMU.js} +1 -1
- package/public/{chunk-TAXFAQ3L.js → chunk-BOE57LT5.js} +1 -1
- package/public/{chunk-VQVAGTMR.js → chunk-CUOS2FWX.js} +1 -1
- package/public/{chunk-DXS2JFNS.js → chunk-CX6JKA5M.js} +1 -1
- package/public/{chunk-JUUBECIG.js → chunk-DCNSZOAX.js} +1 -1
- package/public/{chunk-WTWK5PKA.js → chunk-FP4B5ZM4.js} +1 -1
- package/public/{chunk-KSHFL3PJ.js → chunk-GH4JGNJN.js} +1 -1
- package/public/{chunk-SRT2MKSY.js → chunk-GIE4TMN3.js} +1 -1
- package/public/{chunk-XY3LHZ2J.js → chunk-GP2GNSMH.js} +1 -1
- package/public/{chunk-DIGXHM2E.js → chunk-HO6C3ZNS.js} +1 -1
- package/public/{chunk-UUAVDVSZ.js → chunk-HPUVHUIE.js} +1 -1
- package/public/{chunk-576B3ZXM.js → chunk-JR2FLREK.js} +1 -1
- package/public/{chunk-FBCSOP2P.js → chunk-JY7WBI77.js} +1 -1
- package/public/chunk-KLRMJTX4.js +1 -0
- package/public/{chunk-REBKFE4A.js → chunk-LQZNIDZL.js} +1 -1
- package/public/{chunk-GXMJ7U7T.js → chunk-LTBNWBMR.js} +1 -1
- package/public/{chunk-3PXAB53U.js → chunk-MCA223NA.js} +1 -1
- package/public/{chunk-M2T6ORNT.js → chunk-MCFOWF4A.js} +1 -1
- package/public/{chunk-KOEXWD3A.js → chunk-NPZOV2X7.js} +1 -1
- package/public/{chunk-DPA2LRNL.js → chunk-NQOKXOSJ.js} +1 -1
- package/public/{chunk-QRPF6KGY.js → chunk-NZX64JHS.js} +1 -1
- package/public/{chunk-J2XPD6IX.js → chunk-QDN5XMMB.js} +1 -1
- package/public/{chunk-3XNMT6P7.js → chunk-QFVLYN66.js} +1 -1
- package/public/{chunk-HFRNQJIL.js → chunk-R3RKTCAQ.js} +1 -1
- package/public/{chunk-5GDPNWX3.js → chunk-RPAP36X2.js} +1 -1
- package/public/{chunk-TIKCTHIY.js → chunk-SDNFT4EO.js} +1 -1
- package/public/{chunk-JYDEVI3D.js → chunk-SHZB7AIZ.js} +1 -1
- package/public/{chunk-OGKVLHAX.js → chunk-TES6RTPW.js} +1 -1
- package/public/{chunk-WVKC3J7Q.js → chunk-VQGEOKAU.js} +1 -1
- package/public/{chunk-NBZEYGST.js → chunk-WDE5OXOY.js} +1 -1
- package/public/{chunk-KYPZYUOW.js → chunk-WZBU3SBS.js} +1 -1
- package/public/{chunk-EAZMFN2Z.js → chunk-X7HR3QMP.js} +1 -1
- package/public/{chunk-XKCI2ZTD.js → chunk-YHSF3BIL.js} +1 -1
- package/public/{chunk-O6OYJCEI.js → chunk-Z5TUCCAE.js} +1 -1
- package/public/{chunk-ATA2ICPN.js → chunk-ZLL7JTA4.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-J4EUNOOK.js → main-B7UGKBVJ.js} +1 -1
- package/public/chunk-KA4NI23B.js +0 -49
- package/public/chunk-LHORTAWA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$c as zt,Ac as Kt,B as at,C as lt,D as Pt,Db as Tt,Fa as Ht,Fb as $t,Ga as gt,Gb as V,Ib as f,L as Mt,La as a,Mc as Ct,Na as Bt,O as P,Qa as L,Sb as $,Ub as v,Vb as b,Wa as mt,X as ut,Xa as vt,Xb as x,Za as Vt,_ as ct,a as c,ab as N,b as F,cb as bt,e as ne,ea as d,fa as ht,ha as Y,ia as S,id as qt,ja as u,jb as W,ka as Nt,kb as H,n as p,oa as dt,pa as ft,r as k,rb as h,sa as J,sb as g,t as D,ta as pt,tb as m,ub as B,wa as M,x as ot,yb as _t,za as Q,zb as yt}from"./chunk-V2XN5VIX.js";var Xt=ne((Li,Ne)=>{Ne.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.4.2-beta.28",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:{"hb-service":"dist/bin/hb-service.js"},engines:{node:"^20.19.0 || ^22.12.0 || ^24.0.0",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":"13.0.1","@fastify/multipart":"9.0.3","@fastify/static":"8.2.0","@homebridge/hap-client":"3.1.1","@homebridge/node-pty-prebuilt-multiarch":"0.13.1","@nestjs/axios":"4.0.1","@nestjs/common":"11.1.6","@nestjs/core":"11.1.6","@nestjs/jwt":"11.0.0","@nestjs/passport":"11.0.5","@nestjs/platform-fastify":"11.1.6","@nestjs/platform-socket.io":"11.1.6","@nestjs/swagger":"11.2.0","@nestjs/websockets":"11.1.6",axios:"1.11.0","bash-color":"0.0.4","class-transformer":"0.5.1","class-validator":"0.14.2",commander:"14.0.0",dayjs:"1.11.13",fastify:"5.5.0","fs-extra":"11.3.1",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"8.2.0",otplib:"12.0.1","p-limit":"7.1.0",passport:"0.7.0","passport-jwt":"4.0.1","reflect-metadata":"0.2.2",rxjs:"7.8.2",semver:"7.7.2",systeminformation:"5.27.7",tail:"2.2.6",tar:"7.4.3","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^5.2.1","@nestjs/testing":"^11.1.6","@prettier/plugin-xml":"^3.4.2","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.20","@types/node":"^24.3.0","@types/node-schedule":"^2.1.8","@types/passport-jwt":"^4.0.1","@types/semver":"^7.7.0","@types/tail":"^2.2.3","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.11","@vitest/coverage-v8":"^3.2.4",concurrently:"^9.2.0","eslint-plugin-format":"^1.0.1","form-data":"^4.0.4",nodemon:"^3.1.10",rimraf:"^6.0.1","ts-loader":"^9.5.4","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.9.2","unplugin-swc":"^1.5.7",vitest:"^3.2.4"},overrides:{"@nestjs/platform-fastify":{fastify:"^5.5.0"}},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"}],scarfSettings:{enabled:!1}}});var y=(function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e})(y||{}),se="*";function Lt(e,n){return{type:y.Trigger,name:e,definitions:n,options:{}}}function X(e,n=null){return{type:y.Animate,styles:n,timings:e}}function He(e,n=null){return{type:y.Sequence,steps:e,options:n}}function K(e){return{type:y.Style,styles:e,offset:null}}function z(e,n,t){return{type:y.State,name:e,styles:n,options:t}}function tt(e,n,t=null){return{type:y.Transition,expr:e,animation:n,options:t}}var wt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(n=0,t=0){this.totalTime=n+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}onStart(n){this._originalOnStartFns.push(n),this._onStartFns.push(n)}onDone(n){this._originalOnDoneFns.push(n),this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(n=>n()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(n){this._position=this.totalTime?n*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},Dt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(n){this.players=n;let t=0,i=0,s=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++i==r&&this._onDestroy()}),o.onStart(()=>{++s==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,l)=>Math.max(o,l.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this.players.forEach(n=>n.init())}onStart(n){this._onStartFns.push(n)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(n=>n()),this._onStartFns=[])}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(n=>n.play())}pause(){this.players.forEach(n=>n.pause())}restart(){this.players.forEach(n=>n.restart())}finish(){this._onFinish(),this.players.forEach(n=>n.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(n=>n.destroy()),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this.players.forEach(n=>n.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(n){let t=n*this.totalTime;this.players.forEach(i=>{let s=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(s)})}getPosition(){let n=this.players.reduce((t,i)=>t===null||i.totalTime>t.totalTime?i:t,null);return n!=null?n.getPosition():0}beforeDestroy(){this.players.forEach(n=>{n.beforeDestroy&&n.beforeDestroy()})}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},re="!";var G=class{},le=(()=>{class e{handle(t){return t.key}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),O=class{},ue=(()=>{class e extends O{compile(t,i){return t}compileTranslations(t,i){return t}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),E=class{},ce=(()=>{class e extends E{getTranslation(t){return k({})}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function et(e,n){if(e===n)return!0;if(e===null||n===null)return!1;if(e!==e&&n!==n)return!0;let t=typeof e,i=typeof n,s;if(t==i&&t=="object")if(Array.isArray(e)){if(!Array.isArray(n))return!1;if((s=e.length)==n.length){for(let r=0;r<s;r++)if(!et(e[r],n[r]))return!1;return!0}}else{if(Array.isArray(n))return!1;if(_(e)&&_(n)){let r=Object.create(null);for(let o in e){if(!et(e[o],n[o]))return!1;r[o]=!0}for(let o in n)if(!(o in r)&&typeof n[o]<"u")return!1;return!0}}return!1}function T(e){return typeof e<"u"&&e!==null}function Zt(e){return e!==void 0}function _(e){return Z(e)&&!I(e)&&e!==null}function Z(e){return typeof e=="object"&&e!==null}function I(e){return Array.isArray(e)}function it(e){return typeof e=="string"}function he(e){return typeof e=="function"}function nt(e){if(I(e))return e.map(n=>nt(n));if(_(e)){let n={};return Object.keys(e).forEach(t=>{n[t]=nt(e[t])}),n}else return e}function St(e,n){if(!Z(e))return nt(n);let t=nt(e);return Z(t)&&Z(n)&&Object.keys(n).forEach(i=>{_(n[i])?i in e?t[i]=St(e[i],n[i]):Object.assign(t,{[i]:n[i]}):Object.assign(t,{[i]:n[i]})}),t}function Ut(e,n){let t=n.split(".");n="";do{n+=t.shift();let i=!t.length;if(T(e)){if(_(e)&&Zt(e[n])&&(_(e[n])||I(e[n])||i)){e=e[n],n="";continue}if(I(e)){let s=parseInt(n,10);if(Zt(e[s])&&(_(e[s])||I(e[s])||i)){e=e[s],n="";continue}}}if(i){e=void 0;continue}n+="."}while(t.length);return e}function de(e,n,t){return St(e,fe(n,t))}function fe(e,n){return e.split(".").reduceRight((t,i)=>({[i]:t}),n)}var A=class{},pe=(()=>{class e extends A{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(t,i){if(it(t))return this.interpolateString(t,i);if(he(t))return this.interpolateFunction(t,i)}interpolateFunction(t,i){return t(i)}interpolateString(t,i){return i?t.replace(this.templateMatcher,(s,r)=>{let o=this.getInterpolationReplacement(i,r);return o!==void 0?o:s}):t}getInterpolationReplacement(t,i){return this.formatValue(Ut(t,i))}formatValue(t){if(it(t))return t;if(typeof t=="number"||typeof t=="boolean")return t.toString();if(t===null)return"null";if(I(t))return t.join(", ");if(Z(t))return typeof t.toString=="function"&&t.toString!==Object.prototype.toString?t.toString():JSON.stringify(t)}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),xt=(()=>{class e{_onTranslationChange=new p;_onLangChange=new p;_onFallbackLangChange=new p;fallbackLang=null;currentLang;translations={};languages=[];getTranslations(t){return this.translations[t]}setTranslations(t,i,s){this.translations[t]=s&&this.hasTranslationFor(t)?St(this.translations[t],i):i,this.addLanguages([t]),this._onTranslationChange.next({lang:t,translations:this.getTranslations(t)})}getLanguages(){return this.languages}getCurrentLang(){return this.currentLang}getFallbackLang(){return this.fallbackLang}setFallbackLang(t,i=!0){this.fallbackLang=t,i&&this._onFallbackLangChange.next({lang:t,translations:this.translations[t]})}setCurrentLang(t,i=!0){this.currentLang=t,i&&this._onLangChange.next({lang:t,translations:this.translations[t]})}get onTranslationChange(){return this._onTranslationChange.asObservable()}get onLangChange(){return this._onLangChange.asObservable()}get onFallbackLangChange(){return this._onFallbackLangChange.asObservable()}addLanguages(t){this.languages=Array.from(new Set([...this.languages,...t]))}hasTranslationFor(t){return typeof this.translations[t]<"u"}deleteTranslations(t){delete this.translations[t]}getTranslation(t){let i=this.getValue(this.currentLang,t);return i===void 0&&this.fallbackLang!=null&&this.fallbackLang!==this.currentLang&&(i=this.getValue(this.fallbackLang,t)),i}getValue(t,i){return Ut(this.getTranslations(t),i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),It=new Y("TRANSLATE_CONFIG"),q=e=>D(e)?e:k(e);var Ft=(()=>{class e{loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;currentLoader=u(E);compiler=u(O);parser=u(A);missingTranslationHandler=u(G);store=u(xt);extend=!1;get onTranslationChange(){return this.store.onTranslationChange}get onLangChange(){return this.store.onLangChange}get onFallbackLangChange(){return this.store.onFallbackLangChange}get onDefaultLangChange(){return this.store.onFallbackLangChange}constructor(){let t=c({extend:!1,fallbackLang:null},u(It,{optional:!0}));t.lang&&this.use(t.lang),t.fallbackLang&&this.setFallbackLang(t.fallbackLang),t.extend&&(this.extend=!0)}setFallbackLang(t){this.getFallbackLang()||this.store.setFallbackLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.store.setFallbackLang(t)},error:()=>{}}),i):(this.store.setFallbackLang(t),k(this.store.getTranslations(t)))}use(t){this.lastUseLanguage=t,this.getCurrentLang()||this.store.setCurrentLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.changeLang(t)},error:()=>{}}),i):(this.changeLang(t),k(this.store.getTranslations(t)))}loadOrExtendLanguage(t){if(!this.store.hasTranslationFor(t)||this.extend)return this._translationRequests[t]=this._translationRequests[t]||this.loadAndCompileTranslations(t),this._translationRequests[t]}changeLang(t){t===this.lastUseLanguage&&this.store.setCurrentLang(t)}getCurrentLang(){return this.store.getCurrentLang()}loadAndCompileTranslations(t){this.pending=!0;let i=this.currentLoader.getTranslation(t).pipe(ut(1),P(1));return this.loadingTranslations=i.pipe(ot(s=>this.compiler.compileTranslations(s,t)),ut(1),P(1)),this.loadingTranslations.subscribe({next:s=>{this.store.setTranslations(t,s,this.extend),this.pending=!1},error:s=>{this.pending=!1}}),i}setTranslation(t,i,s=!1){let r=this.compiler.compileTranslations(i,t);this.store.setTranslations(t,r,s||this.extend)}getLangs(){return this.store.getLanguages()}addLangs(t){this.store.addLanguages(t)}getParsedResultForKey(t,i){let s=this.getTextToInterpolate(t);if(T(s))return this.runInterpolation(s,i);let r=this.missingTranslationHandler.handle(c({key:t,translateService:this},i!==void 0&&{interpolateParams:i}));return r!==void 0?r:t}getFallbackLang(){return this.store.getFallbackLang()}getTextToInterpolate(t){return this.store.getTranslation(t)}runInterpolation(t,i){if(T(t))return I(t)?this.runInterpolationOnArray(t,i):_(t)?this.runInterpolationOnDict(t,i):this.parser.interpolate(t,i)}runInterpolationOnArray(t,i){return t.map(s=>this.runInterpolation(s,i))}runInterpolationOnDict(t,i){let s={};for(let r in t){let o=this.runInterpolation(t[r],i);o!==void 0&&(s[r]=o)}return s}getParsedResult(t,i){return t instanceof Array?this.getParsedResultForArray(t,i):this.getParsedResultForKey(t,i)}getParsedResultForArray(t,i){let s={},r=!1;for(let l of t)s[l]=this.getParsedResultForKey(l,i),r=r||D(s[l]);if(!r)return s;let o=t.map(l=>q(s[l]));return Pt(o).pipe(ot(l=>{let C={};return l.forEach((U,w)=>{C[t[w]]=U}),C}))}get(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(Mt(()=>q(this.getParsedResult(t,i)))):q(this.getParsedResult(t,i))}getStreamOnTranslationChange(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return at(lt(()=>this.get(t,i)),this.onTranslationChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}stream(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" required');return at(lt(()=>this.get(t,i)),this.onLangChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}instant(t,i){if(!T(t)||t.length===0)throw new Error('Parameter "key" is required and cannot be empty');let s=this.getParsedResult(t,i);return D(s)?Array.isArray(t)?t.reduce((r,o)=>(r[o]=o,r),{}):t:s}set(t,i,s=this.getCurrentLang()){this.store.setTranslations(s,de(this.store.getTranslations(s),t,it(i)?this.compiler.compile(i,s):this.compiler.compileTranslations(i,s)),!1)}reloadLang(t){return this.resetLang(t),this.loadAndCompileTranslations(t)}resetLang(t){delete this._translationRequests[t],this.store.deleteTranslations(t)}static getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let t=this.getBrowserCultureLang();return t?t.split(/[-_]/)[0]:void 0}static getBrowserCultureLang(){if(!(typeof window>"u"||typeof window.navigator>"u"))return window.navigator.languages?window.navigator.languages[0]:window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}getBrowserLang(){return e.getBrowserLang()}getBrowserCultureLang(){return e.getBrowserCultureLang()}get defaultLang(){return this.getFallbackLang()}get currentLang(){return this.store.getCurrentLang()}get langs(){return this.store.getLanguages()}setDefaultLang(t){return this.setFallbackLang(t)}getDefaultLang(){return this.getFallbackLang()}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();var Ye=(()=>{class e{translate=u(Ft);_ref=u(Kt);value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onFallbackLangChange;updateValue(t,i,s){let r=o=>{this.value=o!==void 0?o:t,this.lastKey=t,this._ref.markForCheck()};if(s){let o=this.translate.getParsedResult(t,i);D(o)?o.subscribe(r):r(o)}this.translate.get(t,i).subscribe(r)}transform(t,...i){if(!t||!t.length)return t;if(et(t,this.lastKey)&&et(i,this.lastParams))return this.value;let s;if(T(i[0])&&i.length)if(it(i[0])&&i[0].length){let r=i[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{s=JSON.parse(r)}catch(o){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${i[0]}`)}}else _(i[0])&&(s=i[0]);return this.lastKey=t,this.lastParams=i,this.updateValue(t,s),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(r=>{(this.lastKey&&r.lang===this.translate.getCurrentLang()||r.lang===this.translate.getFallbackLang())&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(r=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onFallbackLangChange||(this.onFallbackLangChange=this.translate.onFallbackLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onFallbackLangChange<"u"&&(this.onFallbackLangChange.unsubscribe(),this.onFallbackLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=Vt({name:"translate",type:e,pure:!1});static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function ge(e){return{provide:E,useClass:e}}function me(e){return{provide:O,useClass:e}}function ve(e){return{provide:A,useClass:e}}function be(e){return{provide:G,useClass:e}}function Je(e={}){return _e(c({compiler:me(ue),parser:ve(pe),loader:ge(ce),missingTranslationHandler:be(le)},e),!0)}function _e(e={},n){let t=[];e.loader&&t.push(e.loader),e.compiler&&t.push(e.compiler),e.parser&&t.push(e.parser),e.missingTranslationHandler&&t.push(e.missingTranslationHandler),n&&t.push(xt),(e.useDefaultLang||e.defaultLanguage)&&(console.warn("The `useDefaultLang` and `defaultLanguage` options are deprecated. Please use `fallbackLang` instead."),e.useDefaultLang===!0&&e.defaultLanguage&&(e.fallbackLang=e.defaultLanguage));let i={fallbackLang:e.fallbackLang??null,lang:e.lang,extend:e.extend??!1};return t.push({provide:It,useValue:i}),t.push({provide:Ft,useClass:Ft,deps:[xt,E,O,A,G,It]}),t}var Yt=["toast-component",""];function ye(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Te(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Ce(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Te,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function we(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function De(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Le(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}function xe(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Ie(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Fe(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Ie,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function Se(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function Oe(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Ee(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}var Ot=class{_attachedHost;component;viewContainerRef;injector;constructor(n,t){this.component=n,this.injector=t}attach(n,t){return this._attachedHost=n,n.attach(this,t)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},Et=class{_attachedPortal;_disposeFn;attach(n,t){return this._attachedPortal=n,this.attachComponentPortal(n,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},At=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new p;_activate=new p;_manualClose=new p;_resetTimeout=new p;_countDuplicate=new p;constructor(n){this._overlayRef=n}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(n,t){n&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},R=class{toastId;config;message;title;toastType;toastRef;_onTap=new p;_onAction=new p;constructor(n,t,i,s,r,o){this.toastId=n,this.config=t,this.message=i,this.title=s,this.toastType=r,this.toastRef=o,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(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},Jt={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"},Qt=new Y("ToastConfig"),Rt=class extends Et{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,t,i){super(),this._hostDomElement=n,this._componentFactoryResolver=t,this._appRef=i}attachComponentPortal(n,t){let i=this._componentFactoryResolver.resolveComponentFactory(n.component),s;return s=i.create(n.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Ae=(()=>{class e{_document=u(pt);_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(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),jt=class{_portalHost;constructor(n){this._portalHost=n}attach(n,t=!0){return this._portalHost.attach(n,t)}detach(){return this._portalHost.detach()}},Re=(()=>{class e{_overlayContainer=u(Ae);_componentFactoryResolver=u(Bt);_appRef=u(W);_document=u(pt);_paneElements=new Map;create(t,i){return this._createOverlayRef(this.getPaneElement(t,i))}getPaneElement(t="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[t]||(this._paneElements.get(i)[t]=this._createPaneElement(t,i)),this._paneElements.get(i)[t]}_createPaneElement(t,i){let s=this._document.createElement("div");return s.id="toast-container",s.classList.add(t),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(t){return new Rt(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new jt(this._createPortalHost(t))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Wt=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,i,s,r,o){this.overlay=i,this._injector=s,this.sanitizer=r,this.ngZone=o,this.toastrConfig=c(c({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=c(c({},t.default.iconClasses),t.config.iconClasses))}show(t,i,s={},r=""){return this._preBuildNotification(r,t,i,this.applyConfig(s))}success(t,i,s={}){let r=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}error(t,i,s={}){let r=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}info(t,i,s={}){let r=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}warning(t,i,s={}){let r=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}clear(t){for(let i of this.toasts)if(t!==void 0){if(i.toastId===t){i.toastRef.manualClose();return}}else i.toastRef.manualClose()}remove(t){let i=this._findToast(t);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.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 s=this.toasts[this.currentlyActive].toastRef;s.isInactive()||(this.currentlyActive=this.currentlyActive+1,s.activate())}return!0}findDuplicate(t="",i="",s,r){let{includeTitleDuplicates:o}=this.toastrConfig;for(let l of this.toasts){let C=o&&l.title===t;if((!o||C)&&l.message===i)return l.toastRef.onDuplicate(s,r),l}return null}applyConfig(t={}){return c(c({},this.toastrConfig),t)}_findToast(t){for(let i=0;i<this.toasts.length;i++)if(this.toasts[i].toastId===t)return{index:i,activeToast:this.toasts[i]};return null}_preBuildNotification(t,i,s,r){return r.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,i,s,r)):this._buildNotification(t,i,s,r)}_buildNotification(t,i,s,r){if(!r.toastComponent)throw new Error("toastComponent required");let o=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&o!==null)return o;this.previousToastMessage=i;let l=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(l=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let C=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let U=i;i&&r.enableHtml&&(U=this.sanitizer.sanitize(Ht.HTML,i));let w=new At(C),st=new R(this.index,r,U,s,t,w),te=[{provide:R,useValue:st}],ee=J.create({providers:te,parent:this._injector}),ie=new Ot(r.toastComponent,ee),kt=C.attach(ie,r.newestOnTop);w.componentInstance=kt.instance;let rt={toastId:this.index,title:s||"",message:i||"",toastRef:w,onShown:w.afterActivate(),onHidden:w.afterClosed(),onTap:st.onTap(),onAction:st.onAction(),portal:kt};return l||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{rt.toastRef.activate()})),this.toasts.push(rt),rt}static \u0275fac=function(i){return new(i||e)(S(Qt),S(Re),S(J),S(qt),S(bt))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),je=(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=M(-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,i,s){this.toastrService=t,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r}),this.state=M({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=>F(c({},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(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),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=>F(c({},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=>F(c({},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,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),i)):this.timeout=setTimeout(()=>t(),i)}outsideInterval(t,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),i)):this.intervalId=setInterval(()=>t(),i)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(i){return new(i||e)(L(Wt),L(R),L(bt))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&($t("@flyInOut",s._state),v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,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(i,s){i&1&&N(0,ye,3,0,"button",0)(1,Ce,3,5,"div",1)(2,we,1,3,"div",2)(3,De,2,4,"div",3)(4,Le,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,data:{animation:[Lt("flyInOut",[z("inactive",K({opacity:0})),z("active",K({opacity:1})),z("removed",K({opacity:0})),tt("inactive => active",X("{{ easeTime }}ms {{ easing }}")),tt("active => removed",X("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})(),ke=F(c({},Jt),{toastComponent:je}),Pe=(e={})=>Nt([{provide:Qt,useValue:{default:ke,config:e}}]),Ti=(()=>{class e{static forRoot(t={}){return{ngModule:e,providers:[Pe(t)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=vt({type:e});static \u0275inj=ht({})}return e})();var Me=(()=>{class e{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=M(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=M("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,i,s){this.toastrService=t,this.toastPackage=i,this.appRef=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r})}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(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),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(i){return new(i||e)(L(Wt),L(R),L(W))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&(v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,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(i,s){i&1&&N(0,xe,3,0,"button",0)(1,Fe,3,5,"div",1)(2,Se,1,3,"div",2)(3,Oe,2,4,"div",3)(4,Ee,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,changeDetection:0})}return e})(),Ci=F(c({},Jt),{toastComponent:Me});var j={serverTarget:Xt().version,production:!0,socket:"",api:{base:(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/";return n.endsWith("/")?`${n}api`:`${n}/api`})(),socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/",t=n.endsWith("/")?`${n}api`:`${n}/api`;return`${window.location.protocol}//${document.location.host}${t}/auth/login`})()]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Ei=(()=>{class e{$http=u(zt);get(t,i){return this.$http.get(`${j.api.base}${t}`,i)}post(t,i,s){return this.$http.post(`${j.api.base}${t}`,i,s)}put(t,i,s){return this.$http.put(`${j.api.base}${t}`,i,s)}patch(t,i,s){return this.$http.patch(`${j.api.base}${t}`,i,s)}delete(t,i){return this.$http.delete(`${j.api.base}${t}`,i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{y as a,se as b,Lt as c,X as d,He as e,K as f,tt as g,wt as h,Dt as i,re as j,Ft as k,Ye as l,Je as m,Wt as n,Ti as o,j as p,Ei as q};
|
|
1
|
+
import{$c as zt,Ac as Kt,B as at,C as lt,D as Pt,Db as Tt,Fa as Ht,Fb as $t,Ga as gt,Gb as V,Ib as f,L as Mt,La as a,Mc as Ct,Na as Bt,O as P,Qa as L,Sb as $,Ub as v,Vb as b,Wa as mt,X as ut,Xa as vt,Xb as x,Za as Vt,_ as ct,a as c,ab as N,b as F,cb as bt,e as ne,ea as d,fa as ht,ha as Y,ia as S,id as qt,ja as u,jb as W,ka as Nt,kb as H,n as p,oa as dt,pa as ft,r as k,rb as h,sa as J,sb as g,t as D,ta as pt,tb as m,ub as B,wa as M,x as ot,yb as _t,za as Q,zb as yt}from"./chunk-V2XN5VIX.js";var Xt=ne((Li,Ne)=>{Ne.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.4.2-beta.29",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:{"hb-service":"dist/bin/hb-service.js"},engines:{node:"^20.19.0 || ^22.12.0 || ^24.0.0",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":"13.0.1","@fastify/multipart":"9.0.3","@fastify/static":"8.2.0","@homebridge/hap-client":"3.1.1","@homebridge/node-pty-prebuilt-multiarch":"0.13.1","@nestjs/axios":"4.0.1","@nestjs/common":"11.1.6","@nestjs/core":"11.1.6","@nestjs/jwt":"11.0.0","@nestjs/passport":"11.0.5","@nestjs/platform-fastify":"11.1.6","@nestjs/platform-socket.io":"11.1.6","@nestjs/swagger":"11.2.0","@nestjs/websockets":"11.1.6",axios:"1.11.0","bash-color":"0.0.4","class-transformer":"0.5.1","class-validator":"0.14.2",commander:"14.0.0",dayjs:"1.11.13",fastify:"5.5.0","fs-extra":"11.3.1",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"8.2.0",otplib:"12.0.1","p-limit":"7.1.0",passport:"0.7.0","passport-jwt":"4.0.1","reflect-metadata":"0.2.2",rxjs:"7.8.2",semver:"7.7.2",systeminformation:"5.27.7",tail:"2.2.6",tar:"7.4.3","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^5.2.1","@nestjs/testing":"^11.1.6","@prettier/plugin-xml":"^3.4.2","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.20","@types/node":"^24.3.0","@types/node-schedule":"^2.1.8","@types/passport-jwt":"^4.0.1","@types/semver":"^7.7.0","@types/tail":"^2.2.3","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.11","@vitest/coverage-v8":"^3.2.4",concurrently:"^9.2.0","eslint-plugin-format":"^1.0.1","form-data":"^4.0.4",nodemon:"^3.1.10",rimraf:"^6.0.1","ts-loader":"^9.5.4","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.9.2","unplugin-swc":"^1.5.7",vitest:"^3.2.4"},overrides:{"@nestjs/platform-fastify":{fastify:"^5.5.0"}},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"}],scarfSettings:{enabled:!1}}});var y=(function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e})(y||{}),se="*";function Lt(e,n){return{type:y.Trigger,name:e,definitions:n,options:{}}}function X(e,n=null){return{type:y.Animate,styles:n,timings:e}}function He(e,n=null){return{type:y.Sequence,steps:e,options:n}}function K(e){return{type:y.Style,styles:e,offset:null}}function z(e,n,t){return{type:y.State,name:e,styles:n,options:t}}function tt(e,n,t=null){return{type:y.Transition,expr:e,animation:n,options:t}}var wt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(n=0,t=0){this.totalTime=n+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}onStart(n){this._originalOnStartFns.push(n),this._onStartFns.push(n)}onDone(n){this._originalOnDoneFns.push(n),this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(n=>n()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(n){this._position=this.totalTime?n*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},Dt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(n){this.players=n;let t=0,i=0,s=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++i==r&&this._onDestroy()}),o.onStart(()=>{++s==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,l)=>Math.max(o,l.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this.players.forEach(n=>n.init())}onStart(n){this._onStartFns.push(n)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(n=>n()),this._onStartFns=[])}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(n=>n.play())}pause(){this.players.forEach(n=>n.pause())}restart(){this.players.forEach(n=>n.restart())}finish(){this._onFinish(),this.players.forEach(n=>n.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(n=>n.destroy()),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this.players.forEach(n=>n.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(n){let t=n*this.totalTime;this.players.forEach(i=>{let s=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(s)})}getPosition(){let n=this.players.reduce((t,i)=>t===null||i.totalTime>t.totalTime?i:t,null);return n!=null?n.getPosition():0}beforeDestroy(){this.players.forEach(n=>{n.beforeDestroy&&n.beforeDestroy()})}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},re="!";var G=class{},le=(()=>{class e{handle(t){return t.key}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),O=class{},ue=(()=>{class e extends O{compile(t,i){return t}compileTranslations(t,i){return t}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),E=class{},ce=(()=>{class e extends E{getTranslation(t){return k({})}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function et(e,n){if(e===n)return!0;if(e===null||n===null)return!1;if(e!==e&&n!==n)return!0;let t=typeof e,i=typeof n,s;if(t==i&&t=="object")if(Array.isArray(e)){if(!Array.isArray(n))return!1;if((s=e.length)==n.length){for(let r=0;r<s;r++)if(!et(e[r],n[r]))return!1;return!0}}else{if(Array.isArray(n))return!1;if(_(e)&&_(n)){let r=Object.create(null);for(let o in e){if(!et(e[o],n[o]))return!1;r[o]=!0}for(let o in n)if(!(o in r)&&typeof n[o]<"u")return!1;return!0}}return!1}function T(e){return typeof e<"u"&&e!==null}function Zt(e){return e!==void 0}function _(e){return Z(e)&&!I(e)&&e!==null}function Z(e){return typeof e=="object"&&e!==null}function I(e){return Array.isArray(e)}function it(e){return typeof e=="string"}function he(e){return typeof e=="function"}function nt(e){if(I(e))return e.map(n=>nt(n));if(_(e)){let n={};return Object.keys(e).forEach(t=>{n[t]=nt(e[t])}),n}else return e}function St(e,n){if(!Z(e))return nt(n);let t=nt(e);return Z(t)&&Z(n)&&Object.keys(n).forEach(i=>{_(n[i])?i in e?t[i]=St(e[i],n[i]):Object.assign(t,{[i]:n[i]}):Object.assign(t,{[i]:n[i]})}),t}function Ut(e,n){let t=n.split(".");n="";do{n+=t.shift();let i=!t.length;if(T(e)){if(_(e)&&Zt(e[n])&&(_(e[n])||I(e[n])||i)){e=e[n],n="";continue}if(I(e)){let s=parseInt(n,10);if(Zt(e[s])&&(_(e[s])||I(e[s])||i)){e=e[s],n="";continue}}}if(i){e=void 0;continue}n+="."}while(t.length);return e}function de(e,n,t){return St(e,fe(n,t))}function fe(e,n){return e.split(".").reduceRight((t,i)=>({[i]:t}),n)}var A=class{},pe=(()=>{class e extends A{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(t,i){if(it(t))return this.interpolateString(t,i);if(he(t))return this.interpolateFunction(t,i)}interpolateFunction(t,i){return t(i)}interpolateString(t,i){return i?t.replace(this.templateMatcher,(s,r)=>{let o=this.getInterpolationReplacement(i,r);return o!==void 0?o:s}):t}getInterpolationReplacement(t,i){return this.formatValue(Ut(t,i))}formatValue(t){if(it(t))return t;if(typeof t=="number"||typeof t=="boolean")return t.toString();if(t===null)return"null";if(I(t))return t.join(", ");if(Z(t))return typeof t.toString=="function"&&t.toString!==Object.prototype.toString?t.toString():JSON.stringify(t)}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),xt=(()=>{class e{_onTranslationChange=new p;_onLangChange=new p;_onFallbackLangChange=new p;fallbackLang=null;currentLang;translations={};languages=[];getTranslations(t){return this.translations[t]}setTranslations(t,i,s){this.translations[t]=s&&this.hasTranslationFor(t)?St(this.translations[t],i):i,this.addLanguages([t]),this._onTranslationChange.next({lang:t,translations:this.getTranslations(t)})}getLanguages(){return this.languages}getCurrentLang(){return this.currentLang}getFallbackLang(){return this.fallbackLang}setFallbackLang(t,i=!0){this.fallbackLang=t,i&&this._onFallbackLangChange.next({lang:t,translations:this.translations[t]})}setCurrentLang(t,i=!0){this.currentLang=t,i&&this._onLangChange.next({lang:t,translations:this.translations[t]})}get onTranslationChange(){return this._onTranslationChange.asObservable()}get onLangChange(){return this._onLangChange.asObservable()}get onFallbackLangChange(){return this._onFallbackLangChange.asObservable()}addLanguages(t){this.languages=Array.from(new Set([...this.languages,...t]))}hasTranslationFor(t){return typeof this.translations[t]<"u"}deleteTranslations(t){delete this.translations[t]}getTranslation(t){let i=this.getValue(this.currentLang,t);return i===void 0&&this.fallbackLang!=null&&this.fallbackLang!==this.currentLang&&(i=this.getValue(this.fallbackLang,t)),i}getValue(t,i){return Ut(this.getTranslations(t),i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),It=new Y("TRANSLATE_CONFIG"),q=e=>D(e)?e:k(e);var Ft=(()=>{class e{loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;currentLoader=u(E);compiler=u(O);parser=u(A);missingTranslationHandler=u(G);store=u(xt);extend=!1;get onTranslationChange(){return this.store.onTranslationChange}get onLangChange(){return this.store.onLangChange}get onFallbackLangChange(){return this.store.onFallbackLangChange}get onDefaultLangChange(){return this.store.onFallbackLangChange}constructor(){let t=c({extend:!1,fallbackLang:null},u(It,{optional:!0}));t.lang&&this.use(t.lang),t.fallbackLang&&this.setFallbackLang(t.fallbackLang),t.extend&&(this.extend=!0)}setFallbackLang(t){this.getFallbackLang()||this.store.setFallbackLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.store.setFallbackLang(t)},error:()=>{}}),i):(this.store.setFallbackLang(t),k(this.store.getTranslations(t)))}use(t){this.lastUseLanguage=t,this.getCurrentLang()||this.store.setCurrentLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.changeLang(t)},error:()=>{}}),i):(this.changeLang(t),k(this.store.getTranslations(t)))}loadOrExtendLanguage(t){if(!this.store.hasTranslationFor(t)||this.extend)return this._translationRequests[t]=this._translationRequests[t]||this.loadAndCompileTranslations(t),this._translationRequests[t]}changeLang(t){t===this.lastUseLanguage&&this.store.setCurrentLang(t)}getCurrentLang(){return this.store.getCurrentLang()}loadAndCompileTranslations(t){this.pending=!0;let i=this.currentLoader.getTranslation(t).pipe(ut(1),P(1));return this.loadingTranslations=i.pipe(ot(s=>this.compiler.compileTranslations(s,t)),ut(1),P(1)),this.loadingTranslations.subscribe({next:s=>{this.store.setTranslations(t,s,this.extend),this.pending=!1},error:s=>{this.pending=!1}}),i}setTranslation(t,i,s=!1){let r=this.compiler.compileTranslations(i,t);this.store.setTranslations(t,r,s||this.extend)}getLangs(){return this.store.getLanguages()}addLangs(t){this.store.addLanguages(t)}getParsedResultForKey(t,i){let s=this.getTextToInterpolate(t);if(T(s))return this.runInterpolation(s,i);let r=this.missingTranslationHandler.handle(c({key:t,translateService:this},i!==void 0&&{interpolateParams:i}));return r!==void 0?r:t}getFallbackLang(){return this.store.getFallbackLang()}getTextToInterpolate(t){return this.store.getTranslation(t)}runInterpolation(t,i){if(T(t))return I(t)?this.runInterpolationOnArray(t,i):_(t)?this.runInterpolationOnDict(t,i):this.parser.interpolate(t,i)}runInterpolationOnArray(t,i){return t.map(s=>this.runInterpolation(s,i))}runInterpolationOnDict(t,i){let s={};for(let r in t){let o=this.runInterpolation(t[r],i);o!==void 0&&(s[r]=o)}return s}getParsedResult(t,i){return t instanceof Array?this.getParsedResultForArray(t,i):this.getParsedResultForKey(t,i)}getParsedResultForArray(t,i){let s={},r=!1;for(let l of t)s[l]=this.getParsedResultForKey(l,i),r=r||D(s[l]);if(!r)return s;let o=t.map(l=>q(s[l]));return Pt(o).pipe(ot(l=>{let C={};return l.forEach((U,w)=>{C[t[w]]=U}),C}))}get(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(Mt(()=>q(this.getParsedResult(t,i)))):q(this.getParsedResult(t,i))}getStreamOnTranslationChange(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return at(lt(()=>this.get(t,i)),this.onTranslationChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}stream(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" required');return at(lt(()=>this.get(t,i)),this.onLangChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}instant(t,i){if(!T(t)||t.length===0)throw new Error('Parameter "key" is required and cannot be empty');let s=this.getParsedResult(t,i);return D(s)?Array.isArray(t)?t.reduce((r,o)=>(r[o]=o,r),{}):t:s}set(t,i,s=this.getCurrentLang()){this.store.setTranslations(s,de(this.store.getTranslations(s),t,it(i)?this.compiler.compile(i,s):this.compiler.compileTranslations(i,s)),!1)}reloadLang(t){return this.resetLang(t),this.loadAndCompileTranslations(t)}resetLang(t){delete this._translationRequests[t],this.store.deleteTranslations(t)}static getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let t=this.getBrowserCultureLang();return t?t.split(/[-_]/)[0]:void 0}static getBrowserCultureLang(){if(!(typeof window>"u"||typeof window.navigator>"u"))return window.navigator.languages?window.navigator.languages[0]:window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}getBrowserLang(){return e.getBrowserLang()}getBrowserCultureLang(){return e.getBrowserCultureLang()}get defaultLang(){return this.getFallbackLang()}get currentLang(){return this.store.getCurrentLang()}get langs(){return this.store.getLanguages()}setDefaultLang(t){return this.setFallbackLang(t)}getDefaultLang(){return this.getFallbackLang()}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();var Ye=(()=>{class e{translate=u(Ft);_ref=u(Kt);value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onFallbackLangChange;updateValue(t,i,s){let r=o=>{this.value=o!==void 0?o:t,this.lastKey=t,this._ref.markForCheck()};if(s){let o=this.translate.getParsedResult(t,i);D(o)?o.subscribe(r):r(o)}this.translate.get(t,i).subscribe(r)}transform(t,...i){if(!t||!t.length)return t;if(et(t,this.lastKey)&&et(i,this.lastParams))return this.value;let s;if(T(i[0])&&i.length)if(it(i[0])&&i[0].length){let r=i[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{s=JSON.parse(r)}catch(o){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${i[0]}`)}}else _(i[0])&&(s=i[0]);return this.lastKey=t,this.lastParams=i,this.updateValue(t,s),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(r=>{(this.lastKey&&r.lang===this.translate.getCurrentLang()||r.lang===this.translate.getFallbackLang())&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(r=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onFallbackLangChange||(this.onFallbackLangChange=this.translate.onFallbackLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onFallbackLangChange<"u"&&(this.onFallbackLangChange.unsubscribe(),this.onFallbackLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=Vt({name:"translate",type:e,pure:!1});static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function ge(e){return{provide:E,useClass:e}}function me(e){return{provide:O,useClass:e}}function ve(e){return{provide:A,useClass:e}}function be(e){return{provide:G,useClass:e}}function Je(e={}){return _e(c({compiler:me(ue),parser:ve(pe),loader:ge(ce),missingTranslationHandler:be(le)},e),!0)}function _e(e={},n){let t=[];e.loader&&t.push(e.loader),e.compiler&&t.push(e.compiler),e.parser&&t.push(e.parser),e.missingTranslationHandler&&t.push(e.missingTranslationHandler),n&&t.push(xt),(e.useDefaultLang||e.defaultLanguage)&&(console.warn("The `useDefaultLang` and `defaultLanguage` options are deprecated. Please use `fallbackLang` instead."),e.useDefaultLang===!0&&e.defaultLanguage&&(e.fallbackLang=e.defaultLanguage));let i={fallbackLang:e.fallbackLang??null,lang:e.lang,extend:e.extend??!1};return t.push({provide:It,useValue:i}),t.push({provide:Ft,useClass:Ft,deps:[xt,E,O,A,G,It]}),t}var Yt=["toast-component",""];function ye(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Te(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Ce(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Te,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function we(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function De(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Le(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}function xe(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Ie(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Fe(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Ie,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function Se(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function Oe(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Ee(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}var Ot=class{_attachedHost;component;viewContainerRef;injector;constructor(n,t){this.component=n,this.injector=t}attach(n,t){return this._attachedHost=n,n.attach(this,t)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},Et=class{_attachedPortal;_disposeFn;attach(n,t){return this._attachedPortal=n,this.attachComponentPortal(n,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},At=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new p;_activate=new p;_manualClose=new p;_resetTimeout=new p;_countDuplicate=new p;constructor(n){this._overlayRef=n}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(n,t){n&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},R=class{toastId;config;message;title;toastType;toastRef;_onTap=new p;_onAction=new p;constructor(n,t,i,s,r,o){this.toastId=n,this.config=t,this.message=i,this.title=s,this.toastType=r,this.toastRef=o,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(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},Jt={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"},Qt=new Y("ToastConfig"),Rt=class extends Et{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,t,i){super(),this._hostDomElement=n,this._componentFactoryResolver=t,this._appRef=i}attachComponentPortal(n,t){let i=this._componentFactoryResolver.resolveComponentFactory(n.component),s;return s=i.create(n.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Ae=(()=>{class e{_document=u(pt);_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(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),jt=class{_portalHost;constructor(n){this._portalHost=n}attach(n,t=!0){return this._portalHost.attach(n,t)}detach(){return this._portalHost.detach()}},Re=(()=>{class e{_overlayContainer=u(Ae);_componentFactoryResolver=u(Bt);_appRef=u(W);_document=u(pt);_paneElements=new Map;create(t,i){return this._createOverlayRef(this.getPaneElement(t,i))}getPaneElement(t="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[t]||(this._paneElements.get(i)[t]=this._createPaneElement(t,i)),this._paneElements.get(i)[t]}_createPaneElement(t,i){let s=this._document.createElement("div");return s.id="toast-container",s.classList.add(t),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(t){return new Rt(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new jt(this._createPortalHost(t))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Wt=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,i,s,r,o){this.overlay=i,this._injector=s,this.sanitizer=r,this.ngZone=o,this.toastrConfig=c(c({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=c(c({},t.default.iconClasses),t.config.iconClasses))}show(t,i,s={},r=""){return this._preBuildNotification(r,t,i,this.applyConfig(s))}success(t,i,s={}){let r=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}error(t,i,s={}){let r=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}info(t,i,s={}){let r=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}warning(t,i,s={}){let r=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}clear(t){for(let i of this.toasts)if(t!==void 0){if(i.toastId===t){i.toastRef.manualClose();return}}else i.toastRef.manualClose()}remove(t){let i=this._findToast(t);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.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 s=this.toasts[this.currentlyActive].toastRef;s.isInactive()||(this.currentlyActive=this.currentlyActive+1,s.activate())}return!0}findDuplicate(t="",i="",s,r){let{includeTitleDuplicates:o}=this.toastrConfig;for(let l of this.toasts){let C=o&&l.title===t;if((!o||C)&&l.message===i)return l.toastRef.onDuplicate(s,r),l}return null}applyConfig(t={}){return c(c({},this.toastrConfig),t)}_findToast(t){for(let i=0;i<this.toasts.length;i++)if(this.toasts[i].toastId===t)return{index:i,activeToast:this.toasts[i]};return null}_preBuildNotification(t,i,s,r){return r.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,i,s,r)):this._buildNotification(t,i,s,r)}_buildNotification(t,i,s,r){if(!r.toastComponent)throw new Error("toastComponent required");let o=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&o!==null)return o;this.previousToastMessage=i;let l=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(l=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let C=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let U=i;i&&r.enableHtml&&(U=this.sanitizer.sanitize(Ht.HTML,i));let w=new At(C),st=new R(this.index,r,U,s,t,w),te=[{provide:R,useValue:st}],ee=J.create({providers:te,parent:this._injector}),ie=new Ot(r.toastComponent,ee),kt=C.attach(ie,r.newestOnTop);w.componentInstance=kt.instance;let rt={toastId:this.index,title:s||"",message:i||"",toastRef:w,onShown:w.afterActivate(),onHidden:w.afterClosed(),onTap:st.onTap(),onAction:st.onAction(),portal:kt};return l||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{rt.toastRef.activate()})),this.toasts.push(rt),rt}static \u0275fac=function(i){return new(i||e)(S(Qt),S(Re),S(J),S(qt),S(bt))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),je=(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=M(-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,i,s){this.toastrService=t,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r}),this.state=M({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=>F(c({},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(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),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=>F(c({},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=>F(c({},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,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),i)):this.timeout=setTimeout(()=>t(),i)}outsideInterval(t,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),i)):this.intervalId=setInterval(()=>t(),i)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(i){return new(i||e)(L(Wt),L(R),L(bt))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&($t("@flyInOut",s._state),v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,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(i,s){i&1&&N(0,ye,3,0,"button",0)(1,Ce,3,5,"div",1)(2,we,1,3,"div",2)(3,De,2,4,"div",3)(4,Le,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,data:{animation:[Lt("flyInOut",[z("inactive",K({opacity:0})),z("active",K({opacity:1})),z("removed",K({opacity:0})),tt("inactive => active",X("{{ easeTime }}ms {{ easing }}")),tt("active => removed",X("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})(),ke=F(c({},Jt),{toastComponent:je}),Pe=(e={})=>Nt([{provide:Qt,useValue:{default:ke,config:e}}]),Ti=(()=>{class e{static forRoot(t={}){return{ngModule:e,providers:[Pe(t)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=vt({type:e});static \u0275inj=ht({})}return e})();var Me=(()=>{class e{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=M(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=M("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,i,s){this.toastrService=t,this.toastPackage=i,this.appRef=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r})}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(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),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(i){return new(i||e)(L(Wt),L(R),L(W))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&(v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,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(i,s){i&1&&N(0,xe,3,0,"button",0)(1,Fe,3,5,"div",1)(2,Se,1,3,"div",2)(3,Oe,2,4,"div",3)(4,Ee,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,changeDetection:0})}return e})(),Ci=F(c({},Jt),{toastComponent:Me});var j={serverTarget:Xt().version,production:!0,socket:"",api:{base:(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/";return n.endsWith("/")?`${n}api`:`${n}/api`})(),socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/",t=n.endsWith("/")?`${n}api`:`${n}/api`;return`${window.location.protocol}//${document.location.host}${t}/auth/login`})()]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Ei=(()=>{class e{$http=u(zt);get(t,i){return this.$http.get(`${j.api.base}${t}`,i)}post(t,i,s){return this.$http.post(`${j.api.base}${t}`,i,s)}put(t,i,s){return this.$http.put(`${j.api.base}${t}`,i,s)}patch(t,i,s){return this.$http.patch(`${j.api.base}${t}`,i,s)}delete(t,i){return this.$http.delete(`${j.api.base}${t}`,i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{y as a,se as b,Lt as c,X as d,He as e,K as f,tt as g,wt as h,Dt as i,re as j,Ft as k,Ye as l,Je as m,Wt as n,Ti as o,j as p,Ei as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-74TLD7UE.js";import"./chunk-2D7HQVKR.js";import{d as D}from"./chunk-YMAWYUA6.js";import{b as F}from"./chunk-HPUVHUIE.js";import{k as E,l as R,n as B,q as U}from"./chunk-7KLW5GIG.js";import{Db as S,Gb as k,Ib as u,Kc as O,La as r,Vb as a,Wa as y,Wb as p,Xb as x,gc as I,h as w,hc as g,ja as d,lb as f,mb as h,mc as l,nc as c,oa as $,pa as b,rb as _,sb as s,tb as n,ub as v,w as C,zc as T}from"./chunk-V2XN5VIX.js";var W=(t,m)=>({"fas fa-fw fa-spinner fa-spin":t,"far fa-fw fa-check-circle":m}),M=t=>({"grey-text":t}),V=(t,m)=>({"far fa-fw fa-circle":t,"fas fa-fw fa-spinner fa-spin":m});function j(t,m){if(t&1&&(s(0,"div",7),a(1),n()),t&2){let e=u();r(),p(e.error)}}function q(t,m){if(t&1&&(s(0,"p",9),a(1),l(2,"translate"),n(),s(3,"div",10)(4,"div",11)(5,"span"),v(6,"i",12),a(7),l(8,"translate"),n()(),s(9,"div",11)(10,"span",12),v(11,"i",12),a(12),l(13,"translate"),n()()()),t&2){let e=u();r(),p(c(2,6,"restart.please_wait_while_server_restarts")),r(5),_("ngClass",g(12,W,!e.uiOnline,e.uiOnline)),r(),x(" ",c(8,8,"restart.ui_online")," "),r(3),_("ngClass",I(15,M,!e.uiOnline)),r(),_("ngClass",g(17,V,!e.uiOnline,e.uiOnline)),r(),x(" ",c(13,10,"restart.service_ready")," ")}}function z(t,m){if(t&1){let e=S();s(0,"p",15)(1,"button",16),k("click",function(){$(e);let o=u(2);return b(o.viewLogs())}),a(2),l(3,"translate"),n()()}t&2&&(r(2),p(c(3,1,"menu.tooltip_view_logs")))}function A(t,m){if(t&1&&(s(0,"div",8)(1,"p"),a(2),l(3,"translate"),n(),s(4,"p",13),a(5),l(6,"translate"),s(7,"span",14),a(8),n()(),f(9,z,4,3,"p",15),n()),t&2){let e=u();r(2),p(c(3,4,"restart.server_is_taking_long_time_to_restart")),r(3),x(" ",c(6,6,"restart.label_restart_command_executed"),": "),r(3),p(e.resp.command||"End Process"),r(),h(e.uiOnline?9:-1)}}var et=(()=>{class t{$api=d(U);$router=d(D);$settings=d(F);$toastr=d(B);$translate=d(E);$ws=d(P);checkTimeout;checkDelay;io;webrootChanged=!1;uiOnline=!1;error=!1;resp={};timeout=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$router.parseUrl(this.$router.url).queryParams.restarting==="true"?(this.uiOnline=!0,this.checkIfServerUp()):this.performRestart()}viewLogs(){this.$router.navigate(["/logs"])}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}performRestart(){return w(this,null,function*(){try{let e=this.$settings.originalWebroot||"",i=this.$settings.webroot||"";this.webrootChanged=e!==i,this.webrootChanged&&(yield C(this.$api.put("/server/webroot",{webroot:i}))),this.$api.put("/server/restart",{}).subscribe({next:o=>{this.resp=o,this.checkIfServerUp(),o.restartingUI||(this.uiOnline=!0)},error:o=>{console.error(o),this.error=this.$translate.instant("restart.toast_server_restart_error"),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}catch(e){console.error("Failed to update webroot:",e),this.$api.put("/server/restart",{}).subscribe({next:i=>{this.resp=i,this.checkIfServerUp(),i.restartingUI||(this.uiOnline=!0)},error:i=>{console.error(i),this.error=this.$translate.instant("restart.toast_server_restart_error"),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}})}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{if(this.uiOnline=!0,e.status==="up"||e.status==="pending")if(this.$toastr.success(this.$translate.instant("restart.toast_server_restarted"),this.$translate.instant("toast.title_success")),this.webrootChanged&&!T()){let i=this.$settings.webroot?.replace(/^\/+|\/+$/g,"")||"";window.location.href=i?`/${i}/`:"/"}else this.$router.navigate(["/"])})},7e3),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},4e4)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[3,"ngClass"],[1,"grey-text","mb-0"],[1,"font-monospace"],[1,"mt-2","mb-0"],[1,"btn","btn-primary","mb-0",3,"click"]],template:function(i,o){i&1&&(s(0,"div",0)(1,"h3",1),a(2),l(3,"translate"),n()(),s(4,"div",2)(5,"div",3),v(6,"i",4),n(),s(7,"div",5)(8,"h4",6),a(9),l(10,"translate"),n(),f(11,j,2,1,"div",7)(12,q,14,20),f(13,A,10,8,"div",8),n()()),i&2&&(r(2),p(c(3,4,"menu.restart.title")),r(7),p(c(10,6,"restart.title_restart")),r(2),h(o.error?11:12),r(2),h(o.timeout?13:-1))},dependencies:[O,R],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{et as RestartComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ee}from"./chunk-7XG67XSY.js";import{b as T,e as ve,f as xe,g as je}from"./chunk-DWC2MBWX.js";import{a as be,b as _e}from"./chunk-ECQJTOVP.js";import{a as we}from"./chunk-I5TETZ3I.js";import{a as Pe}from"./chunk-KT4VIVBF.js";import{m as ue,n as he,t as P}from"./chunk-LXFVNKLD.js";import{B as pe,C as ge,c as ce,e as fe,l as me}from"./chunk-F7ZV2JBO.js";import{b as ye,d as H}from"./chunk-YMAWYUA6.js";import{b as Ce}from"./chunk-UUAVDVSZ.js";import{k as j,l as I,n as O,q as N}from"./chunk-G67KYACP.js";import{Db as S,Gb as b,Ib as f,Kc as le,La as r,Pa as ee,Rc as de,Tb as ne,Vb as _,Wa as R,Wb as $,Xb as A,a as G,ac as re,b as Q,bc as se,cc as ae,d as X,g as Z,h as v,hc as z,ja as p,kb as C,lb as x,mb as E,mc as s,nc as l,oa as u,ob as te,oc as K,pa as h,pb as ie,qb as oe,rb as g,sb as a,tb as d,ub as m,w as k}from"./chunk-V2XN5VIX.js";var Me=Z(je(),1);var Se=Z(Pe(),1);var ke=(n,y)=>({"fa-trash":n,"fa-cog fa-spin":y});function Oe(n,y){n&1&&(a(0,"div",13),m(1,"i",20),d())}function He(n,y){if(n&1){let e=S();a(0,"li",9)(1,"span"),_(2),s(3,"date"),m(4,"br"),a(5,"span",21),_(6),s(7,"date"),d()(),a(8,"span",22)(9,"button",25),s(10,"translate"),s(11,"translate"),b("click",function(){let i=u(e).$implicit,o=f(2);return h(o.restore(i.id))}),m(12,"i",26),d(),a(13,"button",27),s(14,"translate"),s(15,"translate"),b("click",function(){let i=u(e).$implicit,o=f(2);return h(o.download(i.id))}),m(16,"i",28),d(),a(17,"button",23),s(18,"translate"),s(19,"translate"),b("click",function(){let i=u(e).$implicit,o=f(2);return h(o.delete(i.id))}),m(20,"i",24),d()()()}if(n&2){let e=y.$implicit,t=f(2);r(2),A(" ",K(3,15,e.timestamp,"mediumDate")),r(4),$(K(7,18,e.timestamp,"shortTime")),r(3),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(10,21,"config.restore.copy_to_editor"))("openDelay",150),C("aria-label",l(11,23,"config.restore.copy_to_editor")),r(4),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(14,25,"form.button_download"))("openDelay",150),C("aria-label",l(15,27,"form.button_download")),r(4),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(18,29,"form.button_delete"))("openDelay",150),C("aria-label",l(19,31,"form.button_delete")),r(3),g("ngClass",z(33,ke,e.id!==t.deleting,e.id===t.deleting))}}function Ne(n,y){if(n&1){let e=S();a(0,"ul",14),ie(1,He,21,36,"li",9,te),a(3,"li",9)(4,"span"),_(5),s(6,"translate"),m(7,"br"),a(8,"span",21),_(9),s(10,"translate"),d()(),a(11,"span",22)(12,"button",23),s(13,"translate"),s(14,"translate"),b("click",function(){u(e);let i=f();return h(i.deleteAllBackups())}),m(15,"i",24),d()()()()}if(n&2){let e=f();r(),oe(e.backupList),r(4),A(" ",l(6,7,"form.button_delete_all")),r(4),A(" ",l(10,9,"common.labels.no_confirmation")," "),r(3),g("disabled",e.clicked||e.deleting)("ngbTooltip",l(13,11,"form.button_delete_all"))("openDelay",150),C("aria-label",l(14,13,"form.button_delete")),r(3),g("ngClass",z(15,ke,e.deleting!=="all",e.deleting==="all"))}}var $e=(()=>{class n{$activeModal=p(ue);$api=p(N);$router=p(H);$toastr=p(O);$translate=p(j);currentConfig;fromSettings=!1;loading=!0;backupList=[];clicked=!1;deleting=null;ngOnInit(){this.getConfigBackups()}getConfigBackups(){return v(this,null,function*(){try{let e=yield k(this.$api.get("/config-editor/backups"));this.loading=!1,this.backupList=e}catch(e){this.loading=!1,console.error(e),this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),this.dismissModal()}})}restore(e){return this.$activeModal.close(e)}download(e){return v(this,null,function*(){this.clicked=!0;try{let t=yield k(this.$api.get(`/config-editor/backups/${e}`)),i=JSON.stringify(t,null,4),o=new Blob([i],{type:"application/json"}),w=`config-backup-${e}.json`;(0,Se.saveAs)(o,w),this.clicked=!1}catch(t){this.clicked=!1,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}downloadCurrentConfig(){let e=`data:text/json;charset=utf-8,${encodeURIComponent(this.currentConfig)}`,t=document.createElement("a");t.setAttribute("href",e),t.setAttribute("download","config.json"),document.body.appendChild(t),t.click(),t.remove()}delete(e){return v(this,null,function*(){this.deleting=e;try{yield k(this.$api.delete(`/config-editor/backups/${e}`)),yield this.getConfigBackups(),this.deleting=null}catch(t){this.deleting=null,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}deleteAllBackups(){return v(this,null,function*(){this.deleting="all";try{yield k(this.$api.delete("/config-editor/backups")),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success")),this.backupList=[],this.deleting=null}catch(e){this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e),this.deleting=null}})}dismissModal(){this.fromSettings&&this.$router.navigate(["/settings"]),this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=R({type:n,selectors:[["ng-component"]],inputs:{currentConfig:"currentConfig",fromSettings:"fromSettings"},decls:40,vars:31,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-history","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right"],[1,"text-center","primary-text"],[1,"list-group","list-group-box","mt-3"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"fa","fa-fw","fa-cog","fa-spin","mt-3",2,"font-size","75px"],[1,"grey-text","small"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-download"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),_(3),s(4,"translate"),d(),a(5,"button",3),s(6,"translate"),b("click",function(){return i.dismissModal()}),d()(),a(7,"div",4)(8,"div",5),m(9,"i",6),d(),a(10,"ul",7)(11,"li"),_(12),s(13,"translate"),d(),a(14,"li"),_(15),s(16,"translate"),d()(),a(17,"ul",8)(18,"li",9)(19,"div")(20,"span"),_(21),s(22,"translate"),d(),m(23,"br"),a(24,"small",10),_(25),s(26,"translate"),d()(),a(27,"button",11),s(28,"translate"),b("click",function(){return i.downloadCurrentConfig()}),m(29,"i",12),d()()(),x(30,Oe,2,0,"div",13)(31,Ne,16,18,"ul",14),d(),a(32,"div",15),m(33,"div",16),a(34,"div",17)(35,"button",18),s(36,"translate"),b("click",function(){return i.dismissModal()}),_(37),s(38,"translate"),d()(),m(39,"div",19),d()()),t&2&&(r(3),$(l(4,13,"config.restore.title")),r(2),g("disabled",i.clicked||i.deleting),C("aria-label",l(6,15,"form.button_close")),r(7),$(l(13,17,"config.restore.help_1")),r(3),$(l(16,19,"config.restore.help_2")),r(6),$(l(22,21,"form.button_download")),r(4),$(l(26,23,"config.restore.download")),r(2),g("disabled",i.clicked||i.deleting),C("aria-label",l(28,25,"backup.backup_now")),r(3),E(i.loading?30:i.backupList.length?31:-1),r(5),g("disabled",i.clicked||i.deleting),C("aria-label",l(36,27,"form.button_close")),r(2),A(" ",l(38,29,"form.button_close")," "))},dependencies:[P,le,ge,de,I],encapsulation:2})}return n})();function qe(n,y){if(n&1){let e=S();a(0,"button",13),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=f();return h(i.onCancelRestore())}),m(3,"i",14),d()}if(n&2){let e=f();g("disabled",e.saveInProgress)("openDelay",150)("ngbTooltip",l(1,4,"form.button_cancel")),C("aria-label",l(2,6,"form.button_cancel"))}}function Fe(n,y){if(n&1){let e=S();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=f();return h(i.onRestore())}),m(3,"i",16),d()}n&2&&(g("openDelay",150)("ngbTooltip",l(1,3,"form.button_restore")),C("aria-label",l(2,5,"form.button_restore")))}function Je(n,y){if(n&1){let e=S();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=f();return h(i.toggleSideBySide())}),m(3,"i",17),d()}if(n&2){let e=f();g("openDelay",150)("ngbTooltip",l(1,7,e.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),C("aria-label",l(2,9,e.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),r(3),ne("fa-columns",!e.renderSideBySide)("fa-bars",e.renderSideBySide)}}function Le(n,y){n&1&&m(0,"i",8)}function Ue(n,y){n&1&&m(0,"i",9)}function ze(n,y){if(n&1){let e=S();a(0,"ngx-monaco-editor",18),b("onInit",function(i){u(e);let o=f();return h(o.onEditorInit(i))})("keydown.control.s",function(i){u(e);let o=f();return i.preventDefault(),h(o.onSave())})("keydown.meta.s",function(i){u(e);let o=f();return i.preventDefault(),h(o.onSave())}),d()}if(n&2){let e=f();g("options",e.editorOptions)("model",e.monacoEditorModel)}}function Ke(n,y){if(n&1){let e=S();a(0,"ngx-monaco-diff-editor",19),b("onInit",function(i){u(e);let o=f();return h(o.onInitDiffEditor(i))})("keydown.control.s",function(i){u(e);let o=f();return i.preventDefault(),h(o.onSave())})("keydown.meta.s",function(i){u(e);let o=f();return i.preventDefault(),h(o.onSave())}),d()}if(n&2){let e=f();g("options",e.editorOptions)("originalModel",e.diffOriginalModel)("modifiedModel",e.diffModifiedModel)}}function We(n,y){if(n&1){let e=S();a(0,"textarea",20),ae("ngModelChange",function(i){u(e);let o=f();return se(o.homebridgeConfig,i)||(o.homebridgeConfig=i),h(i)}),_(1," "),d()}if(n&2){let e=f();re("ngModel",e.homebridgeConfig)}}var $t=(()=>{class n{$api=p(N);$md=p(we);$modal=p(he);$monacoEditor=p(Ee);$renderer=p(ee);$route=p(ye);$router=p(H);$settings=p(Ce);$toastr=p(O);$translate=p(j);editorDecorations=[];lastHeight;visualViewPortEventCallback;latestSavedConfig;childBridgesToRestart=[];hbPendingRestart=!1;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;diffOriginalModel;diffModifiedModel;renderSideBySide=!1;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",renderSideBySide:this.renderSideBySide,renderIndicators:!0,ignoreTrimWhitespace:!1,glyphMargin:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),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(i=>{this.homebridgeConfig=i.config,this.latestSavedConfig=JSON.parse(i.config),this.diffModifiedModel&&this.updateDiffModels()}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},this.diffOriginalModel={code:"",language:"json"},this.diffModifiedModel={code:this.homebridgeConfig||"{}",language:"json"},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>this.setMonacoEditorModel()});let{action:t}=this.$router.parseUrl(this.$router.url).queryParams;if(t){switch(t){case"restore":{this.onRestore(!0);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:""})}}onEditorInit(e){window.editor=e,this.monacoEditor=e,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(e){this.monacoEditor=e.getModifiedEditor(),this.updateDiffModels(),window.editor=e}updateDiffModels(){if(this.diffOriginalModel&&(this.diffOriginalModel.code=this.originalConfig||""),this.diffModifiedModel&&(this.diffModifiedModel.code=this.homebridgeConfig||"{}"),window.editor&&window.editor.getOriginalEditor){let e=window.editor.getOriginalEditor(),t=window.editor.getModifiedEditor();if(e&&t){let i=e.getModel(),o=t.getModel();i&&i.setValue(this.originalConfig||""),o&&o.setValue(this.homebridgeConfig||"{}")}}}onSave(){return v(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let t=window.monaco.editor.getModelMarkers({owner:"json"});for(let i of t)if(i.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let e=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(e,null,4),typeof e.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(e.bridge.username)?e.accessories&&!Array.isArray(e.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&!Array.isArray(e.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&Array.isArray(e.platforms)&&!this.validateSection(e.platforms,"platform")||e.accessories&&Array.isArray(e.accessories)&&!this.validateSection(e.accessories,"accessory")||e.plugins&&Array.isArray(e.plugins)&&!this.validatePlugins(e.plugins,"plugins")||e.disabledPlugins&&Array.isArray(e.disabledPlugins)&&!this.validatePlugins(e.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(e),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(e=!1){let t=this.$modal.open($e,{size:"lg",backdrop:"static"});t.componentInstance.currentConfig=this.homebridgeConfig,t.componentInstance.fromSettings=e,t.result.then(i=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig,this.updateDiffModels()),this.$api.get(`/config-editor/backups/${i}`).subscribe({next:o=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(o,null,4),this.updateDiffModels(),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:o=>{console.error(o),this.$toastr.error(o.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onCancelRestore(){if(window.editor&&window.editor.dispose)try{window.editor.dispose(),window.editor=void 0}catch{}this.homebridgeConfig=this.originalConfig,this.originalConfig="",this.renderSideBySide&&this.toggleSideBySide(),this.updateDiffModels(),this.onRestore()}toggleSideBySide(){this.renderSideBySide=!this.renderSideBySide,this.editorOptions=Q(G({},this.editorOptions),{renderSideBySide:this.renderSideBySide})}ngOnDestroy(){let e=document.querySelector(".content");this.$renderer.removeStyle(e,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove());try{if(window.editor&&window.editor.dispose&&(window.editor.dispose(),window.editor=void 0),window.monaco){let t=window.monaco.Uri.parse("file:///original.json"),i=window.monaco.Uri.parse("file:///modified.json"),o=window.monaco.editor.getModel(t);o&&o.dispose();let w=window.monaco.editor.getModel(i);w&&w.dispose()}this.monacoEditor&&this.monacoEditor.dispose()}catch{}}validateSection(e,t){for(let i of e){if(typeof i!="object"||Array.isArray(i))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(!i[t])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(typeof i[t]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1}return!0}validatePlugins(e,t){for(let i of e)if(typeof i!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:t}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(e){this.monacoEditor&&(e=JSON.stringify(e,null,4).split(`
|
|
1
|
+
import{a as Ee}from"./chunk-7XG67XSY.js";import{b as T,e as ve,f as xe,g as je}from"./chunk-BD4L4MMU.js";import{a as be,b as _e}from"./chunk-ECQJTOVP.js";import{a as we}from"./chunk-I5TETZ3I.js";import{a as Pe}from"./chunk-KT4VIVBF.js";import{m as ue,n as he,t as P}from"./chunk-LXFVNKLD.js";import{B as pe,C as ge,c as ce,e as fe,l as me}from"./chunk-F7ZV2JBO.js";import{b as ye,d as H}from"./chunk-YMAWYUA6.js";import{b as Ce}from"./chunk-HPUVHUIE.js";import{k as j,l as I,n as O,q as N}from"./chunk-7KLW5GIG.js";import{Db as S,Gb as b,Ib as f,Kc as le,La as r,Pa as ee,Rc as de,Tb as ne,Vb as _,Wa as R,Wb as $,Xb as A,a as G,ac as re,b as Q,bc as se,cc as ae,d as X,g as Z,h as v,hc as z,ja as p,kb as C,lb as x,mb as E,mc as s,nc as l,oa as u,ob as te,oc as K,pa as h,pb as ie,qb as oe,rb as g,sb as a,tb as d,ub as m,w as k}from"./chunk-V2XN5VIX.js";var Me=Z(je(),1);var Se=Z(Pe(),1);var ke=(n,y)=>({"fa-trash":n,"fa-cog fa-spin":y});function Oe(n,y){n&1&&(a(0,"div",13),m(1,"i",20),d())}function He(n,y){if(n&1){let e=S();a(0,"li",9)(1,"span"),_(2),s(3,"date"),m(4,"br"),a(5,"span",21),_(6),s(7,"date"),d()(),a(8,"span",22)(9,"button",25),s(10,"translate"),s(11,"translate"),b("click",function(){let i=u(e).$implicit,o=f(2);return h(o.restore(i.id))}),m(12,"i",26),d(),a(13,"button",27),s(14,"translate"),s(15,"translate"),b("click",function(){let i=u(e).$implicit,o=f(2);return h(o.download(i.id))}),m(16,"i",28),d(),a(17,"button",23),s(18,"translate"),s(19,"translate"),b("click",function(){let i=u(e).$implicit,o=f(2);return h(o.delete(i.id))}),m(20,"i",24),d()()()}if(n&2){let e=y.$implicit,t=f(2);r(2),A(" ",K(3,15,e.timestamp,"mediumDate")),r(4),$(K(7,18,e.timestamp,"shortTime")),r(3),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(10,21,"config.restore.copy_to_editor"))("openDelay",150),C("aria-label",l(11,23,"config.restore.copy_to_editor")),r(4),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(14,25,"form.button_download"))("openDelay",150),C("aria-label",l(15,27,"form.button_download")),r(4),g("disabled",t.clicked||t.deleting)("ngbTooltip",l(18,29,"form.button_delete"))("openDelay",150),C("aria-label",l(19,31,"form.button_delete")),r(3),g("ngClass",z(33,ke,e.id!==t.deleting,e.id===t.deleting))}}function Ne(n,y){if(n&1){let e=S();a(0,"ul",14),ie(1,He,21,36,"li",9,te),a(3,"li",9)(4,"span"),_(5),s(6,"translate"),m(7,"br"),a(8,"span",21),_(9),s(10,"translate"),d()(),a(11,"span",22)(12,"button",23),s(13,"translate"),s(14,"translate"),b("click",function(){u(e);let i=f();return h(i.deleteAllBackups())}),m(15,"i",24),d()()()()}if(n&2){let e=f();r(),oe(e.backupList),r(4),A(" ",l(6,7,"form.button_delete_all")),r(4),A(" ",l(10,9,"common.labels.no_confirmation")," "),r(3),g("disabled",e.clicked||e.deleting)("ngbTooltip",l(13,11,"form.button_delete_all"))("openDelay",150),C("aria-label",l(14,13,"form.button_delete")),r(3),g("ngClass",z(15,ke,e.deleting!=="all",e.deleting==="all"))}}var $e=(()=>{class n{$activeModal=p(ue);$api=p(N);$router=p(H);$toastr=p(O);$translate=p(j);currentConfig;fromSettings=!1;loading=!0;backupList=[];clicked=!1;deleting=null;ngOnInit(){this.getConfigBackups()}getConfigBackups(){return v(this,null,function*(){try{let e=yield k(this.$api.get("/config-editor/backups"));this.loading=!1,this.backupList=e}catch(e){this.loading=!1,console.error(e),this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),this.dismissModal()}})}restore(e){return this.$activeModal.close(e)}download(e){return v(this,null,function*(){this.clicked=!0;try{let t=yield k(this.$api.get(`/config-editor/backups/${e}`)),i=JSON.stringify(t,null,4),o=new Blob([i],{type:"application/json"}),w=`config-backup-${e}.json`;(0,Se.saveAs)(o,w),this.clicked=!1}catch(t){this.clicked=!1,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}downloadCurrentConfig(){let e=`data:text/json;charset=utf-8,${encodeURIComponent(this.currentConfig)}`,t=document.createElement("a");t.setAttribute("href",e),t.setAttribute("download","config.json"),document.body.appendChild(t),t.click(),t.remove()}delete(e){return v(this,null,function*(){this.deleting=e;try{yield k(this.$api.delete(`/config-editor/backups/${e}`)),yield this.getConfigBackups(),this.deleting=null}catch(t){this.deleting=null,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}deleteAllBackups(){return v(this,null,function*(){this.deleting="all";try{yield k(this.$api.delete("/config-editor/backups")),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success")),this.backupList=[],this.deleting=null}catch(e){this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e),this.deleting=null}})}dismissModal(){this.fromSettings&&this.$router.navigate(["/settings"]),this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=R({type:n,selectors:[["ng-component"]],inputs:{currentConfig:"currentConfig",fromSettings:"fromSettings"},decls:40,vars:31,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-history","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right"],[1,"text-center","primary-text"],[1,"list-group","list-group-box","mt-3"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"fa","fa-fw","fa-cog","fa-spin","mt-3",2,"font-size","75px"],[1,"grey-text","small"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-download"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),_(3),s(4,"translate"),d(),a(5,"button",3),s(6,"translate"),b("click",function(){return i.dismissModal()}),d()(),a(7,"div",4)(8,"div",5),m(9,"i",6),d(),a(10,"ul",7)(11,"li"),_(12),s(13,"translate"),d(),a(14,"li"),_(15),s(16,"translate"),d()(),a(17,"ul",8)(18,"li",9)(19,"div")(20,"span"),_(21),s(22,"translate"),d(),m(23,"br"),a(24,"small",10),_(25),s(26,"translate"),d()(),a(27,"button",11),s(28,"translate"),b("click",function(){return i.downloadCurrentConfig()}),m(29,"i",12),d()()(),x(30,Oe,2,0,"div",13)(31,Ne,16,18,"ul",14),d(),a(32,"div",15),m(33,"div",16),a(34,"div",17)(35,"button",18),s(36,"translate"),b("click",function(){return i.dismissModal()}),_(37),s(38,"translate"),d()(),m(39,"div",19),d()()),t&2&&(r(3),$(l(4,13,"config.restore.title")),r(2),g("disabled",i.clicked||i.deleting),C("aria-label",l(6,15,"form.button_close")),r(7),$(l(13,17,"config.restore.help_1")),r(3),$(l(16,19,"config.restore.help_2")),r(6),$(l(22,21,"form.button_download")),r(4),$(l(26,23,"config.restore.download")),r(2),g("disabled",i.clicked||i.deleting),C("aria-label",l(28,25,"backup.backup_now")),r(3),E(i.loading?30:i.backupList.length?31:-1),r(5),g("disabled",i.clicked||i.deleting),C("aria-label",l(36,27,"form.button_close")),r(2),A(" ",l(38,29,"form.button_close")," "))},dependencies:[P,le,ge,de,I],encapsulation:2})}return n})();function qe(n,y){if(n&1){let e=S();a(0,"button",13),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=f();return h(i.onCancelRestore())}),m(3,"i",14),d()}if(n&2){let e=f();g("disabled",e.saveInProgress)("openDelay",150)("ngbTooltip",l(1,4,"form.button_cancel")),C("aria-label",l(2,6,"form.button_cancel"))}}function Fe(n,y){if(n&1){let e=S();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=f();return h(i.onRestore())}),m(3,"i",16),d()}n&2&&(g("openDelay",150)("ngbTooltip",l(1,3,"form.button_restore")),C("aria-label",l(2,5,"form.button_restore")))}function Je(n,y){if(n&1){let e=S();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){u(e);let i=f();return h(i.toggleSideBySide())}),m(3,"i",17),d()}if(n&2){let e=f();g("openDelay",150)("ngbTooltip",l(1,7,e.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),C("aria-label",l(2,9,e.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),r(3),ne("fa-columns",!e.renderSideBySide)("fa-bars",e.renderSideBySide)}}function Le(n,y){n&1&&m(0,"i",8)}function Ue(n,y){n&1&&m(0,"i",9)}function ze(n,y){if(n&1){let e=S();a(0,"ngx-monaco-editor",18),b("onInit",function(i){u(e);let o=f();return h(o.onEditorInit(i))})("keydown.control.s",function(i){u(e);let o=f();return i.preventDefault(),h(o.onSave())})("keydown.meta.s",function(i){u(e);let o=f();return i.preventDefault(),h(o.onSave())}),d()}if(n&2){let e=f();g("options",e.editorOptions)("model",e.monacoEditorModel)}}function Ke(n,y){if(n&1){let e=S();a(0,"ngx-monaco-diff-editor",19),b("onInit",function(i){u(e);let o=f();return h(o.onInitDiffEditor(i))})("keydown.control.s",function(i){u(e);let o=f();return i.preventDefault(),h(o.onSave())})("keydown.meta.s",function(i){u(e);let o=f();return i.preventDefault(),h(o.onSave())}),d()}if(n&2){let e=f();g("options",e.editorOptions)("originalModel",e.diffOriginalModel)("modifiedModel",e.diffModifiedModel)}}function We(n,y){if(n&1){let e=S();a(0,"textarea",20),ae("ngModelChange",function(i){u(e);let o=f();return se(o.homebridgeConfig,i)||(o.homebridgeConfig=i),h(i)}),_(1," "),d()}if(n&2){let e=f();re("ngModel",e.homebridgeConfig)}}var $t=(()=>{class n{$api=p(N);$md=p(we);$modal=p(he);$monacoEditor=p(Ee);$renderer=p(ee);$route=p(ye);$router=p(H);$settings=p(Ce);$toastr=p(O);$translate=p(j);editorDecorations=[];lastHeight;visualViewPortEventCallback;latestSavedConfig;childBridgesToRestart=[];hbPendingRestart=!1;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;diffOriginalModel;diffModifiedModel;renderSideBySide=!1;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",renderSideBySide:this.renderSideBySide,renderIndicators:!0,ignoreTrimWhitespace:!1,glyphMargin:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),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(i=>{this.homebridgeConfig=i.config,this.latestSavedConfig=JSON.parse(i.config),this.diffModifiedModel&&this.updateDiffModels()}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},this.diffOriginalModel={code:"",language:"json"},this.diffModifiedModel={code:this.homebridgeConfig||"{}",language:"json"},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>this.setMonacoEditorModel()});let{action:t}=this.$router.parseUrl(this.$router.url).queryParams;if(t){switch(t){case"restore":{this.onRestore(!0);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:""})}}onEditorInit(e){window.editor=e,this.monacoEditor=e,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(e){this.monacoEditor=e.getModifiedEditor(),this.updateDiffModels(),window.editor=e}updateDiffModels(){if(this.diffOriginalModel&&(this.diffOriginalModel.code=this.originalConfig||""),this.diffModifiedModel&&(this.diffModifiedModel.code=this.homebridgeConfig||"{}"),window.editor&&window.editor.getOriginalEditor){let e=window.editor.getOriginalEditor(),t=window.editor.getModifiedEditor();if(e&&t){let i=e.getModel(),o=t.getModel();i&&i.setValue(this.originalConfig||""),o&&o.setValue(this.homebridgeConfig||"{}")}}}onSave(){return v(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let t=window.monaco.editor.getModelMarkers({owner:"json"});for(let i of t)if(i.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let e=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(e,null,4),typeof e.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(e.bridge.username)?e.accessories&&!Array.isArray(e.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&!Array.isArray(e.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&Array.isArray(e.platforms)&&!this.validateSection(e.platforms,"platform")||e.accessories&&Array.isArray(e.accessories)&&!this.validateSection(e.accessories,"accessory")||e.plugins&&Array.isArray(e.plugins)&&!this.validatePlugins(e.plugins,"plugins")||e.disabledPlugins&&Array.isArray(e.disabledPlugins)&&!this.validatePlugins(e.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(e),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(e=!1){let t=this.$modal.open($e,{size:"lg",backdrop:"static"});t.componentInstance.currentConfig=this.homebridgeConfig,t.componentInstance.fromSettings=e,t.result.then(i=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig,this.updateDiffModels()),this.$api.get(`/config-editor/backups/${i}`).subscribe({next:o=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(o,null,4),this.updateDiffModels(),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:o=>{console.error(o),this.$toastr.error(o.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onCancelRestore(){if(window.editor&&window.editor.dispose)try{window.editor.dispose(),window.editor=void 0}catch{}this.homebridgeConfig=this.originalConfig,this.originalConfig="",this.renderSideBySide&&this.toggleSideBySide(),this.updateDiffModels(),this.onRestore()}toggleSideBySide(){this.renderSideBySide=!this.renderSideBySide,this.editorOptions=Q(G({},this.editorOptions),{renderSideBySide:this.renderSideBySide})}ngOnDestroy(){let e=document.querySelector(".content");this.$renderer.removeStyle(e,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove());try{if(window.editor&&window.editor.dispose&&(window.editor.dispose(),window.editor=void 0),window.monaco){let t=window.monaco.Uri.parse("file:///original.json"),i=window.monaco.Uri.parse("file:///modified.json"),o=window.monaco.editor.getModel(t);o&&o.dispose();let w=window.monaco.editor.getModel(i);w&&w.dispose()}this.monacoEditor&&this.monacoEditor.dispose()}catch{}}validateSection(e,t){for(let i of e){if(typeof i!="object"||Array.isArray(i))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(!i[t])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(typeof i[t]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1}return!0}validatePlugins(e,t){for(let i of e)if(typeof i!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:t}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(e){this.monacoEditor&&(e=JSON.stringify(e,null,4).split(`
|
|
2
2
|
`).map(t=>` ${t}`).join(`
|
|
3
3
|
`),setTimeout(()=>{let t=this.monacoEditor.getModel().findMatches(e);if(t.length){let i=t[0].range,o=new monaco.Range(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[{range:o,options:{isWholeLine:!0,linesDecorationsClassName:"hb-monaco-editor-line-error"}}])}},200))}setMonacoEditorModel(){if(window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.some(t=>t.uri==="http://homebridge/config.json"))return;let e=monaco.Uri.parse("a://homebridge/config.json");window.monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!1,validate:!0,schemas:[{uri:"http://homebridge/config.json",fileMatch:[e.toString()],schema:{type:"object",required:["bridge"],properties:{bridge:{type:"object",required:["name","username","port","pin"],properties:{name:{type:"string",description:`The Homebridge instance name.
|
|
4
4
|
This should be unique if you are running multiple instances of Homebridge.`,default:"Homebridge"},username:{type:"string",description:`Homebridge username must be 6 pairs of colon-separated hexadecimal characters (A-F 0-9).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-HFRNQJIL.js";import{a as ee,b as te,c as ie}from"./chunk-GKQKFOED.js";import{c as ae}from"./chunk-3PXAB53U.js";import"./chunk-STNZ2QMW.js";import{a as le}from"./chunk-JUUBECIG.js";import{a as se}from"./chunk-I5TETZ3I.js";import{m as D,n as Y,t as Z}from"./chunk-LXFVNKLD.js";import{B as X,c as q,e as G,f as J,i as K,l as Q,m as U}from"./chunk-F7ZV2JBO.js";import"./chunk-BQWL4A33.js";import{b as oe}from"./chunk-UOPTK3F2.js";import"./chunk-YMAWYUA6.js";import{b as ne}from"./chunk-UUAVDVSZ.js";import{l as h}from"./chunk-G67KYACP.js";import{Db as T,Ga as L,Gb as b,Ib as p,Kc as z,La as o,Vb as c,Wa as y,Wb as u,Xb as S,ac as k,bc as A,cc as E,fc as W,gc as B,hc as R,ja as g,kb as v,lb as M,mb as w,mc as s,nc as l,oa as x,ob as $,oc as j,pa as C,pb as V,qb as F,rb as _,sb as r,tb as a,ub as m,vb as P,wb as H,xb as O}from"./chunk-V2XN5VIX.js";var ce=(()=>{class t{$activeModal=g(D);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],decls:42,vars:30,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"ms-2","mt-2"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),b("click",function(){return n.dismissModal()}),a()(),r(8,"div",4)(9,"div",5),m(10,"i",6),a(),r(11,"h5",7),c(12),s(13,"translate"),a(),r(14,"ul",8)(15,"li"),c(16),s(17,"translate"),a(),r(18,"li"),c(19),s(20,"translate"),a()(),r(21,"h5",9),c(22),s(23,"translate"),a(),r(24,"ul",8)(25,"li"),c(26),s(27,"translate"),a(),r(28,"li"),c(29),s(30,"translate"),a(),r(31,"li"),c(32),s(33,"translate"),a()(),m(34,"app-support-banner"),a(),r(35,"div",10),m(36,"div",11),r(37,"div",12)(38,"button",13),b("click",function(){return n.dismissModal()}),c(39),s(40,"translate"),a()(),m(41,"div",14),a()()()),i&2&&(o(4),u(l(5,10,"support.title")),o(2),v("aria-label",l(7,12,"form.button_close")),o(6),u(l(13,14,"menu.label_accessories")),o(4),u(l(17,16,"accessories.support.acc_1")),o(3),u(l(20,18,"accessories.support.acc_2")),o(3),u(l(23,20,"accessories.title_rooms")),o(4),u(l(27,22,"accessories.support.rooms_1")),o(3),u(l(30,24,"accessories.support.rooms_2")),o(3),u(l(33,26,"accessories.support.rooms_3")),o(7),S(" ",l(40,28,"form.button_close")," "))},dependencies:[le,h],encapsulation:2})}return t})();var me=()=>({standalone:!0}),de=(()=>{class t{$activeModal=g(D);roomName;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(e){this.$activeModal.close(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:28,vars:19,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-folder-plus","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["autocomplete","off","type","text","id","form-name","autofocus","",1,"form-control","custom-input",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),b("click",function(){return n.dismissModal()}),a()(),r(8,"div",4)(9,"div",5),m(10,"i",6),a(),r(11,"ul",7)(12,"li",8)(13,"label",9),c(14),s(15,"translate"),a(),r(16,"div",10)(17,"input",11),E("ngModelChange",function(I){return A(n.roomName,I)||(n.roomName=I),I}),b("keyup.enter",function(){return n.closeModal(n.roomName)}),a()()()()(),r(18,"div",12)(19,"div",13)(20,"button",14),b("click",function(){return n.dismissModal()}),c(21),s(22,"translate"),a()(),m(23,"div",15),r(24,"div",16)(25,"button",17),b("click",function(){return n.closeModal(n.roomName)}),c(26),s(27,"translate"),a()()()()()),i&2&&(o(4),u(l(5,8,"accessories.button_add_room")),o(2),v("aria-label",l(7,10,"form.button_close")),o(8),u(l(15,12,"accessories.room_name")),o(3),k("ngModel",n.roomName),_("ngModelOptions",W(18,me)),o(4),S(" ",l(22,14,"form.button_close")," "),o(4),_("disabled",!n.roomName),o(),S(" ",l(27,16,"form.button_save")," "))},dependencies:[X,U,q,G,J,Q,K,h],encapsulation:2})}return t})();var pe=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-drag-here-placeholder"]],decls:5,vars:3,consts:[[1,"accessory-box"],[1,"fas","fa-fw","fa-arrow-alt-circle-down","accessory-icon"],[1,"accessory-label"]],template:function(i,n){i&1&&(P(0,"div",0),O(1,"i",1),P(2,"div",2),c(3),s(4,"translate"),H()()),i&2&&(o(3),u(l(4,1,"accessories.control.drag_here")))},dependencies:[h],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var ue=(t,f)=>({"fa-eye":t,"fa-eye-slash":f}),_e=t=>({"cursor-move":t}),be=t=>({"justify-content-between":t}),fe=t=>({link:t});function ge(t,f){if(t&1&&(r(0,"div",0)(1,"div",19)(2,"h5",20),c(3),s(4,"translate"),a()()()),t&2){let e=p().$implicit,i=p(2);o(2),_("ngClass",B(4,_e,!i.isMobile)),o(),S(" ",e.name==="Default Room"?l(4,2,"accessories.control.default_room"):e.name," ")}}function ve(t,f){if(t&1&&(r(0,"div",23),m(1,"app-accessory-tile",24),a()),t&2){let e=p().$implicit;o(),_("service",e)}}function xe(t,f){if(t&1&&M(0,ve,2,1,"div",23),t&2){let e=f.$implicit,i=p(4);w(!i.hideHidden||!e.hidden?0:-1)}}function Ce(t,f){if(t&1){let e=T();r(0,"div",21),E("dragulaModelChange",function(n){x(e);let d=p().$implicit;return A(d.services,n)||(d.services=n),C(n)}),V(1,xe,1,1,null,null,$),m(3,"div",22)(4,"div",22)(5,"div",22)(6,"div",22)(7,"div",22)(8,"div",22)(9,"div",22)(10,"div",22)(11,"div",22)(12,"div",22),a()}if(t&2){let e=p().$implicit,i=p(2);_("ngClass",B(3,be,i.isMobile))("dragula","services-bag"),k("dragulaModel",e.services),o(),F(e.services)}}function ye(t,f){if(t&1){let e=T();r(0,"div",25),E("dragulaModelChange",function(n){x(e);let d=p().$implicit;return A(d.services,n)||(d.services=n),C(n)}),m(1,"app-drag-here-placeholder",26),a()}if(t&2){let e=p().$implicit;_("dragula","services-bag"),k("dragulaModel",e.services)}}function he(t,f){if(t&1&&(r(0,"div"),M(1,ge,5,6,"div",0),r(2,"div",16),M(3,Ce,13,5,"div",17),M(4,ye,2,2,"div",18),a()()),t&2){let e=f.$implicit,i=p(2);o(),w(!i.isMobile||e.services.length?1:-1),o(2),w(e.services.length?3:-1),o(),w(!e.services.length&&!i.isMobile?4:-1)}}function Me(t,f){if(t&1){let e=T();r(0,"div",1)(1,"div",2)(2,"h3",3),c(3),s(4,"translate"),a()(),r(5,"div",4)(6,"button",5),s(7,"translate"),b("click",function(){x(e);let n=p();return C(n.openSupport())}),m(8,"i",6),a()(),r(9,"div",7)(10,"button",8),s(11,"translate"),s(12,"translate"),b("click",function(){x(e);let n=p();return C(n.addRoom())}),m(13,"i",9),a(),r(14,"button",8),s(15,"translate"),s(16,"translate"),s(17,"translate"),s(18,"translate"),b("click",function(){x(e);let n=p();return C(n.hideHidden=!n.hideHidden)}),m(19,"i",10),a(),r(20,"div",11)(21,"button",12),s(22,"translate"),s(23,"translate"),b("click",function(){x(e);let n=p();return C(n.toggleLayoutLock())}),m(24,"i",13),a(),r(25,"button",12),s(26,"translate"),s(27,"translate"),b("click",function(){x(e);let n=p();return C(n.toggleLayoutLock())}),m(28,"i",14),a()(),r(29,"button",5),s(30,"translate"),b("click",function(){x(e);let n=p();return C(n.openSupport())}),m(31,"i",6),a()()(),r(32,"div",15),E("dragulaModelChange",function(n){x(e);let d=p();return A(d.$accessories.rooms,n)||(d.$accessories.rooms=n),C(n)}),V(33,he,5,3,"div",null,$),a()}if(t&2){let e=p();o(3),u(l(4,22,"menu.label_accessories")),o(3),v("aria-label",l(7,24,"support.title")),o(4),_("hidden",e.isMobile)("openDelay",150)("ngbTooltip",l(11,26,"accessories.button_add_room")),v("aria-label",l(12,28,"accessories.button_add_room")),o(4),_("hidden",e.isMobile)("openDelay",150)("ngbTooltip",e.hideHidden?l(15,30,"accessories.button_hidden_show"):l(16,32,"accessories.button_hidden_hide")),v("aria-label",e.hideHidden?l(17,34,"accessories.button_hidden_show"):l(18,36,"accessories.button_hidden_hide")),o(5),_("ngClass",R(48,ue,!e.hideHidden,e.hideHidden)),o(2),_("disabled",!e.isMobile)("openDelay",150)("ngbTooltip",l(22,38,"form.button_unlock")),v("aria-label",l(23,40,"form.button_unlock")),o(4),_("disabled",e.isMobile)("openDelay",150)("ngbTooltip",l(26,42,"form.button_lock")),v("aria-label",l(27,44,"form.button_lock")),o(4),v("aria-label",l(30,46,"support.title")),o(3),_("dragula","rooms-bag"),k("dragulaModel",e.$accessories.rooms),o(),F(e.$accessories.rooms)}}function we(t,f){t&1&&(r(0,"p",33),c(1),s(2,"translate"),a()),t&2&&(o(),u(l(2,1,"accessories.settings_link")))}function Se(t,f){if(t&1&&(r(0,"div",0)(1,"div",27)(2,"h3",28),c(3),s(4,"translate"),a()(),r(5,"div",29)(6,"div",30)(7,"h5",31),c(8),s(9,"translate"),a(),m(10,"p",32),s(11,"translate"),M(12,we,3,3,"p",33),a()()()),t&2){let e=p();o(3),u(l(4,4,"menu.label_accessories")),o(5),u(l(9,6,"accessories.control_disabled")),o(2),_("innerHTML",j(11,8,"accessories.message_must_use_insecure_mode",B(11,fe,e.linkInsecure)),L),o(2),w(e.isAdmin?12:-1)}}var nt=(()=>{class t{$accessories=g(ae);$auth=g(oe);dragulaService=g(ee);$modal=g(Y);$settings=g(ne);$md=g(se);orderSubscription;isAdmin=this.$auth.user.admin;enableAccessories=this.$settings.env.enableAccessories;isMobile=!1;hideHidden=!0;linkInsecure='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(i,n,d)=>!this.isMobile&&d.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:i=>!this.isMobile&&!i.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),this.isMobile=!0}ngOnInit(){this.$accessories.start()}addRoom(){this.$modal.open(de,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(i=>i.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?document.querySelectorAll(".services-bag").forEach(i=>{for(let n=0;n<10;n++){let d=document.createElement("div");d.className="accessory-box invisible py-0 my-0",d.style.height="0",i.appendChild(d)}}):document.querySelectorAll(".invisible").forEach(i=>i.remove())}openSupport(){this.$modal.open(ce,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-accessories"]],decls:2,vars:1,consts:[[1,"row"],[1,"row","mb-3"],[1,"col-9","col-sm-6"],[1,"primary-text","m-0"],[1,"col-3","col-sm-6","text-end","d-inline-block","d-sm-none"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"col-3","col-sm-6","text-end","d-none","d-sm-inline-block"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","hidden","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-folder-plus"],[1,"fas","fa-fw",3,"ngClass"],["role","group",1,"btn-group","me-2"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-unlock"],[1,"fas","fa-fw","fa-lock"],[3,"dragulaModelChange","dragula","dragulaModel"],[1,"row","mb-4"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"ngClass","dragula","dragulaModel"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragula","dragulaModel"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0","mb-1","mb-sm-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"dragulaModelChange","ngClass","dragula","dragulaModel"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0"],[1,"accessory-item","accessory-tab"],[3,"service"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragulaModelChange","dragula","dragulaModel"],[1,"no-drag"],[1,"col-12"],[1,"primary-text","m-0","mb-3"],[1,"col-12","text-center"],["role","alert",1,"alert","alert-warning","p-4"],[1,"mb-3","mt-0"],[1,"mb-0",3,"innerHTML"],[1,"mt-3","mb-0"]],template:function(i,n){i&1&&M(0,Me,35,51)(1,Se,13,13,"div",0),i&2&&w(n.enableAccessories?0:1)},dependencies:[Z,z,ie,te,re,pe,h],styles:[".room-title[_ngcontent-%COMP%]{margin-left:10px}@media (max-width: 575px){.room-title[_ngcontent-%COMP%]{margin-left:7px}}.services-bag[_ngcontent-%COMP%]{min-height:170px}@media (max-width: 575px){.services-bag[_ngcontent-%COMP%]{min-height:initial}}.cursor-move[_ngcontent-%COMP%]{cursor:move}.gu-transit[_ngcontent-%COMP%] .manage-accessory-button[_ngcontent-%COMP%]{display:none}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return t})();export{nt as AccessoriesComponent};
|
|
1
|
+
import{a as re}from"./chunk-R3RKTCAQ.js";import{a as ee,b as te,c as ie}from"./chunk-GKQKFOED.js";import{c as ae}from"./chunk-MCA223NA.js";import"./chunk-4VGD3WI7.js";import{a as le}from"./chunk-DCNSZOAX.js";import{a as se}from"./chunk-I5TETZ3I.js";import{m as D,n as Y,t as Z}from"./chunk-LXFVNKLD.js";import{B as X,c as q,e as G,f as J,i as K,l as Q,m as U}from"./chunk-F7ZV2JBO.js";import"./chunk-74TLD7UE.js";import{b as oe}from"./chunk-2D7HQVKR.js";import"./chunk-YMAWYUA6.js";import{b as ne}from"./chunk-HPUVHUIE.js";import{l as h}from"./chunk-7KLW5GIG.js";import{Db as T,Ga as L,Gb as b,Ib as p,Kc as z,La as o,Vb as c,Wa as y,Wb as u,Xb as S,ac as k,bc as A,cc as E,fc as W,gc as B,hc as R,ja as g,kb as v,lb as M,mb as w,mc as s,nc as l,oa as x,ob as $,oc as j,pa as C,pb as V,qb as F,rb as _,sb as r,tb as a,ub as m,vb as P,wb as H,xb as O}from"./chunk-V2XN5VIX.js";var ce=(()=>{class t{$activeModal=g(D);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],decls:42,vars:30,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"ms-2","mt-2"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),b("click",function(){return n.dismissModal()}),a()(),r(8,"div",4)(9,"div",5),m(10,"i",6),a(),r(11,"h5",7),c(12),s(13,"translate"),a(),r(14,"ul",8)(15,"li"),c(16),s(17,"translate"),a(),r(18,"li"),c(19),s(20,"translate"),a()(),r(21,"h5",9),c(22),s(23,"translate"),a(),r(24,"ul",8)(25,"li"),c(26),s(27,"translate"),a(),r(28,"li"),c(29),s(30,"translate"),a(),r(31,"li"),c(32),s(33,"translate"),a()(),m(34,"app-support-banner"),a(),r(35,"div",10),m(36,"div",11),r(37,"div",12)(38,"button",13),b("click",function(){return n.dismissModal()}),c(39),s(40,"translate"),a()(),m(41,"div",14),a()()()),i&2&&(o(4),u(l(5,10,"support.title")),o(2),v("aria-label",l(7,12,"form.button_close")),o(6),u(l(13,14,"menu.label_accessories")),o(4),u(l(17,16,"accessories.support.acc_1")),o(3),u(l(20,18,"accessories.support.acc_2")),o(3),u(l(23,20,"accessories.title_rooms")),o(4),u(l(27,22,"accessories.support.rooms_1")),o(3),u(l(30,24,"accessories.support.rooms_2")),o(3),u(l(33,26,"accessories.support.rooms_3")),o(7),S(" ",l(40,28,"form.button_close")," "))},dependencies:[le,h],encapsulation:2})}return t})();var me=()=>({standalone:!0}),de=(()=>{class t{$activeModal=g(D);roomName;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(e){this.$activeModal.close(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:28,vars:19,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-folder-plus","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["autocomplete","off","type","text","id","form-name","autofocus","",1,"form-control","custom-input",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),a(),r(6,"button",3),s(7,"translate"),b("click",function(){return n.dismissModal()}),a()(),r(8,"div",4)(9,"div",5),m(10,"i",6),a(),r(11,"ul",7)(12,"li",8)(13,"label",9),c(14),s(15,"translate"),a(),r(16,"div",10)(17,"input",11),E("ngModelChange",function(I){return A(n.roomName,I)||(n.roomName=I),I}),b("keyup.enter",function(){return n.closeModal(n.roomName)}),a()()()()(),r(18,"div",12)(19,"div",13)(20,"button",14),b("click",function(){return n.dismissModal()}),c(21),s(22,"translate"),a()(),m(23,"div",15),r(24,"div",16)(25,"button",17),b("click",function(){return n.closeModal(n.roomName)}),c(26),s(27,"translate"),a()()()()()),i&2&&(o(4),u(l(5,8,"accessories.button_add_room")),o(2),v("aria-label",l(7,10,"form.button_close")),o(8),u(l(15,12,"accessories.room_name")),o(3),k("ngModel",n.roomName),_("ngModelOptions",W(18,me)),o(4),S(" ",l(22,14,"form.button_close")," "),o(4),_("disabled",!n.roomName),o(),S(" ",l(27,16,"form.button_save")," "))},dependencies:[X,U,q,G,J,Q,K,h],encapsulation:2})}return t})();var pe=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-drag-here-placeholder"]],decls:5,vars:3,consts:[[1,"accessory-box"],[1,"fas","fa-fw","fa-arrow-alt-circle-down","accessory-icon"],[1,"accessory-label"]],template:function(i,n){i&1&&(P(0,"div",0),O(1,"i",1),P(2,"div",2),c(3),s(4,"translate"),H()()),i&2&&(o(3),u(l(4,1,"accessories.control.drag_here")))},dependencies:[h],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var ue=(t,f)=>({"fa-eye":t,"fa-eye-slash":f}),_e=t=>({"cursor-move":t}),be=t=>({"justify-content-between":t}),fe=t=>({link:t});function ge(t,f){if(t&1&&(r(0,"div",0)(1,"div",19)(2,"h5",20),c(3),s(4,"translate"),a()()()),t&2){let e=p().$implicit,i=p(2);o(2),_("ngClass",B(4,_e,!i.isMobile)),o(),S(" ",e.name==="Default Room"?l(4,2,"accessories.control.default_room"):e.name," ")}}function ve(t,f){if(t&1&&(r(0,"div",23),m(1,"app-accessory-tile",24),a()),t&2){let e=p().$implicit;o(),_("service",e)}}function xe(t,f){if(t&1&&M(0,ve,2,1,"div",23),t&2){let e=f.$implicit,i=p(4);w(!i.hideHidden||!e.hidden?0:-1)}}function Ce(t,f){if(t&1){let e=T();r(0,"div",21),E("dragulaModelChange",function(n){x(e);let d=p().$implicit;return A(d.services,n)||(d.services=n),C(n)}),V(1,xe,1,1,null,null,$),m(3,"div",22)(4,"div",22)(5,"div",22)(6,"div",22)(7,"div",22)(8,"div",22)(9,"div",22)(10,"div",22)(11,"div",22)(12,"div",22),a()}if(t&2){let e=p().$implicit,i=p(2);_("ngClass",B(3,be,i.isMobile))("dragula","services-bag"),k("dragulaModel",e.services),o(),F(e.services)}}function ye(t,f){if(t&1){let e=T();r(0,"div",25),E("dragulaModelChange",function(n){x(e);let d=p().$implicit;return A(d.services,n)||(d.services=n),C(n)}),m(1,"app-drag-here-placeholder",26),a()}if(t&2){let e=p().$implicit;_("dragula","services-bag"),k("dragulaModel",e.services)}}function he(t,f){if(t&1&&(r(0,"div"),M(1,ge,5,6,"div",0),r(2,"div",16),M(3,Ce,13,5,"div",17),M(4,ye,2,2,"div",18),a()()),t&2){let e=f.$implicit,i=p(2);o(),w(!i.isMobile||e.services.length?1:-1),o(2),w(e.services.length?3:-1),o(),w(!e.services.length&&!i.isMobile?4:-1)}}function Me(t,f){if(t&1){let e=T();r(0,"div",1)(1,"div",2)(2,"h3",3),c(3),s(4,"translate"),a()(),r(5,"div",4)(6,"button",5),s(7,"translate"),b("click",function(){x(e);let n=p();return C(n.openSupport())}),m(8,"i",6),a()(),r(9,"div",7)(10,"button",8),s(11,"translate"),s(12,"translate"),b("click",function(){x(e);let n=p();return C(n.addRoom())}),m(13,"i",9),a(),r(14,"button",8),s(15,"translate"),s(16,"translate"),s(17,"translate"),s(18,"translate"),b("click",function(){x(e);let n=p();return C(n.hideHidden=!n.hideHidden)}),m(19,"i",10),a(),r(20,"div",11)(21,"button",12),s(22,"translate"),s(23,"translate"),b("click",function(){x(e);let n=p();return C(n.toggleLayoutLock())}),m(24,"i",13),a(),r(25,"button",12),s(26,"translate"),s(27,"translate"),b("click",function(){x(e);let n=p();return C(n.toggleLayoutLock())}),m(28,"i",14),a()(),r(29,"button",5),s(30,"translate"),b("click",function(){x(e);let n=p();return C(n.openSupport())}),m(31,"i",6),a()()(),r(32,"div",15),E("dragulaModelChange",function(n){x(e);let d=p();return A(d.$accessories.rooms,n)||(d.$accessories.rooms=n),C(n)}),V(33,he,5,3,"div",null,$),a()}if(t&2){let e=p();o(3),u(l(4,22,"menu.label_accessories")),o(3),v("aria-label",l(7,24,"support.title")),o(4),_("hidden",e.isMobile)("openDelay",150)("ngbTooltip",l(11,26,"accessories.button_add_room")),v("aria-label",l(12,28,"accessories.button_add_room")),o(4),_("hidden",e.isMobile)("openDelay",150)("ngbTooltip",e.hideHidden?l(15,30,"accessories.button_hidden_show"):l(16,32,"accessories.button_hidden_hide")),v("aria-label",e.hideHidden?l(17,34,"accessories.button_hidden_show"):l(18,36,"accessories.button_hidden_hide")),o(5),_("ngClass",R(48,ue,!e.hideHidden,e.hideHidden)),o(2),_("disabled",!e.isMobile)("openDelay",150)("ngbTooltip",l(22,38,"form.button_unlock")),v("aria-label",l(23,40,"form.button_unlock")),o(4),_("disabled",e.isMobile)("openDelay",150)("ngbTooltip",l(26,42,"form.button_lock")),v("aria-label",l(27,44,"form.button_lock")),o(4),v("aria-label",l(30,46,"support.title")),o(3),_("dragula","rooms-bag"),k("dragulaModel",e.$accessories.rooms),o(),F(e.$accessories.rooms)}}function we(t,f){t&1&&(r(0,"p",33),c(1),s(2,"translate"),a()),t&2&&(o(),u(l(2,1,"accessories.settings_link")))}function Se(t,f){if(t&1&&(r(0,"div",0)(1,"div",27)(2,"h3",28),c(3),s(4,"translate"),a()(),r(5,"div",29)(6,"div",30)(7,"h5",31),c(8),s(9,"translate"),a(),m(10,"p",32),s(11,"translate"),M(12,we,3,3,"p",33),a()()()),t&2){let e=p();o(3),u(l(4,4,"menu.label_accessories")),o(5),u(l(9,6,"accessories.control_disabled")),o(2),_("innerHTML",j(11,8,"accessories.message_must_use_insecure_mode",B(11,fe,e.linkInsecure)),L),o(2),w(e.isAdmin?12:-1)}}var nt=(()=>{class t{$accessories=g(ae);$auth=g(oe);dragulaService=g(ee);$modal=g(Y);$settings=g(ne);$md=g(se);orderSubscription;isAdmin=this.$auth.user.admin;enableAccessories=this.$settings.env.enableAccessories;isMobile=!1;hideHidden=!0;linkInsecure='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(i,n,d)=>!this.isMobile&&d.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:i=>!this.isMobile&&!i.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),this.isMobile=!0}ngOnInit(){this.$accessories.start()}addRoom(){this.$modal.open(de,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(i=>i.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?document.querySelectorAll(".services-bag").forEach(i=>{for(let n=0;n<10;n++){let d=document.createElement("div");d.className="accessory-box invisible py-0 my-0",d.style.height="0",i.appendChild(d)}}):document.querySelectorAll(".invisible").forEach(i=>i.remove())}openSupport(){this.$modal.open(ce,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=y({type:t,selectors:[["app-accessories"]],decls:2,vars:1,consts:[[1,"row"],[1,"row","mb-3"],[1,"col-9","col-sm-6"],[1,"primary-text","m-0"],[1,"col-3","col-sm-6","text-end","d-inline-block","d-sm-none"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"col-3","col-sm-6","text-end","d-none","d-sm-inline-block"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","hidden","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-folder-plus"],[1,"fas","fa-fw",3,"ngClass"],["role","group",1,"btn-group","me-2"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-unlock"],[1,"fas","fa-fw","fa-lock"],[3,"dragulaModelChange","dragula","dragulaModel"],[1,"row","mb-4"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"ngClass","dragula","dragulaModel"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragula","dragulaModel"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0","mb-1","mb-sm-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"dragulaModelChange","ngClass","dragula","dragulaModel"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0"],[1,"accessory-item","accessory-tab"],[3,"service"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragulaModelChange","dragula","dragulaModel"],[1,"no-drag"],[1,"col-12"],[1,"primary-text","m-0","mb-3"],[1,"col-12","text-center"],["role","alert",1,"alert","alert-warning","p-4"],[1,"mb-3","mt-0"],[1,"mb-0",3,"innerHTML"],[1,"mt-3","mb-0"]],template:function(i,n){i&1&&M(0,Me,35,51)(1,Se,13,13,"div",0),i&2&&w(n.enableAccessories?0:1)},dependencies:[Z,z,ie,te,re,pe,h],styles:[".room-title[_ngcontent-%COMP%]{margin-left:10px}@media (max-width: 575px){.room-title[_ngcontent-%COMP%]{margin-left:7px}}.services-bag[_ngcontent-%COMP%]{min-height:170px}@media (max-width: 575px){.services-bag[_ngcontent-%COMP%]{min-height:initial}}.cursor-move[_ngcontent-%COMP%]{cursor:move}.gu-transit[_ngcontent-%COMP%] .manage-accessory-button[_ngcontent-%COMP%]{display:none}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return t})();export{nt as AccessoriesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk-
|
|
1
|
+
import{a as w}from"./chunk-74TLD7UE.js";import"./chunk-2D7HQVKR.js";import{d as $}from"./chunk-YMAWYUA6.js";import{b as S}from"./chunk-HPUVHUIE.js";import{k as g,l as _,n as E,q as y}from"./chunk-7KLW5GIG.js";import{Ib as v,La as n,Vb as a,Wa as h,Wb as s,ja as o,lb as c,mb as d,mc as m,nc as l,vb as r,wb as i,xb as f}from"./chunk-V2XN5VIX.js";function T(t,u){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=v();n(),s(e.error)}}function C(t,u){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),f(5,"i",12),i()()),t&2&&(n(),s(l(2,1,"restart.please_wait_while_server_restarts")))}function k(t,u){t&1&&(r(0,"div",8),a(1),m(2,"translate"),i()),t&2&&(n(),s(l(2,1,"platform.linux.long_time")))}var z=(()=>{class t{$api=o(y);$router=o($);$settings=o(S);$toastr=o(E);$translate=o(g);$ws=o(w);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/linux/restart-host",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{console.error(e),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.linux.server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},3e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("platform.linux.server_taking_long_time"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},12e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=h({type:t,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"]],template:function(p,x){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),f(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),c(11,T,2,1,"div",7)(12,C,6,3),c(13,k,3,3,"div",8),i()()),p&2&&(n(2),s(l(3,4,"menu.restart.title")),n(7),s(l(10,6,"platform.linux.restarting_server")),n(2),d(x.error?11:12),n(2),d(x.timeout?13:-1))},dependencies:[_],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{z as RestartLinuxComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as r}from"./chunk-YMAWYUA6.js";import{Xa as e,fa as t}from"./chunk-V2XN5VIX.js";var m=[{path:"",loadComponent:()=>import("./chunk-
|
|
1
|
+
import{g as r}from"./chunk-YMAWYUA6.js";import{Xa as e,fa as t}from"./chunk-V2XN5VIX.js";var m=[{path:"",loadComponent:()=>import("./chunk-Z5TUCCAE.js").then(o=>o.PowerOptionsComponent)}],n=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[r.forChild(m),r]})}return o})();var d=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[n]})}return o})();export{d as PowerOptionsModule};
|