homebridge-config-ui-x 5.0.0-beta.113 → 5.0.0-beta.115
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 +16 -1
- package/dist/modules/platform-tools/docker/docker.service.js.map +1 -1
- package/dist/modules/plugins/plugins.service.js +8 -5
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/status/status.gateway.js.map +1 -1
- package/package.json +3 -3
- package/public/assets/hap-icons/vacuum-off.svg +34 -0
- package/public/assets/hap-icons/vacuum-on.svg +73 -0
- package/public/{chunk-JLAB57DY.js → chunk-2EFII46K.js} +1 -1
- package/public/{chunk-OBSUISSQ.js → chunk-2IUXG2EN.js} +1 -1
- package/public/{chunk-2TARYUWY.js → chunk-3H3N5KRW.js} +1 -1
- package/public/{chunk-RWWJ3AND.js → chunk-3S2WTI7E.js} +1 -1
- package/public/{chunk-GW2DVJRQ.js → chunk-3UCLNJIE.js} +1 -1
- package/public/{chunk-GBNJTVDU.js → chunk-42ME5L3R.js} +1 -1
- package/public/{chunk-HAAF32V3.js → chunk-4GSDDNS4.js} +1 -1
- package/public/{chunk-T27EJN3V.js → chunk-4LCIAXO2.js} +1 -1
- package/public/{chunk-ZT7I3BIJ.js → chunk-4QC4PBZL.js} +1 -1
- package/public/{chunk-LZTR2JMZ.js → chunk-6VMMFEEB.js} +1 -1
- package/public/chunk-6VTI52J2.js +1 -0
- package/public/{chunk-RD66VCFJ.js → chunk-6Y2OAEVG.js} +1 -1
- package/public/{chunk-PGM5AZZE.js → chunk-7UBIRML4.js} +1 -1
- package/public/chunk-AF3JBKYZ.js +1 -0
- package/public/{chunk-UD6SVFW2.js → chunk-BG5MCCBU.js} +1 -1
- package/public/{chunk-7YJPZ7IS.js → chunk-BMP5IKAG.js} +1 -1
- package/public/chunk-BTHUOI3P.js +1 -0
- package/public/chunk-C3GSKPPS.js +1 -0
- package/public/chunk-C3HWKB2Q.js +5 -0
- package/public/chunk-CHYWVK3W.js +1 -0
- package/public/{chunk-QJJWOZRV.js → chunk-CI2DUK2L.js} +1 -1
- package/public/{chunk-6HU2TIJU.js → chunk-CXANN4XV.js} +1 -1
- package/public/{chunk-X2SHRXXY.js → chunk-CXP6VKNZ.js} +1 -1
- package/public/{chunk-IN7NZAFJ.js → chunk-D5MSFLIQ.js} +1 -1
- package/public/{chunk-JDMWYDGV.js → chunk-EI76KND2.js} +1 -1
- package/public/{chunk-F3ERQJVG.js → chunk-FDBWBMB3.js} +1 -1
- package/public/chunk-G5V7VNU6.js +12 -0
- package/public/{chunk-X7PVYZAE.js → chunk-GEIS2BWE.js} +1 -1
- package/public/{chunk-6QTT6WJB.js → chunk-GEO4DT7J.js} +1 -1
- package/public/{chunk-TXGBXF5X.js → chunk-HAE77KT7.js} +2 -2
- package/public/{chunk-GDFV4BMO.js → chunk-HUAADM2I.js} +1 -1
- package/public/chunk-IJLX5JKF.js +28 -0
- package/public/chunk-J2D4NQET.js +1 -0
- package/public/{chunk-QDCKP2LU.js → chunk-J7Q5BUJW.js} +1 -1
- package/public/chunk-JFX6FD7T.js +1 -0
- package/public/{chunk-5BKSPZCJ.js → chunk-K6OAGSPQ.js} +1 -1
- package/public/chunk-KFNXMHXX.js +1 -0
- package/public/chunk-LPOUENXE.js +1 -0
- package/public/{chunk-LMK6T7VD.js → chunk-M5CMDZZD.js} +1 -1
- package/public/{chunk-SJ6BD37Z.js → chunk-MHUXDZEF.js} +1 -1
- package/public/{chunk-CKYDFJZX.js → chunk-OWX3CBVC.js} +1 -1
- package/public/{chunk-CYNMODOM.js → chunk-PH3XR7JL.js} +1 -1
- package/public/chunk-PPPQR4O4.js +20 -0
- package/public/chunk-Q4CZ7LVK.js +2 -0
- package/public/{chunk-7EQ4BJZB.js → chunk-QIOCGI3G.js} +5 -5
- package/public/{chunk-OJS6YR32.js → chunk-QR4VLNDI.js} +1 -1
- package/public/{chunk-CS2GS4HN.js → chunk-QTTC6A7P.js} +1 -1
- package/public/{chunk-LXXELGX4.js → chunk-R3563DDE.js} +1 -1
- package/public/{chunk-PEVRU6AZ.js → chunk-RPHC6QJY.js} +1 -1
- package/public/{chunk-FCULIZZM.js → chunk-SCL7UVTQ.js} +1 -1
- package/public/{chunk-HLRE47IE.js → chunk-SE3VEIYB.js} +1 -1
- package/public/{chunk-YWLPA4JO.js → chunk-ST6S2EEM.js} +1 -1
- package/public/{chunk-NGNQPAAK.js → chunk-THGDS273.js} +1 -1
- package/public/{chunk-UPZVR4LA.js → chunk-TKTXNLQU.js} +1 -1
- package/public/{chunk-PWSXD4G2.js → chunk-U3OKAWTP.js} +1 -1
- package/public/chunk-ULJPS3WS.js +7 -0
- package/public/{chunk-QJHJSB5X.js → chunk-VEGQX5TF.js} +1 -1
- package/public/{chunk-GH54IGVT.js → chunk-VWBW7JSQ.js} +1 -1
- package/public/{chunk-UQYCFN3T.js → chunk-WDFAWIMZ.js} +7 -7
- package/public/{chunk-LI35R22H.js → chunk-WFXCEU4I.js} +1 -1
- package/public/chunk-WFYBML4S.js +1 -0
- package/public/{chunk-KWQDKO3N.js → chunk-XTBMSQM5.js} +1 -1
- package/public/{chunk-J6YDFLQQ.js → chunk-YJ2Q2RAD.js} +1 -1
- package/public/chunk-ZUYGS2P3.js +1 -0
- package/public/chunk-ZXNNCTE2.js +4 -0
- package/public/index.html +1 -1
- package/public/main-6ZIVRYGV.js +1 -0
- package/scripts/upgrade-install-plugin.sh +6 -1
- package/public/chunk-3LATV7D4.js +0 -12
- package/public/chunk-5SV3CLSS.js +0 -1
- package/public/chunk-7ZCMOMUZ.js +0 -4
- package/public/chunk-BHOIUF73.js +0 -1
- package/public/chunk-CF2ZN7LY.js +0 -5
- package/public/chunk-CHBDRXE6.js +0 -28
- package/public/chunk-D3NX55OC.js +0 -1
- package/public/chunk-DGHOEBLZ.js +0 -1
- package/public/chunk-ESR376KP.js +0 -1
- package/public/chunk-EZZ4JJTY.js +0 -1
- package/public/chunk-OSJWAVFW.js +0 -1
- package/public/chunk-RFLXMTDL.js +0 -20
- package/public/chunk-RM4HOGFF.js +0 -1
- package/public/chunk-SKZUTSHE.js +0 -7
- package/public/chunk-SRP6QX5M.js +0 -2
- package/public/chunk-T252YJXA.js +0 -1
- package/public/chunk-TQNKRJOX.js +0 -1
- package/public/chunk-Y55EO6OK.js +0 -1
- package/public/main-UTDT7FIF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,c as
|
|
1
|
+
import{A,c as $,d as C,e as R,f as O,g as T,j as w,m as q,p as z,q as D,w as H,x as G,z as Q}from"./chunk-WFYBML4S.js";import{b as K}from"./chunk-QR4VLNDI.js";import{d as U}from"./chunk-GEIS2BWE.js";import{b as J}from"./chunk-6Y2OAEVG.js";import{m as W}from"./chunk-K6OAGSPQ.js";import{b as j}from"./chunk-R3563DDE.js";import"./chunk-Q4CZ7LVK.js";import{Dc as f,Hc as l,Ib as u,Ic as d,Jb as c,M as I,Ob as m,Pb as r,Qb as a,Rb as s,Sc as b,Uc as V,Xa as x,ab as i,bc as E,dc as M,h as y,id as P,kc as v,la as p,lc as F,ld as B,mb as k,qc as g,rc as h,sc as L,w as S,zd as N}from"./chunk-ULJPS3WS.js";var Y=["password"],Z=["username"],ee=["otp"],te=e=>({background:e}),ie=e=>({anim:e}),X=e=>({"is-invalid":e});function ne(e,_){if(e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",13),a(),s(3,"input",14,0),l(5,"translate"),a(),r(6,"div",8)(7,"span",12),s(8,"i",15),a(),s(9,"input",16,1),l(11,"translate"),a()),e&2){let n=M();i(3),m("placeholder",d(5,4,"users.label_username"))("ngClass",f(8,X,n.form.controls.username.dirty&&n.form.controls.username.errors)),i(6),m("placeholder",d(11,6,"users.label_password"))("ngClass",f(10,X,n.form.controls.password.dirty&&n.form.controls.password.errors))}}function oe(e,_){e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",17),a(),s(3,"input",18,2),l(5,"translate"),a()),e&2&&(i(3),m("placeholder",d(5,1,"login.label_2fa_code")))}function ae(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_credentials")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}function re(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_code")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}var _e=(()=>{class e{$auth=p(K);$cdr=p(V);$router=p(U);$settings=p(J);targetRoute;passwordInput=b("password");usernameInput=b("username");otpInput=b("otp");backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;form;ngOnInit(){this.form=new T({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(I(500)).subscribe(n=>{let o=this.passwordInput()?.nativeElement.value;o&&o!==n.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}ngAfterViewChecked(){this.$cdr.detectChanges()}onSubmit(){return y(this,null,function*(){this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0,document.getElementById("submit-button")?.blur();let n=this.passwordInput()?.nativeElement.value;n&&n!==this.form.get("password").value&&this.form.controls.password.setValue(n);let o=this.usernameInput()?.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let t=this.otpInput()?.nativeElement.value;t&&t!==this.form.get("otp").value&&this.form.controls.username.setValue(t)}try{yield this.$auth.login(this.form.getRawValue()),this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}catch(t){t.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[C.required,C.minLength(6),C.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}this.inProgress=!1})}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield S(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let n=`${W.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${n}') center/cover`}})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=k({type:e,selectors:[["ng-component"]],viewQuery:function(o,t){o&1&&(v(t.passwordInput,Y,5),v(t.usernameInput,Z,5),v(t.otpInput,ee,5)),o&2&&F(3)},decls:15,vars:18,consts:[["username",""],["password",""],["otp",""],[1,"login-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","login-card","d-flex","py-4","flex-column"],["ngSrc","/assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],["novalidate","",3,"ngSubmit","formGroup"],[1,"mb-4","text-center"],[1,"input-group","mb-4"],[1,"input-group","no-border","mb-4"],[1,"text-center"],["tabindex","3","id","submit-button","type","submit",1,"btn","btn-primary","mb-2",3,"disabled"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-key","primary-text","fa-lg"],["formControlName","otp","type","text","id","form-ota","autofocus","","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","custom-input",3,"placeholder"],[1,"fas","fa-fw","fa-exclamation-triangle","pink-text","fa-lg"],[1,"form-control","custom-input"],[1,"small","grey-text","fw-semibold"],[1,"small","grey-text",3,"innerHTML"]],template:function(o,t){o&1&&(r(0,"div",3)(1,"div",4),s(2,"img",5),r(3,"form",6),E("ngSubmit",function(){return t.onSubmit()}),r(4,"h4",7),g(5),l(6,"translate"),a(),u(7,ne,12,12),u(8,oe,6,3,"div",8),u(9,ae,9,6,"div",9),u(10,re,9,6,"div",9),r(11,"div",10)(12,"button",11),g(13),l(14,"translate"),a()()()()()),o&2&&(m("ngStyle",f(14,te,t.backgroundStyle))("ngClass",f(16,ie,!t.backgroundStyle)),i(3),m("formGroup",t.form),i(2),h(d(6,10,"setup.welcome_to_homebridge")),i(2),c(t.twoFactorCodeRequired?-1:7),i(),c(t.twoFactorCodeRequired?8:-1),i(),c(t.invalidCredentials?9:-1),i(),c(t.invalid2faCode?10:-1),i(2),m("disabled",t.form.invalid),i(),L(" ",d(14,12,"form.label_continue")," "))},dependencies:[B,Q,q,$,R,O,H,G,A,z,D,P,N,j],styles:["body{overflow:scroll!important} body.dark-mode .login-card{background-color:#2b2b2b;color:#fff}.login-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.login-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.login-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}"]})}return e})();export{_e as LoginComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ca as xe,Fa as Se,H as ee,e as $,g as yt,ga as we,gb as te,ha as Me,i as Q,ka as ye,n as Z,nb as Oe,ob as ke,ub as Ie,x as Ce}from"./chunk-SKZUTSHE.js";var $e=$((Jt,De)=>{De.exports=function(r,a){return Array.prototype.slice.call(r,a)}});var Ne=$((Qt,Re)=>{var xt=typeof setImmediate=="function",re;xt?re=function(e){setImmediate(e)}:re=function(e){setTimeout(e,0)};Re.exports=re});var Ye=$((Zt,Xe)=>{"use strict";var St=Ne();Xe.exports=function(r,a,t){r&&St(function(){r.apply(t||null,a||[])})}});var Be=$((er,je)=>{"use strict";var Fe=$e(),Ot=Ye();je.exports=function(r,a){var t=a||{},n={};return r===void 0&&(r={}),r.on=function(i,u){return n[i]?n[i].push(u):n[i]=[u],r},r.once=function(i,u){return u._once=!0,r.on(i,u),r},r.off=function(i,u){var s=arguments.length;if(s===1)delete n[i];else if(s===0)n={};else{var d=n[i];if(!d)return r;d.splice(d.indexOf(u),1)}return r},r.emit=function(){var i=Fe(arguments);return r.emitterSnapshot(i.shift()).apply(this,i)},r.emitterSnapshot=function(i){var u=(n[i]||[]).slice(0);return function(){var s=Fe(arguments),d=this||r;if(i==="error"&&t.throws!==!1&&!u.length)throw s.length===1?s[0]:s;return u.forEach(function(p){t.async?Ot(p,s,d):p.apply(d,s),p._once&&r.off(i,p)}),r}},r}});var qe=$((tr,Ae)=>{var Pe=global.CustomEvent;function kt(){try{var e=new Pe("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}Ae.exports=kt()?Pe:typeof document<"u"&&typeof document.createEvent=="function"?function(r,a){var t=document.createEvent("CustomEvent");return a?t.initCustomEvent(r,a.bubbles,a.cancelable,a.detail):t.initCustomEvent(r,!1,!1,void 0),t}:function(r,a){var t=document.createEventObject();return t.type=r,a?(t.bubbles=!!a.bubbles,t.cancelable=!!a.cancelable,t.detail=a.detail):(t.bubbles=!1,t.cancelable=!1,t.detail=void 0),t}});var Ge=$((rr,Ve)=>{"use strict";var Te=[],ne="",It=/^on/;for(ne in global)It.test(ne)&&Te.push(ne.slice(2));Ve.exports=Te});var Ke=$((nr,ze)=>{"use strict";var Dt=qe(),$t=Ge(),H=global.document,He=Rt,Le=Xt,q=[];global.addEventListener||(He=Nt,Le=Yt);ze.exports={add:He,remove:Le,fabricate:Ft};function Rt(e,r,a,t){return e.addEventListener(r,a,t)}function Nt(e,r,a){return e.attachEvent("on"+r,Bt(e,r,a))}function Xt(e,r,a,t){return e.removeEventListener(r,a,t)}function Yt(e,r,a){var t=_e(e,r,a);if(t)return e.detachEvent("on"+r,t)}function Ft(e,r,a){var t=$t.indexOf(r)===-1?i():n();e.dispatchEvent?e.dispatchEvent(t):e.fireEvent("on"+r,t);function n(){var u;return H.createEvent?(u=H.createEvent("Event"),u.initEvent(r,!0,!0)):H.createEventObject&&(u=H.createEventObject()),u}function i(){return new Dt(r,{detail:a})}}function jt(e,r,a){return function(n){var i=n||global.event;i.target=i.target||i.srcElement,i.preventDefault=i.preventDefault||function(){i.returnValue=!1},i.stopPropagation=i.stopPropagation||function(){i.cancelBubble=!0},i.which=i.which||i.keyCode,a.call(e,i)}}function Bt(e,r,a){var t=_e(e,r,a)||jt(e,r,a);return q.push({wrapper:t,element:e,type:r,fn:a}),t}function _e(e,r,a){var t=Pt(e,r,a);if(t){var n=q[t].wrapper;return q.splice(t,1),n}}function Pt(e,r,a){var t,n;for(t=0;t<q.length;t++)if(n=q[t],n.element===e&&n.type===r&&n.fn===a)return t}});var Qe=$((ir,Je)=>{"use strict";var Ue={},At="(?:^|\\s)",qt="(?:\\s|$)";function We(e){var r=Ue[e];return r?r.lastIndex=0:Ue[e]=r=new RegExp(At+e+qt,"g"),r}function Tt(e,r){var a=e.className;a.length?We(r).test(a)||(e.className+=" "+r):e.className=r}function Vt(e,r){e.className=e.className.replace(We(r)," ").trim()}Je.exports={add:Tt,rm:Vt}});var ut=$((or,st)=>{"use strict";var Gt=Be(),P=Ke(),X=Qe(),A=document,D=A.documentElement;function Ht(e,r){var a=arguments.length;a===1&&Array.isArray(e)===!1&&(r=e,e=[]);var t,n,i,u,s,d,b,p,w,h,C,M=null,O,c=r||{};c.moves===void 0&&(c.moves=rt),c.accepts===void 0&&(c.accepts=rt),c.invalid===void 0&&(c.invalid=ht),c.containers===void 0&&(c.containers=e||[]),c.isContainer===void 0&&(c.isContainer=_t),c.copy===void 0&&(c.copy=!1),c.copySortSource===void 0&&(c.copySortSource=!1),c.revertOnSpill===void 0&&(c.revertOnSpill=!1),c.removeOnSpill===void 0&&(c.removeOnSpill=!1),c.direction===void 0&&(c.direction="vertical"),c.ignoreInputTextSelection===void 0&&(c.ignoreInputTextSelection=!0),c.mirrorContainer===void 0&&(c.mirrorContainer=A.body);var g=Gt({containers:c.containers,start:vt,end:fe,cancel:pe,remove:me,destroy:ct,canMove:ft,dragging:!1});return c.removeOnSpill===!0&&g.on("over",mt).on("out",pt),ue(),g;function L(o){return g.containers.indexOf(o)!==-1||c.isContainer(o)}function ue(o){var l=o?"remove":"add";T(D,l,"mousedown",lt),T(D,l,"mouseup",K)}function _(o){var l=o?"remove":"add";T(D,l,"mousemove",dt)}function ce(o){var l=o?"remove":"add";P[l](D,"selectstart",le),P[l](D,"click",le)}function ct(){ue(!0),K({})}function le(o){O&&o.preventDefault()}function lt(o){d=o.clientX,b=o.clientY;var l=Ze(o)!==1||o.metaKey||o.ctrlKey;if(!l){var f=o.target,m=z(f);m&&(O=m,_(),o.type==="mousedown"&&(ot(f)?f.focus():o.preventDefault()))}}function dt(o){if(O){if(Ze(o)===0){K({});return}if(!(o.clientX!==void 0&&Math.abs(o.clientX-d)<=(c.slideFactorX||0)&&o.clientY!==void 0&&Math.abs(o.clientY-b)<=(c.slideFactorY||0))){if(c.ignoreInputTextSelection){var l=Y("clientX",o)||0,f=Y("clientY",o)||0,m=A.elementFromPoint(l,f);if(ot(m))return}var x=O;_(!0),ce(),fe(),de(x);var E=Lt(i);u=Y("pageX",o)-E.left,s=Y("pageY",o)-E.top,X.add(h||i,"gu-transit"),gt(),J(o)}}}function z(o){if(!(g.dragging&&t)&&!L(o)){for(var l=o;S(o)&&L(S(o))===!1;)if(c.invalid(o,l)||(o=S(o),!o))return;var f=S(o);if(f&&!c.invalid(o,l)){var m=c.moves(o,f,l,V(o));if(m)return{item:o,source:f}}}}function ft(o){return!!z(o)}function vt(o){var l=z(o);l&&de(l)}function de(o){Et(o.item,o.source)&&(h=o.item.cloneNode(!0),g.emit("cloned",h,o.item,"copy")),n=o.source,i=o.item,p=w=V(o.item),g.dragging=!0,g.emit("drag",i,n)}function ht(){return!1}function fe(){if(g.dragging){var o=h||i;he(o,S(o))}}function ve(){O=!1,_(!0),ce(!0)}function K(o){if(ve(),!!g.dragging){var l=h||i,f=Y("clientX",o)||0,m=Y("clientY",o)||0,x=tt(t,f,m),E=ge(x,f,m);E&&(h&&c.copySortSource||!h||E!==n)?he(l,E):c.removeOnSpill?me():pe()}}function he(o,l){var f=S(o);h&&c.copySortSource&&l===n&&f.removeChild(i),W(l)?g.emit("cancel",o,n,n):g.emit("drop",o,l,n,w),U()}function me(){if(g.dragging){var o=h||i,l=S(o);l&&l.removeChild(o),g.emit(h?"cancel":"remove",o,l,n),U()}}function pe(o){if(g.dragging){var l=arguments.length>0?o:c.revertOnSpill,f=h||i,m=S(f),x=W(m);x===!1&&l&&(h?m&&m.removeChild(h):n.insertBefore(f,p)),x||l?g.emit("cancel",f,n,n):g.emit("drop",f,m,n,w),U()}}function U(){var o=h||i;ve(),bt(),o&&X.rm(o,"gu-transit"),C&&clearTimeout(C),g.dragging=!1,M&&g.emit("out",o,M,n),g.emit("dragend",o),n=i=h=p=w=C=M=null}function W(o,l){var f;return l!==void 0?f=l:t?f=w:f=V(h||i),o===n&&f===p}function ge(o,l,f){for(var m=o;m&&!x();)m=S(m);return m;function x(){var E=L(m);if(E===!1)return!1;var B=be(m,o),y=Ee(m,B,l,f),R=W(m,y);return R?!0:c.accepts(i,m,n,y)}}function J(o){if(!t)return;o.preventDefault();var l=Y("clientX",o)||0,f=Y("clientY",o)||0,m=l-u,x=f-s;t.style.left=m+"px",t.style.top=x+"px";var E=h||i,B=tt(t,l,f),y=ge(B,l,f),R=y!==null&&y!==M;(R||y===null)&&(wt(),M=y,Ct());var k=S(E);if(y===n&&h&&!c.copySortSource){k&&k.removeChild(E);return}var I,F=be(y,B);if(F!==null)I=Ee(y,F,l,f);else if(c.revertOnSpill===!0&&!h)I=p,y=n;else{h&&k&&k.removeChild(E);return}(I===null&&R||I!==E&&I!==V(E))&&(w=I,y.insertBefore(E,I),g.emit("shadow",E,y,n));function N(Mt){g.emit(Mt,E,M,n)}function Ct(){R&&N("over")}function wt(){M&&N("out")}}function mt(o){X.rm(o,"gu-hide")}function pt(o){g.dragging&&X.add(o,"gu-hide")}function gt(){if(!t){var o=i.getBoundingClientRect();t=i.cloneNode(!0),t.style.width=nt(o)+"px",t.style.height=it(o)+"px",X.rm(t,"gu-transit"),X.add(t,"gu-mirror"),c.mirrorContainer.appendChild(t),T(D,"add","mousemove",J),X.add(c.mirrorContainer,"gu-unselectable"),g.emit("cloned",t,i,"mirror")}}function bt(){t&&(X.rm(c.mirrorContainer,"gu-unselectable"),T(D,"remove","mousemove",J),S(t).removeChild(t),t=null)}function be(o,l){for(var f=l;f!==o&&S(f)!==o;)f=S(f);return f===D?null:f}function Ee(o,l,f,m){var x=c.direction==="horizontal",E=l!==o?y():B();return E;function B(){var k=o.children.length,I,F,N;for(I=0;I<k;I++)if(F=o.children[I],N=F.getBoundingClientRect(),x&&N.left+N.width/2>f||!x&&N.top+N.height/2>m)return F;return null}function y(){var k=l.getBoundingClientRect();return R(x?f>k.left+nt(k)/2:m>k.top+it(k)/2)}function R(k){return k?V(l):l}}function Et(o,l){return typeof c.copy=="boolean"?c.copy:c.copy(o,l)}}function T(e,r,a,t){var n={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},i={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},u={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};global.navigator.pointerEnabled?P[r](e,i[a],t):global.navigator.msPointerEnabled?P[r](e,u[a],t):(P[r](e,n[a],t),P[r](e,a,t))}function Ze(e){if(e.touches!==void 0)return e.touches.length;if(e.which!==void 0&&e.which!==0)return e.which;if(e.buttons!==void 0)return e.buttons;var r=e.button;if(r!==void 0)return r&1?1:r&2?3:r&4?2:0}function Lt(e){var r=e.getBoundingClientRect();return{left:r.left+et("scrollLeft","pageXOffset"),top:r.top+et("scrollTop","pageYOffset")}}function et(e,r){return typeof global[r]<"u"?global[r]:D.clientHeight?D[e]:A.body[e]}function tt(e,r,a){e=e||{};var t=e.className||"",n;return e.className+=" gu-hide",n=A.elementFromPoint(r,a),e.className=t,n}function _t(){return!1}function rt(){return!0}function nt(e){return e.width||e.right-e.left}function it(e){return e.height||e.bottom-e.top}function S(e){return e.parentNode===A?null:e.parentNode}function ot(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"||at(e)}function at(e){return!e||e.contentEditable==="false"?!1:e.contentEditable==="true"?!0:at(S(e))}function V(e){return e.nextElementSibling||r();function r(){var a=e;do a=a.nextSibling;while(a&&a.nodeType!==1);return a}}function zt(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}function Y(e,r){var a=zt(r),t={pageX:"clientX",pageY:"clientY"};return e in t&&!(e in a)&&t[e]in a&&(e=t[e]),a[e]}st.exports=Ht});var se=yt(ut(),1),ie=class{constructor(r,a,t){this.name=r,this.drake=a,this.options=t,this.initEvents=!1}},v=function(e){return e.Cancel="cancel",e.Cloned="cloned",e.Drag="drag",e.DragEnd="dragend",e.Drop="drop",e.Out="out",e.Over="over",e.Remove="remove",e.Shadow="shadow",e.DropModel="dropModel",e.RemoveModel="removeModel",e}(v||{}),Kt=Object.keys(v).map(e=>v[e]),Ut=se.default||se,G=class{constructor(r=Ut){this.build=r}},j=(e,r,a)=>t=>t.pipe(ee(({event:n,name:i})=>n===e&&(r===void 0||i===r)),Ce(({name:n,args:i})=>a(n,i))),Wt=(e,[r,a,t])=>({name:e,el:r,container:a,source:t}),oe=(()=>{let r=class r{constructor(t){this.drakeFactory=t,this.groups={},this.dispatch$=new Z,this.elContainerSource=n=>i=>this.dispatch$.pipe(j(n,i,Wt)),this.cancel=this.elContainerSource(v.Cancel),this.remove=this.elContainerSource(v.Remove),this.shadow=this.elContainerSource(v.Shadow),this.over=this.elContainerSource(v.Over),this.out=this.elContainerSource(v.Out),this.drag=n=>this.dispatch$.pipe(j(v.Drag,n,(i,[u,s])=>({name:i,el:u,source:s}))),this.dragend=n=>this.dispatch$.pipe(j(v.DragEnd,n,(i,[u])=>({name:i,el:u}))),this.drop=n=>this.dispatch$.pipe(j(v.Drop,n,(i,[u,s,d,b])=>({name:i,el:u,target:s,source:d,sibling:b}))),this.cloned=n=>this.dispatch$.pipe(j(v.Cloned,n,(i,[u,s,d])=>({name:i,clone:u,original:s,cloneType:d}))),this.dropModel=n=>this.dispatch$.pipe(j(v.DropModel,n,(i,[u,s,d,b,p,w,h,C,M])=>({name:i,el:u,target:s,source:d,sibling:b,item:p,sourceModel:w,targetModel:h,sourceIndex:C,targetIndex:M}))),this.removeModel=n=>this.dispatch$.pipe(j(v.RemoveModel,n,(i,[u,s,d,b,p,w])=>({name:i,el:u,container:s,source:d,item:b,sourceModel:p,sourceIndex:w}))),(this.drakeFactory===null||this.drakeFactory===void 0)&&(this.drakeFactory=new G)}add(t){if(this.find(t.name))throw new Error('Group named: "'+t.name+'" already exists.');return this.groups[t.name]=t,this.handleModels(t),this.setupEvents(t),t}find(t){return this.groups[t]}destroy(t){let n=this.find(t);n&&(n.drake&&n.drake.destroy(),delete this.groups[t])}createGroup(t,n){return this.add(new ie(t,this.drakeFactory.build([],n),n))}handleModels({name:t,drake:n,options:i}){let u,s,d;n.on("remove",(b,p,w)=>{if(!n.models)return;let h=n.models[n.containers.indexOf(w)];h=h.slice(0);let C=h.splice(s,1)[0];this.dispatch$.next({event:v.RemoveModel,name:t,args:[b,p,w,C,h,s]})}),n.on("drag",(b,p)=>{n.models&&(u=b,s=this.domIndexOf(b,p))}),n.on("drop",(b,p,w,h)=>{if(!n.models||!p)return;d=this.domIndexOf(b,p);let C=n.models[n.containers.indexOf(w)],M=n.models[n.containers.indexOf(p)],O;if(p===w)C=C.slice(0),O=C.splice(s,1)[0],C.splice(d,0,O),M=C;else{let c=u!==b;if(O=C[s],c){if(!i.copyItem)throw new Error("If you have enabled `copy` on a group, you must provide a `copyItem` function.");O=i.copyItem(O)}if(c||(C=C.slice(0),C.splice(s,1)),M=M.slice(0),M.splice(d,0,O),c)try{p.removeChild(b)}catch{}}this.dispatch$.next({event:v.DropModel,name:t,args:[b,p,w,h,O,C,M,s,d]})})}setupEvents(t){if(t.initEvents)return;t.initEvents=!0;let n=t.name,i=this,u=s=>{switch(s){case v.Drag:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.Drop:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.DragEnd:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.Cancel:case v.Remove:case v.Shadow:case v.Over:case v.Out:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.Cloned:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.DropModel:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.RemoveModel:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;default:break}};Kt.forEach(u)}domIndexOf(t,n){if(n)return Array.prototype.indexOf.call(n.children,t)}};r.\u0275fac=function(n){return new(n||r)(ye(G,8))},r.\u0275prov=we({token:r,factory:r.\u0275fac,providedIn:"root"});let e=r;return e})(),pr=(()=>{let r=class r{get container(){return this.el&&this.el.nativeElement}constructor(t,n){this.el=t,this.dragulaService=n,this.dragulaModelChange=new Ie}ngOnChanges(t){if(t&&t.dragula){let{previousValue:n,currentValue:i,firstChange:u}=t.dragula,s=!!n,d=!!i;s&&this.teardown(n),d&&this.setup()}else if(t&&t.dragulaModel){let{previousValue:n,currentValue:i,firstChange:u}=t.dragulaModel,s=this.group?.drake;if(this.dragula&&s){s.models=s.models||[];let d=s.models.indexOf(n);d!==-1?(s.models.splice(d,1),i&&s.models.splice(d,0,i)):i&&s.models.push(i)}}}setup(){let t=i=>{this.dragulaModel&&(i.drake?.models?i.drake?.models?.push(this.dragulaModel):i.drake&&(i.drake.models=[this.dragulaModel]))};if(!this.dragula)return;let n=this.dragulaService.find(this.dragula);if(!n){let i={};n=this.dragulaService.createGroup(this.dragula,i)}t(n),n.drake?.containers.push(this.container),this.subscribe(this.dragula),this.group=n}subscribe(t){this.subs=new Q,this.subs.add(this.dragulaService.dropModel(t).subscribe(({source:n,target:i,sourceModel:u,targetModel:s})=>{n===this.el.nativeElement?this.dragulaModelChange.emit(u):i===this.el.nativeElement&&this.dragulaModelChange.emit(s)})),this.subs.add(this.dragulaService.removeModel(t).subscribe(({source:n,sourceModel:i})=>{n===this.el.nativeElement&&this.dragulaModelChange.emit(i)}))}teardown(t){this.subs&&this.subs.unsubscribe();let n=this.dragulaService.find(t);if(n){let i=n.drake?.containers.indexOf(this.el.nativeElement);if(i!==-1&&n.drake?.containers.splice(i,1),this.dragulaModel&&n.drake&&n.drake.models){let u=n.drake.models.indexOf(this.dragulaModel);u!==-1&&n.drake.models.splice(u,1)}}}ngOnDestroy(){this.dragula&&this.teardown(this.dragula)}};r.\u0275fac=function(n){return new(n||r)(te(Se),te(oe))},r.\u0275dir=ke({type:r,selectors:[["","dragula",""]],inputs:{dragula:"dragula",dragulaModel:"dragulaModel"},outputs:{dragulaModelChange:"dragulaModelChange"},standalone:!1,features:[xe]});let e=r;return e})(),gr=(()=>{let r=class r{static forRoot(){return{ngModule:r,providers:[oe]}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275mod=Oe({type:r}),r.\u0275inj=Me({providers:[oe]});let e=r;return e})(),br=new G((e,r)=>new ae(e,r)),ae=class{constructor(r=[],a={},t){this.containers=r,this.options=a,this.models=t,this.emitter$=new Z,this.subs=new Q,this.dragging=!1}on(r,a){this.subs.add(this.emitter$.pipe(ee(({eventType:t})=>t===r)).subscribe(({eventType:t,args:n})=>{if(t===v.Drag){let i=Array.from(n),u=i[0],s=i[1];a(u,s);return}if(t===v.Drop){let i=Array.from(n),u=i[0],s=i[1],d=i[2],b=i[3];a(u,s,d,b);return}if(t===v.Remove){let i=Array.from(n),u=i[0],s=i[1],d=i[2];a(u,s,d);return}a(n)}))}start(r){this.dragging=!0}end(){this.dragging=!1}cancel(r){this.dragging=!1}canMove(r){return this.options.accepts?this.options.accepts(r):!1}remove(){this.dragging=!1}destroy(){this.subs.unsubscribe()}emit(r,...a){this.emitter$.next({eventType:r,args:a})}};export{oe as a,pr as b,gr as c};
|
|
1
|
+
import{Ca as xe,Fa as Se,H as ee,e as $,g as yt,ga as we,gb as te,ha as Me,i as Q,ka as ye,n as Z,nb as Oe,ob as ke,ub as Ie,x as Ce}from"./chunk-ULJPS3WS.js";var $e=$((Jt,De)=>{De.exports=function(r,a){return Array.prototype.slice.call(r,a)}});var Ne=$((Qt,Re)=>{var xt=typeof setImmediate=="function",re;xt?re=function(e){setImmediate(e)}:re=function(e){setTimeout(e,0)};Re.exports=re});var Ye=$((Zt,Xe)=>{"use strict";var St=Ne();Xe.exports=function(r,a,t){r&&St(function(){r.apply(t||null,a||[])})}});var Be=$((er,je)=>{"use strict";var Fe=$e(),Ot=Ye();je.exports=function(r,a){var t=a||{},n={};return r===void 0&&(r={}),r.on=function(i,u){return n[i]?n[i].push(u):n[i]=[u],r},r.once=function(i,u){return u._once=!0,r.on(i,u),r},r.off=function(i,u){var s=arguments.length;if(s===1)delete n[i];else if(s===0)n={};else{var d=n[i];if(!d)return r;d.splice(d.indexOf(u),1)}return r},r.emit=function(){var i=Fe(arguments);return r.emitterSnapshot(i.shift()).apply(this,i)},r.emitterSnapshot=function(i){var u=(n[i]||[]).slice(0);return function(){var s=Fe(arguments),d=this||r;if(i==="error"&&t.throws!==!1&&!u.length)throw s.length===1?s[0]:s;return u.forEach(function(p){t.async?Ot(p,s,d):p.apply(d,s),p._once&&r.off(i,p)}),r}},r}});var qe=$((tr,Ae)=>{var Pe=global.CustomEvent;function kt(){try{var e=new Pe("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}Ae.exports=kt()?Pe:typeof document<"u"&&typeof document.createEvent=="function"?function(r,a){var t=document.createEvent("CustomEvent");return a?t.initCustomEvent(r,a.bubbles,a.cancelable,a.detail):t.initCustomEvent(r,!1,!1,void 0),t}:function(r,a){var t=document.createEventObject();return t.type=r,a?(t.bubbles=!!a.bubbles,t.cancelable=!!a.cancelable,t.detail=a.detail):(t.bubbles=!1,t.cancelable=!1,t.detail=void 0),t}});var Ge=$((rr,Ve)=>{"use strict";var Te=[],ne="",It=/^on/;for(ne in global)It.test(ne)&&Te.push(ne.slice(2));Ve.exports=Te});var Ke=$((nr,ze)=>{"use strict";var Dt=qe(),$t=Ge(),H=global.document,He=Rt,Le=Xt,q=[];global.addEventListener||(He=Nt,Le=Yt);ze.exports={add:He,remove:Le,fabricate:Ft};function Rt(e,r,a,t){return e.addEventListener(r,a,t)}function Nt(e,r,a){return e.attachEvent("on"+r,Bt(e,r,a))}function Xt(e,r,a,t){return e.removeEventListener(r,a,t)}function Yt(e,r,a){var t=_e(e,r,a);if(t)return e.detachEvent("on"+r,t)}function Ft(e,r,a){var t=$t.indexOf(r)===-1?i():n();e.dispatchEvent?e.dispatchEvent(t):e.fireEvent("on"+r,t);function n(){var u;return H.createEvent?(u=H.createEvent("Event"),u.initEvent(r,!0,!0)):H.createEventObject&&(u=H.createEventObject()),u}function i(){return new Dt(r,{detail:a})}}function jt(e,r,a){return function(n){var i=n||global.event;i.target=i.target||i.srcElement,i.preventDefault=i.preventDefault||function(){i.returnValue=!1},i.stopPropagation=i.stopPropagation||function(){i.cancelBubble=!0},i.which=i.which||i.keyCode,a.call(e,i)}}function Bt(e,r,a){var t=_e(e,r,a)||jt(e,r,a);return q.push({wrapper:t,element:e,type:r,fn:a}),t}function _e(e,r,a){var t=Pt(e,r,a);if(t){var n=q[t].wrapper;return q.splice(t,1),n}}function Pt(e,r,a){var t,n;for(t=0;t<q.length;t++)if(n=q[t],n.element===e&&n.type===r&&n.fn===a)return t}});var Qe=$((ir,Je)=>{"use strict";var Ue={},At="(?:^|\\s)",qt="(?:\\s|$)";function We(e){var r=Ue[e];return r?r.lastIndex=0:Ue[e]=r=new RegExp(At+e+qt,"g"),r}function Tt(e,r){var a=e.className;a.length?We(r).test(a)||(e.className+=" "+r):e.className=r}function Vt(e,r){e.className=e.className.replace(We(r)," ").trim()}Je.exports={add:Tt,rm:Vt}});var ut=$((or,st)=>{"use strict";var Gt=Be(),P=Ke(),X=Qe(),A=document,D=A.documentElement;function Ht(e,r){var a=arguments.length;a===1&&Array.isArray(e)===!1&&(r=e,e=[]);var t,n,i,u,s,d,b,p,w,h,C,M=null,O,c=r||{};c.moves===void 0&&(c.moves=rt),c.accepts===void 0&&(c.accepts=rt),c.invalid===void 0&&(c.invalid=ht),c.containers===void 0&&(c.containers=e||[]),c.isContainer===void 0&&(c.isContainer=_t),c.copy===void 0&&(c.copy=!1),c.copySortSource===void 0&&(c.copySortSource=!1),c.revertOnSpill===void 0&&(c.revertOnSpill=!1),c.removeOnSpill===void 0&&(c.removeOnSpill=!1),c.direction===void 0&&(c.direction="vertical"),c.ignoreInputTextSelection===void 0&&(c.ignoreInputTextSelection=!0),c.mirrorContainer===void 0&&(c.mirrorContainer=A.body);var g=Gt({containers:c.containers,start:vt,end:fe,cancel:pe,remove:me,destroy:ct,canMove:ft,dragging:!1});return c.removeOnSpill===!0&&g.on("over",mt).on("out",pt),ue(),g;function L(o){return g.containers.indexOf(o)!==-1||c.isContainer(o)}function ue(o){var l=o?"remove":"add";T(D,l,"mousedown",lt),T(D,l,"mouseup",K)}function _(o){var l=o?"remove":"add";T(D,l,"mousemove",dt)}function ce(o){var l=o?"remove":"add";P[l](D,"selectstart",le),P[l](D,"click",le)}function ct(){ue(!0),K({})}function le(o){O&&o.preventDefault()}function lt(o){d=o.clientX,b=o.clientY;var l=Ze(o)!==1||o.metaKey||o.ctrlKey;if(!l){var f=o.target,m=z(f);m&&(O=m,_(),o.type==="mousedown"&&(ot(f)?f.focus():o.preventDefault()))}}function dt(o){if(O){if(Ze(o)===0){K({});return}if(!(o.clientX!==void 0&&Math.abs(o.clientX-d)<=(c.slideFactorX||0)&&o.clientY!==void 0&&Math.abs(o.clientY-b)<=(c.slideFactorY||0))){if(c.ignoreInputTextSelection){var l=Y("clientX",o)||0,f=Y("clientY",o)||0,m=A.elementFromPoint(l,f);if(ot(m))return}var x=O;_(!0),ce(),fe(),de(x);var E=Lt(i);u=Y("pageX",o)-E.left,s=Y("pageY",o)-E.top,X.add(h||i,"gu-transit"),gt(),J(o)}}}function z(o){if(!(g.dragging&&t)&&!L(o)){for(var l=o;S(o)&&L(S(o))===!1;)if(c.invalid(o,l)||(o=S(o),!o))return;var f=S(o);if(f&&!c.invalid(o,l)){var m=c.moves(o,f,l,V(o));if(m)return{item:o,source:f}}}}function ft(o){return!!z(o)}function vt(o){var l=z(o);l&&de(l)}function de(o){Et(o.item,o.source)&&(h=o.item.cloneNode(!0),g.emit("cloned",h,o.item,"copy")),n=o.source,i=o.item,p=w=V(o.item),g.dragging=!0,g.emit("drag",i,n)}function ht(){return!1}function fe(){if(g.dragging){var o=h||i;he(o,S(o))}}function ve(){O=!1,_(!0),ce(!0)}function K(o){if(ve(),!!g.dragging){var l=h||i,f=Y("clientX",o)||0,m=Y("clientY",o)||0,x=tt(t,f,m),E=ge(x,f,m);E&&(h&&c.copySortSource||!h||E!==n)?he(l,E):c.removeOnSpill?me():pe()}}function he(o,l){var f=S(o);h&&c.copySortSource&&l===n&&f.removeChild(i),W(l)?g.emit("cancel",o,n,n):g.emit("drop",o,l,n,w),U()}function me(){if(g.dragging){var o=h||i,l=S(o);l&&l.removeChild(o),g.emit(h?"cancel":"remove",o,l,n),U()}}function pe(o){if(g.dragging){var l=arguments.length>0?o:c.revertOnSpill,f=h||i,m=S(f),x=W(m);x===!1&&l&&(h?m&&m.removeChild(h):n.insertBefore(f,p)),x||l?g.emit("cancel",f,n,n):g.emit("drop",f,m,n,w),U()}}function U(){var o=h||i;ve(),bt(),o&&X.rm(o,"gu-transit"),C&&clearTimeout(C),g.dragging=!1,M&&g.emit("out",o,M,n),g.emit("dragend",o),n=i=h=p=w=C=M=null}function W(o,l){var f;return l!==void 0?f=l:t?f=w:f=V(h||i),o===n&&f===p}function ge(o,l,f){for(var m=o;m&&!x();)m=S(m);return m;function x(){var E=L(m);if(E===!1)return!1;var B=be(m,o),y=Ee(m,B,l,f),R=W(m,y);return R?!0:c.accepts(i,m,n,y)}}function J(o){if(!t)return;o.preventDefault();var l=Y("clientX",o)||0,f=Y("clientY",o)||0,m=l-u,x=f-s;t.style.left=m+"px",t.style.top=x+"px";var E=h||i,B=tt(t,l,f),y=ge(B,l,f),R=y!==null&&y!==M;(R||y===null)&&(wt(),M=y,Ct());var k=S(E);if(y===n&&h&&!c.copySortSource){k&&k.removeChild(E);return}var I,F=be(y,B);if(F!==null)I=Ee(y,F,l,f);else if(c.revertOnSpill===!0&&!h)I=p,y=n;else{h&&k&&k.removeChild(E);return}(I===null&&R||I!==E&&I!==V(E))&&(w=I,y.insertBefore(E,I),g.emit("shadow",E,y,n));function N(Mt){g.emit(Mt,E,M,n)}function Ct(){R&&N("over")}function wt(){M&&N("out")}}function mt(o){X.rm(o,"gu-hide")}function pt(o){g.dragging&&X.add(o,"gu-hide")}function gt(){if(!t){var o=i.getBoundingClientRect();t=i.cloneNode(!0),t.style.width=nt(o)+"px",t.style.height=it(o)+"px",X.rm(t,"gu-transit"),X.add(t,"gu-mirror"),c.mirrorContainer.appendChild(t),T(D,"add","mousemove",J),X.add(c.mirrorContainer,"gu-unselectable"),g.emit("cloned",t,i,"mirror")}}function bt(){t&&(X.rm(c.mirrorContainer,"gu-unselectable"),T(D,"remove","mousemove",J),S(t).removeChild(t),t=null)}function be(o,l){for(var f=l;f!==o&&S(f)!==o;)f=S(f);return f===D?null:f}function Ee(o,l,f,m){var x=c.direction==="horizontal",E=l!==o?y():B();return E;function B(){var k=o.children.length,I,F,N;for(I=0;I<k;I++)if(F=o.children[I],N=F.getBoundingClientRect(),x&&N.left+N.width/2>f||!x&&N.top+N.height/2>m)return F;return null}function y(){var k=l.getBoundingClientRect();return R(x?f>k.left+nt(k)/2:m>k.top+it(k)/2)}function R(k){return k?V(l):l}}function Et(o,l){return typeof c.copy=="boolean"?c.copy:c.copy(o,l)}}function T(e,r,a,t){var n={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},i={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},u={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};global.navigator.pointerEnabled?P[r](e,i[a],t):global.navigator.msPointerEnabled?P[r](e,u[a],t):(P[r](e,n[a],t),P[r](e,a,t))}function Ze(e){if(e.touches!==void 0)return e.touches.length;if(e.which!==void 0&&e.which!==0)return e.which;if(e.buttons!==void 0)return e.buttons;var r=e.button;if(r!==void 0)return r&1?1:r&2?3:r&4?2:0}function Lt(e){var r=e.getBoundingClientRect();return{left:r.left+et("scrollLeft","pageXOffset"),top:r.top+et("scrollTop","pageYOffset")}}function et(e,r){return typeof global[r]<"u"?global[r]:D.clientHeight?D[e]:A.body[e]}function tt(e,r,a){e=e||{};var t=e.className||"",n;return e.className+=" gu-hide",n=A.elementFromPoint(r,a),e.className=t,n}function _t(){return!1}function rt(){return!0}function nt(e){return e.width||e.right-e.left}function it(e){return e.height||e.bottom-e.top}function S(e){return e.parentNode===A?null:e.parentNode}function ot(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"||at(e)}function at(e){return!e||e.contentEditable==="false"?!1:e.contentEditable==="true"?!0:at(S(e))}function V(e){return e.nextElementSibling||r();function r(){var a=e;do a=a.nextSibling;while(a&&a.nodeType!==1);return a}}function zt(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}function Y(e,r){var a=zt(r),t={pageX:"clientX",pageY:"clientY"};return e in t&&!(e in a)&&t[e]in a&&(e=t[e]),a[e]}st.exports=Ht});var se=yt(ut(),1),ie=class{constructor(r,a,t){this.name=r,this.drake=a,this.options=t,this.initEvents=!1}},v=function(e){return e.Cancel="cancel",e.Cloned="cloned",e.Drag="drag",e.DragEnd="dragend",e.Drop="drop",e.Out="out",e.Over="over",e.Remove="remove",e.Shadow="shadow",e.DropModel="dropModel",e.RemoveModel="removeModel",e}(v||{}),Kt=Object.keys(v).map(e=>v[e]),Ut=se.default||se,G=class{constructor(r=Ut){this.build=r}},j=(e,r,a)=>t=>t.pipe(ee(({event:n,name:i})=>n===e&&(r===void 0||i===r)),Ce(({name:n,args:i})=>a(n,i))),Wt=(e,[r,a,t])=>({name:e,el:r,container:a,source:t}),oe=(()=>{let r=class r{constructor(t){this.drakeFactory=t,this.groups={},this.dispatch$=new Z,this.elContainerSource=n=>i=>this.dispatch$.pipe(j(n,i,Wt)),this.cancel=this.elContainerSource(v.Cancel),this.remove=this.elContainerSource(v.Remove),this.shadow=this.elContainerSource(v.Shadow),this.over=this.elContainerSource(v.Over),this.out=this.elContainerSource(v.Out),this.drag=n=>this.dispatch$.pipe(j(v.Drag,n,(i,[u,s])=>({name:i,el:u,source:s}))),this.dragend=n=>this.dispatch$.pipe(j(v.DragEnd,n,(i,[u])=>({name:i,el:u}))),this.drop=n=>this.dispatch$.pipe(j(v.Drop,n,(i,[u,s,d,b])=>({name:i,el:u,target:s,source:d,sibling:b}))),this.cloned=n=>this.dispatch$.pipe(j(v.Cloned,n,(i,[u,s,d])=>({name:i,clone:u,original:s,cloneType:d}))),this.dropModel=n=>this.dispatch$.pipe(j(v.DropModel,n,(i,[u,s,d,b,p,w,h,C,M])=>({name:i,el:u,target:s,source:d,sibling:b,item:p,sourceModel:w,targetModel:h,sourceIndex:C,targetIndex:M}))),this.removeModel=n=>this.dispatch$.pipe(j(v.RemoveModel,n,(i,[u,s,d,b,p,w])=>({name:i,el:u,container:s,source:d,item:b,sourceModel:p,sourceIndex:w}))),(this.drakeFactory===null||this.drakeFactory===void 0)&&(this.drakeFactory=new G)}add(t){if(this.find(t.name))throw new Error('Group named: "'+t.name+'" already exists.');return this.groups[t.name]=t,this.handleModels(t),this.setupEvents(t),t}find(t){return this.groups[t]}destroy(t){let n=this.find(t);n&&(n.drake&&n.drake.destroy(),delete this.groups[t])}createGroup(t,n){return this.add(new ie(t,this.drakeFactory.build([],n),n))}handleModels({name:t,drake:n,options:i}){let u,s,d;n.on("remove",(b,p,w)=>{if(!n.models)return;let h=n.models[n.containers.indexOf(w)];h=h.slice(0);let C=h.splice(s,1)[0];this.dispatch$.next({event:v.RemoveModel,name:t,args:[b,p,w,C,h,s]})}),n.on("drag",(b,p)=>{n.models&&(u=b,s=this.domIndexOf(b,p))}),n.on("drop",(b,p,w,h)=>{if(!n.models||!p)return;d=this.domIndexOf(b,p);let C=n.models[n.containers.indexOf(w)],M=n.models[n.containers.indexOf(p)],O;if(p===w)C=C.slice(0),O=C.splice(s,1)[0],C.splice(d,0,O),M=C;else{let c=u!==b;if(O=C[s],c){if(!i.copyItem)throw new Error("If you have enabled `copy` on a group, you must provide a `copyItem` function.");O=i.copyItem(O)}if(c||(C=C.slice(0),C.splice(s,1)),M=M.slice(0),M.splice(d,0,O),c)try{p.removeChild(b)}catch{}}this.dispatch$.next({event:v.DropModel,name:t,args:[b,p,w,h,O,C,M,s,d]})})}setupEvents(t){if(t.initEvents)return;t.initEvents=!0;let n=t.name,i=this,u=s=>{switch(s){case v.Drag:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.Drop:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.DragEnd:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.Cancel:case v.Remove:case v.Shadow:case v.Over:case v.Out:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.Cloned:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.DropModel:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;case v.RemoveModel:t.drake.on(s,(...d)=>{this.dispatch$.next({event:s,name:n,args:d})});break;default:break}};Kt.forEach(u)}domIndexOf(t,n){if(n)return Array.prototype.indexOf.call(n.children,t)}};r.\u0275fac=function(n){return new(n||r)(ye(G,8))},r.\u0275prov=we({token:r,factory:r.\u0275fac,providedIn:"root"});let e=r;return e})(),pr=(()=>{let r=class r{get container(){return this.el&&this.el.nativeElement}constructor(t,n){this.el=t,this.dragulaService=n,this.dragulaModelChange=new Ie}ngOnChanges(t){if(t&&t.dragula){let{previousValue:n,currentValue:i,firstChange:u}=t.dragula,s=!!n,d=!!i;s&&this.teardown(n),d&&this.setup()}else if(t&&t.dragulaModel){let{previousValue:n,currentValue:i,firstChange:u}=t.dragulaModel,s=this.group?.drake;if(this.dragula&&s){s.models=s.models||[];let d=s.models.indexOf(n);d!==-1?(s.models.splice(d,1),i&&s.models.splice(d,0,i)):i&&s.models.push(i)}}}setup(){let t=i=>{this.dragulaModel&&(i.drake?.models?i.drake?.models?.push(this.dragulaModel):i.drake&&(i.drake.models=[this.dragulaModel]))};if(!this.dragula)return;let n=this.dragulaService.find(this.dragula);if(!n){let i={};n=this.dragulaService.createGroup(this.dragula,i)}t(n),n.drake?.containers.push(this.container),this.subscribe(this.dragula),this.group=n}subscribe(t){this.subs=new Q,this.subs.add(this.dragulaService.dropModel(t).subscribe(({source:n,target:i,sourceModel:u,targetModel:s})=>{n===this.el.nativeElement?this.dragulaModelChange.emit(u):i===this.el.nativeElement&&this.dragulaModelChange.emit(s)})),this.subs.add(this.dragulaService.removeModel(t).subscribe(({source:n,sourceModel:i})=>{n===this.el.nativeElement&&this.dragulaModelChange.emit(i)}))}teardown(t){this.subs&&this.subs.unsubscribe();let n=this.dragulaService.find(t);if(n){let i=n.drake?.containers.indexOf(this.el.nativeElement);if(i!==-1&&n.drake?.containers.splice(i,1),this.dragulaModel&&n.drake&&n.drake.models){let u=n.drake.models.indexOf(this.dragulaModel);u!==-1&&n.drake.models.splice(u,1)}}}ngOnDestroy(){this.dragula&&this.teardown(this.dragula)}};r.\u0275fac=function(n){return new(n||r)(te(Se),te(oe))},r.\u0275dir=ke({type:r,selectors:[["","dragula",""]],inputs:{dragula:"dragula",dragulaModel:"dragulaModel"},outputs:{dragulaModelChange:"dragulaModelChange"},standalone:!1,features:[xe]});let e=r;return e})(),gr=(()=>{let r=class r{static forRoot(){return{ngModule:r,providers:[oe]}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275mod=Oe({type:r}),r.\u0275inj=Me({providers:[oe]});let e=r;return e})(),br=new G((e,r)=>new ae(e,r)),ae=class{constructor(r=[],a={},t){this.containers=r,this.options=a,this.models=t,this.emitter$=new Z,this.subs=new Q,this.dragging=!1}on(r,a){this.subs.add(this.emitter$.pipe(ee(({eventType:t})=>t===r)).subscribe(({eventType:t,args:n})=>{if(t===v.Drag){let i=Array.from(n),u=i[0],s=i[1];a(u,s);return}if(t===v.Drop){let i=Array.from(n),u=i[0],s=i[1],d=i[2],b=i[3];a(u,s,d,b);return}if(t===v.Remove){let i=Array.from(n),u=i[0],s=i[1],d=i[2];a(u,s,d);return}a(n)}))}start(r){this.dragging=!0}end(){this.dragging=!1}cancel(r){this.dragging=!1}canMove(r){return this.options.accepts?this.options.accepts(r):!1}remove(){this.dragging=!1}destroy(){this.subs.unsubscribe()}emit(r,...a){this.emitter$.next({eventType:r,args:a})}};export{oe as a,pr as b,gr as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ke}from"./chunk-SE3VEIYB.js";import{a as He}from"./chunk-6VMMFEEB.js";import{a as We}from"./chunk-FDBWBMB3.js";import{n as Ge}from"./chunk-IJLX5JKF.js";import"./chunk-WDFAWIMZ.js";import"./chunk-HUAADM2I.js";import"./chunk-THGDS273.js";import{b as pt}from"./chunk-RPHC6QJY.js";import{a as st,b as lt}from"./chunk-BG5MCCBU.js";import"./chunk-QIOCGI3G.js";import"./chunk-EI76KND2.js";import"./chunk-J7Q5BUJW.js";import"./chunk-CHYWVK3W.js";import{g as de,m as M,n as re,t as ce}from"./chunk-C3HWKB2Q.js";import{A as oe,b as ie,c as le,e as ne,j as w,k as Fe,l as Pe,n as Re,o as pe,r as Me,s as Ae,t as De,u as Ve,v as Ne,x as Le,z as ae}from"./chunk-WFYBML4S.js";import{a as Ue}from"./chunk-42ME5L3R.js";import"./chunk-QR4VLNDI.js";import{d as H,e as Oe}from"./chunk-GEIS2BWE.js";import{b as X}from"./chunk-6Y2OAEVG.js";import{c as $e,d as _e,f as se,g as ge,k as D,m as ze,n as V}from"./chunk-K6OAGSPQ.js";import{a as A,b as R}from"./chunk-R3563DDE.js";import{c as Be,d as Te}from"./chunk-Q4CZ7LVK.js";import{$b as K,Dc as N,Ec as F,Fc as ee,Hb as v,Hc as r,Ib as h,Ic as s,Jb as _,Jc as G,Lb as L,M as E,Mb as O,Nb as z,Ob as m,Pb as a,Qb as o,Rb as d,Sb as $,Tb as B,Ub as U,Xa as he,Ya as Ce,_b as k,ab as t,bc as S,cc as W,dc as b,g as ue,h as x,hc as xe,ic as Se,id as j,jc as ye,la as f,mb as P,nd as te,pd as we,qc as l,ra as y,rc as u,sa as I,sc as g,w as T,xc as Ie,yc as ke,zc as Ee}from"./chunk-ULJPS3WS.js";var je=(i,c)=>({"green-text":i,"grey-text":c});function dt(i,c){if(i&1){let e=k();a(0,"li",9)(1,"div",10),l(2),d(3,"br"),a(4,"small",11),d(5,"i",12),r(6,"translate"),l(7," \xB7 "),a(8,"span",13),l(9),o(),l(10),r(11,"titlecase"),o()(),a(12,"div",14)(13,"input",23),r(14,"translate"),S("click",function(){let p=y(e).$implicit,C=b();return I(C.toggleList(p._username))}),o(),d(15,"label",24),o()()}if(i&2){let e=c.$implicit,n=b();t(2),g(" ",e.name," "),t(3),m("ngbTooltip",s(6,10,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired"))("ngClass",F(16,je,e._isPaired,!e._isPaired)),t(4),u(e._username),t(),g(" \xB7 ",s(11,12,e._category)," "),t(3),m("id","hidePluginUpdates_"+e._username)("checked",!n.isInList(e._username))("disabled",n.clicked),v("aria-label",s(14,14,"form.button_allow")+" "+e.name),t(2),m("for","hidePluginUpdates_"+e._username)}}function ct(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"form.button_save")," ")}function mt(i,c){i&1&&d(0,"i",22)}var qe=(()=>{class i{$activeModal=f(M);$api=f(V);$settings=f(X);$toastr=f(D);$translate=f(A);originalBlacklist=[];updatedBlacklist=[];existingBlacklist=[];clicked=!1;mainPairing={};pairings=[];get blacklistHasUpdated(){return this.updatedBlacklist.join(",")!==this.originalBlacklist.join(",")}ngOnInit(){return x(this,null,function*(){this.updatedBlacklist=this.existingBlacklist.map(e=>e.trim().toUpperCase()).sort((e,n)=>e.localeCompare(n)),this.originalBlacklist=[...this.updatedBlacklist];try{let e=yield T(this.$api.get("/server/pairings"));this.mainPairing=e.find(n=>n._main),this.pairings=e.filter(n=>!n._main).sort((n,p)=>n.name.localeCompare(p.name))}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e){this.updatedBlacklist.includes(e)?this.updatedBlacklist=this.updatedBlacklist.filter(n=>n!==e):(this.updatedBlacklist.push(e),this.updatedBlacklist.sort((n,p)=>n.localeCompare(p)))}isInList(e){return this.updatedBlacklist.includes(e)}updateBlacklist(){return x(this,null,function*(){this.clicked=!0;try{yield T(this.$api.put("/config-editor/ui/accessory-control/instance-blacklist",{body:this.updatedBlacklist})),this.$settings.setEnvItem("accessoryControl.instanceBlacklist",this.updatedBlacklist),this.$activeModal.close()}catch(e){this.clicked=!1,console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],inputs:{existingBlacklist:"existingBlacklist"},decls:45,vars:34,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-list-check","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"text-start"],[1,"grey-text"],["container","body","openDelay","150","triggers","hover","placement","left",1,"fas","fa-fw","fa-link",3,"ngbTooltip","ngClass"],[1,"font-monospace"],[1,"text-end","grey-text","d-flex","align-items-center"],["type","checkbox","id","controlMainBridge",1,"rendux-input",3,"click","checked","disabled"],["for","controlMainBridge",1,"rendux-label","ms-3"],[1,"modal-footer","justify-content-between"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],["type","checkbox",1,"rendux-input",3,"click","id","checked","disabled"],[1,"rendux-label","ms-3",3,"for"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),S("click",function(){return p.dismissModal()}),o()(),a(7,"div",4)(8,"div",5),d(9,"i",6),o(),a(10,"ul",7)(11,"li"),l(12),r(13,"translate"),o(),a(14,"li"),l(15),r(16,"translate"),o()(),a(17,"ul",8)(18,"li",9)(19,"div",10),l(20),d(21,"br"),a(22,"small",11),d(23,"i",12),r(24,"translate"),l(25," \xB7 "),a(26,"span",13),l(27),o(),l(28," \xB7 Homebridge "),o()(),a(29,"div",14)(30,"input",15),r(31,"translate"),S("click",function(){return p.toggleList(p.mainPairing._username)}),o(),d(32,"label",16),o()(),O(33,dt,16,19,"li",9,L),o()(),a(35,"div",17)(36,"div",10)(37,"button",18),S("click",function(){return p.dismissModal()}),l(38),r(39,"translate"),o()(),d(40,"div",19),a(41,"div",20)(42,"button",21),S("click",function(){return p.updateBlacklist()}),h(43,ct,2,3),h(44,mt,1,0,"i",22),o()()()()),n&2&&(t(3),u(s(4,17,"settings.security.ui_control")),t(2),m("disabled",p.clicked),v("aria-label",s(6,19,"form.button_close")),t(7),u(s(13,21,"settings.security.ui_control_desc")),t(3),u(s(16,23,"settings.security.ui_control_desc_2")),t(5),g(" ",p.mainPairing.name),t(3),m("ngbTooltip",s(24,25,p.mainPairing._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired"))("ngClass",F(31,je,p.mainPairing._isPaired,!p.mainPairing._isPaired)),t(4),u(p.mainPairing._username),t(3),m("checked",!p.isInList(p.mainPairing._username))("disabled",p.clicked),v("aria-label",s(31,27,"plugins.manage.hide_updates")),t(3),z(p.pairings),t(4),m("disabled",p.clicked),t(),g(" ",s(39,29,"form.button_close")," "),t(4),m("disabled",!p.blacklistHasUpdated||p.clicked),t(),_(p.clicked?-1:43),t(),_(p.clicked?44:-1))},dependencies:[j,ae,ce,R,te],encapsulation:2})}return i})();var be=ue(pt(),1);var Qe=ue(st(),1),Je=ue(lt(),1);var ut=i=>({maxBackupSizeText:i});function ht(i,c){if(i&1&&U(0,"input",10),i&2){let e=b(2);K("value",e.selectedBackup.fileName)}}function _t(i,c){if(i&1){let e=k();$(0,"input",12),W("change",function(p){y(e);let C=b(2);return I(C.handleRestoreFileInput(p.target.files))}),B()}}function gt(i,c){if(i&1&&($(0,"div",4)(1,"div",7),U(2,"i",8),B(),$(3,"ul",9)(4,"li"),l(5),r(6,"translate"),B(),$(7,"li"),l(8),r(9,"translate"),B(),$(10,"li"),l(11),r(12,"translate"),B(),$(13,"li"),l(14),r(15,"translate"),B()(),h(16,ht,1,1,"input",10),h(17,_t,1,0,"input",11),B()),i&2){let e=b();t(5),u(s(6,6,"backup.restore_help_one")),t(3),u(s(9,8,"backup.restore_help_two")),t(3),u(G(12,10,"backup.restore_max_size",N(15,ut,e.maxFileSizeText))),t(3),u(s(15,13,"backup.restore_warning")),t(2),_(e.selectedBackup?16:-1),t(),_(e.selectedBackup?-1:17)}}function bt(i,c){if(i&1){let e=k();$(0,"button",18),r(1,"translate"),W("click",function(){y(e);let p=b(2);return I(p.dismissModal())}),l(2),r(3,"translate"),B()}if(i&2){let e=b(2);K("disabled",e.clicked),v("aria-label",s(1,3,"form.button_close")),t(2),g(" ",s(3,5,"form.button_close")," ")}}function vt(i,c){if(i&1){let e=k();$(0,"button",18),r(1,"translate"),W("click",function(){y(e);let p=b(2);return I(p.reopenBackupModal())}),l(2),r(3,"translate"),B()}if(i&2){let e=b(2);K("disabled",e.clicked),v("aria-label",s(1,3,"form.button_back")),t(2),g(" ",s(3,5,"form.button_back")," ")}}function ft(i,c){i&1&&U(0,"i",19)}function Ct(i,c){if(i&1&&($(0,"span"),l(1),B()),i&2){let e=b(3);t(),g("",e.uploadPercent,"% - ")}}function xt(i,c){i&1&&($(0,"span"),l(1," Extracting Archive"),B())}function St(i,c){i&1&&($(0,"span"),l(1),r(2,"translate"),B()),i&2&&(t(),g(" ",s(2,1,"backup.label_uploading")))}function yt(i,c){if(i&1&&($(0,"span"),h(1,ft,1,0,"i",19),h(2,Ct,2,1,"span"),h(3,xt,2,0,"span"),h(4,St,3,3,"span"),B()),i&2){let e=b(2);t(),_(!e.uploadPercent||e.uploadPercent===100?1:-1),t(),_(e.uploadPercent&&e.uploadPercent!==100?2:-1),t(),_(e.uploadPercent===100?3:-1),t(),_(e.uploadPercent!==100?4:-1)}}function It(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"form.button_restore")," ")}function kt(i,c){if(i&1){let e=k();$(0,"div",6)(1,"div",13),h(2,bt,4,7,"button",14),h(3,vt,4,7,"button",14),B(),U(4,"div",15),$(5,"div",16)(6,"button",17),W("click",function(){y(e);let p=b();return I(p.onRestoreBackupClick())}),h(7,yt,5,4,"span"),h(8,It,2,3),B()()()}if(i&2){let e=b();t(2),_(e.setupWizardRestore?2:-1),t(),_(e.setupWizardRestore?-1:3),t(3),K("disabled",!e.selectedBackup&&!e.selectedFile||e.clicked),t(),_(e.clicked?7:-1),t(),_(e.clicked?-1:8)}}function Et(i,c){if(i&1){let e=k();$(0,"div",6),U(1,"div",13),$(2,"div",15)(3,"button",20),W("click",function(){y(e);let p=b();return I(p.postBackupRestart())}),l(4),r(5,"translate"),B()(),U(6,"div",16),B()}i&2&&(t(4),g(" ",s(5,1,"menu.hbrestart.title")," "))}var Xe=(()=>{class i{$activeModal=f(M);$api=f(V);$modal=f(re);$route=f(H);$toastr=f(D);$translate=f(A);$ws=f(Ue);io;term=new Qe.Terminal;termTarget;fitAddon=new Je.FitAddon;setupWizardRestore=!1;selectedBackup=null;clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;restoreArchiveType="homebridge";uploadPercent=0;ngOnInit(){return x(this,null,function*(){this.io=this.$ws.connectToNamespace("backup"),this.termTarget=document.getElementById("plugin-log-output"),this.term.open(this.termTarget),this.fitAddon.fit(),this.io.socket.on("stdout",e=>{this.term.write(e)}),this.setupWizardRestore&&(this.restoreStarted=!0,this.restoreInProgress=!0,this.startRestore())})}onRestoreBackupClick(){this.selectedBackup?this.restoreScheduledBackup():this.restoreArchiveType==="homebridge"?this.uploadHomebridgeArchive():this.restoreArchiveType==="hbfx"&&this.uploadHbfxArchive()}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.selectedFile.name.endsWith(".hbfx")?this.restoreArchiveType="hbfx":this.restoreArchiveType="homebridge"):delete this.selectedFile}postBackupRestart(){this.$api.put("/backup/restart",{}).subscribe({next:()=>{this.$activeModal.close(!0),this.$route.navigate(["/"])},error:()=>{}})}reopenBackupModal(){this.$activeModal.dismiss(),this.$modal.open(me,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.io.end()}dismissModal(){this.$activeModal.dismiss("Dismiss")}uploadHomebridgeArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore",e).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:n=>{console.error(n),this.$toastr.error(n.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})}restoreScheduledBackup(){return x(this,null,function*(){this.term.reset(),this.clicked=!0,this.$api.post(`/backup/scheduled-backups/${this.selectedBackup.id}/restore`,{}).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})})}startRestore(){return x(this,null,function*(){this.io.request("do-restore").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success")),this.setupWizardRestore&&this.postBackupRestart()},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}uploadHbfxArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore/hbfx",e,{reportProgress:!0,observe:"events"}).subscribe({next:n=>{n.type===Be.UploadProgress?this.uploadPercent=Math.round(100*n.loaded/n.total):n instanceof Te&&(this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startHbfxRestore()},500),this.clicked=!1)},error:n=>{this.clicked=!1,console.error(n),this.$toastr.error(n.error?.message||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})}startHbfxRestore(){return x(this,null,function*(){this.io.request("do-restore-hbfx").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success"))},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],inputs:{setupWizardRestore:"setupWizardRestore",selectedBackup:"selectedBackup"},decls:11,vars:11,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"],["id","plugin-log-output",1,"modal-body",3,"hidden"],[1,"modal-footer","justify-content-between"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","text","disabled","",1,"form-control","custom-input",3,"value"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"form-control"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"form-control",3,"change"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"fa","fa-fw","fa-circle-notch","fa-spin"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"]],template:function(n,p){n&1&&($(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),B(),$(5,"button",3),r(6,"translate"),W("click",function(){return p.dismissModal()}),B()(),h(7,gt,18,17,"div",4),U(8,"div",5),h(9,kt,9,5,"div",6),h(10,Et,7,3,"div",6),B()),n&2&&(t(3),u(s(4,7,"backup.title_backup")),t(2),K("disabled",p.restoreInProgress),v("aria-label",s(6,9,"form.button_close")),t(2),_(!p.restoreStarted&&!p.setupWizardRestore?7:-1),t(),K("hidden",!p.restoreStarted),t(),_(!p.restoreStarted||p.restoreFailed===!0?9:-1),t(),_(!p.restoreInProgress&&p.restoreStarted?10:-1))},dependencies:[R],encapsulation:2})}return i})();var Ye=(i,c)=>({"fa-arrow-right":i,"fa-cog fa-spin":c}),wt=i=>({backupTime:i,dayCount:7}),Bt=(i,c)=>({"fa-trash":i,"fa-cog fa-spin":c}),Tt=(i,c)=>({backupSize:i,maxBackupSizeText:c});function $t(i,c){if(i&1&&(l(0),r(1,"date"),r(2,"translate")),i&2){let e=b(2);g(" ",G(2,4,"backup.scheduled_backup_time",N(7,wt,G(1,1,e.backupTime,"shortTime")))," ")}}function Ft(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"plugins.settings.restart_required")," ")}function Pt(i,c){if(i&1&&h(0,$t,3,9)(1,Ft,2,3),i&2){let e=b();_(e.backupTime?0:1)}}function Rt(i,c){if(i&1&&(l(0),r(1,"translate")),i&2){let e=b();g(" ",s(1,1,e.backupTime?"plugins.settings.restart_required":"backup.scheduled_backup_disabled")," ")}}function Mt(i,c){if(i&1&&(a(0,"span",33),r(1,"translate"),d(2,"i",40),l(3),o()),i&2){let e=b().$implicit;m("ngbTooltip",G(1,2,"backup.backup_exceeds_max_size",F(5,Tt,e.size+"MB",e.maxBackupSizeText))),t(3),g(" ",e.size,"MB ")}}function At(i,c){if(i&1&&(a(0,"span"),l(1),o()),i&2){let e=b().$implicit;t(),g(" ",e.size,"MB ")}}function Dt(i,c){if(i&1){let e=k();a(0,"li",22)(1,"span")(2,"span",32),l(3),r(4,"date"),o(),d(5,"br"),a(6,"small",23),l(7),r(8,"date"),h(9,Mt,4,8,"span",33),h(10,At,2,1,"span"),o()(),a(11,"span",34)(12,"button",35),r(13,"translate"),r(14,"translate"),S("click",function(){let p=y(e).$implicit,C=b(2);return I(C.restore(p))}),d(15,"i",36),o(),a(16,"button",37),r(17,"translate"),r(18,"translate"),S("click",function(){let p=y(e).$implicit,C=b(2);return I(C.download(p))}),d(19,"i",38),o(),a(20,"button",39),r(21,"translate"),r(22,"translate"),S("click",function(){let p=y(e).$implicit,C=b(2);return I(C.delete(p))}),d(23,"i",25),o()()()}if(i&2){let e=c.$implicit,n=b(2);t(2),m("ngbTooltip",e.fileName),t(),g(" ",G(4,15,e.timestamp,"mediumDate")," "),t(4),g(" ",G(8,18,e.timestamp,"shortTime")," \xB7 "),t(2),_(e.size>e.maxBackupSize?9:-1),t(),_(e.size<=e.maxBackupSize?10:-1),t(2),m("disabled",n.clicked||n.deleting||e.size>e.maxBackupSize)("ngbTooltip",s(13,21,"form.button_restore")),v("aria-label",s(14,23,"form.button_restore")),t(4),m("disabled",n.clicked||n.deleting)("ngbTooltip",s(17,25,"form.button_download")),v("aria-label",s(18,27,"form.button_download")),t(4),m("disabled",n.clicked||n.deleting)("ngbTooltip",s(21,29,"form.button_delete")),v("aria-label",s(22,31,"form.button_delete")),t(3),m("ngClass",F(33,Bt,e.id!==n.deleting,e.id===n.deleting))}}function Vt(i,c){if(i&1&&(a(0,"ul",27)(1,"li",9)(2,"h6",10),l(3),r(4,"translate"),o()(),O(5,Dt,24,36,"li",22,L),o()),i&2){let e=b();t(3),u(s(4,1,"backup.files_auto")),t(2),z(e.scheduledBackups)}}var me=(()=>{class i{$activeModal=f(M);$api=f(V);$modal=f(re);$router=f(H);$settings=f(X);$toastr=f(D);$translate=f(A);restartToastIsShown=!1;Date=Date;clicked=!1;scheduledBackups=[];backupTime;deleting=null;currentSettingEnabled=!1;currentSettingPath="";enabledFormControl=new w(!1);pathFormControl=new w("");ngOnInit(){this.getScheduledBackups(),this.getNextBackup(),this.currentSettingEnabled=!this.$settings.env.scheduledBackupDisable,this.currentSettingPath=this.$settings.env.scheduledBackupPath,this.enabledFormControl.patchValue(this.currentSettingEnabled),this.pathFormControl.patchValue(this.currentSettingPath),this.enabledFormControl.valueChanges.pipe(E(750)).subscribe(e=>x(this,null,function*(){this.currentSettingEnabled=e,yield this.saveUiSettingChange("scheduledBackupDisable",!this.currentSettingEnabled)})),this.pathFormControl.valueChanges.pipe(E(1500)).subscribe(e=>x(this,null,function*(){this.currentSettingPath=e,yield this.saveUiSettingChange("scheduledBackupPath",this.currentSettingPath)}))}download(e){this.$api.get(`/backup/scheduled-backups/${e.id}`,{observe:"response",responseType:"blob"}).subscribe({next:n=>{let p=e.fileName||"homebridge-backup.tar.gz",C=n.body.size;if(C>globalThis.backup.maxBackupSize){let J=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(C/1048576).toFixed(1)}MB`});this.$toastr.warning(J,this.$translate.instant("toast.title_warning"))}(0,be.saveAs)(n.body,p)},error:n=>{console.error(n),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})}restore(e){this.$activeModal.close();let n=this.$modal.open(Xe,{size:"lg",backdrop:"static"});n.componentInstance.selectedBackup=e}delete(e){this.deleting=e.id,this.$api.delete(`/backup/scheduled-backups/${e.id}`).subscribe({next:()=>{this.getScheduledBackups(),this.deleting=null},error:n=>{this.deleting=null,console.error(n),this.$toastr.error(this.$translate.instant("backup.backup_delete_failed"),this.$translate.instant("toast.title_error"))}})}onDownloadBackupClick(){return x(this,null,function*(){this.clicked=!0;try{let e=yield T(this.$api.get("/backup/download",{observe:"response",responseType:"blob"})),n=e.headers.get("File-Name")||"homebridge-backup.tar.gz",p=e.body.size;if(p>globalThis.backup.maxBackupSize){let C=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(p/1048576).toFixed(1)}MB`});this.$toastr.warning(C,this.$translate.instant("toast.title_warning"))}(0,be.saveAs)(e.body,n),this.clicked=!1}catch(e){this.clicked=!1,console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}onCreateBackupClick(){return x(this,null,function*(){this.clicked=!0;try{yield T(this.$api.post("/backup",{})),this.clicked=!1,this.getScheduledBackups()}catch(e){this.clicked=!1,console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}saveUiSettingChange(e,n){return x(this,null,function*(){try{yield T(this.$api.put("/config-editor/ui",{key:e,value:n})),this.$settings.setEnvItem(e,n),this.showRestartToast()}catch(p){console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}getScheduledBackups(){this.$api.get("/backup/scheduled-backups").subscribe({next:e=>{this.scheduledBackups=e},error:e=>console.error(e)})}getNextBackup(){this.$api.get("/backup/scheduled-backups/next").subscribe({next:e=>{this.backupTime=e.next},error:e=>{console.error(e)}})}showRestartToast(){if(!this.restartToastIsShown){this.restartToastIsShown=!0;let e=this.$toastr.info(this.$translate.instant("settings.changes.saved"),this.$translate.instant("menu.hbrestart.title"),{timeOut:0,tapToDismiss:!0,disableTimeOut:!0,positionClass:"toast-bottom-right",enableHtml:!0});e&&e.onTap&&e.onTap.subscribe(()=>{this.$router.navigate(["/restart"])})}}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:92,vars:80,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-hard-drive","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item"],[1,"mb-0","text-center"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"grey-text","small"],[1,"text-start","text-md-end","w-100","w-md-50"],["type","text","placeholder","/home/pi/homebridge-backups",1,"form-control","custom-input",3,"formControl"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"text-start"],[1,"small","grey-text"],[1,"text-end","grey-text","d-flex","align-items-center"],["type","checkbox","id","disableScheduledBackups",1,"rendux-input",3,"formControl"],["for","disableScheduledBackups",1,"rendux-label"],[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",3,"ngClass"],[1,"fas","fa-fw","fa-arrow-right"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],["container","modal","openDelay","150","triggers","hover",3,"ngbTooltip"],["container","modal","openDelay","150","triggers","hover",1,"red-text",3,"ngbTooltip"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-exclamation-circle"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),S("click",function(){return p.dismissModal()}),o()(),a(7,"div",4)(8,"div",5),d(9,"i",6),o(),a(10,"ul",7)(11,"li"),l(12),r(13,"translate"),o(),a(14,"li"),l(15),r(16,"translate"),o(),a(17,"li"),l(18),r(19,"translate"),o()(),a(20,"ul",8)(21,"li",9)(22,"h6",10),l(23),r(24,"translate"),o()(),a(25,"li",11)(26,"div",12),l(27),r(28,"translate"),d(29,"br"),a(30,"span",13),l(31),r(32,"translate"),o()(),a(33,"div",14),d(34,"input",15),r(35,"translate"),o()(),a(36,"li",16)(37,"div",17),l(38),r(39,"translate"),d(40,"br"),a(41,"span",18),h(42,Pt,2,1)(43,Rt,2,3),o()(),a(44,"div",19),d(45,"input",20),r(46,"translate"),d(47,"label",21),o()(),a(48,"li",22)(49,"div")(50,"span"),l(51),r(52,"translate"),o(),d(53,"br"),a(54,"small",23),l(55),r(56,"translate"),o()(),a(57,"button",24),r(58,"translate"),S("click",function(){return p.onDownloadBackupClick()}),d(59,"i",25),o()(),a(60,"li",22)(61,"div")(62,"span"),l(63),r(64,"translate"),o(),d(65,"br"),a(66,"small",23),l(67),r(68,"translate"),o()(),a(69,"button",24),r(70,"translate"),S("click",function(){return p.onCreateBackupClick()}),d(71,"i",25),o()(),a(72,"li",22)(73,"div")(74,"span"),l(75),r(76,"translate"),o(),d(77,"br"),a(78,"small",23),l(79),r(80,"translate"),o()(),a(81,"button",24),r(82,"translate"),S("click",function(){return p.restore(null)}),d(83,"i",26),o()()(),h(84,Vt,7,3,"ul",27),o(),a(85,"div",28),d(86,"div",17),a(87,"div",29)(88,"button",30),S("click",function(){return p.dismissModal()}),l(89),r(90,"translate"),o()(),d(91,"div",31),o()()),n&2&&(t(3),u(s(4,32,"backup.title_backup")),t(2),m("disabled",p.clicked||p.deleting),v("aria-label",s(6,34,"form.button_close")),t(7),u(s(13,36,"backup.backup_help_one")),t(3),u(s(16,38,"backup.backup_help_two")),t(3),u(s(19,40,"backup.backup_warning")),t(5),u(s(24,42,"backup.settings_title")),t(4),g(" ",s(28,44,"backup.settings_path")),t(4),u(s(32,46,"backup.settings_path_desc")),t(3),m("formControl",p.pathFormControl),v("aria-label",s(35,48,"backup.settings_path")),t(4),g(" ",s(39,50,"backup.settings_enable")),t(4),_(p.enabledFormControl.value?42:43),t(3),m("formControl",p.enabledFormControl),v("aria-label",s(46,52,"backup.settings_enable")),t(6),u(s(52,54,"backup.backup_now")),t(4),u(s(56,56,"backup.backup_now_desc")),t(2),m("disabled",p.clicked),v("aria-label",s(58,58,"backup.backup_now")),t(2),m("ngClass",F(74,Ye,!p.clicked,p.clicked)),t(4),u(s(64,60,"backup.backup_now")),t(4),u(s(68,62,"backup.backup_now_save_desc")),t(2),m("disabled",p.clicked),v("aria-label",s(70,64,"backup.backup_now")),t(2),m("ngClass",F(77,Ye,!p.clicked,p.clicked)),t(4),u(s(76,66,"backup.restore_now")),t(4),u(s(80,68,"backup.restore_now_desc")),t(2),m("disabled",p.clicked),v("aria-label",s(82,70,"backup.restore_now")),t(3),_(p.scheduledBackups.length?84:-1),t(4),m("disabled",p.clicked||p.deleting),t(),g(" ",s(90,72,"form.button_close")," "))},dependencies:[ce,j,oe,le,ie,ne,pe,we,R],encapsulation:2})}return i})();function Nt(i,c){i&1&&(a(0,"div",12),d(1,"i",13),o(),a(2,"p",14),l(3),r(4,"translate"),o()),i&2&&(t(3),u(s(4,1,"reset.no_accessories")))}function Lt(i,c){i&1&&(a(0,"div",12),d(1,"i",15),o(),a(2,"ul",16)(3,"li"),l(4),r(5,"translate"),o(),a(6,"li"),l(7),r(8,"translate"),o(),a(9,"li"),l(10),r(11,"translate"),o()(),a(12,"ngb-alert",17)(13,"p",18),l(14),r(15,"translate"),o()()),i&2&&(t(4),u(s(5,5,"reset.accessory_all.list_1")),t(3),u(s(8,7,"reset.accessory_all.list_2")),t(3),u(s(11,9,"reset.accessory_all.list_3")),t(2),m("dismissible",!1),t(2),u(s(15,11,"reset.action_is_irreversible")))}function Ot(i,c){if(i&1){let e=k();a(0,"button",19),r(1,"translate"),S("click",function(){y(e);let p=b();return I(p.dismissModal())}),l(2),r(3,"translate"),o()}if(i&2){let e=b();m("disabled",e.clicked),v("aria-label",s(1,3,"form.button_close")),t(2),g(" ",s(3,5,"form.button_close")," ")}}function zt(i,c){if(i&1){let e=k();a(0,"button",20),r(1,"translate"),S("click",function(){y(e);let p=b();return I(p.dismissModal())}),l(2),r(3,"translate"),o()}i&2&&(v("aria-label",s(1,2,"form.button_close")),t(2),g(" ",s(3,4,"form.button_close")," "))}function Ut(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"form.button_remove")," ")}function Ht(i,c){i&1&&d(0,"i",22)}function Wt(i,c){if(i&1){let e=k();a(0,"button",21),S("click",function(){y(e);let p=b();return I(p.onResetCachedAccessoriesClick())}),h(1,Ut,2,3),h(2,Ht,1,0,"i",22),o()}if(i&2){let e=b();m("disabled",e.clicked),t(),_(e.clicked?-1:1),t(),_(e.clicked?2:-1)}}var et=(()=>{class i{$activeModal=f(M);$api=f(V);$router=f(H);$toastr=f(D);$translate=f(A);clicked=!1;cachedAccessories=[];ngOnInit(){this.loadCachedAccessories()}onResetCachedAccessoriesClick(){return this.clicked=!0,this.$api.put("/server/reset-cached-accessories",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.delete_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadCachedAccessories(){return x(this,null,function*(){try{this.cachedAccessories=yield T(this.$api.get("/server/cached-accessories"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),S("click",function(){return p.dismissModal()}),o()(),a(7,"div",4),h(8,Nt,5,3),h(9,Lt,16,13),o(),a(10,"div",5)(11,"div",6),h(12,Ot,4,7,"button",7),o(),a(13,"div",8),h(14,zt,4,6,"button",9),o(),a(15,"div",10),h(16,Wt,3,3,"button",11),o()()()),n&2&&(t(3),u(s(4,8,"reset.accessory_all.title")),t(2),m("disabled",p.clicked),v("aria-label",s(6,10,"form.button_close")),t(3),_(p.cachedAccessories.length===0?8:-1),t(),_(p.cachedAccessories.length>0?9:-1),t(3),_(p.cachedAccessories.length>0?12:-1),t(2),_(p.cachedAccessories.length===0?14:-1),t(2),_(p.cachedAccessories.length>0?16:-1))},dependencies:[de,R],encapsulation:2})}return i})();var Kt=(i,c)=>({"green-text":i,"grey-text":c}),Gt=(i,c)=>({"btn-danger":i,"btn-elegant":c}),jt=(i,c,e)=>({"fa-broom":i,"fa-undo":c,"fa-spinner fa-pulse":e});function qt(i,c){i&1&&(a(0,"div",12),d(1,"i",13),o(),a(2,"p",14),l(3),r(4,"translate"),o()),i&2&&(t(3),u(s(4,1,"reset.bridge_accessories.empty")))}function Qt(i,c){if(i&1){let e=k();a(0,"li",18)(1,"span"),l(2),d(3,"br"),a(4,"small",19),d(5,"i",20),l(6),r(7,"translate"),a(8,"span",21),l(9),o()()(),a(10,"button",22),r(11,"translate"),S("click",function(){let p=y(e).$implicit,C=b(2);return I(C.toggleList(p._id))}),d(12,"i",23),o()()}if(i&2){let e=c.$implicit,n=b(2);t(2),g(" ",e.name," "),t(3),m("ngClass",F(12,Kt,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",n.clicked)("ngClass",F(15,Gt,!n.toDelete.includes(e._id),n.toDelete.includes(e._id))),v("aria-label",s(11,10,"form.button_delete")),t(2),m("ngClass",ee(18,jt,!n.toDelete.includes(e._id),n.toDelete.includes(e._id)&&!n.clicked,n.toDelete.includes(e._id)&&n.clicked))}}function Jt(i,c){if(i&1&&(a(0,"div",12),d(1,"i",15),o(),a(2,"ul",16)(3,"li"),l(4),r(5,"translate"),o(),a(6,"li"),l(7),r(8,"translate"),o(),a(9,"li"),l(10),r(11,"translate"),o()(),a(12,"ul",17),O(13,Qt,13,22,"li",18,L),o()),i&2){let e=b();t(4),u(s(5,3,"reset.bridge_accessories.list_1")),t(3),u(s(8,5,"reset.clear_cache_single.list_3")),t(3),u(s(11,7,"reset.bridge_accessories.list_2")),t(3),z(e.pairings)}}function Xt(i,c){if(i&1){let e=k();a(0,"button",24),S("click",function(){y(e);let p=b();return I(p.dismissModal())}),l(1),r(2,"translate"),o()}if(i&2){let e=b();m("disabled",e.clicked),t(),g(" ",s(2,2,"form.button_close")," ")}}function Yt(i,c){if(i&1){let e=k();a(0,"button",25),S("click",function(){y(e);let p=b();return I(p.dismissModal())}),l(1),r(2,"translate"),o()}i&2&&(t(),g(" ",s(2,1,"form.button_close")," "))}function Zt(i,c){i&1&&d(0,"i",27)}function ei(i,c){if(i&1&&l(0),i&2){let e=b(3);g(" (",e.toDelete.length,") ")}}function ti(i,c){if(i&1&&(l(0),r(1,"translate"),h(2,ei,1,1)),i&2){let e=b(2);g(" ",s(1,2,"form.button_remove")," "),t(2),_(e.toDelete.length>0?2:-1)}}function ii(i,c){if(i&1){let e=k();a(0,"button",26),S("click",function(){y(e);let p=b();return I(p.cleanBridges())}),h(1,Zt,1,0,"i",27)(2,ti,3,4),o()}if(i&2){let e=b();m("disabled",!e.toDelete.length||e.clicked),t(),_(e.clicked?1:2)}}var tt=(()=>{class i{$activeModal=f(M);$api=f(V);$router=f(H);$toastr=f(D);$translate=f(A);clicked=!1;pairings=[];toDelete=[];ngOnInit(){this.loadPairings()}cleanBridges(){return this.clicked=!0,this.$api.delete("/server/pairings/accessories",{body:this.toDelete.map(e=>({id:e}))}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}toggleList(e){this.toDelete.includes(e)?this.toDelete=this.toDelete.filter(n=>n!==e):this.toDelete.push(e)}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadPairings(){return x(this,null,function*(){try{this.pairings=(yield T(this.$api.get("/server/pairings"))).filter(e=>e._category==="bridge"&&!e._main).sort((e,n)=>e.name.localeCompare(n.name))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-broom","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),S("click",function(){return p.dismissModal()}),o()(),a(7,"div",4),h(8,qt,5,3),h(9,Jt,15,9),o(),a(10,"div",5)(11,"div",6),h(12,Xt,3,4,"button",7),o(),a(13,"div",8),h(14,Yt,3,3,"button",9),o(),a(15,"div",10),h(16,ii,3,2,"button",11),o()()()),n&2&&(t(3),u(s(4,8,"reset.bridge_accessories.title")),t(2),m("disabled",p.clicked),v("aria-label",s(6,10,"form.button_close")),t(3),_(p.pairings.length===0?8:-1),t(),_(p.pairings.length>0?9:-1),t(3),_(p.pairings.length>0?12:-1),t(2),_(p.pairings.length===0?14:-1),t(2),_(p.pairings.length>0?16:-1))},dependencies:[j,R],encapsulation:2})}return i})();function ni(i,c){i&1&&(l(0),r(1,"translate")),i&2&&g(" ",s(1,1,"form.button_reset")," ")}function ai(i,c){i&1&&d(0,"i",16)}var it=(()=>{class i{$activeModal=f(M);$api=f(V);$route=f(H);$toastr=f(D);$translate=f(A);clicked;onResetHomebridgeAccessoryClick(){return this.clicked=!0,this.$api.put("/server/reset-homebridge-accessory",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_reset"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$route.navigate(["/restart"])},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:38,vars:33,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),S("click",function(){return p.dismissModal()}),o()(),a(7,"div",4)(8,"div",5),d(9,"i",6),o(),a(10,"ul",7)(11,"li"),l(12),r(13,"translate"),o(),a(14,"li"),l(15),r(16,"translate"),o(),a(17,"li"),l(18),r(19,"translate"),o(),a(20,"li"),l(21),r(22,"translate"),o()(),a(23,"ngb-alert",8)(24,"p",9),l(25),r(26,"translate"),o()()(),a(27,"div",10)(28,"div",11)(29,"button",12),r(30,"translate"),S("click",function(){return p.dismissModal()}),l(31),r(32,"translate"),o()(),d(33,"div",13),a(34,"div",14)(35,"button",15),S("click",function(){return p.onResetHomebridgeAccessoryClick()}),h(36,ni,2,3),h(37,ai,1,0,"i",16),o()()()()),n&2&&(t(3),u(s(4,15,"reset.bridge_all.title")),t(2),m("disabled",p.clicked),v("aria-label",s(6,17,"form.button_close")),t(7),u(s(13,19,"reset.bridge_all.list_1")),t(3),u(s(16,21,"reset.bridge_all.list_2")),t(3),u(s(19,23,"reset.bridge_all.list_3")),t(3),u(s(22,25,"reset.bridge_all.list_4")),t(2),m("dismissible",!1),t(2),u(s(26,27,"reset.action_is_irreversible")),t(4),m("disabled",p.clicked),v("aria-label",s(30,29,"form.button_close")),t(2),g(" ",s(32,31,"form.button_close")," "),t(4),m("disabled",p.clicked),t(),_(p.clicked?-1:36),t(),_(p.clicked?37:-1))},dependencies:[de,R],encapsulation:2})}return i})();var ve=(i,c)=>({"green-text":i,"grey-text":c}),fe=(i,c)=>({"btn-danger":i,"btn-elegant":c}),nt=(i,c,e)=>({"fa-refresh":i,"fa-undo":c,"fa-spinner fa-pulse":e}),oi=(i,c,e)=>({"fa-trash":i,"fa-undo":c,"fa-spinner fa-pulse":e});function ri(i,c){i&1&&(a(0,"div",12),d(1,"i",13),o(),a(2,"p",14),l(3),r(4,"translate"),o()),i&2&&(t(3),u(s(4,1,"reset.bridges.empty")))}function si(i,c){if(i&1){let e=k();a(0,"li",20)(1,"span"),l(2),d(3,"br"),a(4,"small",21),d(5,"i",22),l(6),r(7,"translate"),a(8,"span",23),l(9),o(),l(10),r(11,"titlecase"),o()(),a(12,"button",24),r(13,"translate"),S("click",function(){let p=y(e).$implicit,C=b(3);return I(C.toggleList(p._id,!1))}),d(14,"i",25),o()()}if(i&2){let e=c.$implicit,n=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",F(15,ve,e._isPaired,!e._isPaired)),t(),g(" ",s(7,9,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),g(" \xB7 ",e._main?"Homebridge":s(11,11,e._category)," "),t(2),m("disabled",n.clicked)("ngClass",F(18,fe,!n.isInList(e._id),n.isInList(e._id))),v("aria-label",s(13,13,"form.button_unpair")),t(2),m("ngClass",ee(21,nt,!n.isInList(e._id),n.isInList(e._id)&&!n.clicked,n.isInList(e._id)&&n.clicked))}}function li(i,c){if(i&1&&(a(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),r(4,"translate"),o(),a(5,"p",19),l(6),r(7,"translate"),o()(),O(8,si,15,25,"li",20,L),o()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_non_child")),t(3),u(s(7,4,"reset.bridge_ind.desc_non_child")),t(2),z(e.pairingsNonChild)}}function pi(i,c){if(i&1){let e=k();a(0,"li",20)(1,"span"),l(2),d(3,"br"),a(4,"small",21),d(5,"i",22),l(6),r(7,"translate"),a(8,"span",23),l(9),o()()(),a(10,"button",24),r(11,"translate"),S("click",function(){let p=y(e).$implicit,C=b(3);return I(C.toggleList(p._id,!0))}),d(12,"i",25),o()()}if(i&2){let e=c.$implicit,n=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",F(12,ve,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",n.clicked)("ngClass",F(15,fe,!n.isInList(e._id),n.isInList(e._id))),v("aria-label",s(11,10,"form.button_unpair")),t(2),m("ngClass",ee(18,nt,!n.isInList(e._id),n.isInList(e._id)&&!n.clicked,n.isInList(e._id)&&n.clicked))}}function di(i,c){if(i&1&&(a(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),r(4,"translate"),o(),a(5,"p",19),l(6),r(7,"translate"),o()(),O(8,pi,13,22,"li",20,L),o()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_child_active")),t(3),u(s(7,4,"reset.bridge_ind.desc_child_active")),t(2),z(e.pairingsChildActive)}}function ci(i,c){if(i&1){let e=k();a(0,"li",20)(1,"span"),l(2),d(3,"br"),a(4,"small",21),d(5,"i",22),l(6),r(7,"translate"),a(8,"span",23),l(9),o()()(),a(10,"button",24),r(11,"translate"),S("click",function(){let p=y(e).$implicit,C=b(3);return I(C.toggleList(p._id,!1))}),d(12,"i",25),o()()}if(i&2){let e=c.$implicit,n=b(3);t(2),g(" ",e.name," "),t(3),m("ngClass",F(12,ve,e._isPaired,!e._isPaired)),t(),g(" ",s(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),u(e._username),t(),m("disabled",n.clicked)("ngClass",F(15,fe,!n.isInList(e._id),n.isInList(e._id))),v("aria-label",s(11,10,"form.button_unpair")),t(2),m("ngClass",ee(18,oi,!n.isInList(e._id),n.isInList(e._id)&&!n.clicked,n.isInList(e._id)&&n.clicked))}}function mi(i,c){if(i&1&&(a(0,"ul",16)(1,"li",17)(2,"h6",18),l(3),r(4,"translate"),o(),a(5,"p",19),l(6),r(7,"translate"),o()(),O(8,ci,13,22,"li",20,L),o()),i&2){let e=b(2);t(3),u(s(4,2,"reset.bridge_ind.head_child_stale")),t(3),u(s(7,4,"reset.bridge_ind.desc_child_stale")),t(2),z(e.pairingsChildStale)}}function ui(i,c){if(i&1&&(a(0,"div",12),d(1,"i",15),o(),h(2,li,10,6,"ul",16),h(3,di,10,6,"ul",16),h(4,mi,10,6,"ul",16)),i&2){let e=b();t(2),_(e.pairingsNonChild.length>0?2:-1),t(),_(e.pairingsChildActive.length>0?3:-1),t(),_(e.pairingsChildStale.length>0?4:-1)}}function hi(i,c){if(i&1){let e=k();a(0,"button",26),S("click",function(){y(e);let p=b();return I(p.dismissModal())}),l(1),r(2,"translate"),o()}if(i&2){let e=b();m("disabled",e.clicked),t(),g(" ",s(2,2,"form.button_close")," ")}}function _i(i,c){if(i&1){let e=k();a(0,"button",27),S("click",function(){y(e);let p=b();return I(p.dismissModal())}),l(1),r(2,"translate"),o()}i&2&&(t(),g(" ",s(2,1,"form.button_close")," "))}function gi(i,c){if(i&1&&l(0),i&2){let e=b(3);g(" (",e.toDelete.length,") ")}}function bi(i,c){if(i&1&&(l(0),r(1,"translate"),h(2,gi,1,1)),i&2){let e=b(2);g(" ",s(1,2,"form.button_reset")," "),t(2),_(e.toDelete.length>0?2:-1)}}function vi(i,c){i&1&&d(0,"i",29)}function fi(i,c){if(i&1){let e=k();a(0,"button",28),S("click",function(){y(e);let p=b();return I(p.removeBridges())}),h(1,bi,3,4),h(2,vi,1,0,"i",29),o()}if(i&2){let e=b();m("disabled",!e.toDelete.length||e.clicked),t(),_(e.clicked?-1:1),t(),_(e.clicked?2:-1)}}var at=(()=>{class i{$activeModal=f(M);$api=f(V);$router=f(H);$toastr=f(D);$translate=f(A);clicked=!1;pairingsNonChild=[];pairingsChildActive=[];pairingsChildStale=[];toDelete=[];ngOnInit(){this.loadPairings()}toggleList(e,n=!1){this.toDelete.some(p=>p.id===e)?this.toDelete=this.toDelete.filter(p=>p.id!==e):this.toDelete.push({id:e,resetPairingInfo:n})}isInList(e){return this.toDelete.some(n=>n.id===e)}removeBridges(){return this.clicked=!0,this.$api.delete("/server/pairings",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.bridge_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.bridge_ind.fail"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadPairings(){return x(this,null,function*(){try{let e=(yield T(this.$api.get("/server/pairings"))).filter(n=>!n._main).sort((n,p)=>n.name.localeCompare(p.name));this.pairingsChildActive=e.filter(n=>n._category==="bridge"&&!n._couldBeStale),this.pairingsNonChild=e.filter(n=>n._category!=="bridge"),this.pairingsChildStale=e.filter(n=>n._category==="bridge"&&n._couldBeStale)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"text-center","mb-0"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"list-group-item"],[1,"mb-1","text-center"],[1,"mb-0","small","grey-text","text-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),S("click",function(){return p.dismissModal()}),o()(),a(7,"div",4),h(8,ri,5,3),h(9,ui,5,3),o(),a(10,"div",5)(11,"div",6),h(12,hi,3,4,"button",7),o(),a(13,"div",8),h(14,_i,3,3,"button",9),o(),a(15,"div",10),h(16,fi,3,3,"button",11),o()()()),n&2&&(t(3),u(s(4,8,"reset.bridge_ind.title")),t(2),m("disabled",p.clicked),v("aria-label",s(6,10,"form.button_close")),t(3),_(p.pairingsChildActive.length===0&&p.pairingsChildStale.length===0&&p.pairingsNonChild.length===0?8:-1),t(),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?9:-1),t(3),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?12:-1),t(2),_(p.pairingsChildActive.length===0&&p.pairingsChildStale.length===0&&p.pairingsNonChild.length===0?14:-1),t(2),_(p.pairingsChildActive.length>0||p.pairingsChildStale.length>0||p.pairingsNonChild.length>0?16:-1))},dependencies:[j,te,R],encapsulation:2})}return i})();function Ci(i,c){if(i&1){let e=k();a(0,"li",9)(1,"div")(2,"span",16),l(3),o(),d(4,"br"),a(5,"span",17),l(6),o()(),a(7,"span")(8,"input",18),Ee("ngModelChange",function(p){let C=y(e).$implicit;return ke(C.selected,p)||(C.selected=p),I(p)}),S("ngModelChange",function(){y(e);let p=b();return I(p.onAdapterSelectionChange())}),o(),d(9,"label",19),o()()}if(i&2){let e=c.$implicit;t(3),u(e.ip4||e.ip6),t(3),u(e.iface),t(2),m("id","adapter"+e.iface),Ie("ngModel",e.selected),t(),m("for","adapter"+e.iface)}}var ot=(()=>{class i{$activeModal=f(M);adaptersOriginal=[];adaptersAvailable=[];adaptersSelected=[];isUnchanged=!0;ngOnInit(){this.adaptersAvailable.forEach(e=>{e.selected=this.adaptersSelected.some(n=>n.iface===e.iface)}),this.adaptersOriginal=this.adaptersSelected.map(e=>e.iface)}onAdapterSelectionChange(){this.isUnchanged=this.adaptersOriginal.length===this.adaptersAvailable.filter(e=>e.selected).length&&this.adaptersOriginal.every(e=>this.adaptersAvailable.some(n=>n.iface===e&&n.selected))}submit(){this.$activeModal.close(this.adaptersAvailable.filter(e=>e.selected).map(e=>e.iface))}closeAndReset(){this.adaptersAvailable.forEach(e=>{e.selected=this.adaptersOriginal.includes(e.iface)}),this.isUnchanged=!0,this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],inputs:{adaptersAvailable:"adaptersAvailable",adaptersSelected:"adaptersSelected"},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-ethernet","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[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"],[1,"font-monospace"],[1,"font-monospace","grey-text"],["type","checkbox",1,"rendux-input",3,"ngModelChange","id","ngModel"],[1,"rendux-label","ms-3",3,"for"]],template:function(n,p){n&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),l(3),r(4,"translate"),o(),a(5,"button",3),r(6,"translate"),S("click",function(){return p.closeAndReset()}),o()(),a(7,"div",4)(8,"div",5),d(9,"i",6),o(),a(10,"ul",7)(11,"li"),l(12),r(13,"translate"),o()(),a(14,"ul",8),O(15,Ci,10,5,"li",9,L),o()(),a(17,"div",10)(18,"div",11)(19,"button",12),r(20,"translate"),S("click",function(){return p.closeAndReset()}),l(21),r(22,"translate"),o()(),d(23,"div",13),a(24,"div",14)(25,"button",15),S("click",function(){return p.submit()}),l(26),r(27,"translate"),o()()()()),n&2&&(t(3),u(s(4,7,"settings.network.title_network_interfaces")),t(2),v("aria-label",s(6,9,"form.button_close")),t(7),u(s(13,11,"settings.network.message_network_interface")),t(3),z(p.adaptersAvailable),t(4),v("aria-label",s(20,13,"form.button_close")),t(2),g(" ",s(22,15,"form.button_close")," "),t(4),m("disabled",p.isUnchanged),t(),g(" ",s(27,17,"form.button_save")," "))},dependencies:[ae,ie,ne,Pe,R],encapsulation:2})}return i})();var xi=["wallpaperInput"],Si=i=>({maxFileSizeText:i});function yi(i,c){if(i&1){let e=k();$(0,"div",10),U(1,"img",20),$(2,"button",21),r(3,"translate"),W("click",function(){y(e);let p=b();return I(p.clearWallpaper())}),U(4,"i",22),B()()}if(i&2){let e=b();t(),K("src",e.wallpaperUrl,Ce),t(),v("aria-label",s(3,2,"form.button_delete"))}}function Ii(i,c){i&1&&U(0,"div",11)}var rt=(()=>{class i{$activeModal=f(M);$api=f(V);$settings=f(X);$toastr=f(D);$translate=f(A);clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;wallpaperUrl=null;originalWallpaperUrl=null;wallpaperInput;ngOnInit(){this.$settings.env.customWallpaperHash&&(this.wallpaperUrl=`${ze.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`,this.originalWallpaperUrl=this.wallpaperUrl)}onFileChange(e){if(e.length){this.selectedFile=e[0];let n=new FileReader;n.onload=p=>{this.wallpaperUrl=p.target.result},n.readAsDataURL(this.selectedFile)}else delete this.selectedFile,this.wallpaperUrl=this.originalWallpaperUrl}saveWallpaper(){if(this.clicked=!0,this.selectedFile){let e=new FormData;e.append("wallpaper",this.selectedFile,this.selectedFile.name),this.$api.post("/server/wallpaper",e).subscribe({next:()=>{this.$settings.setItem("wallpaper",`ui-wallpaper.${this.selectedFile.name.split(".").pop()}`),this.$activeModal.close(),this.$toastr.success(this.$translate.instant("settings.display.wallpaper_success"),this.$translate.instant("toast.title_success"))},error:n=>{console.error(n),this.$toastr.error(n.error?.message,this.$translate.instant("toast.title_error")),this.clicked=!1}})}else this.$api.delete("/server/wallpaper").subscribe({next:()=>{this.$activeModal.close()},error:e=>{console.error(e),this.$toastr.error(e.error?.message,this.$translate.instant("toast.title_error")),this.clicked=!1}})}clearWallpaper(){this.selectedFile=null,this.wallpaperUrl=this.wallpaperUrl===this.originalWallpaperUrl?null:this.originalWallpaperUrl,this.wallpaperInput.nativeElement.value=""}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],viewQuery:function(n,p){if(n&1&&xe(xi,5),n&2){let C;Se(C=ye())&&(p.wallpaperInput=C.first)}},decls:36,vars:28,consts:[["wallpaperInput",""],[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-image","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"mb-3","text-center"],[1,"position-relative","d-inline-block"],[1,"gradient","anim","rounded",2,"height","200px","width","350px","margin","0 auto"],[1,"mb-0"],["type","file","id","wallpaper","accept","image/*",1,"form-control",3,"change"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],["alt","Current Wallpaper",1,"img-fluid","rounded","mx-auto","d-block",2,"height","200px",3,"src"],[1,"btn","btn-danger","position-absolute",2,"top","10px","right","10px",3,"click"],[1,"fas","fa-fw","fa-trash"]],template:function(n,p){if(n&1){let C=k();$(0,"div",1)(1,"div",2)(2,"h5",3),l(3),r(4,"translate"),B(),$(5,"button",4),r(6,"translate"),W("click",function(){return y(C),I(p.dismissModal())}),B()(),$(7,"div",5)(8,"div",6),U(9,"i",7),B(),$(10,"ul",8)(11,"li"),l(12),r(13,"translate"),B(),$(14,"li"),l(15),r(16,"translate"),B(),$(17,"li"),l(18),r(19,"translate"),B()(),$(20,"div",9),h(21,yi,5,4,"div",10)(22,Ii,1,0,"div",11),B(),$(23,"div",12)(24,"input",13,0),W("change",function(q){return y(C),I(p.onFileChange(q.target.files))}),B()()(),$(26,"div",14)(27,"div",15)(28,"button",16),W("click",function(){return y(C),I(p.dismissModal())}),l(29),r(30,"translate"),B()(),U(31,"div",17),$(32,"div",18)(33,"button",19),W("click",function(){return y(C),I(p.saveWallpaper())}),l(34),r(35,"translate"),B()()()()}n&2&&(t(3),u(s(4,11,"settings.display.wallpaper")),t(2),K("disabled",p.clicked),v("aria-label",s(6,13,"form.button_close")),t(7),u(s(13,15,"settings.display.wallpaper_intro")),t(3),u(G(16,17,"settings.display.wallpaper_rule",N(26,Si,p.maxFileSizeText))),t(3),u(s(19,20,"settings.display.wallpaper_rule2")),t(3),_(p.wallpaperUrl?21:22),t(7),K("disabled",p.clicked),t(),g(" ",s(30,22,"form.button_close")," "),t(4),K("disabled",p.wallpaperUrl===p.originalWallpaperUrl||p.clicked),t(),g(" ",s(35,24,"form.button_save")," "))},dependencies:[oe,R],styles:[".anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}"]})}return i})();var Z=(i,c)=>({"fa-chevron-down":i,"fa-chevron-right":c}),Y=i=>({"is-invalid":i}),ki=i=>({link:i}),Ei=(i,c)=>({"badge-danger":i,"badge-info":c});function wi(i,c){i&1&&d(0,"app-spinner")}function Bi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Ti(i,c){if(i&1){let e=k();a(0,"ul",5)(1,"li",13)(2,"span"),l(3),r(4,"translate"),o(),a(5,"div",14),d(6,"input",15),r(7,"translate"),h(8,Bi,1,1,"i",16),o()(),a(9,"li",17)(10,"span",18),l(11),r(12,"translate"),o(),a(13,"button",19),r(14,"translate"),S("click",function(){y(e);let p=b();return I(p.openBackupModal())}),d(15,"i",20),o()(),a(16,"li",17)(17,"span",18),l(18),r(19,"translate"),o(),a(20,"a",21),r(21,"translate"),d(22,"i",20),o()()()}if(i&2){let e=b();t(3),u(s(4,9,"settings.name")),t(3),m("formControl",e.hbNameFormControl)("ngClass",N(21,Y,e.hbNameIsInvalid)),v("aria-label",s(7,11,"settings.name")),t(2),_(e.hbNameIsSaving?8:-1),t(3),g(" ",s(12,13,"backup.title_backup")," "),t(2),v("aria-label",s(14,15,"backup.title_backup")),t(5),g(" ",s(19,17,"menu.tooltip_user_accounts")," "),t(2),v("aria-label",s(21,19,"menu.tooltip_user_accounts"))}}function $i(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Fi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Pi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Ri(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Mi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Ai(i,c){if(i&1){let e=k();a(0,"ul",6)(1,"li",13),l(2),r(3,"translate"),a(4,"div",22)(5,"select",23)(6,"option",24),l(7),r(8,"translate"),o(),a(9,"option",25),l(10,"Bulgarian (bg)"),o(),a(11,"option",26),l(12,"Catalan (ca)"),o(),a(13,"option",27),l(14,"Chinese - Simplified (zh-CN)"),o(),a(15,"option",28),l(16,"Chinese - Traditional (zh-TW)"),o(),a(17,"option",29),l(18,"Czech (cs)"),o(),a(19,"option",30),l(20,"Dutch (nl)"),o(),a(21,"option",31),l(22,"English (en)"),o(),a(23,"option",32),l(24,"Finnish (fi)"),o(),a(25,"option",33),l(26,"French (fr)"),o(),a(27,"option",34),l(28,"German (de)"),o(),a(29,"option",35),l(30,"Hebrew (he)"),o(),a(31,"option",36),l(32,"Hungarian (hu)"),o(),a(33,"option",37),l(34,"Indonesian (id)"),o(),a(35,"option",38),l(36,"Italian (it)"),o(),a(37,"option",39),l(38,"Japanese (ja)"),o(),a(39,"option",40),l(40,"Korean (ko)"),o(),a(41,"option",41),l(42,"Macedonian (mk)"),o(),a(43,"option",42),l(44,"Norwegian (no)"),o(),a(45,"option",43),l(46,"Polish (pl)"),o(),a(47,"option",44),l(48,"Portuguese (Brazil)"),o(),a(49,"option",45),l(50,"Portuguese (Portugal)"),o(),a(51,"option",46),l(52,"Russian (ru)"),o(),a(53,"option",47),l(54,"Slovenian (sl)"),o(),a(55,"option",48),l(56,"Spanish (es)"),o(),a(57,"option",49),l(58,"Swedish (sv)"),o(),a(59,"option",50),l(60,"Thai (th)"),o(),a(61,"option",51),l(62,"Turkish (tr)"),o(),a(63,"option",52),l(64,"Ukrainian (uk)"),o()(),h(65,$i,1,1,"i",16),o()(),a(66,"li",13),l(67),r(68,"translate"),a(69,"div",22)(70,"select",23)(71,"option",53),l(72),r(73,"translate"),o(),a(74,"option",54),l(75),r(76,"translate"),o(),a(77,"option",55),l(78),r(79,"translate"),o(),a(80,"option",56),l(81),r(82,"translate"),o(),a(83,"option",57),l(84),r(85,"translate"),o(),a(86,"option",58),l(87),r(88,"translate"),o(),a(89,"option",59),l(90),r(91,"translate"),o(),a(92,"option",60),l(93),r(94,"translate"),o(),a(95,"option",61),l(96),r(97,"translate"),o(),a(98,"option",62),l(99),r(100,"translate"),o(),a(101,"option",63),l(102),r(103,"translate"),o(),a(104,"option",64),l(105),r(106,"translate"),o(),a(107,"option",65),l(108),r(109,"translate"),o()(),h(110,Fi,1,1,"i",16),o()(),a(111,"li",13),l(112),r(113,"translate"),a(114,"div",22)(115,"select",23)(116,"option",24),l(117),r(118,"translate"),o(),a(119,"option",66),l(120),r(121,"translate"),o(),a(122,"option",67),l(123),r(124,"translate"),o()(),h(125,Pi,1,1,"i",16),o()(),a(126,"li",13),l(127),r(128,"translate"),a(129,"div",22)(130,"select",23)(131,"option",68),l(132),r(133,"translate"),o(),a(134,"option",69),l(135),r(136,"translate"),o()(),h(137,Ri,1,1,"i",16),o()(),a(138,"li",13),l(139),r(140,"translate"),a(141,"div",22)(142,"select",23)(143,"option",70),l(144),r(145,"translate"),o(),a(146,"option",71),l(147),r(148,"translate"),o()(),h(149,Mi,1,1,"i",16),o()(),a(150,"li",17)(151,"span",18),l(152),r(153,"translate"),o(),a(154,"button",19),r(155,"translate"),S("click",function(){y(e);let p=b();return I(p.openWallpaperModal())}),d(156,"i",20),o()()()}if(i&2){let e=b();t(2),g(" ",s(3,38,"settings.display.lang")," "),t(3),m("formControl",e.uiLangFormControl),t(2),u(s(8,40,"form.select.auto")),t(58),_(e.uiLangIsSaving?65:-1),t(2),g(" ",s(68,42,"settings.display.theme")," "),t(3),m("formControl",e.uiThemeFormControl),t(2),u(s(73,44,"settings.display.orange")),t(3),u(s(76,46,"settings.display.red")),t(3),u(s(79,48,"settings.display.pink")),t(3),u(s(82,50,"settings.display.purple")),t(3),u(s(85,52,"settings.display.deep_purple")),t(3),u(s(88,54,"settings.display.indigo")),t(3),u(s(91,56,"settings.display.blue")),t(3),u(s(94,58,"settings.display.bluegrey")),t(3),u(s(97,60,"settings.display.cyan")),t(3),u(s(100,62,"settings.display.green")),t(3),u(s(103,64,"settings.display.teal")),t(3),u(s(106,66,"settings.display.grey")),t(3),u(s(109,68,"settings.display.brown")),t(2),_(e.uiThemeIsSaving?110:-1),t(2),g(" ",s(113,70,"settings.display.lighting_mode")," "),t(3),m("formControl",e.uiLightFormControl),t(2),u(s(118,72,"form.select.auto")),t(3),u(s(121,74,"settings.display.light")),t(3),u(s(124,76,"settings.display.dark")),t(2),_(e.uiLightIsSaving?125:-1),t(2),g(" ",s(128,78,"settings.display.menu_mode")," "),t(3),m("formControl",e.uiMenuFormControl),t(2),u(s(133,80,"settings.display.menu_default")),t(3),u(s(136,82,"settings.display.menu_freeze")),t(2),_(e.uiMenuIsSaving?137:-1),t(2),g(" ",s(140,84,"settings.display.temp_units")," "),t(3),m("formControl",e.uiTempFormControl),t(2),u(s(145,86,"settings.display.temp_units.c")),t(3),u(s(148,88,"settings.display.temp_units.f")),t(2),_(e.uiTempIsSaving?149:-1),t(3),u(s(153,90,"settings.display.wallpaper")),t(2),v("aria-label",s(155,92,"settings.display.wallpaper"))}}function Di(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Vi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Ni(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Li(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Oi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function zi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Ui(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Hi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Wi(i,c){if(i&1&&(a(0,"li",13)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",73),l(6),r(7,"translate"),o()(),a(8,"div",22),d(9,"input",92),r(10,"translate"),h(11,Hi,1,1,"i",16),o()()),i&2){let e=b(4);t(2),g(" ",s(3,5,"settings.linux.temp")),t(4),u(s(7,7,"settings.linux.temp_desc")),t(3),m("formControl",e.uiTempFileFormControl),v("aria-label",s(10,9,"settings.linux.temp")),t(2),_(e.uiTempFileIsSaving?11:-1)}}function Ki(i,c){if(i&1&&(a(0,"li",13)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",73),l(6),r(7,"translate"),o()(),a(8,"div",22),d(9,"input",90),r(10,"translate"),h(11,zi,1,1,"i",16),o()(),a(12,"li",13)(13,"span"),l(14),r(15,"translate"),d(16,"br"),a(17,"small",73),l(18),r(19,"translate"),o()(),a(20,"div",22),d(21,"input",91),r(22,"translate"),h(23,Ui,1,1,"i",16),o()(),h(24,Wi,12,11,"li",13)),i&2){let e=b(3);t(2),g(" ",s(3,11,"settings.linux.shutdown")),t(4),u(s(7,13,"settings.linux.shutdown_desc")),t(3),m("formControl",e.hbLinuxShutdownFormControl),v("aria-label",s(10,15,"settings.linux.shutdown")),t(2),_(e.hbLinuxShutdownIsSaving?11:-1),t(3),g(" ",s(15,17,"settings.linux.restart")),t(4),u(s(19,19,"settings.linux.restart_desc")),t(3),m("formControl",e.hbLinuxRestartFormControl),v("aria-label",s(22,21,"settings.linux.restart")),t(2),_(e.hbLinuxRestartIsSaving?23:-1),t(),_(e.runningOnRaspberryPi?24:-1)}}function Gi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function ji(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function qi(i,c){i&1&&(a(0,"li",17)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",73),l(6),r(7,"translate"),o()(),a(8,"a",93),r(9,"translate"),d(10,"i",20),o()()),i&2&&(t(2),g(" ",s(3,3,"menu.docker.startup_script")),t(4),u(s(7,5,"platform.docker.script_help")),t(2),v("aria-label",s(9,7,"menu.docker.startup_script")))}function Qi(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Ji(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Xi(i,c){if(i&1&&(a(0,"li",13)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",73),l(6),r(7,"translate"),o()(),a(8,"div",22),d(9,"input",94),r(10,"translate"),h(11,Ji,1,1,"i",16),o()()),i&2){let e=b(3);t(2),g(" ",s(3,6,"settings.startup.log_truncate")),t(4),u(s(7,8,"settings.startup.log_truncate_desc")),t(3),m("formControl",e.hbLogTruncateFormControl)("ngClass",N(12,Y,e.hbLogTruncateIsInvalid)),v("aria-label",s(10,10,"settings.startup.log_truncate")),t(2),_(e.hbLogTruncateIsSaving?11:-1)}}function Yi(i,c){if(i&1&&(a(0,"ul",72)(1,"li",17)(2,"span"),l(3),r(4,"translate"),a(5,"code"),l(6,"-D"),o(),d(7,"br"),a(8,"small",73),l(9),r(10,"translate"),o()(),a(11,"div",74)(12,"div",75),d(13,"input",76),r(14,"translate"),d(15,"label",77),o(),h(16,Di,1,1,"i",16),o()(),a(17,"li",17)(18,"span"),l(19),r(20,"translate"),a(21,"code"),l(22,"-I"),o(),d(23,"br"),a(24,"small",73),l(25),r(26,"translate"),o()(),a(27,"div",74)(28,"div",75),d(29,"input",78),r(30,"translate"),d(31,"label",79),o(),h(32,Vi,1,1,"i",16),o()(),a(33,"li",17)(34,"span"),l(35),r(36,"translate"),a(37,"code"),l(38,"-K"),o(),d(39,"br"),a(40,"small",73),l(41),r(42,"translate"),o()(),a(43,"div",74)(44,"div",75),d(45,"input",80),r(46,"translate"),d(47,"label",81),o(),h(48,Ni,1,1,"i",16),o()(),a(49,"li",17)(50,"span"),l(51),r(52,"translate"),d(53,"br"),a(54,"small",73),l(55),r(56,"translate"),o()(),a(57,"div",74)(58,"div",75),d(59,"input",82),r(60,"translate"),d(61,"label",83),o(),h(62,Li,1,1,"i",16),o()(),a(63,"li",13)(64,"span"),l(65),r(66,"translate"),d(67,"br"),a(68,"small",73),l(69),r(70,"translate"),o()(),a(71,"div",22),d(72,"input",84),r(73,"translate"),h(74,Oi,1,1,"i",16),o()(),h(75,Ki,25,23),a(76,"li",13)(77,"span")(78,"span",85),l(79,"DEBUG"),o(),d(80,"br")(81,"small",86),r(82,"translate"),o(),a(83,"div",22),d(84,"input",87),h(85,Gi,1,1,"i",16),o()(),a(86,"li",13)(87,"span")(88,"span",85),l(89,"NODE_OPTIONS"),o(),d(90,"br"),a(91,"small",73),l(92),r(93,"translate"),o()(),a(94,"div",22),d(95,"input",88),h(96,ji,1,1,"i",16),o()(),h(97,qi,11,9,"li",17),a(98,"li",13)(99,"span"),l(100),r(101,"translate"),d(102,"br"),a(103,"small",73),l(104),r(105,"translate"),o()(),a(106,"div",22),d(107,"input",89),r(108,"translate"),h(109,Qi,1,1,"i",16),o()(),h(110,Xi,12,14,"li",13),o()),i&2){let e=b(2);t(3),g(" ",s(4,40,"settings.startup.debug")," "),t(6),g(" ",s(10,42,e.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),t(4),m("formControl",e.hbDebugFormControl),v("aria-label",s(14,44,"settings.startup.debug")),t(3),_(e.hbDebugIsSaving?16:-1),t(3),g(" ",s(20,46,"settings.startup.insecure")," "),t(6),u(s(26,48,"settings.startup.insecure_desc")),t(4),m("formControl",e.hbInsecureFormControl),v("aria-label",s(30,50,"settings.startup.insecure")),t(3),_(e.hbInsecureIsSaving?32:-1),t(3),g(" ",s(36,52,"settings.startup.keep_accessories")," "),t(6),u(s(42,54,"settings.startup.keep_accessories_desc")),t(4),m("formControl",e.hbKeepFormControl),v("aria-label",s(46,56,"settings.startup.keep_accessories")),t(3),_(e.hbKeepIsSaving?48:-1),t(3),g(" ",s(52,58,"settings.startup.metrics")),t(4),u(s(56,60,"settings.startup.metrics_desc")),t(4),m("formControl",e.uiMetricsFormControl),v("aria-label",s(60,62,"settings.startup.metrics")),t(3),_(e.uiMetricsIsSaving?62:-1),t(3),g(" ",s(66,64,"settings.network.hb_package")),t(4),u(s(70,66,"settings.network.hb_package_desc")),t(3),m("formControl",e.hbPackageFormControl),v("aria-label",s(73,68,"settings.network.hb_package")),t(2),_(e.hbPackageIsSaving?74:-1),t(),_(e.platform==="linux"?75:-1),t(6),m("innerHTML",G(82,70,"settings.service.debug_tooltip",N(81,ki,e.linkDebug)),he),t(3),m("formControl",e.hbEnvDebugFormControl),t(),_(e.hbEnvDebugIsSaving?85:-1),t(7),u(s(93,73,"settings.service.node_tooltip")),t(3),m("formControl",e.hbEnvNodeFormControl),t(),_(e.hbEnvNodeIsSaving?96:-1),t(),_(e.runningInDocker?97:-1),t(3),g(" ",s(101,75,"settings.startup.log_max")),t(4),u(s(105,77,"settings.startup.log_max_desc")),t(3),m("formControl",e.hbLogSizeFormControl)("ngClass",N(83,Y,e.hbLogSizeIsInvalid)),v("aria-label",s(108,79,"settings.startup.log_max")),t(2),_(e.hbLogSizeIsSaving?109:-1),t(),_(e.hbLogSizeFormControl.value>0?110:-1)}}function Zi(i,c){if(i&1){let e=k();a(0,"div",1)(1,"div",2),S("click",function(){y(e);let p=b();return I(p.toggleSection("startup"))}),a(2,"h5",3),d(3,"i",4),l(4),r(5,"translate"),o()(),h(6,Yi,111,85,"ul",72),o()}if(i&2){let e=b();t(),v("aria-expanded",e.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),t(2),m("ngClass",F(7,Z,e.showFields.startup,!e.showFields.startup)),t(),g(" ",s(5,5,"settings.title_startup_options")," "),t(2),_(e.showFields.startup?6:-1)}}function en(i,c){i&1&&d(0,"i",107)}function tn(i,c){if(i&1&&(a(0,"span",96),h(1,en,1,0,"i",107),l(2),a(3,"span",108),l(4),r(5,"translate"),o()()),i&2){let e=c.$implicit;m("ngClass",F(6,Ei,e.missing,!e.missing)),t(),_(e.missing?1:-1),t(),g(" ",e.iface,": "),t(2),u(e.missing?s(5,4,"settings.mdns_advertiser_not_connected"):e.ip4||e.ip6)}}function nn(i,c){i&1&&(a(0,"option",98),l(1),r(2,"translate"),o()),i&2&&(t(),g("Avahi (",s(2,1,"settings.mdns_advertiser_rec"),")"))}function an(i,c){i&1&&(a(0,"option",101),l(1),r(2,"translate"),o()),i&2&&(t(),g("systemd-resolved (",s(2,1,"settings.mdns_advertiser_exp"),")"))}function on(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function rn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function sn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function ln(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function pn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function dn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function cn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function mn(i,c){if(i&1){let e=k();a(0,"ul",7)(1,"li",17)(2,"span",18),l(3),r(4,"translate"),d(5,"br"),a(6,"div",95),l(7),r(8,"translate"),o(),O(9,tn,6,9,"span",96,L),o(),a(11,"button",97),r(12,"translate"),S("click",function(){y(e);let p=b();return I(p.selectNetworkInterfaces())}),d(13,"i",20),o()(),a(14,"li",13)(15,"span"),l(16),r(17,"translate"),d(18,"br"),a(19,"small",73),l(20),r(21,"translate"),o()(),a(22,"div",22)(23,"select",23),r(24,"translate"),h(25,nn,3,3,"option",98),a(26,"option",99),l(27),r(28,"translate"),o(),a(29,"option",100),l(30,"Bonjour HAP"),o(),h(31,an,3,3,"option",101),o(),h(32,on,1,1,"i",16),o()(),a(33,"li",13)(34,"span"),l(35),r(36,"translate"),d(37,"br"),a(38,"small",73),l(39),r(40,"translate"),o()(),a(41,"div",22),d(42,"input",102),r(43,"translate"),h(44,rn,1,1,"i",16),o()(),a(45,"li",13)(46,"span"),l(47),r(48,"translate"),d(49,"br"),a(50,"small",73),l(51),r(52,"translate"),o()(),a(53,"div",22),d(54,"input",103),r(55,"translate"),h(56,sn,1,1,"i",16),o()(),a(57,"li",13)(58,"span"),l(59),r(60,"translate"),d(61,"br"),a(62,"small",73),l(63),r(64,"translate"),o()(),a(65,"div",22),d(66,"input",102),r(67,"translate"),h(68,ln,1,1,"i",16),o()(),a(69,"li",13)(70,"span"),l(71),r(72,"translate"),d(73,"br"),a(74,"small",73),l(75),r(76,"translate"),o()(),a(77,"div",22),d(78,"input",102),r(79,"translate"),h(80,pn,1,1,"i",16),o()(),a(81,"li",13)(82,"span"),l(83),r(84,"translate"),d(85,"br")(86,"small",104),r(87,"translate"),o(),a(88,"div",22),d(89,"input",105),r(90,"translate"),h(91,dn,1,1,"i",16),o()(),a(92,"li",13)(93,"span"),l(94),r(95,"translate"),d(96,"br"),a(97,"small",73),l(98),r(99,"translate"),o()(),a(100,"div",22),d(101,"input",106),r(102,"translate"),h(103,cn,1,1,"i",16),o()()()}if(i&2){let e=b();t(3),g(" ",s(4,46,"settings.network.title_network_interfaces")),t(4),u(s(8,48,"settings.network.message_network_interface")),t(2),z(e.adaptersSelected),t(2),m("disabled",!e.adaptersAvailable.length),v("aria-label",s(12,50,"settings.network.title_network_interfaces")),t(5),g(" ",s(17,52,"settings.mdns_advertiser")),t(4),u(s(21,54,"settings.mdns_advertiser_help")),t(3),m("formControl",e.hbMDnsFormControl),v("aria-label",s(24,56,"settings.mdns_advertiser")),t(2),_(e.showAvahiMdnsOption?25:-1),t(2),g(" Ciao ",e.showAvahiMdnsOption?"":"("+s(28,58,"settings.mdns_advertiser_rec")+")"," "),t(4),_(e.showResolvedMdnsOption?31:-1),t(),_(e.hbMDnsIsSaving?32:-1),t(3),g(" ",s(36,60,"settings.network.port_hb")),t(4),u(s(40,62,"settings.network.port_hb_desc")),t(3),m("formControl",e.hbPortFormControl)("ngClass",N(96,Y,e.hbPortIsInvalid)),v("aria-label",s(43,64,"settings.network.port_hb")),t(2),_(e.hbPortIsSaving?44:-1),t(3),g(" ",s(48,66,"settings.network.port_ui")),t(4),u(s(52,68,"settings.network.port_ui_desc")),t(3),m("formControl",e.uiPortFormControl)("ngClass",N(98,Y,e.uiPortIsInvalid)),v("aria-label",s(55,70,"settings.network.port_ui")),t(2),_(e.uiPortIsSaving?56:-1),t(3),g(" ",s(60,72,"settings.network.port_start")),t(4),u(s(64,74,"settings.network.port_start_desc")),t(3),m("formControl",e.hbStartPortFormControl)("ngClass",N(100,Y,e.hbStartPortIsInvalid)),v("aria-label",s(67,76,"settings.network.port_start")),t(2),_(e.hbStartPortIsSaving?68:-1),t(3),g(" ",s(72,78,"settings.network.port_end")),t(4),u(s(76,80,"settings.network.port_end_desc")),t(3),m("formControl",e.hbEndPortFormControl)("ngClass",N(102,Y,e.hbEndPortIsInvalid)),v("aria-label",s(79,82,"settings.network.port_end")),t(2),_(e.hbEndPortIsSaving?80:-1),t(3),g(" ",s(84,84,"settings.network.host")),t(3),m("innerHtml",s(87,86,"settings.network.host_desc"),he),t(3),m("formControl",e.uiHostFormControl),v("aria-label",s(90,88,"settings.network.host")),t(2),_(e.uiHostIsSaving?91:-1),t(3),g(" ",s(95,90,"settings.network.proxy")),t(4),u(s(99,92,"settings.network.proxy_desc")),t(3),m("formControl",e.uiProxyHostFormControl),v("aria-label",s(102,94,"settings.network.proxy")),t(2),_(e.uiProxyHostIsSaving?103:-1)}}function un(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function hn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function _n(i,c){if(i&1&&(a(0,"li",13)(1,"span"),l(2),r(3,"translate"),d(4,"br"),a(5,"small",73),l(6),r(7,"translate"),o()(),a(8,"div",22),d(9,"input",114),r(10,"translate"),h(11,hn,1,1,"i",16),o()()),i&2){let e=b(2);t(2),g(" ",s(3,6,"settings.startup.session")),t(4),u(s(7,8,"settings.startup.session_desc")),t(3),m("formControl",e.uiSessionTimeoutFormControl)("ngClass",N(12,Y,e.uiSessionTimeoutIsInvalid)),v("aria-label",s(10,10,"settings.startup.session")),t(2),_(e.uiSessionTimeoutIsSaving?11:-1)}}function gn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function bn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function vn(i,c){if(i&1&&(a(0,"li",13)(1,"span"),l(2),r(3,"translate"),o(),a(4,"div",22),d(5,"input",115),r(6,"translate"),h(7,gn,1,1,"i",16),o()(),a(8,"li",13)(9,"span"),l(10),r(11,"translate"),o(),a(12,"div",22),d(13,"input",116),r(14,"translate"),h(15,bn,1,1,"i",16),o()()),i&2){let e=b(2);t(2),u(s(3,8,"settings.security.key")),t(3),m("formControl",e.uiSslKeyFormControl),v("aria-label",s(6,10,"settings.security.key")),t(2),_(e.uiSslKeyIsSaving?7:-1),t(3),u(s(11,12,"settings.security.cert")),t(3),m("formControl",e.uiSslCertFormControl),v("aria-label",s(14,14,"settings.security.cert")),t(2),_(e.uiSslCertIsSaving?15:-1)}}function fn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function Cn(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function xn(i,c){if(i&1){let e=k();a(0,"li",13)(1,"span"),l(2),r(3,"translate"),o(),a(4,"div",22),d(5,"input",117),r(6,"translate"),h(7,fn,1,1,"i",16),o()(),a(8,"li",13)(9,"span"),l(10),r(11,"translate"),o(),a(12,"div",22)(13,"input",118),r(14,"translate"),S("focus",function(){y(e);let p=b(2);return I(p.showPfxPassphrase=!0)})("blur",function(){y(e);let p=b(2);return I(p.showPfxPassphrase=!1)}),o(),h(15,Cn,1,1,"i",16),o()()}if(i&2){let e=b(2);t(2),u(s(3,9,"settings.security.pfx")),t(3),m("formControl",e.uiSslPfxFormControl),v("aria-label",s(6,11,"settings.security.pfx")),t(2),_(e.uiSslPfxIsSaving?7:-1),t(3),u(s(11,13,"settings.security.pass")),t(3),m("type",e.showPfxPassphrase?"text":"password")("formControl",e.uiSslPassphraseFormControl),v("aria-label",s(14,15,"settings.security.pass")),t(2),_(e.uiSslPassphraseIsSaving?15:-1)}}function Sn(i,c){if(i&1){let e=k();a(0,"ul",8)(1,"li",17)(2,"span"),l(3),r(4,"translate"),d(5,"br"),a(6,"small",73),l(7),r(8,"translate"),o()(),a(9,"div",74)(10,"div",75),d(11,"input",109),r(12,"translate"),d(13,"label",110),o(),h(14,un,1,1,"i",16),o()(),h(15,_n,12,14,"li",13),a(16,"li",13)(17,"span"),l(18),r(19,"translate"),d(20,"br"),a(21,"small",73),l(22),r(23,"translate"),o()(),a(24,"div",22)(25,"select",23),r(26,"translate"),a(27,"option",111),l(28),r(29,"translate"),o(),a(30,"option",112),l(31),r(32,"translate"),o(),a(33,"option",113),l(34),r(35,"translate"),o()()()(),h(36,vn,16,16),h(37,xn,16,17),a(38,"li",17)(39,"span",18),l(40),r(41,"translate"),d(42,"br"),a(43,"small",73),l(44),r(45,"translate"),o()(),a(46,"button",19),r(47,"translate"),S("click",function(){y(e);let p=b();return I(p.accessoryUiControl())}),d(48,"i",20),o()()()}if(i&2){let e=b();t(3),g(" ",s(4,18,"settings.security.auth")),t(4),g(" ",s(8,20,"settings.security.auth_desc")," "),t(4),m("formControl",e.uiAuthFormControl),v("aria-label",s(12,22,"settings.security.auth")),t(3),_(e.uiAuthIsSaving?14:-1),t(),_(e.uiAuthFormControl.value?15:-1),t(3),g(" ",s(19,24,"settings.security.https")),t(4),u(s(23,26,"settings.security.https_desc")),t(3),m("formControl",e.uiSslTypeFormControl),v("aria-label",s(26,28,"settings.security.https")),t(3),u(s(29,30,"accessories.control.off")),t(3),u(s(32,32,"settings.security.https_keycert")),t(3),u(s(35,34,"settings.security.https_pfx")),t(2),_(e.uiSslTypeFormControl.value==="keycert"?36:-1),t(),_(e.uiSslTypeFormControl.value==="pfx"?37:-1),t(3),g(" ",s(41,36,"settings.security.ui_control")),t(4),u(s(45,38,"settings.security.ui_control_desc")),t(2),v("aria-label",s(47,40,"settings.security.ui_control"))}}function yn(i,c){i&1&&(a(0,"p",9),l(1),r(2,"translate"),o()),i&2&&(t(),u(s(2,1,"settings.cache.desc")))}function In(i,c){i&1&&d(0,"i",16),i&2&&m("@fadeInOut",void 0)}function kn(i,c){if(i&1){let e=k();a(0,"ul",10)(1,"li",17)(2,"span"),l(3),r(4,"translate"),d(5,"br"),a(6,"small",73),l(7),r(8,"translate"),o()(),a(9,"div",74)(10,"div",75),d(11,"input",119),r(12,"translate"),d(13,"label",120),o(),h(14,In,1,1,"i",16),o()(),a(15,"li",17)(16,"span",18),l(17),r(18,"translate"),d(19,"br"),a(20,"small",73),l(21),r(22,"translate"),o()(),a(23,"button",19),r(24,"translate"),S("click",function(){y(e);let p=b();return I(p.removeSingleCachedAccessories())}),d(25,"i",20),o()(),a(26,"li",17)(27,"span",18),l(28),r(29,"translate"),d(30,"br"),a(31,"small",73),l(32),r(33,"translate"),o()(),a(34,"button",19),r(35,"translate"),S("click",function(){y(e);let p=b();return I(p.removeBridgeAccessories())}),d(36,"i",20),o()(),a(37,"li",17)(38,"span",18),l(39),r(40,"translate"),d(41,"br"),a(42,"small",73),l(43),r(44,"translate"),o()(),a(45,"button",19),r(46,"translate"),S("click",function(){y(e);let p=b();return I(p.removeAllCachedAccessories())}),d(47,"i",20),o()()()}if(i&2){let e=b();t(3),g(" ",s(4,14,"settings.accessory.debug")),t(4),u(s(8,16,"settings.accessory.debug_desc")),t(4),m("formControl",e.uiAccDebugFormControl),v("aria-label",s(12,18,"settings.accessory.debug")),t(3),_(e.uiAccDebugIsSaving?14:-1),t(3),g(" ",s(18,20,"reset.accessory_ind.title")),t(4),u(s(22,22,"reset.accessory_ind.desc")),t(2),v("aria-label",s(24,24,"reset.accessory_ind.title")),t(5),g(" ",s(29,26,"reset.bridge_accessories.title")),t(4),u(s(33,28,"reset.bridge_accessories.desc")),t(2),v("aria-label",s(35,30,"reset.accessory_all.title")),t(5),g(" ",s(40,32,"reset.accessory_all.title")),t(4),u(s(44,34,"reset.accessory_all.desc")),t(2),v("aria-label",s(46,36,"reset.accessory_all.title"))}}function En(i,c){i&1&&(a(0,"p",9),l(1),r(2,"translate"),o()),i&2&&(t(),u(s(2,1,"reset.bridges.desc")))}function wn(i,c){if(i&1){let e=k();a(0,"ul",11)(1,"li",17)(2,"span",18),l(3),r(4,"translate"),d(5,"br"),a(6,"small",73),l(7),r(8,"translate"),o()(),a(9,"button",19),r(10,"translate"),S("click",function(){y(e);let p=b();return I(p.unpairAccessory())}),d(11,"i",20),o()(),a(12,"li",17)(13,"span",18),l(14),r(15,"translate"),r(16,"titlecase"),d(17,"br"),a(18,"small",73),l(19),r(20,"translate"),o()(),a(21,"button",19),r(22,"translate"),S("click",function(){y(e);let p=b();return I(p.resetHomebridgeState())}),d(23,"i",20),o()()()}i&2&&(t(3),g(" ",s(4,6,"reset.bridge_ind.title")),t(4),u(s(8,8,"reset.bridge_ind.desc")),t(2),v("aria-label",s(10,10,"reset.bridge_ind.title")),t(5),g(" ",s(16,14,s(15,12,"reset.bridge_all.title"))),t(5),u(s(20,16,"reset.bridge_all.desc")),t(2),v("aria-label",s(22,18,"reset.bridge_all.title")))}var Ko=(()=>{class i{$api=f(V);$modal=f(re);$notification=f(He);$plugin=f(Ge);$router=f(H);$settings=f(X);$toastr=f(D);$translate=f(A);restartToastIsShown=!1;showFields={general:!0,display:!0,startup:!0,network:!0,security:!0,reset:!0,cache:!0};loading=!0;isHbV2=!1;showAvahiMdnsOption=!1;showResolvedMdnsOption=!1;adaptersAvailable=[];adaptersSelected=[];showPfxPassphrase=!1;runningInDocker=this.$settings.env.runningInDocker;runningOnRaspberryPi=this.$settings.env.runningOnRaspberryPi;platform=this.$settings.env.platform;hbNameIsInvalid=!1;hbNameIsSaving=!1;hbNameFormControl=new w("");uiLangIsSaving=!1;uiLangFormControl=new w("");uiThemeIsSaving=!1;uiThemeFormControl=new w("");uiLightIsSaving=!1;uiLightFormControl=new w("");uiMenuIsSaving=!1;uiMenuFormControl=new w("");uiTempIsSaving=!1;uiTempFormControl=new w("");hbDebugIsSaving=!1;hbDebugFormControl=new w(!1);hbInsecureIsSaving=!1;hbInsecureFormControl=new w(!1);hbKeepIsSaving=!1;hbKeepFormControl=new w(!1);hbEnvDebugIsSaving=!1;hbEnvDebugFormControl=new w("");hbEnvNodeIsSaving=!1;hbEnvNodeFormControl=new w("");hbLogSizeIsInvalid=!1;hbLogSizeIsSaving=!1;hbLogSizeFormControl=new w(-1);hbLogTruncateIsInvalid=!1;hbLogTruncateIsSaving=!1;hbLogTruncateFormControl=new w(0);hbMDnsIsSaving=!1;hbMDnsFormControl=new w("");hbPortIsInvalid=!1;hbPortIsSaving=!1;hbPortFormControl=new w(0);hbStartPortIsInvalid=!1;hbStartPortIsSaving=!1;hbStartPortFormControl=new w(0);hbEndPortIsInvalid=!1;hbEndPortIsSaving=!1;hbEndPortFormControl=new w(0);uiPortIsInvalid=!1;uiPortIsSaving=!1;uiPortFormControl=new w(0);uiAuthIsSaving=!1;uiAuthFormControl=new Fe(!0);uiSessionTimeoutIsInvalid=!1;uiSessionTimeoutIsSaving=!1;uiSessionTimeoutFormControl=new w(0);uiSslTypeFormControl=new w("off");uiSslKeyIsSaving=!1;uiSslKeyFormControl=new w("");uiSslCertIsSaving=!1;uiSslCertFormControl=new w("");uiSslPfxIsSaving=!1;uiSslPfxFormControl=new w("");uiSslPassphraseIsSaving=!1;uiSslPassphraseFormControl=new w("");uiHostIsSaving=!1;uiHostFormControl=new w("");uiProxyHostIsSaving=!1;uiProxyHostFormControl=new w("");hbPackageIsSaving=!1;hbPackageFormControl=new w("");uiMetricsIsSaving=!1;uiMetricsFormControl=new w(!0);uiAccDebugIsSaving=!1;uiAccDebugFormControl=new w(!1);uiTempFileIsSaving=!1;uiTempFileFormControl=new w("");hbLinuxShutdownIsSaving=!1;hbLinuxShutdownFormControl=new w("");hbLinuxRestartIsSaving=!1;hbLinuxRestartFormControl=new w("");linkDebug='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Debug-Common-Values" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';ngOnInit(){return x(this,null,function*(){this.isHbV2=this.$settings.env.homebridgeVersion.startsWith("2"),yield this.initNetworkingOptions(),yield this.initStartupSettings(),this.hbNameFormControl.patchValue(this.$settings.env.homebridgeInstanceName),this.hbNameFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.hbNameSave(e)),this.uiLangFormControl.patchValue(this.$settings.env.lang),this.uiLangFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiLangSave(e)),this.uiThemeFormControl.patchValue(this.$settings.theme),this.uiThemeFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiThemeSave(e)),this.uiLightFormControl.patchValue(this.$settings.lightingMode),this.uiLightFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiLightSave(e)),this.uiMenuFormControl.patchValue(this.$settings.menuMode),this.uiMenuFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiMenuSave(e)),this.uiTempFormControl.patchValue(this.$settings.env.temperatureUnits),this.uiTempFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiTempSave(e)),this.hbLogSizeFormControl.patchValue(this.$settings.env.log?.maxSize),this.hbLogSizeFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.hbLogSizeSave(e)),this.hbLogTruncateFormControl.patchValue(this.$settings.env.log?.truncateSize),this.hbLogTruncateFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.hbLogTruncateSave(e)),this.uiPortFormControl.patchValue(this.$settings.env.port),this.uiPortFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.uiPortSave(e)),this.uiAuthFormControl.patchValue(this.$settings.formAuth),this.uiAuthFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiAuthSave(e)),this.uiSessionTimeoutFormControl.patchValue(this.$settings.sessionTimeout),this.uiSessionTimeoutFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiSessionTimeoutSave(e)),this.uiSslKeyFormControl.patchValue(this.$settings.env.ssl?.key||""),this.uiSslKeyFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.uiSslKeySave(e)),this.uiSslCertFormControl.patchValue(this.$settings.env.ssl?.cert||""),this.uiSslCertFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.uiSslCertSave(e)),this.uiSslPfxFormControl.patchValue(this.$settings.env.ssl?.pfx||""),this.uiSslPfxFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.uiSslPfxSave(e)),this.uiSslPassphraseFormControl.patchValue(this.$settings.env.ssl?.passphrase||""),this.uiSslPassphraseFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.uiSslPassphraseSave(e)),this.uiSslTypeFormControl.patchValue(this.uiSslKeyFormControl.value||this.uiSslCertFormControl.value?"keycert":this.uiSslPfxFormControl.value||this.uiSslPassphraseFormControl.value?"pfx":"off"),this.uiSslTypeFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiSslTypeSave(e)),this.uiHostFormControl.patchValue(this.$settings.env.host||""),this.uiHostFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.uiHostSave(e)),this.uiProxyHostFormControl.patchValue(this.$settings.env.proxyHost||""),this.uiProxyHostFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.uiProxyHostSave(e)),this.hbPackageFormControl.patchValue(this.$settings.env.homebridgePackagePath||""),this.hbPackageFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.hbPackageSave(e)),this.uiMetricsFormControl.patchValue(!this.$settings.env.disableServerMetricsMonitoring),this.uiMetricsFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiMetricsSave(e)),this.uiAccDebugFormControl.patchValue(this.$settings.env.accessoryControl?.debug),this.uiAccDebugFormControl.valueChanges.pipe(E(750)).subscribe(e=>this.uiAccDebugSave(e)),this.uiTempFileFormControl.patchValue(this.$settings.env.temp),this.uiTempFileFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.uiTempFileSave(e)),this.hbLinuxShutdownFormControl.patchValue(this.$settings.env.linux?.shutdown),this.hbLinuxShutdownFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.hbLinuxShutdownSave(e)),this.hbLinuxRestartFormControl.patchValue(this.$settings.env.linux?.restart),this.hbLinuxRestartFormControl.valueChanges.pipe(E(1500)).subscribe(e=>this.hbLinuxRestartSave(e)),this.loading=!1})}openBackupModal(){this.$modal.open(me,{size:"lg",backdrop:"static"})}openWallpaperModal(){this.$modal.open(rt,{size:"lg",backdrop:"static"})}resetHomebridgeState(){this.$modal.open(it,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(at,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open(et,{size:"lg",backdrop:"static"})}accessoryUiControl(){return x(this,null,function*(){try{let e=this.$modal.open(qe,{size:"lg",backdrop:"static"});e.componentInstance.existingBlacklist=this.$settings.env.accessoryControl?.instanceBlacklist||[],yield e.result,this.showRestartToast()}catch(e){e!=="Dismiss"&&(console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error")))}})}removeSingleCachedAccessories(){this.$modal.open(Ke,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open(tt,{size:"lg",backdrop:"static"})}selectNetworkInterfaces(){return x(this,null,function*(){let e=this.$modal.open(ot,{size:"lg",backdrop:"static"});e.componentInstance.adaptersAvailable=this.adaptersAvailable,e.componentInstance.adaptersSelected=this.adaptersSelected;try{let n=yield e.result;this.buildBridgeNetworkAdapterList(n),yield T(this.$api.put("/server/network-interfaces/bridge",{adapters:n})),this.showRestartToast()}catch(n){n!=="Dismiss"&&(console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")))}})}toggleSection(e){this.showFields[e]=!this.showFields[e]}initStartupSettings(){return x(this,null,function*(){try{let e=yield T(this.$api.get("/platform-tools/hb-service/homebridge-startup-settings"));this.hbDebugFormControl.patchValue(e.HOMEBRIDGE_DEBUG),this.hbDebugFormControl.valueChanges.pipe(E(750)).subscribe(n=>this.hbDebugSave(n)),this.hbInsecureFormControl.patchValue(e.HOMEBRIDGE_INSECURE),this.hbInsecureFormControl.valueChanges.pipe(E(750)).subscribe(n=>this.hbInsecureSave(n)),this.hbKeepFormControl.patchValue(e.HOMEBRIDGE_KEEP_ORPHANS),this.hbKeepFormControl.valueChanges.pipe(E(750)).subscribe(n=>this.hbKeepSave(n)),this.hbEnvDebugFormControl.patchValue(e.ENV_DEBUG),this.hbEnvDebugFormControl.valueChanges.pipe(E(1500)).subscribe(n=>this.hbEnvDebugSave(n)),this.hbEnvNodeFormControl.patchValue(e.ENV_NODE_OPTIONS),this.hbEnvNodeFormControl.valueChanges.pipe(E(1500)).subscribe(n=>this.hbEnvNodeSave(n))}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}initNetworkingOptions(){return x(this,null,function*(){try{yield this.getNetworkSettings(),(this.$settings.env.runningInLinux||this.$settings.env.runningInDocker||this.$settings.env.runningInSynologyPackage||this.$settings.env.runningInPackageMode)&&(this.showAvahiMdnsOption=!0,this.showResolvedMdnsOption=!0)}catch(e){console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}getNetworkSettings(){return x(this,null,function*(){return Promise.all([T(this.$api.get("/server/network-interfaces/system")),T(this.$api.get("/server/network-interfaces/bridge")),T(this.$api.get("/server/mdns-advertiser")),T(this.$api.get("/server/port")),T(this.$api.get("/server/ports"))]).then(([e,n,p,C,J])=>{this.adaptersAvailable=e,this.buildBridgeNetworkAdapterList(n),this.hbMDnsFormControl.patchValue(p.advertiser),this.hbMDnsFormControl.valueChanges.pipe(E(750)).subscribe(q=>this.hbMDnsSave(q)),this.hbPortFormControl.patchValue(C.port),this.hbPortFormControl.valueChanges.pipe(E(1500)).subscribe(q=>this.hbPortSave(q)),this.hbStartPortFormControl.patchValue(J.start),this.hbStartPortFormControl.valueChanges.pipe(E(1500)).subscribe(q=>this.hbStartPortSave(q)),this.hbEndPortFormControl.patchValue(J.end),this.hbEndPortFormControl.valueChanges.pipe(E(1500)).subscribe(q=>this.hbEndPortSave(q))})})}saveUiSettingChange(e,n){return x(this,null,function*(){try{yield T(this.$api.put("/config-editor/ui",{key:e,value:n}))}catch(p){console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}hbNameSave(e){return x(this,null,function*(){if(!e||!/^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u.test(e)){this.hbNameIsInvalid=!0;return}try{this.hbNameIsSaving=!0,yield T(this.$api.put("/server/name",{name:e})),this.$settings.setEnvItem("homebridgeInstanceName",e),this.hbNameIsInvalid=!1,setTimeout(()=>{this.hbNameIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbNameIsSaving=!1}})}uiLangSave(e){return x(this,null,function*(){try{this.uiLangIsSaving=!0,this.$settings.setLang(e),yield this.saveUiSettingChange("lang",e),setTimeout(()=>{this.uiLangIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiLangIsSaving=!1}})}uiThemeSave(e){return x(this,null,function*(){try{this.uiThemeIsSaving=!0,this.$settings.setTheme(e),yield this.saveUiSettingChange("theme",e),setTimeout(()=>{this.uiThemeIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiThemeIsSaving=!1}})}uiLightSave(e){return x(this,null,function*(){try{this.uiLightIsSaving=!0,this.$settings.setLightingMode(e,"user"),yield this.saveUiSettingChange("lightingMode",e),setTimeout(()=>{this.uiLightIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiLightIsSaving=!1}})}uiMenuSave(e){return x(this,null,function*(){try{this.uiMenuIsSaving=!0,this.$settings.setMenuMode(e),yield this.saveUiSettingChange("menuMode",e),window.location.reload()}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiMenuIsSaving=!1}})}uiTempSave(e){return x(this,null,function*(){try{this.uiTempIsSaving=!0,this.$settings.setEnvItem("temperatureUnits",e),yield this.saveUiSettingChange("tempUnits",e),setTimeout(()=>{this.uiTempIsSaving=!1},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiTempIsSaving=!1}})}hbDebugSave(e){return x(this,null,function*(){try{this.hbDebugIsSaving=!0,yield T(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:e,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value})),setTimeout(()=>{this.hbDebugIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbDebugIsSaving=!1}})}hbInsecureSave(e){return x(this,null,function*(){try{this.hbInsecureIsSaving=!0,yield T(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:e,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value})),setTimeout(()=>{this.hbInsecureIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbInsecureIsSaving=!1}})}hbKeepSave(e){return x(this,null,function*(){try{this.hbKeepIsSaving=!0,yield T(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:e,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value})),setTimeout(()=>{this.hbKeepIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbKeepIsSaving=!1}})}hbEnvDebugSave(e){return x(this,null,function*(){try{this.hbEnvDebugIsSaving=!0,yield T(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:e,ENV_NODE_OPTIONS:this.hbEnvNodeFormControl.value})),setTimeout(()=>{this.hbEnvDebugIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbEnvDebugIsSaving=!1}})}hbEnvNodeSave(e){return x(this,null,function*(){try{this.hbEnvNodeIsSaving=!0,yield T(this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",{HOMEBRIDGE_DEBUG:this.hbDebugFormControl.value,HOMEBRIDGE_KEEP_ORPHANS:this.hbKeepFormControl.value,HOMEBRIDGE_INSECURE:this.hbInsecureFormControl.value,ENV_DEBUG:this.hbEnvDebugFormControl.value,ENV_NODE_OPTIONS:e})),setTimeout(()=>{this.hbEnvNodeIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbEnvNodeIsSaving=!1}})}hbLogSizeSave(e){return x(this,null,function*(){if(e&&(typeof e!="number"||e<-1||Number.isInteger(e)===!1)){this.hbLogSizeIsInvalid=!0;return}try{this.hbLogSizeIsSaving=!0,this.$settings.setEnvItem("log.maxSize",e),(!e||e===-1)&&(yield this.saveUiSettingChange("log.truncateSize",null),this.hbLogTruncateIsInvalid=!1),yield this.saveUiSettingChange("log.maxSize",e),this.hbLogSizeIsInvalid=!1,setTimeout(()=>{this.hbLogSizeIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbLogSizeIsSaving=!1}})}hbLogTruncateSave(e){return x(this,null,function*(){if(e&&(typeof e!="number"||e<0||Number.isInteger(e)===!1)){this.hbLogTruncateIsInvalid=!0;return}try{this.hbLogTruncateIsSaving=!0,this.$settings.setEnvItem("log.truncateSize",e),yield this.saveUiSettingChange("log.truncateSize",e),this.hbLogTruncateIsInvalid=!1,setTimeout(()=>{this.hbLogTruncateIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbLogTruncateIsSaving=!1}})}hbMDnsSave(e){return x(this,null,function*(){try{this.hbMDnsIsSaving=!0,yield T(this.$api.put("/server/mdns-advertiser",{advertiser:e})),setTimeout(()=>{this.hbMDnsIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbMDnsIsSaving=!1}})}hbPortSave(e){return x(this,null,function*(){if(e===this.uiPortFormControl.value){this.hbPortIsInvalid=!0;return}try{this.hbPortIsSaving=!0,yield T(this.$api.put("/server/port",{port:e})),this.hbPortIsInvalid=!1,setTimeout(()=>{this.hbPortIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbPortIsSaving=!1}})}hbStartPortSave(e){return x(this,null,function*(){try{this.hbStartPortIsSaving=!0,yield T(this.$api.put("/server/ports",{start:e,end:this.hbEndPortFormControl.value})),this.hbStartPortIsInvalid=!1,setTimeout(()=>{this.hbStartPortIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbStartPortIsSaving=!1}})}hbEndPortSave(e){return x(this,null,function*(){try{this.hbEndPortIsSaving=!0,yield T(this.$api.put("/server/ports",{start:this.hbStartPortFormControl.value,end:e})),this.hbEndPortIsInvalid=!1,setTimeout(()=>{this.hbEndPortIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbEndPortIsSaving=!1}})}uiPortSave(e){return x(this,null,function*(){if(!e||typeof e!="number"||e<1025||e>65533||Number.isInteger(e)===!1||e===this.hbPortFormControl.value){this.uiPortIsInvalid=!0;return}try{this.uiPortIsSaving=!0,this.$settings.setEnvItem("port",e),yield this.saveUiSettingChange("port",e),this.uiPortIsInvalid=!1,setTimeout(()=>{this.uiPortIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiPortIsSaving=!1}})}uiAuthSave(e){return x(this,null,function*(){try{this.uiAuthIsSaving=!0,this.$settings.setItem("formAuth",e),yield this.saveUiSettingChange("auth",e?"form":"none"),this.$notification.formAuthEnabled.next(e),setTimeout(()=>{this.uiAuthIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiAuthIsSaving=!1}})}uiSessionTimeoutSave(e){return x(this,null,function*(){if(e&&(typeof e!="number"||e<600||e>864e5||Number.isInteger(e)===!1)){this.uiSessionTimeoutIsInvalid=!0;return}try{this.uiSessionTimeoutIsSaving=!0,this.$settings.setItem("sessionTimeout",e),yield this.saveUiSettingChange("sessionTimeout",e),this.uiSessionTimeoutIsInvalid=!1,setTimeout(()=>{this.uiSessionTimeoutIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSessionTimeoutIsSaving=!1}})}uiSslKeySave(e){return x(this,null,function*(){try{this.uiSslKeyIsSaving=!0,this.$settings.setEnvItem("ssl.key",e),yield this.saveUiSettingChange("ssl.key",e),setTimeout(()=>{this.uiSslKeyIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSslKeyIsSaving=!1}})}uiSslCertSave(e){return x(this,null,function*(){try{this.uiSslCertIsSaving=!0,this.$settings.setEnvItem("ssl.cert",e),yield this.saveUiSettingChange("ssl.cert",e),setTimeout(()=>{this.uiSslCertIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSslCertIsSaving=!1}})}uiSslPfxSave(e){return x(this,null,function*(){try{this.uiSslPfxIsSaving=!0,this.$settings.setEnvItem("ssl.pfx",e),yield this.saveUiSettingChange("ssl.pfx",e),setTimeout(()=>{this.uiSslPfxIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSslPfxIsSaving=!1}})}uiSslPassphraseSave(e){return x(this,null,function*(){try{this.uiSslPassphraseIsSaving=!0,this.$settings.setEnvItem("ssl.passphrase",e),yield this.saveUiSettingChange("ssl.passphrase",e),setTimeout(()=>{this.uiSslPassphraseIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiSslPassphraseIsSaving=!1}})}uiSslTypeSave(e){return x(this,null,function*(){switch(e){case"keycert":this.uiSslPfxFormControl.patchValue("",{emitEvent:!1}),this.uiSslPassphraseFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.pfx",""),this.$settings.setEnvItem("ssl.passphrase","");break;case"pfx":this.uiSslKeyFormControl.patchValue("",{emitEvent:!1}),this.uiSslCertFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.key",""),this.$settings.setEnvItem("ssl.cert","");break;default:this.uiSslKeyFormControl.patchValue("",{emitEvent:!1}),this.uiSslCertFormControl.patchValue("",{emitEvent:!1}),this.uiSslPfxFormControl.patchValue("",{emitEvent:!1}),this.uiSslPassphraseFormControl.patchValue("",{emitEvent:!1}),this.$settings.setEnvItem("ssl.key",""),this.$settings.setEnvItem("ssl.cert",""),this.$settings.setEnvItem("ssl.pfx",""),this.$settings.setEnvItem("ssl.passphrase",""),yield this.saveUiSettingChange("ssl",""),this.showRestartToast()}})}uiHostSave(e){return x(this,null,function*(){try{this.uiHostIsSaving=!0,this.$settings.setEnvItem("host",e),yield this.saveUiSettingChange("host",e),setTimeout(()=>{this.uiHostIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiHostIsSaving=!1}})}uiProxyHostSave(e){return x(this,null,function*(){try{this.uiProxyHostIsSaving=!0,this.$settings.setEnvItem("proxyHost",e),yield this.saveUiSettingChange("proxyHost",e),setTimeout(()=>{this.uiProxyHostIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiProxyHostIsSaving=!1}})}hbPackageSave(e){return x(this,null,function*(){try{this.hbPackageIsSaving=!0,this.$settings.setEnvItem("homebridgePackagePath",e),yield this.saveUiSettingChange("homebridgePackagePath",e),setTimeout(()=>{this.hbPackageIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbPackageIsSaving=!1}})}uiMetricsSave(e){return x(this,null,function*(){try{this.uiMetricsIsSaving=!0,this.$settings.setEnvItem("disableServerMetricsMonitoring",!e),yield this.saveUiSettingChange("disableServerMetricsMonitoring",!e),setTimeout(()=>{this.uiMetricsIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiMetricsIsSaving=!1}})}uiAccDebugSave(e){return x(this,null,function*(){try{this.uiAccDebugIsSaving=!0,this.$settings.setEnvItem("accessoryControl.debug",e),yield this.saveUiSettingChange("accessoryControl.debug",e),setTimeout(()=>{this.uiAccDebugIsSaving=!1,this.showRestartToast()},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiAccDebugIsSaving=!1}})}uiTempFileSave(e){return x(this,null,function*(){try{this.uiTempFileIsSaving=!0,this.$settings.setEnvItem("temp",e),yield this.saveUiSettingChange("temp",e),setTimeout(()=>{this.uiTempFileIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.uiTempFileIsSaving=!1}})}hbLinuxShutdownSave(e){return x(this,null,function*(){try{this.hbLinuxShutdownIsSaving=!0,this.$settings.setEnvItem("linux.shutdown",e),yield this.saveUiSettingChange("linux.shutdown",e),setTimeout(()=>{this.hbLinuxShutdownIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbLinuxShutdownIsSaving=!1}})}hbLinuxRestartSave(e){return x(this,null,function*(){try{this.hbLinuxRestartIsSaving=!0,this.$settings.setEnvItem("linux.restart",e),yield this.saveUiSettingChange("linux.restart",e),setTimeout(()=>{this.hbLinuxRestartIsSaving=!1,this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>this.showRestartToast(),error:n=>{console.error(n),this.showRestartToast()}})},1e3)}catch(n){console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error")),this.hbLinuxRestartIsSaving=!1}})}buildBridgeNetworkAdapterList(e){if(!e.length){this.adaptersSelected=[];return}this.adaptersSelected=e.map(n=>{let p=this.adaptersAvailable.find(C=>C.iface===n);return p?{iface:p.iface,selected:!0,missing:!1,ip4:p.ip4,ip6:p.ip6}:{iface:n,selected:!0,missing:!0}})}showRestartToast(){if(!this.restartToastIsShown){this.restartToastIsShown=!0;let e=this.$toastr.info(this.$translate.instant("settings.changes.saved"),this.$translate.instant("menu.hbrestart.title"),{timeOut:0,tapToDismiss:!0,disableTimeOut:!0,positionClass:"toast-bottom-right",enableHtml:!0});e&&e.onTap&&e.onTap.subscribe(()=>{this.$router.navigate(["/restart"])})}}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:50,vars:67,consts:[[1,"primary-text","m-0"],[1,"my-4"],["role","button","tabindex","0",1,"mt-3","hover-pointer",3,"click"],[1,"primary-text"],[1,"fa","fa-fw",3,"ngClass"],["id","fieldsGeneral",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsDisplay",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsNetwork",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsSecurity",1,"list-group","list-group-box","mt-2","mx-0"],[1,"small","grey-text","mb-2","mx-0"],["id","fieldsCache",1,"list-group","list-group-box","mb-4","mx-0"],["id","fieldsReset",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],[1,"list-group-item","d-block","d-md-flex","justify-content-between","align-items-center"],[1,"my-3","my-md-0","pl-0","pl-md-5","w-auto","d-flex","align-items-center"],["type","text",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[1,"fas","fa-fw","fa-floppy-disk","primary-text","fa-xl","me-0","me-md-2","ms-2","ms-md-0","order-2","order-md-1"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pe-2"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["routerLink","/users",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"my-3","my-md-0","ps-0","ps-md-5","w-auto","d-flex","align-items-center"],[1,"custom-select","resp-select","order-1","order-md-2",3,"formControl"],["value","auto"],["value","bg"],["value","ca"],["value","zh-CN"],["value","zh-TW"],["value","cs"],["value","nl"],["value","en"],["value","fi"],["value","fr"],["value","de"],["value","he"],["value","hu"],["value","id"],["value","it"],["value","ja"],["value","ko"],["value","mk"],["value","no"],["value","pl"],["value","pt-BR"],["value","pt"],["value","ru"],["value","sl"],["value","es"],["value","sv"],["value","th"],["value","tr"],["value","uk"],["value","orange"],["value","red"],["value","pink"],["value","purple"],["value","deep-purple"],["value","indigo"],["value","blue"],["value","blue-grey"],["value","cyan"],["value","green"],["value","teal"],["value","grey"],["value","brown"],["value","light"],["value","dark"],["value","default"],["value","freeze"],["value","c"],["value","f"],["id","fieldsStartup",1,"list-group","list-group-box","mb-4","mx-0"],[1,"grey-text","pe-2"],[1,"d-flex","align-items-center"],[1,"order-1","order-md-2"],["type","checkbox","id","homebridgeDebugMode",1,"rendux-input",3,"formControl"],["for","homebridgeDebugMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeInsecureMode",1,"rendux-input",3,"formControl"],["for","homebridgeInsecureMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeKeepOrphans",1,"rendux-input",3,"formControl"],["for","homebridgeKeepOrphans",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeMetrics",1,"rendux-input",3,"formControl"],["for","homebridgeMetrics",1,"rendux-label","ms-3",2,"min-width","50px"],["type","text","placeholder","/usr/local/lib/node_modules/homebridge",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],[1,"font-monospace"],[1,"grey-text","pe-2",3,"innerHTML"],["type","text","placeholder","HAP-NodeJS:Advertiser,HAP-NodeJS:Service",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","--max-old-space-size=512 --max-http-header-size=8192",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","number","min","-1","placeholder","1000000",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","text","placeholder","shutdown",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","reboot",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/sys/class/thermal/thermal_zone0/temp",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["routerLink","/platform-tools/docker/startup-script",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],["type","number","min","0","placeholder","200000",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[1,"small","grey-text","pe-2"],[1,"badge","badge-primary","me-1",3,"ngClass"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click","disabled"],["value","avahi"],["value","ciao"],["value","bonjour-hap"],["value","resolved"],["type","number","min","1025","max","65533",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","number","min","1025","max","65533","placeholder","8581",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],[1,"grey-text","pe-2",3,"innerHtml"],["type","text","pattern","^[^{}/ :\\\\]+(?::\\d+)?$","placeholder","0.0.0.0",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","pattern","^[^{}/ :\\\\]+(?::\\d+)?$","placeholder","example.com:8443",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],[1,"fas","fa-fw","fa-exclamation-triangle"],[1,"fw-normal"],["type","checkbox","id","uiAuthForm",1,"rendux-input",3,"formControl"],["for","uiAuthForm",1,"rendux-label","ms-3",2,"min-width","50px"],["value","off"],["value","keycert"],["value","pfx"],["type","number","min","600","max","86400000","placeholder","28800",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl","ngClass"],["type","text","placeholder","/Users/.../certs/server.key",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/Users/.../certs/server.crt",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["type","text","placeholder","/Users/.../certs/server.pfx",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"formControl"],["placeholder","mypassphrase",1,"form-control","custom-input","resp-input","order-1","order-md-2",3,"focus","blur","type","formControl"],["type","checkbox","id","accessoryDebug",1,"rendux-input",3,"formControl"],["for","accessoryDebug",1,"rendux-label","ms-3",2,"min-width","50px"]],template:function(n,p){n&1&&(h(0,wi,1,0,"app-spinner"),a(1,"h3",0),l(2),r(3,"translate"),o(),a(4,"div",1)(5,"div",2),S("click",function(){return p.toggleSection("general")}),a(6,"h5",3),d(7,"i",4),l(8),r(9,"translate"),o()(),h(10,Ti,23,23,"ul",5),o(),a(11,"div",1)(12,"div",2),S("click",function(){return p.toggleSection("display")}),a(13,"h5",3),d(14,"i",4),l(15),r(16,"translate"),o()(),h(17,Ai,157,94,"ul",6),o(),h(18,Zi,7,10,"div",1),a(19,"div",1)(20,"div",2),S("click",function(){return p.toggleSection("network")}),a(21,"h5",3),d(22,"i",4),l(23),r(24,"translate"),o()(),h(25,mn,104,104,"ul",7),o(),a(26,"div",1)(27,"div",2),S("click",function(){return p.toggleSection("security")}),a(28,"h5",3),d(29,"i",4),l(30),r(31,"translate"),o()(),h(32,Sn,49,42,"ul",8),o(),a(33,"div",1)(34,"div",2),S("click",function(){return p.toggleSection("cache")}),a(35,"h5",3),d(36,"i",4),l(37),r(38,"translate"),o()(),h(39,yn,3,3,"p",9),h(40,kn,48,38,"ul",10),o(),a(41,"div",1)(42,"div",2),S("click",function(){return p.toggleSection("reset")}),a(43,"h5",3),d(44,"i",4),l(45),r(46,"translate"),o()(),h(47,En,3,3,"p",9),h(48,wn,24,20,"ul",11),o(),d(49,"div",12)),n&2&&(_(p.loading?0:-1),t(2),u(s(3,35,"menu.settings.title")),t(3),v("aria-expanded",p.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),t(2),m("ngClass",F(49,Z,p.showFields.general,!p.showFields.general)),t(),g(" ",s(9,37,"settings.general.title_general")," "),t(2),_(p.showFields.general?10:-1),t(2),v("aria-expanded",p.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),t(2),m("ngClass",F(52,Z,p.showFields.display,!p.showFields.display)),t(),g(" ",s(16,39,"settings.general.title_display")," "),t(2),_(p.showFields.display?17:-1),t(),_(p.runningInDocker?18:-1),t(2),v("aria-expanded",p.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),t(2),m("ngClass",F(55,Z,p.showFields.network,!p.showFields.network)),t(),g(" ",s(24,41,"settings.network.title_network")," "),t(2),_(p.showFields.network?25:-1),t(2),v("aria-expanded",p.showFields.security?"true":"false")("aria-controls","fieldsSecurity"),t(2),m("ngClass",F(58,Z,p.showFields.security,!p.showFields.security)),t(),g(" ",s(31,43,"settings.network.title_security")," "),t(2),_(p.showFields.security?32:-1),t(2),v("aria-expanded",p.showFields.cache?"true":"false")("aria-controls","fieldsCache"),t(2),m("ngClass",F(61,Z,p.showFields.cache,!p.showFields.cache)),t(),g(" ",s(38,45,"settings.cache.title")," "),t(2),_(p.showFields.cache?39:-1),t(),_(p.showFields.cache?40:-1),t(2),v("aria-expanded",p.showFields.reset?"true":"false")("aria-controls","fieldsReset"),t(2),m("ngClass",F(64,Z,p.showFields.reset,!p.showFields.reset)),t(),g(" ",s(46,47,"reset.bridges.title")," "),t(2),_(p.showFields.reset?47:-1),t(),_(p.showFields.reset?48:-1))},dependencies:[j,Oe,ae,Ae,De,le,Re,ie,Me,ne,Le,Ne,Ve,oe,pe,We,te,R],encapsulation:2,data:{animation:[$e("fadeInOut",[ge(":enter",[se({opacity:0}),_e("750ms",se({opacity:1}))]),ge(":leave",[_e("750ms",se({opacity:0}))])])]}})}return i})();export{Ko as SettingsComponent};
|