homebridge-config-ui-x 5.0.0-beta.51 → 5.0.0-beta.52
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 +3 -1
- package/package.json +14 -14
- package/public/chunk-275KUFU5.js +1 -0
- package/public/{chunk-4ANMJJ3Y.js → chunk-2TXKGWMR.js} +1 -1
- package/public/{chunk-NQKVHBGX.js → chunk-2UDC7EMX.js} +1 -1
- package/public/{chunk-7VOWKBC5.js → chunk-2WNK6SOS.js} +1 -1
- package/public/{chunk-CF74UVXM.js → chunk-3EGZ5RTQ.js} +1 -1
- package/public/chunk-3SK2YI5N.js +1 -0
- package/public/{chunk-4ASVYUZP.js → chunk-3XIIWU5P.js} +1 -1
- package/public/chunk-44C4SVOH.js +1 -0
- package/public/{chunk-TRKPIOD5.js → chunk-4B7IZE2P.js} +1 -1
- package/public/chunk-4ZZTRP44.js +1 -0
- package/public/chunk-54WT3CWA.js +1 -0
- package/public/chunk-55LWQ27W.js +1 -0
- package/public/chunk-56QTN3FM.js +1 -0
- package/public/chunk-5YCO5TXF.js +1 -0
- package/public/chunk-6CVPCQKP.js +1 -0
- package/public/{chunk-GKS2WGAQ.js → chunk-6EWOCV2F.js} +1 -1
- package/public/{chunk-5ZFJ4INX.js → chunk-6JK2KWCJ.js} +1 -1
- package/public/{chunk-EDFYZGGZ.js → chunk-6WEQLPNK.js} +1 -1
- package/public/{chunk-YKBVU6AV.js → chunk-7V7FVNQR.js} +1 -1
- package/public/chunk-BAWBN252.js +1 -0
- package/public/chunk-BCX23V6Z.js +1 -0
- package/public/{chunk-XSKOJB4V.js → chunk-BEXZ3EKZ.js} +1 -1
- package/public/{chunk-UCAC3YJL.js → chunk-CJSSN6RK.js} +1 -1
- package/public/{chunk-ATKY7BPX.js → chunk-CYO7GF7S.js} +1 -1
- package/public/{chunk-VIPLB6ON.js → chunk-DNCUP6B7.js} +2 -2
- package/public/{chunk-4MDIQGUS.js → chunk-DZNGJOAD.js} +1 -1
- package/public/chunk-E7HFXMQC.js +1 -0
- package/public/chunk-F3FEWT6G.js +1 -0
- package/public/{chunk-DMDPOVJW.js → chunk-FHOSQQJ4.js} +1 -1
- package/public/{chunk-I4RJOFJA.js → chunk-FNBFKTZI.js} +1 -1
- package/public/chunk-G4RNPDKM.js +1 -0
- package/public/{chunk-PWYRMEUF.js → chunk-GKSJJJEG.js} +1 -1
- package/public/{chunk-XRJZ7K7S.js → chunk-GZSXNYQC.js} +1 -1
- package/public/{chunk-FPILNIO7.js → chunk-HG7ORW3R.js} +1 -1
- package/public/chunk-HSKPWR6T.js +1 -0
- package/public/{chunk-ZJLAMLYN.js → chunk-IC7Y4XQH.js} +1 -1
- package/public/{chunk-O6CWJLIA.js → chunk-IFJS5HBB.js} +1 -1
- package/public/chunk-JKRWJSXD.js +1 -0
- package/public/{chunk-ZV6IGHL6.js → chunk-JN4WEHM3.js} +1 -1
- package/public/chunk-JXE2EDWO.js +1 -0
- package/public/{chunk-Q4TOTCFN.js → chunk-KQ4WIJTU.js} +1 -1
- package/public/{chunk-CBCEQDGK.js → chunk-LRNCAR4N.js} +1 -1
- package/public/{chunk-NHG4TUCE.js → chunk-MAIN5YCW.js} +1 -1
- package/public/{chunk-GKJDQJXY.js → chunk-MFP6D5U2.js} +15 -15
- package/public/{chunk-7BDTDCEB.js → chunk-NPCZCOZC.js} +1 -1
- package/public/chunk-NU7ESJEV.js +1 -0
- package/public/chunk-NVNBNEFN.js +7 -0
- package/public/{chunk-HBOJTK3W.js → chunk-O2IBEQMY.js} +1 -1
- package/public/chunk-OPHOXI7M.js +1 -0
- package/public/chunk-OSNLCRQT.js +1 -0
- package/public/{chunk-EJHOKTHW.js → chunk-OY5MWFSR.js} +1 -1
- package/public/{chunk-4ODGBS6J.js → chunk-OYB4GWS2.js} +1 -1
- package/public/{chunk-IBW35LGZ.js → chunk-PSSA4PHP.js} +1 -1
- package/public/{chunk-AWS7TJOY.js → chunk-PZNRYHHJ.js} +1 -1
- package/public/chunk-QBDCMHMS.js +1 -0
- package/public/chunk-R23RQFWE.js +1 -0
- package/public/{chunk-OH2VPUYU.js → chunk-R5JL6NY3.js} +1 -1
- package/public/{chunk-ZMPWO4WI.js → chunk-RIXGXWCM.js} +1 -1
- package/public/chunk-RJFVCCT6.js +1 -0
- package/public/{chunk-RLOJ4URV.js → chunk-SLUFR3ON.js} +1 -1
- package/public/{chunk-PPKGVJBE.js → chunk-SMBDBPLM.js} +1 -1
- package/public/{chunk-RVTJXBND.js → chunk-T75TOYED.js} +1 -1
- package/public/{chunk-XNFEKMGG.js → chunk-TG6N743W.js} +1 -1
- package/public/{chunk-TF3VIHQQ.js → chunk-TK4BPPSX.js} +1 -1
- package/public/{chunk-ZTTWZU4Q.js → chunk-UFCYTM46.js} +1 -1
- package/public/{chunk-LT62K2G6.js → chunk-UMSMYWYC.js} +1 -1
- package/public/chunk-UXKMPYAN.js +1 -0
- package/public/{chunk-S7LSMLK2.js → chunk-V5C6TH72.js} +1 -1
- package/public/{chunk-RGZ4UMYA.js → chunk-V65HN5SX.js} +1 -1
- package/public/chunk-W3U5YRAT.js +1 -0
- package/public/{chunk-IJOPQHDM.js → chunk-WCXU6QPE.js} +1 -1
- package/public/{chunk-R35OKBR7.js → chunk-WPESHLCE.js} +1 -1
- package/public/{chunk-KGJAZDYN.js → chunk-X3ZB4QGO.js} +1 -1
- package/public/{chunk-Z4VQJOCM.js → chunk-XBIY2EKP.js} +1 -1
- package/public/{chunk-RJ6HXANU.js → chunk-XHTRCMG4.js} +1 -1
- package/public/{chunk-FXH7UJ5I.js → chunk-Y5URZ5MZ.js} +1 -1
- package/public/{chunk-UY5XIM7B.js → chunk-YCKXYAPE.js} +1 -1
- package/public/{chunk-R2YGI2OS.js → chunk-YPMZ3DYC.js} +1 -1
- package/public/chunk-YPSV6VWW.js +1 -0
- package/public/chunk-Z5KABSBS.js +1 -0
- package/public/{chunk-E4TY3GD7.js → chunk-ZNQOGJMW.js} +1 -1
- package/public/chunk-ZS7TMHAN.js +1 -0
- package/public/chunk-ZSUARIC5.js +1 -0
- package/public/index.html +1 -1
- package/public/{main-MNVDWH2C.js → main-4MY7DYH6.js} +1 -1
- package/public/polyfills-JNAS3VFQ.js +2 -0
- package/public/chunk-4GO2ER3F.js +0 -1
- package/public/chunk-5PONL6FC.js +0 -1
- package/public/chunk-6LV4FEWJ.js +0 -1
- package/public/chunk-7PQEY6AT.js +0 -1
- package/public/chunk-AJVPO262.js +0 -1
- package/public/chunk-AZRFXNOQ.js +0 -1
- package/public/chunk-EC7UWAIJ.js +0 -1
- package/public/chunk-EMSBT2VW.js +0 -1
- package/public/chunk-F5HFYQPC.js +0 -1
- package/public/chunk-FGRVUXCU.js +0 -1
- package/public/chunk-H7QJNST5.js +0 -1
- package/public/chunk-HSF575TE.js +0 -1
- package/public/chunk-JZIPYGE6.js +0 -1
- package/public/chunk-KN3QRU4A.js +0 -1
- package/public/chunk-L2R4XPOU.js +0 -1
- package/public/chunk-LHRPSEZP.js +0 -1
- package/public/chunk-NUX2WN3X.js +0 -7
- package/public/chunk-OIIFJ7L5.js +0 -1
- package/public/chunk-OZNUTRGZ.js +0 -1
- package/public/chunk-QYC6YOSS.js +0 -1
- package/public/chunk-QZOMUMX6.js +0 -1
- package/public/chunk-RHAWMCG6.js +0 -1
- package/public/chunk-RMQTDYIN.js +0 -1
- package/public/chunk-RZ7AYZQX.js +0 -1
- package/public/chunk-TXZ2N2XM.js +0 -1
- package/public/chunk-XR25UPXG.js +0 -1
- package/public/chunk-Y54VXXJK.js +0 -1
- package/public/chunk-YUORH5KC.js +0 -1
- package/public/chunk-Z2STW2WN.js +0 -1
- package/public/chunk-ZFCY3QWG.js +0 -1
- package/public/polyfills-C6JHVXJJ.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-PWYRMEUF.js";import{a as Z,b as ne}from"./chunk-KGJAZDYN.js";import{a as W,b as Y}from"./chunk-OH2VPUYU.js";import{a as X}from"./chunk-EDFYZGGZ.js";import{m as J,n as K,o as U}from"./chunk-IJOPQHDM.js";import{c as N,e as F,l as q,y as z}from"./chunk-ZFCY3QWG.js";import{b as G}from"./chunk-RZ7AYZQX.js";import{b as Q}from"./chunk-FXH7UJ5I.js";import{h as M,k as V}from"./chunk-LHRPSEZP.js";import{a as k,b as T}from"./chunk-7VOWKBC5.js";import{Ac as s,Bc as d,Cc as O,Jb as b,Kb as v,Pb as m,Rb as I,Sb as j,Tb as H,Ub as r,Vb as a,Wb as w,_b as _,bc as h,cc as l,g as oe,gb as n,gd as L,h as S,lb as D,ma as u,mc as C,nc as x,oc as E,rc as R,sc as P,tb as $,tc as B,ua as f,va as g,w as A,zb as y}from"./chunk-NUX2WN3X.js";var ie=oe(ne(),1);function ae(o,p){o&1&&(r(0,"div",5),w(1,"i",12),a())}function se(o,p){if(o&1){let e=_();r(0,"li",17),C(1),s(2,"date"),r(3,"button",18),s(4,"translate"),h("click",function(){let t=f(e).$implicit,c=l(3);return g(c.restore(t.id))}),w(5,"i",19),a()()}if(o&2){let e=p.$implicit;n(),E(" ",O(2,2,e.timestamp,"medium")," "),n(2),b("aria-label",d(4,5,"config.restore.copy_to_editor"))}}function le(o,p){if(o&1&&(r(0,"ul",15),j(1,se,6,7,"li",17,I),a()),o&2){let e=l(2);n(),H(e.backupList)}}function de(o,p){o&1&&(r(0,"p",16),C(1),s(2,"translate"),a()),o&2&&(n(),x(d(2,1,"config.restore.no_backups")))}function ce(o,p){if(o&1&&(r(0,"div",13),w(1,"i",14),a(),r(2,"p",13),C(3),s(4,"translate"),a(),y(5,le,3,0,"ul",15)(6,de,3,3,"p",16)),o&2){let e=l();n(3),x(d(4,3,"config.restore.title_restore_homebridge_backup")),n(2),m(e.backupList&&e.backupList.length?5:-1),n(),m(!e.backupList||!e.backupList.length?6:-1)}}function me(o,p){if(o&1){let e=_();r(0,"button",20),s(1,"translate"),h("click",function(){f(e);let t=l();return g(t.$activeModal.dismiss("Dismiss"))}),C(2),s(3,"translate"),a()}o&2&&(b("aria-label",d(1,2,"form.button_close")),n(2),E(" ",d(3,4,"form.button_close")," "))}function pe(o,p){if(o&1){let e=_();r(0,"button",20),s(1,"translate"),h("click",function(){f(e);let t=l();return g(t.$activeModal.dismiss("Dismiss"))}),C(2),s(3,"translate"),a()}o&2&&(b("aria-label",d(1,2,"form.button_close")),n(2),E(" ",d(3,4,"form.button_close")," "))}function fe(o,p){if(o&1){let e=_();r(0,"button",21),s(1,"translate"),h("click",function(){f(e);let t=l();return g(t.deleteAllBackups())}),C(2),s(3,"translate"),a()}o&2&&(b("aria-label",d(1,2,"form.button_remove")),n(2),E(" ",d(3,4,"form.button_remove")," "))}var te=(()=>{class o{$activeModal=u(J);$api=u(V);$toastr=u(M);$translate=u(k);loading=!0;backupList=[];constructor(){}ngOnInit(){this.$api.get("/config-editor/backups").subscribe({next:e=>{this.loading=!1,this.backupList=e},error:e=>{this.loading=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error"))}})}restore(e){return this.$activeModal.close(e)}deleteAllBackups(){return this.$api.delete("/config-editor/backups").subscribe({next:()=>{this.$activeModal.dismiss(),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success"))},error:e=>{console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=$({type:o,selectors:[["ng-component"]],decls:17,vars:11,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","primary-text"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["type","button",1,"btn","btn-danger","me-auto"],[1,"fa","fa-fw","fa-cog","fa-spin",2,"font-size","75px"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-history","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box"],[1,"text-center","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"btn","btn-primary","m-0","ms-3",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button",1,"btn","btn-danger","me-auto",3,"click"]],template:function(i,t){i&1&&(r(0,"div",0)(1,"div",1)(2,"h5",2),C(3),s(4,"translate"),a(),r(5,"button",3),s(6,"translate"),h("click",function(){return t.$activeModal.dismiss("Dismiss")}),a()(),r(7,"div",4),y(8,ae,2,0,"div",5)(9,ce,7,5),a(),r(10,"div",6)(11,"div",7),y(12,me,4,6,"button",8),a(),r(13,"div",9),y(14,pe,4,6,"button",8),a(),r(15,"div",10),y(16,fe,4,6,"button",11),a()()()),i&2&&(n(3),x(d(4,7,"form.button_restore")),n(2),b("aria-label",d(6,9,"form.button_close")),n(3),m(t.loading?8:-1),n(),m(t.loading?-1:9),n(3),m(!t.loading&&t.backupList.length?12:-1),n(2),m(t.loading||!t.loading&&!t.backupList.length?14:-1),n(2),m(!t.loading&&t.backupList.length?16:-1))},dependencies:[L,T],encapsulation:2})}return o})();function ge(o,p){if(o&1){let e=_();r(0,"button",13),s(1,"translate"),s(2,"translate"),h("click",function(){f(e);let t=l();return g(t.onExportConfig())}),w(3,"i",14),a()}o&2&&(v("ngbTooltip",d(1,2,"form.button_download")),b("aria-label",d(2,4,"form.button_download")))}function ue(o,p){if(o&1){let e=_();r(0,"button",15),s(1,"translate"),s(2,"translate"),h("click",function(){f(e);let t=l();return g(t.onCancelRestore())}),w(3,"i",16),a()}if(o&2){let e=l();v("disabled",e.saveInProgress)("ngbTooltip",d(1,3,"form.button_cancel")),b("aria-label",d(2,5,"form.button_cancel"))}}function he(o,p){if(o&1){let e=_();r(0,"button",13),s(1,"translate"),s(2,"translate"),h("click",function(){f(e);let t=l();return g(t.onRestore())}),w(3,"i",17),a()}o&2&&(v("ngbTooltip",d(1,2,"form.button_restore")),b("aria-label",d(2,4,"form.button_restore")))}function _e(o,p){o&1&&w(0,"i",8)}function be(o,p){o&1&&w(0,"i",9)}function Ce(o,p){if(o&1){let e=_();r(0,"ngx-monaco-editor",18),h("onInit",function(t){f(e);let c=l();return g(c.onEditorInit(t))})("keydown.control.s",function(t){f(e);let c=l();return t.preventDefault(),g(c.onSave())})("keydown.meta.s",function(t){f(e);let c=l();return t.preventDefault(),g(c.onSave())}),a()}if(o&2){let e=l();v("options",e.editorOptions)("model",e.monacoEditorModel)}}function ye(o,p){if(o&1){let e=_();r(0,"ngx-monaco-diff-editor",19),h("onInit",function(t){f(e);let c=l();return g(c.onInitDiffEditor(t))})("keydown.control.s",function(t){f(e);let c=l();return t.preventDefault(),g(c.onSave())})("keydown.meta.s",function(t){f(e);let c=l();return t.preventDefault(),g(c.onSave())}),a()}if(o&2){let e=l();v("options",e.editorOptions)("originalModel",e.monacoEditorModel)("modifiedModel",e.monacoEditorModel)}}function we(o,p){if(o&1){let e=_();r(0,"textarea",20),B("ngModelChange",function(t){f(e);let c=l();return P(c.homebridgeConfig,t)||(c.homebridgeConfig=t),g(t)}),C(1," "),a()}if(o&2){let e=l();R("ngModel",e.homebridgeConfig)}}var Ke=(()=>{class o{$api=u(V);$md=u(X);$modal=u(K);$monacoEditor=u(ee);$route=u(G);$renderer=u(D);$settings=u(Q);$toastr=u(M);$translate=u(k);homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;editorDecorations=[];lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(i=>{this.homebridgeConfig=i.config}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>{this.setMonacoEditorModel()}})}onEditorInit(e){window.editor=e,this.monacoEditor=e,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(e){this.monacoEditor=e.modifiedEditor,e.getModel().original.setValue(this.originalConfig),e.getModel().modified.setValue(this.homebridgeConfig),window.editor=e}onSave(){return S(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let i=window.monaco.editor.getModelMarkers({owner:"json"});for(let t of i)if(t.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let e=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(e,null,4),typeof e.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(e.bridge.username)?e.accessories&&!Array.isArray(e.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&!Array.isArray(e.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&Array.isArray(e.platforms)&&!this.validateSection(e.platforms,"platform")||e.accessories&&Array.isArray(e.accessories)&&!this.validateSection(e.accessories,"accessory")||e.plugins&&Array.isArray(e.plugins)&&!this.validatePlugins(e.plugins,"plugins")||e.disabledPlugins&&Array.isArray(e.disabledPlugins)&&!this.validatePlugins(e.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(e),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}parseConfigFromEditor(){try{return JSON.parse(this.homebridgeConfig)}catch{let i=ie.default.parse(this.homebridgeConfig);return this.homebridgeConfig=JSON.stringify(i,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig),i}}saveConfig(e){return S(this,null,function*(){try{let i=yield A(this.$api.post("/config-editor",e));this.homebridgeConfig=JSON.stringify(i,null,4),this.$modal.open(Z,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}onRestore(){this.$modal.open(te,{size:"lg",backdrop:"static"}).result.then(e=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig),this.$api.get(`/config-editor/backups/${e}`).subscribe({next:i=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(i,null,4),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:i=>{console.error(i),this.$toastr.error(i.error.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onExportConfig(){let e=`data:text/json;charset=utf-8,${encodeURIComponent(this.homebridgeConfig)}`,i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download","config.json"),document.body.appendChild(i),i.click(),i.remove()}onCancelRestore(){this.homebridgeConfig=this.originalConfig,this.originalConfig=""}validateSection(e,i){for(let t of e){if(typeof t!="object"||Array.isArray(t))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1;if(!t[i])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1;if(typeof t[i]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1}return!0}validatePlugins(e,i){for(let t of e)if(typeof t!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:i}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(e){this.monacoEditor&&(e=JSON.stringify(e,null,4).split(`
|
|
1
|
+
import{a as ee}from"./chunk-GKSJJJEG.js";import{a as Z,b as ne}from"./chunk-X3ZB4QGO.js";import{a as W,b as Y}from"./chunk-R5JL6NY3.js";import{a as X}from"./chunk-6WEQLPNK.js";import{m as J,n as K,o as U}from"./chunk-WCXU6QPE.js";import{c as N,e as F,l as q,y as z}from"./chunk-JKRWJSXD.js";import{b as G}from"./chunk-ZS7TMHAN.js";import{b as Q}from"./chunk-Y5URZ5MZ.js";import{h as M,k as V}from"./chunk-BAWBN252.js";import{a as k,b as T}from"./chunk-2WNK6SOS.js";import{Ac as s,Bc as d,Cc as O,Jb as b,Kb as v,Pb as m,Rb as I,Sb as j,Tb as H,Ub as r,Vb as a,Wb as w,_b as _,bc as h,cc as l,g as oe,gb as n,gd as L,h as S,lb as D,ma as u,mc as C,nc as x,oc as E,rc as R,sc as P,tb as $,tc as B,ua as f,va as g,w as A,zb as y}from"./chunk-NVNBNEFN.js";var ie=oe(ne(),1);function ae(o,p){o&1&&(r(0,"div",5),w(1,"i",12),a())}function se(o,p){if(o&1){let e=_();r(0,"li",17),C(1),s(2,"date"),r(3,"button",18),s(4,"translate"),h("click",function(){let t=f(e).$implicit,c=l(3);return g(c.restore(t.id))}),w(5,"i",19),a()()}if(o&2){let e=p.$implicit;n(),E(" ",O(2,2,e.timestamp,"medium")," "),n(2),b("aria-label",d(4,5,"config.restore.copy_to_editor"))}}function le(o,p){if(o&1&&(r(0,"ul",15),j(1,se,6,7,"li",17,I),a()),o&2){let e=l(2);n(),H(e.backupList)}}function de(o,p){o&1&&(r(0,"p",16),C(1),s(2,"translate"),a()),o&2&&(n(),x(d(2,1,"config.restore.no_backups")))}function ce(o,p){if(o&1&&(r(0,"div",13),w(1,"i",14),a(),r(2,"p",13),C(3),s(4,"translate"),a(),y(5,le,3,0,"ul",15)(6,de,3,3,"p",16)),o&2){let e=l();n(3),x(d(4,3,"config.restore.title_restore_homebridge_backup")),n(2),m(e.backupList&&e.backupList.length?5:-1),n(),m(!e.backupList||!e.backupList.length?6:-1)}}function me(o,p){if(o&1){let e=_();r(0,"button",20),s(1,"translate"),h("click",function(){f(e);let t=l();return g(t.$activeModal.dismiss("Dismiss"))}),C(2),s(3,"translate"),a()}o&2&&(b("aria-label",d(1,2,"form.button_close")),n(2),E(" ",d(3,4,"form.button_close")," "))}function pe(o,p){if(o&1){let e=_();r(0,"button",20),s(1,"translate"),h("click",function(){f(e);let t=l();return g(t.$activeModal.dismiss("Dismiss"))}),C(2),s(3,"translate"),a()}o&2&&(b("aria-label",d(1,2,"form.button_close")),n(2),E(" ",d(3,4,"form.button_close")," "))}function fe(o,p){if(o&1){let e=_();r(0,"button",21),s(1,"translate"),h("click",function(){f(e);let t=l();return g(t.deleteAllBackups())}),C(2),s(3,"translate"),a()}o&2&&(b("aria-label",d(1,2,"form.button_remove")),n(2),E(" ",d(3,4,"form.button_remove")," "))}var te=(()=>{class o{$activeModal=u(J);$api=u(V);$toastr=u(M);$translate=u(k);loading=!0;backupList=[];constructor(){}ngOnInit(){this.$api.get("/config-editor/backups").subscribe({next:e=>{this.loading=!1,this.backupList=e},error:e=>{this.loading=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error"))}})}restore(e){return this.$activeModal.close(e)}deleteAllBackups(){return this.$api.delete("/config-editor/backups").subscribe({next:()=>{this.$activeModal.dismiss(),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success"))},error:e=>{console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=$({type:o,selectors:[["ng-component"]],decls:17,vars:11,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","primary-text"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["type","button",1,"btn","btn-danger","me-auto"],[1,"fa","fa-fw","fa-cog","fa-spin",2,"font-size","75px"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-history","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box"],[1,"text-center","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"btn","btn-primary","m-0","ms-3",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button",1,"btn","btn-danger","me-auto",3,"click"]],template:function(i,t){i&1&&(r(0,"div",0)(1,"div",1)(2,"h5",2),C(3),s(4,"translate"),a(),r(5,"button",3),s(6,"translate"),h("click",function(){return t.$activeModal.dismiss("Dismiss")}),a()(),r(7,"div",4),y(8,ae,2,0,"div",5)(9,ce,7,5),a(),r(10,"div",6)(11,"div",7),y(12,me,4,6,"button",8),a(),r(13,"div",9),y(14,pe,4,6,"button",8),a(),r(15,"div",10),y(16,fe,4,6,"button",11),a()()()),i&2&&(n(3),x(d(4,7,"form.button_restore")),n(2),b("aria-label",d(6,9,"form.button_close")),n(3),m(t.loading?8:-1),n(),m(t.loading?-1:9),n(3),m(!t.loading&&t.backupList.length?12:-1),n(2),m(t.loading||!t.loading&&!t.backupList.length?14:-1),n(2),m(!t.loading&&t.backupList.length?16:-1))},dependencies:[L,T],encapsulation:2})}return o})();function ge(o,p){if(o&1){let e=_();r(0,"button",13),s(1,"translate"),s(2,"translate"),h("click",function(){f(e);let t=l();return g(t.onExportConfig())}),w(3,"i",14),a()}o&2&&(v("ngbTooltip",d(1,2,"form.button_download")),b("aria-label",d(2,4,"form.button_download")))}function ue(o,p){if(o&1){let e=_();r(0,"button",15),s(1,"translate"),s(2,"translate"),h("click",function(){f(e);let t=l();return g(t.onCancelRestore())}),w(3,"i",16),a()}if(o&2){let e=l();v("disabled",e.saveInProgress)("ngbTooltip",d(1,3,"form.button_cancel")),b("aria-label",d(2,5,"form.button_cancel"))}}function he(o,p){if(o&1){let e=_();r(0,"button",13),s(1,"translate"),s(2,"translate"),h("click",function(){f(e);let t=l();return g(t.onRestore())}),w(3,"i",17),a()}o&2&&(v("ngbTooltip",d(1,2,"form.button_restore")),b("aria-label",d(2,4,"form.button_restore")))}function _e(o,p){o&1&&w(0,"i",8)}function be(o,p){o&1&&w(0,"i",9)}function Ce(o,p){if(o&1){let e=_();r(0,"ngx-monaco-editor",18),h("onInit",function(t){f(e);let c=l();return g(c.onEditorInit(t))})("keydown.control.s",function(t){f(e);let c=l();return t.preventDefault(),g(c.onSave())})("keydown.meta.s",function(t){f(e);let c=l();return t.preventDefault(),g(c.onSave())}),a()}if(o&2){let e=l();v("options",e.editorOptions)("model",e.monacoEditorModel)}}function ye(o,p){if(o&1){let e=_();r(0,"ngx-monaco-diff-editor",19),h("onInit",function(t){f(e);let c=l();return g(c.onInitDiffEditor(t))})("keydown.control.s",function(t){f(e);let c=l();return t.preventDefault(),g(c.onSave())})("keydown.meta.s",function(t){f(e);let c=l();return t.preventDefault(),g(c.onSave())}),a()}if(o&2){let e=l();v("options",e.editorOptions)("originalModel",e.monacoEditorModel)("modifiedModel",e.monacoEditorModel)}}function we(o,p){if(o&1){let e=_();r(0,"textarea",20),B("ngModelChange",function(t){f(e);let c=l();return P(c.homebridgeConfig,t)||(c.homebridgeConfig=t),g(t)}),C(1," "),a()}if(o&2){let e=l();R("ngModel",e.homebridgeConfig)}}var Ke=(()=>{class o{$api=u(V);$md=u(X);$modal=u(K);$monacoEditor=u(ee);$route=u(G);$renderer=u(D);$settings=u(Q);$toastr=u(M);$translate=u(k);homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;editorDecorations=[];lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(i=>{this.homebridgeConfig=i.config}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>{this.setMonacoEditorModel()}})}onEditorInit(e){window.editor=e,this.monacoEditor=e,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(e){this.monacoEditor=e.modifiedEditor,e.getModel().original.setValue(this.originalConfig),e.getModel().modified.setValue(this.homebridgeConfig),window.editor=e}onSave(){return S(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let i=window.monaco.editor.getModelMarkers({owner:"json"});for(let t of i)if(t.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let e=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(e,null,4),typeof e.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(e.bridge.username)?e.accessories&&!Array.isArray(e.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&!Array.isArray(e.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&Array.isArray(e.platforms)&&!this.validateSection(e.platforms,"platform")||e.accessories&&Array.isArray(e.accessories)&&!this.validateSection(e.accessories,"accessory")||e.plugins&&Array.isArray(e.plugins)&&!this.validatePlugins(e.plugins,"plugins")||e.disabledPlugins&&Array.isArray(e.disabledPlugins)&&!this.validatePlugins(e.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(e),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}parseConfigFromEditor(){try{return JSON.parse(this.homebridgeConfig)}catch{let i=ie.default.parse(this.homebridgeConfig);return this.homebridgeConfig=JSON.stringify(i,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig),i}}saveConfig(e){return S(this,null,function*(){try{let i=yield A(this.$api.post("/config-editor",e));this.homebridgeConfig=JSON.stringify(i,null,4),this.$modal.open(Z,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}onRestore(){this.$modal.open(te,{size:"lg",backdrop:"static"}).result.then(e=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig),this.$api.get(`/config-editor/backups/${e}`).subscribe({next:i=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(i,null,4),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:i=>{console.error(i),this.$toastr.error(i.error.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onExportConfig(){let e=`data:text/json;charset=utf-8,${encodeURIComponent(this.homebridgeConfig)}`,i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download","config.json"),document.body.appendChild(i),i.click(),i.remove()}onCancelRestore(){this.homebridgeConfig=this.originalConfig,this.originalConfig=""}validateSection(e,i){for(let t of e){if(typeof t!="object"||Array.isArray(t))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1;if(!t[i])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1;if(typeof t[i]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:i}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(t),!1}return!0}validatePlugins(e,i){for(let t of e)if(typeof t!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:i}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(e){this.monacoEditor&&(e=JSON.stringify(e,null,4).split(`
|
|
2
2
|
`).map(i=>` ${i}`).join(`
|
|
3
3
|
`),setTimeout(()=>{let i=this.monacoEditor.getModel().findMatches(e);if(i.length){let t=i[0].range,c=new monaco.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn);this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[{range:c,options:{isWholeLine:!0,linesDecorationsClassName:"hb-monaco-editor-line-error"}}])}},200))}setMonacoEditorModel(){if(window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.some(i=>i.uri==="http://homebridge/config.json"))return;let e=monaco.Uri.parse("a://homebridge/config.json");window.monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!1,validate:!0,schemas:[{uri:"http://homebridge/config.json",fileMatch:[e.toString()],schema:{type:"object",required:["bridge"],properties:{bridge:{type:"object",required:["name","username","port","pin"],properties:{name:{type:"string",description:`The Homebridge instance name.
|
|
4
4
|
This should be unique if you are running multiple instances of Homebridge.`,default:"Homebridge"},username:{type:"string",description:`Homebridge username must be 6 pairs of colon-separated hexadecimal characters (A-F 0-9).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as wi,b as Pi}from"./chunk-ZJLAMLYN.js";import{a as bi}from"./chunk-YKBVU6AV.js";import{n as xi,v as U}from"./chunk-GKJDQJXY.js";import{a as z}from"./chunk-KGJAZDYN.js";import{a as vi}from"./chunk-EDFYZGGZ.js";import{a as Ci}from"./chunk-R35OKBR7.js";import{a as hi}from"./chunk-RGZ4UMYA.js";import{h as ri,i as si,j as di,k as pi,l as ci,m as ui,n as gi,o as mi}from"./chunk-IJOPQHDM.js";import{c as X,e as Y,f as Z,g as ii,j as ei,m as ni,p as ti,q as oi,y as ai,z as li}from"./chunk-ZFCY3QWG.js";import{a as R}from"./chunk-NHG4TUCE.js";import{a as fi,d as _i}from"./chunk-RZ7AYZQX.js";import{b as F}from"./chunk-FXH7UJ5I.js";import{h as j,k as A}from"./chunk-LHRPSEZP.js";import{a as N,b as $}from"./chunk-7VOWKBC5.js";import{$c as E,Ac as c,Bc as u,Cc as D,Jb as B,Kb as b,Pb as s,Rb as L,Sb as G,Tb as W,Ub as a,Vb as l,Wb as d,_b as h,bc as m,cb as q,cc as p,cd as K,db as T,gb as t,gd as Q,h as y,ma as w,mc as g,nc as P,oc as v,tb as V,ua as f,va as _,w as I,wc as H,xc as k,yc as J,zb as x}from"./chunk-NUX2WN3X.js";var Ii=(n,r)=>({"orange-text":n,"grey-text":r}),O=n=>({opacity:n}),Ti=(n,r)=>({"green-text":n,"grey-text":r}),Vi=(n,r)=>({"purple-text":n,"grey-text":r}),Ei=(n,r)=>({scopedLink:n,verifiedLink:r});function $i(n,r){n&1&&(a(0,"h6",18),g(1),c(2,"translate"),l(),a(3,"p",19),g(4),c(5,"translate"),l(),a(6,"p",19),g(7),c(8,"translate"),l()),n&2&&(t(),P(u(2,3,"plugins.manage.scoped_subtitle")),t(3),P(u(5,5,"plugins.manage.scoped_message")),t(3),P(u(8,7,"plugins.manage.verified_message")))}function Mi(n,r){n&1&&(a(0,"h6",18),g(1),c(2,"translate"),l(),a(3,"p",19),g(4),c(5,"translate"),l()),n&2&&(t(),P(u(2,2,"plugins.manage.verified_subtitle")),t(3),P(u(5,4,"plugins.manage.verified_message")))}function Hi(n,r){n&1&&(a(0,"h6",18),g(1),c(2,"translate"),l(),a(3,"p",19),g(4),c(5,"translate"),l()),n&2&&(t(),P(u(2,2,"plugins.manage.unverified_subtitle")),t(3),P(u(5,4,"plugins.manage.unverified_message")))}function Di(n,r){if(n&1){let e=h();a(0,"button",20),m("click",function(){f(e);let i=p();return _(i.$activeModal.dismiss("Dismiss"))}),g(1),c(2,"translate"),l()}n&2&&(t(),v(" ",u(2,1,"form.button_close")," "))}function Ni(n,r){if(n&1){let e=h();a(0,"button",20),m("click",function(){f(e);let i=p();return _(i.$activeModal.dismiss("Dismiss"))}),g(1),c(2,"translate"),l()}n&2&&(t(),v(" ",u(2,1,"form.button_close")," "))}function ji(n,r){if(n&1&&(a(0,"a",17),g(1),c(2,"translate"),d(3,"i",21),l()),n&2){let e=p();b("href",e.plugin.links.homepage||e.plugin.links.npm,T),t(),v(" ",u(2,2,"plugins.button_homepage")," ")}}var yi=(()=>{class n{$activeModal=w(ui);plugin;defaultIcon="assets/hb-icon.png";linkScoped='<a href="https://github.com/homebridge/plugins/wiki/Scoped-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';linkVerified='<a href="https://github.com/homebridge/plugins/wiki/Verified-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){}ngOnInit(){this.plugin.icon||(this.plugin.icon=this.defaultIcon)}handleIconError(){this.plugin.icon=this.defaultIcon}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=V({type:n,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:32,vars:45,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],["alt","Plugin Icon",1,"mb-3","plugin-icon-card",3,"error","src"],[1,"mb-1"],[1,"grey-text","mb-0","font-monospace"],[1,"grey-text","mb-1","font-monospace"],[1,"mb-3"],[1,"fas","fa-fw","fa-shield-alt","mb-3",2,"font-size","48px",3,"ngClass","ngStyle"],[1,"mb-0","grey-text",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[1,"mb-2"],[1,"mb-1","grey-text"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),g(3),c(4,"translate"),l(),a(5,"button",3),c(6,"translate"),m("click",function(){return i.$activeModal.dismiss("Dismiss")}),l()(),a(7,"div",4)(8,"img",5),m("error",function(){return i.handleIconError()}),l(),a(9,"h4",6),g(10),l(),a(11,"p",7),g(12),l(),a(13,"p",8),g(14),l(),a(15,"p",9),g(16),l(),d(17,"i",10)(18,"i",10)(19,"i",10),x(20,$i,9,9)(21,Mi,6,6)(22,Hi,6,6),d(23,"p",11),c(24,"translate"),l(),a(25,"div",12)(26,"div",13),x(27,Di,3,3,"button",14),l(),a(28,"div",15),x(29,Ni,3,3,"button",14),l(),a(30,"div",16),x(31,ji,4,4,"a",17),l()()()),o&2&&(t(3),P(u(4,20,"plugins.manage.information")),t(2),B("aria-label",u(6,22,"form.button_close")),t(3),b("src",i.plugin.icon,T),t(2),P(i.plugin.displayName),t(2),P(i.plugin.name),t(2),v("@",i.plugin.author,""),t(2),P(i.plugin.description),t(),b("ngClass",k(27,Ii,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin,i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin))("ngStyle",H(30,O,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?1:.25)),t(),b("ngClass",k(32,Ti,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),i.plugin.isHbScoped||!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin))("ngStyle",H(35,O,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?1:.25)),t(),b("ngClass",k(37,Vi,i.plugin.isHbScoped,!i.plugin.isHbScoped))("ngStyle",H(40,O,i.plugin.isHbScoped?1:.25)),t(),s(i.plugin.isHbScoped?20:-1),t(),s(!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?21:-1),t(),s(!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?22:-1),t(),b("innerHTML",D(24,24,"plugins.manage.more_info",k(42,Ei,i.linkScoped,i.linkVerified)),q),t(4),s(i.plugin.links.homepage||i.plugin.links.npm?27:-1),t(2),s(!i.plugin.links.homepage&&!i.plugin.links.npm?29:-1),t(2),s(i.plugin.links.homepage||i.plugin.links.npm?31:-1))},dependencies:[$,E,K],styles:[".plugin-icon[_ngcontent-%COMP%]{height:75px;width:75px;border-radius:15px;border:1px solid #222222}"]})}return n})();var Ai=(n,r,e)=>({"purple-text":n,"green-text":r,"orange-text":e}),Fi=(n,r)=>({"fa-bridge-circle-exclamation orange-text":n,"fa-bridge-circle-xmark red-text":r});function Ri(n,r){n&1&&d(0,"i",25)}function Ui(n,r){n&1&&d(0,"i",26)}function zi(n,r){if(n&1){let e=h();a(0,"a",24),m("click",function(){f(e);let i=p();return _(i.openHb2InfoModal())}),x(1,Ri,1,0,"i",25)(2,Ui,1,0,"i",26),l()}if(n&2){let e=p();b("ngbTooltip","Homebridge v2.0 Readiness")("placement","right"),t(),s(e.hb2Status==="supported"?1:-1),t(),s(e.hb2Status==="unknown"?2:-1)}}function Oi(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.checkAndUpdatePlugin(i.plugin,i.plugin.updateTag||"latest"))}),d(3,"i",28),l()}n&2&&(b("ngbTooltip",u(1,2,"plugins.button_update")),B("aria-label",u(2,4,"plugins.button_update")))}function qi(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.switchToScoped(i.plugin))}),d(3,"i",29),l()}n&2&&(b("ngbTooltip",u(1,2,"plugins.manage.scoped.switch")),B("aria-label",u(2,4,"plugins.manage.scoped.switch")))}function Li(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.settings(i.plugin))}),d(3,"i",30),l()}n&2&&(b("ngbTooltip",u(1,2,"plugins.button_set_up")),B("aria-label",u(2,4,"plugins.button_set_up")))}function Gi(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.bridgeSettings(i.plugin))}),d(3,"i",31),l()}n&2&&(b("ngbTooltip",u(1,2,"child_bridge.setup")),B("aria-label",u(2,4,"child_bridge.setup")))}function Wi(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.bridgeSettings(i.plugin))}),d(3,"i",32),l()}n&2&&(b("ngbTooltip",u(1,2,"child_bridge.bridge_connect")),B("aria-label",u(2,4,"child_bridge.bridge_connect")))}function Ji(n,r){if(n&1&&d(0,"i",13),n&2){let e=p();b("ngClass",k(1,Fi,e.childBridgeStatus==="pending",e.childBridgeStatus==="down"))}}function Ki(n,r){if(n&1){let e=h();a(0,"a",15),m("click",function(){f(e);let i=p();return _(i.openFundingModal(i.plugin))}),d(1,"i",33),a(2,"span",17),g(3),l()()}if(n&2){let e=p();t(3),v("@",e.plugin.author,"")}}function Qi(n,r){if(n&1&&(a(0,"span",17),d(1,"i",34),g(2),l()),n&2){let e=p();t(2),v("@",e.plugin.author," ")}}function Xi(n,r){if(n&1&&(a(0,"span"),g(1),c(2,"date"),l()),n&2){let e=p(2);t(),v("(",D(2,1,e.plugin.lastUpdated,"yyyy-MM-dd"),")")}}function Yi(n,r){if(n&1&&(a(0,"span"),d(1,"i",35),a(2,"span",17),g(3),x(4,Xi,3,4,"span"),l()()),n&2){let e=p();t(3),v("v",e.plugin.latestVersion," "),t(),s(e.plugin.lastUpdated?4:-1)}}function Zi(n,r){if(n&1&&(d(0,"i",36),g(1)),n&2){let e=p();t(),v("v",e.plugin.installedVersion," ")}}function ie(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),m("click",function(){f(e);let i=p();return _(i.doChildBridgeAction("restart"))}),d(2,"i",37),l()}if(n&2){let e=p();b("ngbTooltip",u(1,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart"))}}function ee(n,r){if(n&1){let e=h();a(0,"a",38),m("click",function(){f(e);let i=p();return _(i.enablePlugin(i.plugin))}),d(1,"i",39),c(2,"translate"),l()}n&2&&(t(),b("ngbTooltip",u(2,1,"plugins.status_disabled")))}function ne(n,r){if(n&1){let e=h();a(0,"a",40),m("click",function(){f(e);let i=p();return _(i.$plugin.installAlternateVersion(i.plugin))}),d(1,"i",41),l()}}function te(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.viewPluginLog(i.plugin))}),d(1,"i",50),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.plugin_logs")," "))}function oe(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.installAlternateVersion(i.plugin))}),d(1,"i",51),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.manage_version")," "))}function ae(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.jsonEditor(i.plugin))}),d(1,"i",52),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.json_config")," "))}function le(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.disablePlugin(i.plugin))}),d(1,"i",53),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.disable")," "))}function re(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.enablePlugin(i.plugin))}),d(1,"i",54),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.enable")," "))}function se(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.uninstallPlugin(i.plugin,i.setChildBridges))}),d(1,"i",55),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.button_uninstall")," "))}function de(n,r){n&1&&d(0,"div",48)}function pe(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(3);return _(i.doChildBridgeAction("restart"))}),d(1,"i",58),g(2),c(3,"translate"),l()}if(n&2){let e=p(3);t(2),v(" ",u(3,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart")," ")}}function ce(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(3);return _(i.doChildBridgeAction("stop"))}),d(1,"i",59),g(2),c(3,"translate"),l()}if(n&2){let e=p(3);t(2),v(" ",u(3,1,e.setChildBridges.length>1?"child_bridge.stop_plural":"child_bridge.stop")," ")}}function ue(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(3);return _(i.doChildBridgeAction("start"))}),d(1,"i",60),g(2),c(3,"translate"),l()}if(n&2){let e=p(3);t(2),v(" ",u(3,1,e.setChildBridges.length>1?"child_bridge.start_plural":"child_bridge.start")," ")}}function ge(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.bridgeSettings(i.plugin))}),d(1,"i",56),g(2),c(3,"translate"),l(),x(4,pe,4,3,"button",47)(5,ce,4,3,"button",47)(6,ue,4,3,"button",47),a(7,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.resetChildBridges(i.setChildBridges))}),d(8,"i",57),g(9),c(10,"translate"),l()}if(n&2){let e=p(2);t(2),v(" ",u(3,5,"child_bridge.bridge_settings")," "),t(2),s(e.childBridgeRestartInProgress?-1:4),t(),s(e.allChildBridgesStopped?-1:5),t(),s(e.allChildBridgesStopped?6:-1),t(3),v(" ",u(10,7,"child_bridge.reset_accessories")," ")}}function me(n,r){n&1&&d(0,"div",48)}function fe(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.bridgeSettings(i.plugin))}),d(1,"i",61),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"child_bridge.setup")," "))}function _e(n,r){n&1&&d(0,"div",48)}function he(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.bridgeSettings(i.plugin))}),d(1,"i",61),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"child_bridge.setup")," "))}function Ce(n,r){n&1&&d(0,"div",48)}function be(n,r){if(n&1&&(a(0,"a",49),d(1,"i",62),g(2),c(3,"translate"),l()),n&2){let e=p(2);b("href",e.plugin.links.bugs,T),t(2),v(" ",u(3,2,"support.links.issue")," ")}}function ve(n,r){if(n&1){let e=h();a(0,"span",23)(1,"a",42),d(2,"i",43),l(),a(3,"div",44)(4,"button",45),m("click",function(){f(e);let i=p();return _(i.$plugin.settings(i.plugin))}),d(5,"i",46),g(6),c(7,"translate"),l(),x(8,te,4,3,"button",47)(9,oe,4,3,"button",47)(10,ae,4,3,"button",47)(11,le,4,3,"button",47)(12,re,4,3,"button",47)(13,se,4,3,"button",47)(14,de,1,0,"div",48)(15,ge,11,9)(16,me,1,0,"div",48)(17,fe,4,3,"button",47)(18,_e,1,0,"div",48)(19,he,4,3,"button",47)(20,Ce,1,0,"div",48)(21,be,4,4,"a",49),l()()}if(n&2){let e=p();t(),B("aria-label","Plugin Actions Dropdown"),t(5),v(" ",u(7,16,"plugins.button_settings")," "),t(2),s(e.plugin.isConfigured&&!e.plugin.disabled?8:-1),t(),s(e.plugin.publicPackage?9:-1),t(),s(!e.isMobile&&e.plugin.name!=="homebridge-config-ui-x"?10:-1),t(),s(e.plugin.name!=="homebridge-config-ui-x"&&!e.plugin.disabled?11:-1),t(),s(e.plugin.name!=="homebridge-config-ui-x"&&e.plugin.disabled?12:-1),t(),s(e.plugin.name!=="homebridge-config-ui-x"?13:-1),t(),s(!e.plugin.disabled&&e.plugin.isConfigured&&e.plugin.hasChildBridges&&e.plugin.installedVersion&&e.plugin.name!=="homebridge-config-ui-x"?14:-1),t(),s(e.plugin.hasChildBridges&&!e.plugin.disabled?15:-1),t(),s(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?16:-1),t(),s(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?17:-1),t(),s(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?18:-1),t(),s(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?19:-1),t(),s(e.plugin.links!=null&&e.plugin.links.bugs?20:-1),t(),s(e.plugin.links!=null&&e.plugin.links.bugs?21:-1)}}var Bi=(()=>{class n{$api=w(A);$md=w(vi);$modal=w(gi);$plugin=w(U);$settings=w(F);$toastr=w(j);$translate=w(N);$ws=w(R);plugin;hasChildBridges=!1;hasUnpairedChildBridges=!1;allChildBridgesStopped=!1;childBridgeStatus="pending";childBridgeRestartInProgress=!1;defaultIcon="assets/hb-icon.png";isMobile;setChildBridges=[];hb2Status="unknown";io;constructor(){}set childBridges(e){var C,M;this.hasChildBridges=e.length>0,this.hasUnpairedChildBridges=e.filter(S=>S.paired===!1).length>0,this.allChildBridgesStopped=e.filter(S=>S.manuallyStopped===!0).length===e.length,this.hasChildBridges&&(e.some(S=>S.status==="down")?this.childBridgeStatus="down":e.some(S=>S.status==="pending")?this.childBridgeStatus="pending":e.some(S=>S.status==="ok")&&(this.childBridgeStatus="ok")),this.setChildBridges=e;let o=this.$settings.env.homebridgeVersion.split(".")[0],i=((M=(C=this.plugin.engines)==null?void 0:C.homebridge)==null?void 0:M.split("||").map(S=>S.trim()))||[];this.hb2Status=o==="2"?"hide":i.some(S=>S.startsWith("^2")||S.startsWith(">=2"))?"supported":this.hb2Status}ngOnInit(){this.isMobile=this.$md.detect.mobile(),this.io=this.$ws.getExistingNamespace("child-bridges"),this.isMobile&&this.plugin.displayName.toLowerCase().startsWith("homebridge ")&&(this.plugin.displayName=this.plugin.displayName.replace(/^homebridge /i,"")),this.plugin.icon||(this.plugin.icon=this.defaultIcon)}openFundingModal(e){let o=this.$modal.open(Pi,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}pluginInfoModal(e){let o=this.$modal.open(yi,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}disablePlugin(e){let o=this.$modal.open(wi,{size:"lg",backdrop:"static"});o.componentInstance.pluginName=e.displayName,o.componentInstance.isConfigured=e.isConfigured,o.componentInstance.isConfiguredDynamicPlatform=e.isConfiguredDynamicPlatform,o.result.then(()=>y(this,null,function*(){try{yield I(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/disable`,{})),e.disabled=!0,this.hasChildBridges&&this.doChildBridgeAction("stop"),this.$modal.open(z,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.disable.error"),this.$translate.instant("toast.title_error"))}}))}enablePlugin(e){let o=this.$modal.open(hi,{size:"lg",backdrop:"static"});o.componentInstance.title=e.name,o.componentInstance.message=this.$translate.instant("plugins.manage.confirm_enable",{pluginName:e.displayName}),o.componentInstance.confirmButtonLabel=this.$translate.instant("plugins.manage.enable"),o.componentInstance.faIconClass="fa-circle-play primary-text",o.result.then(()=>y(this,null,function*(){try{yield I(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/enable`,{})),e.disabled=!1,this.hasChildBridges&&(yield this.doChildBridgeAction("start")),this.$modal.open(z,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.enable.error"),this.$translate.instant("toast.title_error"))}}))}viewPluginLog(e){let o=this.$modal.open(xi,{size:"xl",backdrop:"static"});o.componentInstance.plugin=e}doChildBridgeAction(e){return y(this,null,function*(){this.childBridgeRestartInProgress=!0;try{for(let o of this.setChildBridges)yield I(this.io.request(`${e}-child-bridge`,o.username))}catch(o){console.error(o),this.$toastr.error(this.$translate.instant("plugins.bridge.action_error",{action:e}),this.$translate.instant("toast.title_error")),this.childBridgeRestartInProgress=!1}finally{setTimeout(()=>{this.childBridgeRestartInProgress=!1},e==="restart"?12e3:e==="stop"?6e3:1e3)}})}handleIconError(){this.plugin.icon=this.defaultIcon}openHb2InfoModal(){let e=this.$modal.open(Ci,{size:"lg",backdrop:"static"});e.componentInstance.title="Plugin Readiness",this.hb2Status==="supported"?(e.componentInstance.subtitle=`${this.plugin.displayName} is ready for Homebridge v2.0`,e.componentInstance.message="The developer has specifically marked your installed version of the plugin as compatible with Homebridge v2.0.",e.componentInstance.faIconClass="fa-check-circle green-text"):(e.componentInstance.subtitle=`${this.plugin.displayName} might not be ready for Homebridge v2.0`,e.componentInstance.message="The developer has not specifically marked your installed version of the plugin as compatible with Homebridge v2.0, but it may still work.",e.componentInstance.faIconClass="fa-question-circle orange-text"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.ctaButtonLink="https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0"}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=V({type:n,selectors:[["app-plugin-card"]],inputs:{plugin:"plugin",childBridges:"childBridges"},decls:36,vars:24,consts:[[1,"card","card-body","mb-3"],[1,"d-flex","flex-row","justify-content-between"],[1,"d-flex","flex-column","me-3","align-items-center","justify-content-between"],["alt","Plugin Icon",1,"plugin-icon-card","mb-3",3,"error","src"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover","aria-label","Homebridge v2.0 Readiness",3,"ngbTooltip","placement"],[1,"d-flex","flex-column","justify-content-between",2,"min-width","calc(100% - 80px)"],[1,"d-flex","flex-row","align-items-end"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"card-title","mb-2","text-truncate"],[1,"ms-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"ngbTooltip"],[1,"fas","fa-fw","fa-spinner","fa-pulse","fa-lg","grey-text","ms-3",3,"hidden"],[1,"fas","fa-fw","fa-lg","ms-3",3,"ngClass"],[1,"card-text","mb-2","text-truncate"],["href","javascript:void(0)",1,"card-link",3,"click"],[1,"fas","fa-fw","fa-shield-alt","fa-lg","me-1",3,"ngClass"],[1,"grey-text"],[1,"card-text","mb-2"],["href","javascript:void(0)",1,"card-link"],[1,"card-text","mb-0","grey-text"],["href","javascript:void(0)",1,"card-link","red-text"],["href","javascript:void(0)"],["ngbDropdown","","placement","left",1,"d-inline-block","ms-3","mt-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover","aria-label","Homebridge v2.0 Readiness",3,"click","ngbTooltip","placement"],["aria-label","The developer has specifically marked this plugin as compatible with Homebridge v2.0",1,"fas","fa-check-circle","green-text","fa-xl"],["aria-label","The developer has not specifically marked this plugin as compatible with Homebridge v2.0, but it may still work.",1,"fas","fa-question-circle","orange-text","fa-xl"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"click","ngbTooltip"],[1,"far","fa-fw","fa-arrow-alt-circle-up","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-arrow-right-arrow-left","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-sliders","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-bridge","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-qrcode","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1","pink-text"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1",2,"opacity","0.5"],[1,"far","fa-fw","fa-circle-dot","fa-lg","me-1"],[1,"far","fa-fw","fa-circle-check","fa-lg","me-1"],[1,"fas","fa-fw","fa-lg","fa-power-off","ms-3"],["href","javascript:void(0)",1,"card-link","red-text",3,"click"],["container","body","openDelay","150","triggers","hover",1,"far","fa-fw","fa-pause-circle","fa-lg",3,"ngbTooltip"],["href","javascript:void(0)",3,"click"],[1,"far","fa-fw","fa-arrow-alt-circle-down","fa-lg"],["href","javascript:void(0)","ngbDropdownToggle","",1,"card-link","text-decoration-none","mt-auto",2,"outline","none"],[1,"fa-solid","fa-fw","fa-ellipsis-v","fa-lg"],["ngbDropdownMenu","","aria-labelledby","Plugin Actions Dropdown"],["ngbDropdownItem","",3,"click"],[1,"fas","fa-fw","fa-sliders"],["ngbDropdownItem",""],[1,"dropdown-divider"],["ngbDropdownItem","","rel","noopener noreferrer","target","_blank",3,"href"],[1,"fas","fa-fw","fa-wave-square"],[1,"fas","fa-fw","fa-code-compare"],[1,"fas","fa-fw","fa-code"],[1,"far","fa-fw","fa-circle-pause"],[1,"far","fa-fw","fa-circle-play"],[1,"fas","fa-fw","fa-trash"],[1,"fas","fa-fw","fa-bridge"],[1,"fas","fa-fw","fa-broom"],[1,"fa-fw","icon-button","fas","fa-fw","fa-power-off"],[1,"fas","fa-fw","fa-stop"],[1,"fas","fa-fw","fa-play"],[1,"icon-button","fas","fa-fw","fa-bridge"],[1,"icon-button","fa","fa-fw","fa-question-circle-o"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),m("error",function(){return i.handleIconError()}),l(),x(4,zi,3,4,"a",4),l(),a(5,"div",5)(6,"div",6)(7,"div",7)(8,"div",8)(9,"h5",9),g(10),l(),a(11,"div",10),x(12,Oi,4,6,"a",11)(13,qi,4,6,"a",11)(14,Li,4,6,"a",11)(15,Gi,4,6,"a",11)(16,Wi,4,6,"a",11),d(17,"i",12),x(18,Ji,1,4,"i",13),l()(),a(19,"p",14)(20,"a",15),m("click",function(){return i.pluginInfoModal(i.plugin)}),d(21,"i",16),a(22,"span",17),g(23),l()()(),a(24,"p",18),x(25,Ki,4,1,"a",19)(26,Qi,3,1,"span",17),l(),a(27,"div",8)(28,"p",20),x(29,Yi,5,2,"span")(30,Zi,2,1),l(),a(31,"div",10),x(32,ie,3,3,"a",11)(33,ee,3,3,"a",21)(34,ne,2,0,"a",22)(35,ve,22,18,"span",23),l()()()()()()()),o&2&&(t(3),b("src",i.plugin.icon,T),t(),s(i.plugin.installedVersion&&i.hb2Status!=="hide"?4:-1),t(6),P(i.plugin.displayName),t(2),s(i.plugin.installedVersion&&i.plugin.updateAvailable&&!i.childBridgeRestartInProgress?12:-1),t(),s(i.plugin.installedVersion&&(i.plugin.newHbScope==null?null:i.plugin.newHbScope.switch)===i.plugin.installedVersion&&!i.childBridgeRestartInProgress?13:-1),t(),s(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&!i.plugin.isConfigured&&!i.childBridgeRestartInProgress&&!i.plugin.disabled?14:-1),t(),s(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&!i.plugin.hasChildBridges&&!i.plugin.disabled&&i.plugin.recommendChildBridge&&!i.childBridgeRestartInProgress?15:-1),t(),s(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&i.hasUnpairedChildBridges&&i.childBridgeStatus==="ok"&&!i.plugin.disabled?16:-1),t(),b("hidden",!i.childBridgeRestartInProgress),t(),s(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&!i.hasUnpairedChildBridges&&i.childBridgeStatus!=="ok"&&!i.plugin.disabled?18:-1),t(3),b("ngClass",J(20,Ai,i.plugin.isHbScoped,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),!i.plugin.isHbScoped&&!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin)),t(2),P(i.plugin.name),t(2),s((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?25:-1),t(),s((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?-1:26),t(3),s(i.plugin.publicPackage&&!i.plugin.installedVersion?29:-1),t(),s(i.plugin.installedVersion?30:-1),t(2),s(!i.plugin.disabled&&i.plugin.hasChildBridges&&i.childBridgeStatus==="ok"?32:-1),t(),s(i.plugin.installedVersion&&i.plugin.disabled?33:-1),t(),s(i.plugin.publicPackage&&!i.plugin.installedVersion?34:-1),t(),s(i.plugin.installedVersion?35:-1))},dependencies:[mi,E,ci,pi,di,si,ri,Q,$],encapsulation:2})}return n})();var xe=(n,r)=>({"fa-magnifying-glass":n,"fa-exclamation-circle":r});function we(n,r){n&1&&d(0,"app-spinner")}function Pe(n,r){if(n&1){let e=h();a(0,"a",9),m("click",function(){f(e);let i=p();return _(i.onClearSearch())}),d(1,"i",10),l()}}function Se(n,r){if(n&1&&(a(0,"div",11),d(1,"app-plugin-card",13),l()),n&2){let e=r.$implicit,o=p(2);t(),b("plugin",e)("childBridges",o.getPluginChildBridges(e))}}function ye(n,r){if(n&1&&(a(0,"div",12),d(1,"i",14),a(2,"p"),g(3),c(4,"translate"),l()()),n&2){let e=p(2);t(),b("ngClass",k(4,xe,!e.showExitButton,e.showExitButton)),t(2),P(u(4,2,e.showExitButton?"plugins.placeholder_search_none":"plugins.placeholder_search_first"))}}function Be(n,r){if(n&1&&(a(0,"div",8),G(1,Se,2,2,"div",11,L),x(3,ye,5,7,"div",12),l()),n&2){let e=p();t(),W(e.installedPlugins),t(2),s(e.installedPlugins.length===0&&!e.loading&&!e.mainError?3:-1)}}var Cn=(()=>{class n{$api=w(A);$plugin=w(U);$router=w(_i);$settings=w(F);$toastr=w(j);$translate=w(N);$ws=w(R);isSearchMode=!1;mainError=!1;loading=!0;installedPlugins=[];childBridges=[];showExitButton=!1;form=new ii({query:new ei("")});io;navigationSubscription;constructor(){}ngOnInit(){return y(this,null,function*(){this.io=this.$ws.connectToNamespace("child-bridges"),this.io.connected.subscribe(()=>y(this,null,function*(){this.getChildBridgeMetadata(),this.io.socket.emit("monitor-child-bridge-status"),this.loadInstalledPlugins().then(()=>{let e=this.$router.parseUrl(this.$router.url).queryParams.installed;if(e){let o=this.installedPlugins.find(i=>i.name===e);o&&!o.isConfigured&&this.$plugin.settings(o),this.$router.navigate(["/plugins"])}})})),this.io.socket.on("child-bridge-status-update",e=>{let o=this.childBridges.find(i=>i.username===e.username);o?Object.assign(o,e):this.childBridges.push(e)}),this.navigationSubscription=this.$router.events.subscribe(e=>{e instanceof fi&&this.loadInstalledPlugins()})})}loadInstalledPlugins(){return y(this,null,function*(){this.form.setValue({query:""}),this.showExitButton=!1,this.installedPlugins=[],this.loading=!0,this.mainError=!1;try{let e=yield I(this.$api.get("/plugins"));this.installedPlugins=e.filter(i=>i.name!=="homebridge-config-ui-x"),yield this.appendMetaInfo();let o=this.installedPlugins.sort((i,C)=>i.updateAvailable!==C.updateAvailable?i.updateAvailable?-1:1:i.newHbScope&&!C.newHbScope?-1:i.disabled!==C.disabled?i.disabled?1:-1:i.isConfigured!==C.isConfigured?i.isConfigured?1:-1:i.hasChildBridgesUnpaired!==C.hasChildBridgesUnpaired?i.hasChildBridgesUnpaired?-1:1:i.hasChildBridges!==C.hasChildBridges&&this.$settings.env.recommendChildBridges?i.hasChildBridges?1:-1:i.name.localeCompare(C.name));return this.loading=!1,o}catch(e){console.error(e),this.loading=!1,this.mainError=!0,this.$toastr.error(this.$translate.instant("plugins.toast_failed_to_load_plugins"),this.$translate.instant("toast.title_error"))}})}appendMetaInfo(){return y(this,null,function*(){yield Promise.all(this.installedPlugins.filter(e=>e.installedVersion).map(e=>y(this,null,function*(){try{let o=yield I(this.$api.get(`/config-editor/plugin/${encodeURIComponent(e.name)}`));e.isConfigured=o.length>0,e.isConfiguredDynamicPlatform=e.isConfigured&&Object.prototype.hasOwnProperty.call(o[0],"platform"),e.recommendChildBridge=e.isConfiguredDynamicPlatform&&this.$settings.env.recommendChildBridges&&!["homebridge","homebridge-config-ui-x"].includes(e.name),e.hasChildBridges=e.isConfigured&&o.some(C=>C._bridge&&C._bridge.username);let i=this.getPluginChildBridges(e);e.hasChildBridgesUnpaired=i.some(C=>!C.paired)}catch{e.isConfigured=!0,e.hasChildBridges=!0}})))})}search(){this.installedPlugins=[],this.loading=!0,this.showExitButton=!0,this.$api.get(`/plugins/search/${encodeURIComponent(this.form.value.query)}`).subscribe({next:e=>{let o=new Set;this.installedPlugins=e.reduce((i,C)=>{if(C.name==="homebridge-config-ui-x"||o.has(C.name))return i;if(C.newHbScope){let M=C.newHbScope.to,S=e.some(ki=>ki.name===M);(C.installedVersion||!S)&&(o.add(M),i.push(C))}else i.push(C);return i},[]),this.appendMetaInfo(),this.loading=!1},error:e=>{this.loading=!1,this.isSearchMode=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error")),this.loadInstalledPlugins()}})}onClearSearch(){this.loadInstalledPlugins()}onSubmit({value:e}){e.query.length?(this.isSearchMode=!0,this.search()):this.isSearchMode&&(this.isSearchMode=!1,this.loadInstalledPlugins())}getChildBridgeMetadata(){this.io.request("get-homebridge-child-bridge-status").subscribe(e=>{this.childBridges=e})}getPluginChildBridges(e){return this.childBridges.filter(o=>o.plugin===e.name)}ngOnDestroy(){this.navigationSubscription&&this.navigationSubscription.unsubscribe(),this.io.end()}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=V({type:n,selectors:[["ng-component"]],decls:13,vars:10,consts:[[1,"row","mb-3"],[1,"col-12"],[1,"primary-text","m-0"],[1,"row"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","formControlName","query",1,"hb-npm-search",3,"placeholder"],["href","javascript:void(0)",1,"hb-npm-search-clear"],[1,"d-flex","flex-wrap","justify-content-between"],["href","javascript:void(0)",1,"hb-npm-search-clear",3,"click"],[1,"far","fa-fw","fa-times-circle"],[1,"hb-plugin-space-between"],[1,"alert","alert-info","mt-4","text-center","w-100"],[3,"plugin","childBridges"],[1,"fas","fa-fw","primary-text","my-3",2,"font-size","75px",3,"ngClass"]],template:function(o,i){o&1&&(x(0,we,1,0,"app-spinner"),a(1,"div",0)(2,"div",1)(3,"h3",2),g(4),c(5,"translate"),l()()(),a(6,"div",3)(7,"div",4)(8,"form",5),m("ngSubmit",function(){return i.onSubmit(i.form)}),d(9,"input",6),c(10,"translate"),x(11,Pe,2,0,"a",7),l()()(),x(12,Be,4,1,"div",8)),o&2&&(s(i.loading?0:-1),t(4),P(u(5,6,"menu.label_plugins")),t(4),b("formGroup",i.form),t(),b("placeholder",u(10,8,"plugins.placeholder_search_plugin")),t(2),s(i.showExitButton?11:-1),t(),s(i.loading?-1:12))},dependencies:[bi,ai,ni,X,Y,Z,li,ti,oi,Bi,$,E],styles:[".hb-npm-search[_ngcontent-%COMP%]{outline:none;box-sizing:inherit!important;background-color:inherit;height:50px!important;width:100%;border-width:.5px;padding:10px;margin-bottom:15px}@media (hover: hover){.hb-npm-search[_ngcontent-%COMP%]:hover{border:1px solid #000000}}.hb-npm-search[_ngcontent-%COMP%]:focus{border:1px solid #000000;box-shadow:0 1px #000}.hb-npm-search-clear[_ngcontent-%COMP%]{position:absolute;right:25px;font-size:35px;color:#d0d0d0;line-height:50px;cursor:pointer}.hb-plugin-space-between[_ngcontent-%COMP%]{box-sizing:border-box;width:calc(50% - 6.6666666667px)}@media only screen and (max-width: 991px){.hb-plugin-space-between[_ngcontent-%COMP%]{width:100%}}"]})}return n})();export{Cn as a};
|
|
1
|
+
import{a as wi,b as Pi}from"./chunk-IC7Y4XQH.js";import{a as bi}from"./chunk-7V7FVNQR.js";import{n as xi,v as U}from"./chunk-MFP6D5U2.js";import{a as z}from"./chunk-X3ZB4QGO.js";import{a as vi}from"./chunk-6WEQLPNK.js";import{a as Ci}from"./chunk-WPESHLCE.js";import{a as hi}from"./chunk-V65HN5SX.js";import{h as ri,i as si,j as di,k as pi,l as ci,m as ui,n as gi,o as mi}from"./chunk-WCXU6QPE.js";import{c as X,e as Y,f as Z,g as ii,j as ei,m as ni,p as ti,q as oi,y as ai,z as li}from"./chunk-JKRWJSXD.js";import{a as R}from"./chunk-MAIN5YCW.js";import{a as fi,d as _i}from"./chunk-ZS7TMHAN.js";import{b as F}from"./chunk-Y5URZ5MZ.js";import{h as j,k as A}from"./chunk-BAWBN252.js";import{a as N,b as $}from"./chunk-2WNK6SOS.js";import{$c as E,Ac as c,Bc as u,Cc as D,Jb as B,Kb as b,Pb as s,Rb as L,Sb as G,Tb as W,Ub as a,Vb as l,Wb as d,_b as h,bc as m,cb as q,cc as p,cd as K,db as T,gb as t,gd as Q,h as y,ma as w,mc as g,nc as P,oc as v,tb as V,ua as f,va as _,w as I,wc as H,xc as k,yc as J,zb as x}from"./chunk-NVNBNEFN.js";var Ii=(n,r)=>({"orange-text":n,"grey-text":r}),O=n=>({opacity:n}),Ti=(n,r)=>({"green-text":n,"grey-text":r}),Vi=(n,r)=>({"purple-text":n,"grey-text":r}),Ei=(n,r)=>({scopedLink:n,verifiedLink:r});function $i(n,r){n&1&&(a(0,"h6",18),g(1),c(2,"translate"),l(),a(3,"p",19),g(4),c(5,"translate"),l(),a(6,"p",19),g(7),c(8,"translate"),l()),n&2&&(t(),P(u(2,3,"plugins.manage.scoped_subtitle")),t(3),P(u(5,5,"plugins.manage.scoped_message")),t(3),P(u(8,7,"plugins.manage.verified_message")))}function Mi(n,r){n&1&&(a(0,"h6",18),g(1),c(2,"translate"),l(),a(3,"p",19),g(4),c(5,"translate"),l()),n&2&&(t(),P(u(2,2,"plugins.manage.verified_subtitle")),t(3),P(u(5,4,"plugins.manage.verified_message")))}function Hi(n,r){n&1&&(a(0,"h6",18),g(1),c(2,"translate"),l(),a(3,"p",19),g(4),c(5,"translate"),l()),n&2&&(t(),P(u(2,2,"plugins.manage.unverified_subtitle")),t(3),P(u(5,4,"plugins.manage.unverified_message")))}function Di(n,r){if(n&1){let e=h();a(0,"button",20),m("click",function(){f(e);let i=p();return _(i.$activeModal.dismiss("Dismiss"))}),g(1),c(2,"translate"),l()}n&2&&(t(),v(" ",u(2,1,"form.button_close")," "))}function Ni(n,r){if(n&1){let e=h();a(0,"button",20),m("click",function(){f(e);let i=p();return _(i.$activeModal.dismiss("Dismiss"))}),g(1),c(2,"translate"),l()}n&2&&(t(),v(" ",u(2,1,"form.button_close")," "))}function ji(n,r){if(n&1&&(a(0,"a",17),g(1),c(2,"translate"),d(3,"i",21),l()),n&2){let e=p();b("href",e.plugin.links.homepage||e.plugin.links.npm,T),t(),v(" ",u(2,2,"plugins.button_homepage")," ")}}var yi=(()=>{class n{$activeModal=w(ui);plugin;defaultIcon="assets/hb-icon.png";linkScoped='<a href="https://github.com/homebridge/plugins/wiki/Scoped-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';linkVerified='<a href="https://github.com/homebridge/plugins/wiki/Verified-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){}ngOnInit(){this.plugin.icon||(this.plugin.icon=this.defaultIcon)}handleIconError(){this.plugin.icon=this.defaultIcon}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=V({type:n,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:32,vars:45,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],["alt","Plugin Icon",1,"mb-3","plugin-icon-card",3,"error","src"],[1,"mb-1"],[1,"grey-text","mb-0","font-monospace"],[1,"grey-text","mb-1","font-monospace"],[1,"mb-3"],[1,"fas","fa-fw","fa-shield-alt","mb-3",2,"font-size","48px",3,"ngClass","ngStyle"],[1,"mb-0","grey-text",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[1,"mb-2"],[1,"mb-1","grey-text"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),g(3),c(4,"translate"),l(),a(5,"button",3),c(6,"translate"),m("click",function(){return i.$activeModal.dismiss("Dismiss")}),l()(),a(7,"div",4)(8,"img",5),m("error",function(){return i.handleIconError()}),l(),a(9,"h4",6),g(10),l(),a(11,"p",7),g(12),l(),a(13,"p",8),g(14),l(),a(15,"p",9),g(16),l(),d(17,"i",10)(18,"i",10)(19,"i",10),x(20,$i,9,9)(21,Mi,6,6)(22,Hi,6,6),d(23,"p",11),c(24,"translate"),l(),a(25,"div",12)(26,"div",13),x(27,Di,3,3,"button",14),l(),a(28,"div",15),x(29,Ni,3,3,"button",14),l(),a(30,"div",16),x(31,ji,4,4,"a",17),l()()()),o&2&&(t(3),P(u(4,20,"plugins.manage.information")),t(2),B("aria-label",u(6,22,"form.button_close")),t(3),b("src",i.plugin.icon,T),t(2),P(i.plugin.displayName),t(2),P(i.plugin.name),t(2),v("@",i.plugin.author,""),t(2),P(i.plugin.description),t(),b("ngClass",k(27,Ii,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin,i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin))("ngStyle",H(30,O,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?1:.25)),t(),b("ngClass",k(32,Ti,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),i.plugin.isHbScoped||!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin))("ngStyle",H(35,O,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?1:.25)),t(),b("ngClass",k(37,Vi,i.plugin.isHbScoped,!i.plugin.isHbScoped))("ngStyle",H(40,O,i.plugin.isHbScoped?1:.25)),t(),s(i.plugin.isHbScoped?20:-1),t(),s(!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?21:-1),t(),s(!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?22:-1),t(),b("innerHTML",D(24,24,"plugins.manage.more_info",k(42,Ei,i.linkScoped,i.linkVerified)),q),t(4),s(i.plugin.links.homepage||i.plugin.links.npm?27:-1),t(2),s(!i.plugin.links.homepage&&!i.plugin.links.npm?29:-1),t(2),s(i.plugin.links.homepage||i.plugin.links.npm?31:-1))},dependencies:[$,E,K],styles:[".plugin-icon[_ngcontent-%COMP%]{height:75px;width:75px;border-radius:15px;border:1px solid #222222}"]})}return n})();var Ai=(n,r,e)=>({"purple-text":n,"green-text":r,"orange-text":e}),Fi=(n,r)=>({"fa-bridge-circle-exclamation orange-text":n,"fa-bridge-circle-xmark red-text":r});function Ri(n,r){n&1&&d(0,"i",25)}function Ui(n,r){n&1&&d(0,"i",26)}function zi(n,r){if(n&1){let e=h();a(0,"a",24),m("click",function(){f(e);let i=p();return _(i.openHb2InfoModal())}),x(1,Ri,1,0,"i",25)(2,Ui,1,0,"i",26),l()}if(n&2){let e=p();b("ngbTooltip","Homebridge v2.0 Readiness")("placement","right"),t(),s(e.hb2Status==="supported"?1:-1),t(),s(e.hb2Status==="unknown"?2:-1)}}function Oi(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.checkAndUpdatePlugin(i.plugin,i.plugin.updateTag||"latest"))}),d(3,"i",28),l()}n&2&&(b("ngbTooltip",u(1,2,"plugins.button_update")),B("aria-label",u(2,4,"plugins.button_update")))}function qi(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.switchToScoped(i.plugin))}),d(3,"i",29),l()}n&2&&(b("ngbTooltip",u(1,2,"plugins.manage.scoped.switch")),B("aria-label",u(2,4,"plugins.manage.scoped.switch")))}function Li(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.settings(i.plugin))}),d(3,"i",30),l()}n&2&&(b("ngbTooltip",u(1,2,"plugins.button_set_up")),B("aria-label",u(2,4,"plugins.button_set_up")))}function Gi(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.bridgeSettings(i.plugin))}),d(3,"i",31),l()}n&2&&(b("ngbTooltip",u(1,2,"child_bridge.setup")),B("aria-label",u(2,4,"child_bridge.setup")))}function Wi(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),c(2,"translate"),m("click",function(){f(e);let i=p();return _(i.$plugin.bridgeSettings(i.plugin))}),d(3,"i",32),l()}n&2&&(b("ngbTooltip",u(1,2,"child_bridge.bridge_connect")),B("aria-label",u(2,4,"child_bridge.bridge_connect")))}function Ji(n,r){if(n&1&&d(0,"i",13),n&2){let e=p();b("ngClass",k(1,Fi,e.childBridgeStatus==="pending",e.childBridgeStatus==="down"))}}function Ki(n,r){if(n&1){let e=h();a(0,"a",15),m("click",function(){f(e);let i=p();return _(i.openFundingModal(i.plugin))}),d(1,"i",33),a(2,"span",17),g(3),l()()}if(n&2){let e=p();t(3),v("@",e.plugin.author,"")}}function Qi(n,r){if(n&1&&(a(0,"span",17),d(1,"i",34),g(2),l()),n&2){let e=p();t(2),v("@",e.plugin.author," ")}}function Xi(n,r){if(n&1&&(a(0,"span"),g(1),c(2,"date"),l()),n&2){let e=p(2);t(),v("(",D(2,1,e.plugin.lastUpdated,"yyyy-MM-dd"),")")}}function Yi(n,r){if(n&1&&(a(0,"span"),d(1,"i",35),a(2,"span",17),g(3),x(4,Xi,3,4,"span"),l()()),n&2){let e=p();t(3),v("v",e.plugin.latestVersion," "),t(),s(e.plugin.lastUpdated?4:-1)}}function Zi(n,r){if(n&1&&(d(0,"i",36),g(1)),n&2){let e=p();t(),v("v",e.plugin.installedVersion," ")}}function ie(n,r){if(n&1){let e=h();a(0,"a",27),c(1,"translate"),m("click",function(){f(e);let i=p();return _(i.doChildBridgeAction("restart"))}),d(2,"i",37),l()}if(n&2){let e=p();b("ngbTooltip",u(1,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart"))}}function ee(n,r){if(n&1){let e=h();a(0,"a",38),m("click",function(){f(e);let i=p();return _(i.enablePlugin(i.plugin))}),d(1,"i",39),c(2,"translate"),l()}n&2&&(t(),b("ngbTooltip",u(2,1,"plugins.status_disabled")))}function ne(n,r){if(n&1){let e=h();a(0,"a",40),m("click",function(){f(e);let i=p();return _(i.$plugin.installAlternateVersion(i.plugin))}),d(1,"i",41),l()}}function te(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.viewPluginLog(i.plugin))}),d(1,"i",50),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.plugin_logs")," "))}function oe(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.installAlternateVersion(i.plugin))}),d(1,"i",51),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.manage_version")," "))}function ae(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.jsonEditor(i.plugin))}),d(1,"i",52),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.json_config")," "))}function le(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.disablePlugin(i.plugin))}),d(1,"i",53),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.disable")," "))}function re(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.enablePlugin(i.plugin))}),d(1,"i",54),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.manage.enable")," "))}function se(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.uninstallPlugin(i.plugin,i.setChildBridges))}),d(1,"i",55),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"plugins.button_uninstall")," "))}function de(n,r){n&1&&d(0,"div",48)}function pe(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(3);return _(i.doChildBridgeAction("restart"))}),d(1,"i",58),g(2),c(3,"translate"),l()}if(n&2){let e=p(3);t(2),v(" ",u(3,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart")," ")}}function ce(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(3);return _(i.doChildBridgeAction("stop"))}),d(1,"i",59),g(2),c(3,"translate"),l()}if(n&2){let e=p(3);t(2),v(" ",u(3,1,e.setChildBridges.length>1?"child_bridge.stop_plural":"child_bridge.stop")," ")}}function ue(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(3);return _(i.doChildBridgeAction("start"))}),d(1,"i",60),g(2),c(3,"translate"),l()}if(n&2){let e=p(3);t(2),v(" ",u(3,1,e.setChildBridges.length>1?"child_bridge.start_plural":"child_bridge.start")," ")}}function ge(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.bridgeSettings(i.plugin))}),d(1,"i",56),g(2),c(3,"translate"),l(),x(4,pe,4,3,"button",47)(5,ce,4,3,"button",47)(6,ue,4,3,"button",47),a(7,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.resetChildBridges(i.setChildBridges))}),d(8,"i",57),g(9),c(10,"translate"),l()}if(n&2){let e=p(2);t(2),v(" ",u(3,5,"child_bridge.bridge_settings")," "),t(2),s(e.childBridgeRestartInProgress?-1:4),t(),s(e.allChildBridgesStopped?-1:5),t(),s(e.allChildBridgesStopped?6:-1),t(3),v(" ",u(10,7,"child_bridge.reset_accessories")," ")}}function me(n,r){n&1&&d(0,"div",48)}function fe(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.bridgeSettings(i.plugin))}),d(1,"i",61),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"child_bridge.setup")," "))}function _e(n,r){n&1&&d(0,"div",48)}function he(n,r){if(n&1){let e=h();a(0,"button",45),m("click",function(){f(e);let i=p(2);return _(i.$plugin.bridgeSettings(i.plugin))}),d(1,"i",61),g(2),c(3,"translate"),l()}n&2&&(t(2),v(" ",u(3,1,"child_bridge.setup")," "))}function Ce(n,r){n&1&&d(0,"div",48)}function be(n,r){if(n&1&&(a(0,"a",49),d(1,"i",62),g(2),c(3,"translate"),l()),n&2){let e=p(2);b("href",e.plugin.links.bugs,T),t(2),v(" ",u(3,2,"support.links.issue")," ")}}function ve(n,r){if(n&1){let e=h();a(0,"span",23)(1,"a",42),d(2,"i",43),l(),a(3,"div",44)(4,"button",45),m("click",function(){f(e);let i=p();return _(i.$plugin.settings(i.plugin))}),d(5,"i",46),g(6),c(7,"translate"),l(),x(8,te,4,3,"button",47)(9,oe,4,3,"button",47)(10,ae,4,3,"button",47)(11,le,4,3,"button",47)(12,re,4,3,"button",47)(13,se,4,3,"button",47)(14,de,1,0,"div",48)(15,ge,11,9)(16,me,1,0,"div",48)(17,fe,4,3,"button",47)(18,_e,1,0,"div",48)(19,he,4,3,"button",47)(20,Ce,1,0,"div",48)(21,be,4,4,"a",49),l()()}if(n&2){let e=p();t(),B("aria-label","Plugin Actions Dropdown"),t(5),v(" ",u(7,16,"plugins.button_settings")," "),t(2),s(e.plugin.isConfigured&&!e.plugin.disabled?8:-1),t(),s(e.plugin.publicPackage?9:-1),t(),s(!e.isMobile&&e.plugin.name!=="homebridge-config-ui-x"?10:-1),t(),s(e.plugin.name!=="homebridge-config-ui-x"&&!e.plugin.disabled?11:-1),t(),s(e.plugin.name!=="homebridge-config-ui-x"&&e.plugin.disabled?12:-1),t(),s(e.plugin.name!=="homebridge-config-ui-x"?13:-1),t(),s(!e.plugin.disabled&&e.plugin.isConfigured&&e.plugin.hasChildBridges&&e.plugin.installedVersion&&e.plugin.name!=="homebridge-config-ui-x"?14:-1),t(),s(e.plugin.hasChildBridges&&!e.plugin.disabled?15:-1),t(),s(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?16:-1),t(),s(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?17:-1),t(),s(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?18:-1),t(),s(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?19:-1),t(),s(e.plugin.links!=null&&e.plugin.links.bugs?20:-1),t(),s(e.plugin.links!=null&&e.plugin.links.bugs?21:-1)}}var Bi=(()=>{class n{$api=w(A);$md=w(vi);$modal=w(gi);$plugin=w(U);$settings=w(F);$toastr=w(j);$translate=w(N);$ws=w(R);plugin;hasChildBridges=!1;hasUnpairedChildBridges=!1;allChildBridgesStopped=!1;childBridgeStatus="pending";childBridgeRestartInProgress=!1;defaultIcon="assets/hb-icon.png";isMobile;setChildBridges=[];hb2Status="unknown";io;constructor(){}set childBridges(e){var C,M;this.hasChildBridges=e.length>0,this.hasUnpairedChildBridges=e.filter(S=>S.paired===!1).length>0,this.allChildBridgesStopped=e.filter(S=>S.manuallyStopped===!0).length===e.length,this.hasChildBridges&&(e.some(S=>S.status==="down")?this.childBridgeStatus="down":e.some(S=>S.status==="pending")?this.childBridgeStatus="pending":e.some(S=>S.status==="ok")&&(this.childBridgeStatus="ok")),this.setChildBridges=e;let o=this.$settings.env.homebridgeVersion.split(".")[0],i=((M=(C=this.plugin.engines)==null?void 0:C.homebridge)==null?void 0:M.split("||").map(S=>S.trim()))||[];this.hb2Status=o==="2"?"hide":i.some(S=>S.startsWith("^2")||S.startsWith(">=2"))?"supported":this.hb2Status}ngOnInit(){this.isMobile=this.$md.detect.mobile(),this.io=this.$ws.getExistingNamespace("child-bridges"),this.isMobile&&this.plugin.displayName.toLowerCase().startsWith("homebridge ")&&(this.plugin.displayName=this.plugin.displayName.replace(/^homebridge /i,"")),this.plugin.icon||(this.plugin.icon=this.defaultIcon)}openFundingModal(e){let o=this.$modal.open(Pi,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}pluginInfoModal(e){let o=this.$modal.open(yi,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}disablePlugin(e){let o=this.$modal.open(wi,{size:"lg",backdrop:"static"});o.componentInstance.pluginName=e.displayName,o.componentInstance.isConfigured=e.isConfigured,o.componentInstance.isConfiguredDynamicPlatform=e.isConfiguredDynamicPlatform,o.result.then(()=>y(this,null,function*(){try{yield I(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/disable`,{})),e.disabled=!0,this.hasChildBridges&&this.doChildBridgeAction("stop"),this.$modal.open(z,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.disable.error"),this.$translate.instant("toast.title_error"))}}))}enablePlugin(e){let o=this.$modal.open(hi,{size:"lg",backdrop:"static"});o.componentInstance.title=e.name,o.componentInstance.message=this.$translate.instant("plugins.manage.confirm_enable",{pluginName:e.displayName}),o.componentInstance.confirmButtonLabel=this.$translate.instant("plugins.manage.enable"),o.componentInstance.faIconClass="fa-circle-play primary-text",o.result.then(()=>y(this,null,function*(){try{yield I(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/enable`,{})),e.disabled=!1,this.hasChildBridges&&(yield this.doChildBridgeAction("start")),this.$modal.open(z,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.enable.error"),this.$translate.instant("toast.title_error"))}}))}viewPluginLog(e){let o=this.$modal.open(xi,{size:"xl",backdrop:"static"});o.componentInstance.plugin=e}doChildBridgeAction(e){return y(this,null,function*(){this.childBridgeRestartInProgress=!0;try{for(let o of this.setChildBridges)yield I(this.io.request(`${e}-child-bridge`,o.username))}catch(o){console.error(o),this.$toastr.error(this.$translate.instant("plugins.bridge.action_error",{action:e}),this.$translate.instant("toast.title_error")),this.childBridgeRestartInProgress=!1}finally{setTimeout(()=>{this.childBridgeRestartInProgress=!1},e==="restart"?12e3:e==="stop"?6e3:1e3)}})}handleIconError(){this.plugin.icon=this.defaultIcon}openHb2InfoModal(){let e=this.$modal.open(Ci,{size:"lg",backdrop:"static"});e.componentInstance.title="Plugin Readiness",this.hb2Status==="supported"?(e.componentInstance.subtitle=`${this.plugin.displayName} is ready for Homebridge v2.0`,e.componentInstance.message="The developer has specifically marked your installed version of the plugin as compatible with Homebridge v2.0.",e.componentInstance.faIconClass="fa-check-circle green-text"):(e.componentInstance.subtitle=`${this.plugin.displayName} might not be ready for Homebridge v2.0`,e.componentInstance.message="The developer has not specifically marked your installed version of the plugin as compatible with Homebridge v2.0, but it may still work.",e.componentInstance.faIconClass="fa-question-circle orange-text"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.ctaButtonLink="https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0"}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=V({type:n,selectors:[["app-plugin-card"]],inputs:{plugin:"plugin",childBridges:"childBridges"},decls:36,vars:24,consts:[[1,"card","card-body","mb-3"],[1,"d-flex","flex-row","justify-content-between"],[1,"d-flex","flex-column","me-3","align-items-center","justify-content-between"],["alt","Plugin Icon",1,"plugin-icon-card","mb-3",3,"error","src"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover","aria-label","Homebridge v2.0 Readiness",3,"ngbTooltip","placement"],[1,"d-flex","flex-column","justify-content-between",2,"min-width","calc(100% - 80px)"],[1,"d-flex","flex-row","align-items-end"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"card-title","mb-2","text-truncate"],[1,"ms-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"ngbTooltip"],[1,"fas","fa-fw","fa-spinner","fa-pulse","fa-lg","grey-text","ms-3",3,"hidden"],[1,"fas","fa-fw","fa-lg","ms-3",3,"ngClass"],[1,"card-text","mb-2","text-truncate"],["href","javascript:void(0)",1,"card-link",3,"click"],[1,"fas","fa-fw","fa-shield-alt","fa-lg","me-1",3,"ngClass"],[1,"grey-text"],[1,"card-text","mb-2"],["href","javascript:void(0)",1,"card-link"],[1,"card-text","mb-0","grey-text"],["href","javascript:void(0)",1,"card-link","red-text"],["href","javascript:void(0)"],["ngbDropdown","","placement","left",1,"d-inline-block","ms-3","mt-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover","aria-label","Homebridge v2.0 Readiness",3,"click","ngbTooltip","placement"],["aria-label","The developer has specifically marked this plugin as compatible with Homebridge v2.0",1,"fas","fa-check-circle","green-text","fa-xl"],["aria-label","The developer has not specifically marked this plugin as compatible with Homebridge v2.0, but it may still work.",1,"fas","fa-question-circle","orange-text","fa-xl"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"click","ngbTooltip"],[1,"far","fa-fw","fa-arrow-alt-circle-up","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-arrow-right-arrow-left","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-sliders","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-bridge","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-qrcode","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1","pink-text"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1",2,"opacity","0.5"],[1,"far","fa-fw","fa-circle-dot","fa-lg","me-1"],[1,"far","fa-fw","fa-circle-check","fa-lg","me-1"],[1,"fas","fa-fw","fa-lg","fa-power-off","ms-3"],["href","javascript:void(0)",1,"card-link","red-text",3,"click"],["container","body","openDelay","150","triggers","hover",1,"far","fa-fw","fa-pause-circle","fa-lg",3,"ngbTooltip"],["href","javascript:void(0)",3,"click"],[1,"far","fa-fw","fa-arrow-alt-circle-down","fa-lg"],["href","javascript:void(0)","ngbDropdownToggle","",1,"card-link","text-decoration-none","mt-auto",2,"outline","none"],[1,"fa-solid","fa-fw","fa-ellipsis-v","fa-lg"],["ngbDropdownMenu","","aria-labelledby","Plugin Actions Dropdown"],["ngbDropdownItem","",3,"click"],[1,"fas","fa-fw","fa-sliders"],["ngbDropdownItem",""],[1,"dropdown-divider"],["ngbDropdownItem","","rel","noopener noreferrer","target","_blank",3,"href"],[1,"fas","fa-fw","fa-wave-square"],[1,"fas","fa-fw","fa-code-compare"],[1,"fas","fa-fw","fa-code"],[1,"far","fa-fw","fa-circle-pause"],[1,"far","fa-fw","fa-circle-play"],[1,"fas","fa-fw","fa-trash"],[1,"fas","fa-fw","fa-bridge"],[1,"fas","fa-fw","fa-broom"],[1,"fa-fw","icon-button","fas","fa-fw","fa-power-off"],[1,"fas","fa-fw","fa-stop"],[1,"fas","fa-fw","fa-play"],[1,"icon-button","fas","fa-fw","fa-bridge"],[1,"icon-button","fa","fa-fw","fa-question-circle-o"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),m("error",function(){return i.handleIconError()}),l(),x(4,zi,3,4,"a",4),l(),a(5,"div",5)(6,"div",6)(7,"div",7)(8,"div",8)(9,"h5",9),g(10),l(),a(11,"div",10),x(12,Oi,4,6,"a",11)(13,qi,4,6,"a",11)(14,Li,4,6,"a",11)(15,Gi,4,6,"a",11)(16,Wi,4,6,"a",11),d(17,"i",12),x(18,Ji,1,4,"i",13),l()(),a(19,"p",14)(20,"a",15),m("click",function(){return i.pluginInfoModal(i.plugin)}),d(21,"i",16),a(22,"span",17),g(23),l()()(),a(24,"p",18),x(25,Ki,4,1,"a",19)(26,Qi,3,1,"span",17),l(),a(27,"div",8)(28,"p",20),x(29,Yi,5,2,"span")(30,Zi,2,1),l(),a(31,"div",10),x(32,ie,3,3,"a",11)(33,ee,3,3,"a",21)(34,ne,2,0,"a",22)(35,ve,22,18,"span",23),l()()()()()()()),o&2&&(t(3),b("src",i.plugin.icon,T),t(),s(i.plugin.installedVersion&&i.hb2Status!=="hide"?4:-1),t(6),P(i.plugin.displayName),t(2),s(i.plugin.installedVersion&&i.plugin.updateAvailable&&!i.childBridgeRestartInProgress?12:-1),t(),s(i.plugin.installedVersion&&(i.plugin.newHbScope==null?null:i.plugin.newHbScope.switch)===i.plugin.installedVersion&&!i.childBridgeRestartInProgress?13:-1),t(),s(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&!i.plugin.isConfigured&&!i.childBridgeRestartInProgress&&!i.plugin.disabled?14:-1),t(),s(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&!i.plugin.hasChildBridges&&!i.plugin.disabled&&i.plugin.recommendChildBridge&&!i.childBridgeRestartInProgress?15:-1),t(),s(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&i.hasUnpairedChildBridges&&i.childBridgeStatus==="ok"&&!i.plugin.disabled?16:-1),t(),b("hidden",!i.childBridgeRestartInProgress),t(),s(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&!i.hasUnpairedChildBridges&&i.childBridgeStatus!=="ok"&&!i.plugin.disabled?18:-1),t(3),b("ngClass",J(20,Ai,i.plugin.isHbScoped,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),!i.plugin.isHbScoped&&!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin)),t(2),P(i.plugin.name),t(2),s((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?25:-1),t(),s((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?-1:26),t(3),s(i.plugin.publicPackage&&!i.plugin.installedVersion?29:-1),t(),s(i.plugin.installedVersion?30:-1),t(2),s(!i.plugin.disabled&&i.plugin.hasChildBridges&&i.childBridgeStatus==="ok"?32:-1),t(),s(i.plugin.installedVersion&&i.plugin.disabled?33:-1),t(),s(i.plugin.publicPackage&&!i.plugin.installedVersion?34:-1),t(),s(i.plugin.installedVersion?35:-1))},dependencies:[mi,E,ci,pi,di,si,ri,Q,$],encapsulation:2})}return n})();var xe=(n,r)=>({"fa-magnifying-glass":n,"fa-exclamation-circle":r});function we(n,r){n&1&&d(0,"app-spinner")}function Pe(n,r){if(n&1){let e=h();a(0,"a",9),m("click",function(){f(e);let i=p();return _(i.onClearSearch())}),d(1,"i",10),l()}}function Se(n,r){if(n&1&&(a(0,"div",11),d(1,"app-plugin-card",13),l()),n&2){let e=r.$implicit,o=p(2);t(),b("plugin",e)("childBridges",o.getPluginChildBridges(e))}}function ye(n,r){if(n&1&&(a(0,"div",12),d(1,"i",14),a(2,"p"),g(3),c(4,"translate"),l()()),n&2){let e=p(2);t(),b("ngClass",k(4,xe,!e.showExitButton,e.showExitButton)),t(2),P(u(4,2,e.showExitButton?"plugins.placeholder_search_none":"plugins.placeholder_search_first"))}}function Be(n,r){if(n&1&&(a(0,"div",8),G(1,Se,2,2,"div",11,L),x(3,ye,5,7,"div",12),l()),n&2){let e=p();t(),W(e.installedPlugins),t(2),s(e.installedPlugins.length===0&&!e.loading&&!e.mainError?3:-1)}}var Cn=(()=>{class n{$api=w(A);$plugin=w(U);$router=w(_i);$settings=w(F);$toastr=w(j);$translate=w(N);$ws=w(R);isSearchMode=!1;mainError=!1;loading=!0;installedPlugins=[];childBridges=[];showExitButton=!1;form=new ii({query:new ei("")});io;navigationSubscription;constructor(){}ngOnInit(){return y(this,null,function*(){this.io=this.$ws.connectToNamespace("child-bridges"),this.io.connected.subscribe(()=>y(this,null,function*(){this.getChildBridgeMetadata(),this.io.socket.emit("monitor-child-bridge-status"),this.loadInstalledPlugins().then(()=>{let e=this.$router.parseUrl(this.$router.url).queryParams.installed;if(e){let o=this.installedPlugins.find(i=>i.name===e);o&&!o.isConfigured&&this.$plugin.settings(o),this.$router.navigate(["/plugins"])}})})),this.io.socket.on("child-bridge-status-update",e=>{let o=this.childBridges.find(i=>i.username===e.username);o?Object.assign(o,e):this.childBridges.push(e)}),this.navigationSubscription=this.$router.events.subscribe(e=>{e instanceof fi&&this.loadInstalledPlugins()})})}loadInstalledPlugins(){return y(this,null,function*(){this.form.setValue({query:""}),this.showExitButton=!1,this.installedPlugins=[],this.loading=!0,this.mainError=!1;try{let e=yield I(this.$api.get("/plugins"));this.installedPlugins=e.filter(i=>i.name!=="homebridge-config-ui-x"),yield this.appendMetaInfo();let o=this.installedPlugins.sort((i,C)=>i.updateAvailable!==C.updateAvailable?i.updateAvailable?-1:1:i.newHbScope&&!C.newHbScope?-1:i.disabled!==C.disabled?i.disabled?1:-1:i.isConfigured!==C.isConfigured?i.isConfigured?1:-1:i.hasChildBridgesUnpaired!==C.hasChildBridgesUnpaired?i.hasChildBridgesUnpaired?-1:1:i.hasChildBridges!==C.hasChildBridges&&this.$settings.env.recommendChildBridges?i.hasChildBridges?1:-1:i.name.localeCompare(C.name));return this.loading=!1,o}catch(e){console.error(e),this.loading=!1,this.mainError=!0,this.$toastr.error(this.$translate.instant("plugins.toast_failed_to_load_plugins"),this.$translate.instant("toast.title_error"))}})}appendMetaInfo(){return y(this,null,function*(){yield Promise.all(this.installedPlugins.filter(e=>e.installedVersion).map(e=>y(this,null,function*(){try{let o=yield I(this.$api.get(`/config-editor/plugin/${encodeURIComponent(e.name)}`));e.isConfigured=o.length>0,e.isConfiguredDynamicPlatform=e.isConfigured&&Object.prototype.hasOwnProperty.call(o[0],"platform"),e.recommendChildBridge=e.isConfiguredDynamicPlatform&&this.$settings.env.recommendChildBridges&&!["homebridge","homebridge-config-ui-x"].includes(e.name),e.hasChildBridges=e.isConfigured&&o.some(C=>C._bridge&&C._bridge.username);let i=this.getPluginChildBridges(e);e.hasChildBridgesUnpaired=i.some(C=>!C.paired)}catch{e.isConfigured=!0,e.hasChildBridges=!0}})))})}search(){this.installedPlugins=[],this.loading=!0,this.showExitButton=!0,this.$api.get(`/plugins/search/${encodeURIComponent(this.form.value.query)}`).subscribe({next:e=>{let o=new Set;this.installedPlugins=e.reduce((i,C)=>{if(C.name==="homebridge-config-ui-x"||o.has(C.name))return i;if(C.newHbScope){let M=C.newHbScope.to,S=e.some(ki=>ki.name===M);(C.installedVersion||!S)&&(o.add(M),i.push(C))}else i.push(C);return i},[]),this.appendMetaInfo(),this.loading=!1},error:e=>{this.loading=!1,this.isSearchMode=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error")),this.loadInstalledPlugins()}})}onClearSearch(){this.loadInstalledPlugins()}onSubmit({value:e}){e.query.length?(this.isSearchMode=!0,this.search()):this.isSearchMode&&(this.isSearchMode=!1,this.loadInstalledPlugins())}getChildBridgeMetadata(){this.io.request("get-homebridge-child-bridge-status").subscribe(e=>{this.childBridges=e})}getPluginChildBridges(e){return this.childBridges.filter(o=>o.plugin===e.name)}ngOnDestroy(){this.navigationSubscription&&this.navigationSubscription.unsubscribe(),this.io.end()}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=V({type:n,selectors:[["ng-component"]],decls:13,vars:10,consts:[[1,"row","mb-3"],[1,"col-12"],[1,"primary-text","m-0"],[1,"row"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","formControlName","query",1,"hb-npm-search",3,"placeholder"],["href","javascript:void(0)",1,"hb-npm-search-clear"],[1,"d-flex","flex-wrap","justify-content-between"],["href","javascript:void(0)",1,"hb-npm-search-clear",3,"click"],[1,"far","fa-fw","fa-times-circle"],[1,"hb-plugin-space-between"],[1,"alert","alert-info","mt-4","text-center","w-100"],[3,"plugin","childBridges"],[1,"fas","fa-fw","primary-text","my-3",2,"font-size","75px",3,"ngClass"]],template:function(o,i){o&1&&(x(0,we,1,0,"app-spinner"),a(1,"div",0)(2,"div",1)(3,"h3",2),g(4),c(5,"translate"),l()()(),a(6,"div",3)(7,"div",4)(8,"form",5),m("ngSubmit",function(){return i.onSubmit(i.form)}),d(9,"input",6),c(10,"translate"),x(11,Pe,2,0,"a",7),l()()(),x(12,Be,4,1,"div",8)),o&2&&(s(i.loading?0:-1),t(4),P(u(5,6,"menu.label_plugins")),t(4),b("formGroup",i.form),t(),b("placeholder",u(10,8,"plugins.placeholder_search_plugin")),t(2),s(i.showExitButton?11:-1),t(),s(i.loading?-1:12))},dependencies:[bi,ai,ni,X,Y,Z,li,ti,oi,Bi,$,E],styles:[".hb-npm-search[_ngcontent-%COMP%]{outline:none;box-sizing:inherit!important;background-color:inherit;height:50px!important;width:100%;border-width:.5px;padding:10px;margin-bottom:15px}@media (hover: hover){.hb-npm-search[_ngcontent-%COMP%]:hover{border:1px solid #000000}}.hb-npm-search[_ngcontent-%COMP%]:focus{border:1px solid #000000;box-shadow:0 1px #000}.hb-npm-search-clear[_ngcontent-%COMP%]{position:absolute;right:25px;font-size:35px;color:#d0d0d0;line-height:50px;cursor:pointer}.hb-plugin-space-between[_ngcontent-%COMP%]{box-sizing:border-box;width:calc(50% - 6.6666666667px)}@media only screen and (max-width: 991px){.hb-plugin-space-between[_ngcontent-%COMP%]{width:100%}}"]})}return n})();export{Cn as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as
|
|
2
|
-
`).forEach(e=>{let n=e.indexOf(":");if(n>0){let s=e.slice(0,n),o=e.slice(n+1).trim();this.addHeaderEntry(s,o)}})}:typeof Headers<"u"&&t instanceof Headers?(this.headers=new Map,t.forEach((e,n)=>{this.addHeaderEntry(n,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(t).forEach(([e,n])=>{this.setHeaderEntries(e,n)})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();let e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof r?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){let e=new r;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof r?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){let e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(t.name,e);let s=(t.op==="a"?this.headers.get(e):void 0)||[];s.push(...n),this.headers.set(e,s);break;case"d":let o=t.value;if(!o)this.headers.delete(e),this.normalizedNames.delete(e);else{let i=this.headers.get(e);if(!i)return;i=i.filter(c=>o.indexOf(c)===-1),i.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,i)}break}}addHeaderEntry(t,e){let n=t.toLowerCase();this.maybeSetNormalizedName(t,n),this.headers.has(n)?this.headers.get(n).push(e):this.headers.set(n,[e])}setHeaderEntries(t,e){let n=(Array.isArray(e)?e:[e]).map(o=>o.toString()),s=t.toLowerCase();this.headers.set(s,n),this.maybeSetNormalizedName(t,s)}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}};var ye=class{encodeKey(t){return nt(t)}encodeValue(t){return nt(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}};function Ct(r,t){let e=new Map;return r.length>0&&r.replace(/^\?/,"").split("&").forEach(s=>{let o=s.indexOf("="),[i,c]=o==-1?[t.decodeKey(s),""]:[t.decodeKey(s.slice(0,o)),t.decodeValue(s.slice(o+1))],a=e.get(i)||[];a.push(c),e.set(i,a)}),e}var kt=/%(\d[a-f0-9])/gi,xt={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function nt(r){return encodeURIComponent(r).replace(kt,(t,e)=>{var n;return(n=xt[e])!=null?n:t})}function q(r){return`${r}`}var A=class r{map;encoder;updates=null;cloneFrom=null;constructor(t={}){if(this.encoder=t.encoder||new ye,t.fromString){if(t.fromObject)throw new g(2805,!1);this.map=Ct(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{let n=t.fromObject[e],s=Array.isArray(n)?n.map(q):[q(n)];this.map.set(e,s)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();let e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){let e=[];return Object.keys(t).forEach(n=>{let s=t[n];Array.isArray(s)?s.forEach(o=>{e.push({param:n,value:o,op:"a"})}):e.push({param:n,value:s,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{let e=this.encoder.encodeKey(t);return this.map.get(t).map(n=>e+"="+this.encoder.encodeValue(n)).join("&")}).filter(t=>t!=="").join("&")}clone(t){let e=new r({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":let e=(t.op==="a"?this.map.get(t.param):void 0)||[];e.push(q(t.value)),this.map.set(t.param,e);break;case"d":if(t.value!==void 0){let n=this.map.get(t.param)||[],s=n.indexOf(q(t.value));s!==-1&&n.splice(s,1),n.length>0?this.map.set(t.param,n):this.map.delete(t.param)}else{this.map.delete(t.param);break}}}),this.cloneFrom=this.updates=null)}};var ge=class{map=new Map;set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}};function jt(r){switch(r){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function rt(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer}function st(r){return typeof Blob<"u"&&r instanceof Blob}function ot(r){return typeof FormData<"u"&&r instanceof FormData}function Ut(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}var it="Content-Type",at="Accept",ht="X-Request-URL",ft="text/plain",pt="application/json",Ft=`${pt}, ${ft}, */*`,j=class r{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(t,e,n,s){var i,c;this.url=e,this.method=t.toUpperCase();let o;if(jt(this.method)||s?(this.body=n!==void 0?n:null,o=s):o=n,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params),this.transferCache=o.transferCache),(i=this.headers)!=null||(this.headers=new S),(c=this.context)!=null||(this.context=new ge),!this.params)this.params=new A,this.urlWithParams=e;else{let a=this.params.toString();if(a.length===0)this.urlWithParams=e;else{let l=e.indexOf("?"),h=l===-1?"?":l<e.length-1?"&":"";this.urlWithParams=e+h+a}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||rt(this.body)||st(this.body)||ot(this.body)||Ut(this.body)?this.body:this.body instanceof A?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||ot(this.body)?null:st(this.body)?this.body.type||null:rt(this.body)?null:typeof this.body=="string"?ft:this.body instanceof A?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?pt:null}clone(t={}){var E,M,b,d;let e=t.method||this.method,n=t.url||this.url,s=t.responseType||this.responseType,o=(E=t.transferCache)!=null?E:this.transferCache,i=t.body!==void 0?t.body:this.body,c=(M=t.withCredentials)!=null?M:this.withCredentials,a=(b=t.reportProgress)!=null?b:this.reportProgress,l=t.headers||this.headers,h=t.params||this.params,p=(d=t.context)!=null?d:this.context;return t.setHeaders!==void 0&&(l=Object.keys(t.setHeaders).reduce((f,T)=>f.set(T,t.setHeaders[T]),l)),t.setParams&&(h=Object.keys(t.setParams).reduce((f,T)=>f.set(T,t.setParams[T]),h)),new r(e,n,i,{params:h,headers:l,context:p,reportProgress:a,responseType:s,withCredentials:c,transferCache:o})}},L=function(r){return r[r.Sent=0]="Sent",r[r.UploadProgress=1]="UploadProgress",r[r.ResponseHeader=2]="ResponseHeader",r[r.DownloadProgress=3]="DownloadProgress",r[r.Response=4]="Response",r[r.User=5]="User",r}(L||{}),F=class{headers;status;statusText;url;ok;type;constructor(t,e=200,n="OK"){this.headers=t.headers||new S,this.status=t.status!==void 0?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}},ve=class r extends F{constructor(t={}){super(t)}type=L.ResponseHeader;clone(t={}){return new r({headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},K=class r extends F{body;constructor(t={}){super(t),this.body=t.body!==void 0?t.body:null}type=L.Response;clone(t={}){return new r({body:t.body!==void 0?t.body:this.body,headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},H=class extends F{name="HttpErrorResponse";message;error;ok=!1;constructor(t){super(t,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${t.url||"(unknown url)"}`:this.message=`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}},Bt=200,zt=204;function me(r,t){return{body:t,headers:r.headers,context:r.context,observe:r.observe,params:r.params,reportProgress:r.reportProgress,responseType:r.responseType,withCredentials:r.withCredentials,transferCache:r.transferCache}}var Vt=(()=>{class r{handler;constructor(e){this.handler=e}request(e,n,s={}){let o;if(e instanceof j)o=e;else{let a;s.headers instanceof S?a=s.headers:a=new S(s.headers);let l;s.params&&(s.params instanceof A?l=s.params:l=new A({fromObject:s.params})),o=new j(e,n,s.body!==void 0?s.body:null,{headers:a,context:s.context,params:l,reportProgress:s.reportProgress,responseType:s.responseType||"json",withCredentials:s.withCredentials,transferCache:s.transferCache})}let i=se(o).pipe(Le(a=>this.handler.handle(a)));if(e instanceof j||s.observe==="events")return i;let c=i.pipe(_e(a=>a instanceof K));switch(s.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return c.pipe(C(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new g(2806,!1);return a.body}));case"blob":return c.pipe(C(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new g(2807,!1);return a.body}));case"text":return c.pipe(C(a=>{if(a.body!==null&&typeof a.body!="string")throw new g(2808,!1);return a.body}));case"json":default:return c.pipe(C(a=>a.body))}case"response":return c;default:throw new g(2809,!1)}}delete(e,n={}){return this.request("DELETE",e,n)}get(e,n={}){return this.request("GET",e,n)}head(e,n={}){return this.request("HEAD",e,n)}jsonp(e,n){return this.request("JSONP",e,{params:new A().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,n={}){return this.request("OPTIONS",e,n)}patch(e,n,s={}){return this.request("PATCH",e,me(s,n))}post(e,n,s={}){return this.request("POST",e,me(s,n))}put(e,n,s={}){return this.request("PUT",e,me(s,n))}static \u0275fac=function(n){return new(n||r)(u(U))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();var $t=new v("");function mt(r,t){return t(r)}function Xt(r,t){return(e,n)=>t.intercept(e,{handle:s=>r(s,n)})}function Gt(r,t,e){return(n,s)=>je(e,()=>t(n,o=>r(o,s)))}var Jt=new v(""),Ee=new v(""),Wt=new v(""),yt=new v("",{providedIn:"root",factory:()=>!0});function Zt(){let r=null;return(t,e)=>{var o;r===null&&(r=((o=w(Jt,{optional:!0}))!=null?o:[]).reduceRight(Xt,mt));let n=w(ce);if(w(yt)){let i=n.add();return r(t,e).pipe(oe(()=>n.remove(i)))}else return r(t,e)}}var ct=(()=>{class r extends U{backend;injector;chain=null;pendingTasks=w(ce);contributeToStability=w(yt);constructor(e,n){super(),this.backend=e,this.injector=n}handle(e){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(Ee),...this.injector.get(Wt,[])]));this.chain=n.reduceRight((s,o)=>Gt(s,o,this.injector),mt)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(e,s=>this.backend.handle(s)).pipe(oe(()=>this.pendingTasks.remove(n)))}else return this.chain(e,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||r)(u(Y),u(xe))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();var qt=/^\)\]\}',?\n/,Yt=RegExp(`^${ht}:`,"m");function Kt(r){return"responseURL"in r&&r.responseURL?r.responseURL:Yt.test(r.getAllResponseHeaders())?r.getResponseHeader(ht):null}var dt=(()=>{class r{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if(e.method==="JSONP")throw new g(-2800,!1);let n=this.xhrFactory;return(n.\u0275loadImpl?Ne(n.\u0275loadImpl()):se(null)).pipe(Ce(()=>new Ie(o=>{let i=n.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach((d,f)=>i.setRequestHeader(d,f.join(","))),e.headers.has(at)||i.setRequestHeader(at,Ft),!e.headers.has(it)){let d=e.detectContentTypeHeader();d!==null&&i.setRequestHeader(it,d)}if(e.responseType){let d=e.responseType.toLowerCase();i.responseType=d!=="json"?d:"text"}let c=e.serializeBody(),a=null,l=()=>{if(a!==null)return a;let d=i.statusText||"OK",f=new S(i.getAllResponseHeaders()),T=Kt(i)||e.url;return a=new ve({headers:f,status:i.status,statusText:d,url:T}),a},h=()=>{let{headers:d,status:f,statusText:T,url:Pe}=l(),y=null;f!==zt&&(y=typeof i.response>"u"?i.responseText:i.response),f===0&&(f=y?Bt:0);let re=f>=200&&f<300;if(e.responseType==="json"&&typeof y=="string"){let St=y;y=y.replace(qt,"");try{y=y!==""?JSON.parse(y):null}catch(It){y=St,re&&(re=!1,y={error:It,text:y})}}re?(o.next(new K({body:y,headers:d,status:f,statusText:T,url:Pe||void 0})),o.complete()):o.error(new H({error:y,headers:d,status:f,statusText:T,url:Pe||void 0}))},p=d=>{let{url:f}=l(),T=new H({error:d,status:i.status||0,statusText:i.statusText||"Unknown Error",url:f||void 0});o.error(T)},E=!1,M=d=>{E||(o.next(l()),E=!0);let f={type:L.DownloadProgress,loaded:d.loaded};d.lengthComputable&&(f.total=d.total),e.responseType==="text"&&i.responseText&&(f.partialText=i.responseText),o.next(f)},b=d=>{let f={type:L.UploadProgress,loaded:d.loaded};d.lengthComputable&&(f.total=d.total),o.next(f)};return i.addEventListener("load",h),i.addEventListener("error",p),i.addEventListener("timeout",p),i.addEventListener("abort",p),e.reportProgress&&(i.addEventListener("progress",M),c!==null&&i.upload&&i.upload.addEventListener("progress",b)),i.send(c),o.next({type:L.Sent}),()=>{i.removeEventListener("error",p),i.removeEventListener("abort",p),i.removeEventListener("load",h),i.removeEventListener("timeout",p),e.reportProgress&&(i.removeEventListener("progress",M),c!==null&&i.upload&&i.upload.removeEventListener("progress",b)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||r)(u(Z))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),gt=new v(""),Ht="XSRF-TOKEN",Qt=new v("",{providedIn:"root",factory:()=>Ht}),en="X-XSRF-TOKEN",tn=new v("",{providedIn:"root",factory:()=>en}),Q=class{},nn=(()=>{class r{doc;platform;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,n,s){this.doc=e,this.platform=n,this.cookieName=s}getToken(){if(this.platform==="server")return null;let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=W(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(n){return new(n||r)(u(R),u(I),u(Qt))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();function rn(r,t){let e=r.url.toLowerCase();if(!w(gt)||r.method==="GET"||r.method==="HEAD"||e.startsWith("http://")||e.startsWith("https://"))return t(r);let n=w(Q).getToken(),s=w(tn);return n!=null&&!r.headers.has(s)&&(r=r.clone({headers:r.headers.set(s,n)})),t(r)}var vt=function(r){return r[r.Interceptors=0]="Interceptors",r[r.LegacyInterceptors=1]="LegacyInterceptors",r[r.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",r[r.NoXsrfProtection=3]="NoXsrfProtection",r[r.JsonpSupport=4]="JsonpSupport",r[r.RequestsMadeViaParent=5]="RequestsMadeViaParent",r[r.Fetch=6]="Fetch",r}(vt||{});function sn(r,t){return{\u0275kind:r,\u0275providers:t}}function Hn(...r){let t=[Vt,dt,ct,{provide:U,useExisting:ct},{provide:Y,useFactory:()=>{var e;return(e=w($t,{optional:!0}))!=null?e:w(dt)}},{provide:Ee,useValue:rn,multi:!0},{provide:gt,useValue:!0},{provide:Q,useClass:nn}];for(let e of r)t.push(...e.\u0275providers);return ae(t)}var lt=new v("");function Qn(){return sn(vt.LegacyInterceptors,[{provide:lt,useFactory:Zt},{provide:Ee,useExisting:lt,multi:!0}])}var we=class extends Qe{supportsDOMEvents=!0},Re=class r extends we{static makeCurrent(){He(new r)}onAndCancel(t,e,n,s){return t.addEventListener(e,n,s),()=>{t.removeEventListener(e,n,s)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.remove()}createElement(t,e){return e=e||this.getDefaultDocument(),e.createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return e==="window"?window:e==="document"?t:e==="body"?t.body:null}getBaseHref(t){let e=on();return e==null?null:an(e)}resetBaseElement(){B=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return W(document.cookie,t)}},B=null;function on(){return B=B||document.querySelector("base"),B?B.getAttribute("href"):null}function an(r){return new URL(r,document.baseURI).pathname}var be=class{addToWindow(t){D.getAngularTestability=(n,s=!0)=>{let o=t.findTestabilityInTree(n,s);if(o==null)throw new g(5103,!1);return o},D.getAllAngularTestabilities=()=>t.getAllTestabilities(),D.getAllAngularRootElements=()=>t.getAllRootElements();let e=n=>{let s=D.getAllAngularTestabilities(),o=s.length,i=function(){o--,o==0&&n()};s.forEach(c=>{c.whenStable(i)})};D.frameworkStabilizers||(D.frameworkStabilizers=[]),D.frameworkStabilizers.push(e)}findTestabilityInTree(t,e,n){if(e==null)return null;let s=t.getTestability(e);return s!=null?s:n?J().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}},cn=(()=>{class r{build(){return new XMLHttpRequest}static \u0275fac=function(n){return new(n||r)};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),Me=new v(""),Mt=(()=>{class r{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,n){this._zone=n,e.forEach(s=>{s.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,n,s,o){return this._findPluginFor(n).addEventListener(e,n,s,o)}getZone(){return this._zone}_findPluginFor(e){let n=this._eventNameToPlugin.get(e);if(n)return n;if(n=this._plugins.find(o=>o.supports(e)),!n)throw new g(5101,!1);return this._eventNameToPlugin.set(e,n),n}static \u0275fac=function(n){return new(n||r)(u(Me),u(O))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),te=class{_doc;constructor(t){this._doc=t}manager},ee="ng-app-id";function Et(r){for(let t of r)t.remove()}function Tt(r,t){let e=t.createElement("style");return e.textContent=r,e}function dn(r,t,e,n){var o;let s=(o=r.head)==null?void 0:o.querySelectorAll(`style[${ee}="${t}"],link[${ee}="${t}"]`);if(s)for(let i of s)i.removeAttribute(ee),i instanceof HTMLLinkElement?n.set(i.href.slice(i.href.lastIndexOf("/")+1),{usage:0,elements:[i]}):i.textContent&&e.set(i.textContent,{usage:0,elements:[i]})}function De(r,t){let e=t.createElement("link");return e.setAttribute("rel","stylesheet"),e.setAttribute("href",r),e}var Dt=(()=>{class r{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(e,n,s,o={}){this.doc=e,this.appId=n,this.nonce=s,this.isServer=pe(o),dn(e,n,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,n){for(let s of e)this.addUsage(s,this.inline,Tt);n==null||n.forEach(s=>this.addUsage(s,this.external,De))}removeStyles(e,n){for(let s of e)this.removeUsage(s,this.inline);n==null||n.forEach(s=>this.removeUsage(s,this.external))}addUsage(e,n,s){let o=n.get(e);o?o.usage++:n.set(e,{usage:1,elements:[...this.hosts].map(i=>this.addElement(i,s(e,this.doc)))})}removeUsage(e,n){let s=n.get(e);s&&(s.usage--,s.usage<=0&&(Et(s.elements),n.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])Et(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[n,{elements:s}]of this.inline)s.push(this.addElement(e,Tt(n,this.doc)));for(let[n,{elements:s}]of this.external)s.push(this.addElement(e,De(n,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,n){return this.nonce&&n.setAttribute("nonce",this.nonce),this.isServer&&n.setAttribute(ee,this.appId),e.appendChild(n)}static \u0275fac=function(n){return new(n||r)(u(R),u(le),u(ue,8),u(I))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),Te={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},Oe=/%COMP%/g;var At="%COMP%",ln=`_nghost-${At}`,un=`_ngcontent-${At}`,hn=!0,fn=new v("",{providedIn:"root",factory:()=>hn});function pn(r){return un.replace(Oe,r)}function mn(r){return ln.replace(Oe,r)}function Ot(r,t){return t.map(e=>e.replace(Oe,r))}var wt=(()=>{class r{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(e,n,s,o,i,c,a,l=null,h=null){this.eventManager=e,this.sharedStylesHost=n,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=i,this.platformId=c,this.ngZone=a,this.nonce=l,this.tracingService=h,this.platformIsServer=pe(c),this.defaultRenderer=new z(e,i,a,this.platformIsServer,this.tracingService)}createRenderer(e,n){if(!e||!n)return this.defaultRenderer;this.platformIsServer&&n.encapsulation===k.ShadowDom&&(n=Se($({},n),{encapsulation:k.Emulated}));let s=this.getOrCreateRenderer(e,n);return s instanceof ne?s.applyToHost(e):s instanceof V&&s.applyStyles(),s}getOrCreateRenderer(e,n){let s=this.rendererByCompId,o=s.get(n.id);if(!o){let i=this.doc,c=this.ngZone,a=this.eventManager,l=this.sharedStylesHost,h=this.removeStylesOnCompDestroy,p=this.platformIsServer,E=this.tracingService;switch(n.encapsulation){case k.Emulated:o=new ne(a,l,n,this.appId,h,i,c,p,E);break;case k.ShadowDom:return new Ae(a,l,e,n,i,c,this.nonce,p,E);default:o=new V(a,l,n,h,i,c,p,E);break}s.set(n.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=function(n){return new(n||r)(u(Mt),u(Dt),u(le),u(fn),u(R),u(I),u(O),u(ue),u(Be,8))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),z=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(t,e,n,s,o){this.eventManager=t,this.doc=e,this.ngZone=n,this.platformIsServer=s,this.tracingService=o}destroy(){}destroyNode=null;createElement(t,e){return e?this.doc.createElementNS(Te[e]||e,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,e){(Rt(t)?t.content:t).appendChild(e)}insertBefore(t,e,n){t&&(Rt(t)?t.content:t).insertBefore(e,n)}removeChild(t,e){e.remove()}selectRootElement(t,e){let n=typeof t=="string"?this.doc.querySelector(t):t;if(!n)throw new g(-5104,!1);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,s){if(s){e=s+":"+e;let o=Te[s];o?t.setAttributeNS(o,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){let s=Te[n];s?t.removeAttributeNS(s,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,s){s&(x.DashCase|x.Important)?t.style.setProperty(e,n,s&x.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&x.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t!=null&&(t[e]=n)}setValue(t,e){t.nodeValue=e}listen(t,e,n,s){if(typeof t=="string"&&(t=J().getGlobalEventTarget(this.doc,t),!t))throw new Error(`Unsupported event target ${t} for event ${e}`);let o=this.decoratePreventDefault(n);return this.tracingService!==null&&this.tracingService.wrapEventListener&&(o=this.tracingService.wrapEventListener(t,e,o)),this.eventManager.addEventListener(t,e,o,s)}decoratePreventDefault(t){return e=>{if(e==="__ngUnwrap__")return t;(this.platformIsServer?this.ngZone.runGuarded(()=>t(e)):t(e))===!1&&e.preventDefault()}}};function Rt(r){return r.tagName==="TEMPLATE"&&r.content!==void 0}var Ae=class extends z{sharedStylesHost;hostEl;shadowRoot;constructor(t,e,n,s,o,i,c,a,l){var M;super(t,o,i,a,l),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let h=s.styles;h=Ot(s.id,h);for(let b of h){let d=document.createElement("style");c&&d.setAttribute("nonce",c),d.textContent=b,this.shadowRoot.appendChild(d)}let p=(M=s.getExternalStyles)==null?void 0:M.call(s);if(p)for(let b of p){let d=De(b,o);c&&d.setAttribute("nonce",c),this.shadowRoot.appendChild(d)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,n){return super.insertBefore(this.nodeOrShadowRoot(t),e,n)}removeChild(t,e){return super.removeChild(null,e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},V=class extends z{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(t,e,n,s,o,i,c,a,l){var E;super(t,o,i,c,a),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=s;let h=n.styles;this.styles=l?Ot(l,h):h,this.styleUrls=(E=n.getExternalStyles)==null?void 0:E.call(n,l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},ne=class extends V{contentAttr;hostAttr;constructor(t,e,n,s,o,i,c,a,l){let h=s+"-"+n.id;super(t,e,n,o,i,c,a,l,h),this.contentAttr=pn(h),this.hostAttr=mn(h)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,e){let n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}},yn=(()=>{class r extends te{constructor(e){super(e)}supports(e){return!0}addEventListener(e,n,s,o){return e.addEventListener(n,s,o),()=>this.removeEventListener(e,n,s,o)}removeEventListener(e,n,s,o){return e.removeEventListener(n,s,o)}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),bt=["alt","control","meta","shift"],gn={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},vn={alt:r=>r.altKey,control:r=>r.ctrlKey,meta:r=>r.metaKey,shift:r=>r.shiftKey},En=(()=>{class r extends te{constructor(e){super(e)}supports(e){return r.parseEventName(e)!=null}addEventListener(e,n,s,o){let i=r.parseEventName(n),c=r.eventCallback(i.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>J().onAndCancel(e,i.domEventName,c,o))}static parseEventName(e){let n=e.toLowerCase().split("."),s=n.shift();if(n.length===0||!(s==="keydown"||s==="keyup"))return null;let o=r._normalizeKey(n.pop()),i="",c=n.indexOf("code");if(c>-1&&(n.splice(c,1),i="code."),bt.forEach(l=>{let h=n.indexOf(l);h>-1&&(n.splice(h,1),i+=l+".")}),i+=o,n.length!=0||o.length===0)return null;let a={};return a.domEventName=s,a.fullKey=i,a}static matchEventFullKeyCode(e,n){let s=gn[e.key]||e.key,o="";return n.indexOf("code.")>-1&&(s=e.code,o="code."),s==null||!s?!1:(s=s.toLowerCase(),s===" "?s="space":s==="."&&(s="dot"),bt.forEach(i=>{if(i!==s){let c=vn[i];c(e)&&(o+=i+".")}}),o+=s,o===n)}static eventCallback(e,n,s){return o=>{r.matchEventFullKeyCode(o,e)&&s.runGuarded(()=>n(o))}}static _normalizeKey(e){return e==="esc"?"escape":e}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();function Tr(r,t){return Ke($({rootComponent:r},Tn(t)))}function Tn(r){var t;return{appProviders:[...Pt,...(t=r==null?void 0:r.providers)!=null?t:[]],platformProviders:Mn}}function wn(){Re.makeCurrent()}function Rn(){return new de}function bn(){return Ue(document),document}var Mn=[{provide:I,useValue:tt},{provide:Fe,useValue:wn,multi:!0},{provide:R,useFactory:bn,deps:[]}];var Dn=[{provide:X,useClass:be,deps:[]},{provide:qe,useClass:G,deps:[O,fe,X]},{provide:G,useClass:G,deps:[O,fe,X]}],Pt=[{provide:ke,useValue:"root"},{provide:de,useFactory:Rn,deps:[]},{provide:Me,useClass:yn,multi:!0,deps:[R]},{provide:Me,useClass:En,multi:!0,deps:[R]},wt,Dt,Mt,{provide:Ze,useExisting:wt},{provide:Z,useClass:cn,deps:[]},[]],wr=(()=>{class r{constructor(){}static \u0275fac=function(n){return new(n||r)};static \u0275mod=he({type:r});static \u0275inj=ie({providers:[...Pt,...Dn],imports:[et,Ye]})}return r})();var Rr=(()=>{class r{_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=m({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var An=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275prov=m({token:r,factory:function(n){let s=null;return n?s=new(n||r):s=u(On),s},providedIn:"root"})}return r})(),On=(()=>{class r extends An{_doc;constructor(e){super(),this._doc=e}sanitize(e,n){if(n==null)return null;switch(e){case P.NONE:return n;case P.HTML:return _(n,"HTML")?N(n):We(this._doc,String(n)).toString();case P.STYLE:return _(n,"Style")?N(n):n;case P.SCRIPT:if(_(n,"Script"))return N(n);throw new g(5200,!1);case P.URL:return _(n,"URL")?N(n):Je(String(n));case P.RESOURCE_URL:if(_(n,"ResourceURL"))return N(n);throw new g(5201,!1);default:throw new g(5202,!1)}}bypassSecurityTrustHtml(e){return ze(e)}bypassSecurityTrustStyle(e){return Ve(e)}bypassSecurityTrustScript(e){return $e(e)}bypassSecurityTrustUrl(e){return Xe(e)}bypassSecurityTrustResourceUrl(e){return Ge(e)}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=m({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{Y as a,A as b,L as c,K as d,Vt as e,Jt as f,Hn as g,Qn as h,wt as i,Tr as j,wr as k,Rr as l,An as m};
|
|
1
|
+
import{$ as Le,$a as Je,Ba as ce,Bb as Ze,Cb as X,Da as A,Db as G,Ea as le,Eb as fe,H as Ne,Hc as qe,Ic as Ke,Ja as Ue,Ka as de,L as Ce,La as Fe,Ma as P,Oa as ue,Oc as J,Pa as Be,Pc as He,Qc as Qe,Rc as R,S as oe,Ta as k,Ua as I,Va as N,Wa as ze,Xa as Ve,Ya as $e,Za as Xe,_a as Ge,_c as W,a as $,ab as We,b as Oe,bb as S,da as m,ea as _,ga as y,ha as ie,hb as x,id as et,ja as v,jd as tt,k as Pe,kb as Ye,la as u,ld as pe,ma as w,na as ae,nd as Y,pa as ke,q as Ie,qa as xe,r as se,ra as je,ub as he,x as L}from"./chunk-NVNBNEFN.js";var U=class{},q=class{},O=class r{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(t){t?typeof t=="string"?this.lazyInit=()=>{this.headers=new Map,t.split(`
|
|
2
|
+
`).forEach(e=>{let n=e.indexOf(":");if(n>0){let s=e.slice(0,n),o=e.slice(n+1).trim();this.addHeaderEntry(s,o)}})}:typeof Headers<"u"&&t instanceof Headers?(this.headers=new Map,t.forEach((e,n)=>{this.addHeaderEntry(n,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(t).forEach(([e,n])=>{this.setHeaderEntries(e,n)})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();let e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof r?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){let e=new r;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof r?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){let e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(t.name,e);let s=(t.op==="a"?this.headers.get(e):void 0)||[];s.push(...n),this.headers.set(e,s);break;case"d":let o=t.value;if(!o)this.headers.delete(e),this.normalizedNames.delete(e);else{let i=this.headers.get(e);if(!i)return;i=i.filter(c=>o.indexOf(c)===-1),i.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,i)}break}}addHeaderEntry(t,e){let n=t.toLowerCase();this.maybeSetNormalizedName(t,n),this.headers.has(n)?this.headers.get(n).push(e):this.headers.set(n,[e])}setHeaderEntries(t,e){let n=(Array.isArray(e)?e:[e]).map(o=>o.toString()),s=t.toLowerCase();this.headers.set(s,n),this.maybeSetNormalizedName(t,s)}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}};var ye=class{encodeKey(t){return nt(t)}encodeValue(t){return nt(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}};function Lt(r,t){let e=new Map;return r.length>0&&r.replace(/^\?/,"").split("&").forEach(s=>{let o=s.indexOf("="),[i,c]=o==-1?[t.decodeKey(s),""]:[t.decodeKey(s.slice(0,o)),t.decodeValue(s.slice(o+1))],a=e.get(i)||[];a.push(c),e.set(i,a)}),e}var kt=/%(\d[a-f0-9])/gi,xt={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function nt(r){return encodeURIComponent(r).replace(kt,(t,e)=>{var n;return(n=xt[e])!=null?n:t})}function Z(r){return`${r}`}var D=class r{map;encoder;updates=null;cloneFrom=null;constructor(t={}){if(this.encoder=t.encoder||new ye,t.fromString){if(t.fromObject)throw new m(2805,!1);this.map=Lt(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{let n=t.fromObject[e],s=Array.isArray(n)?n.map(Z):[Z(n)];this.map.set(e,s)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();let e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){let e=[];return Object.keys(t).forEach(n=>{let s=t[n];Array.isArray(s)?s.forEach(o=>{e.push({param:n,value:o,op:"a"})}):e.push({param:n,value:s,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{let e=this.encoder.encodeKey(t);return this.map.get(t).map(n=>e+"="+this.encoder.encodeValue(n)).join("&")}).filter(t=>t!=="").join("&")}clone(t){let e=new r({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":let e=(t.op==="a"?this.map.get(t.param):void 0)||[];e.push(Z(t.value)),this.map.set(t.param,e);break;case"d":if(t.value!==void 0){let n=this.map.get(t.param)||[],s=n.indexOf(Z(t.value));s!==-1&&n.splice(s,1),n.length>0?this.map.set(t.param,n):this.map.delete(t.param)}else{this.map.delete(t.param);break}}}),this.cloneFrom=this.updates=null)}};var ge=class{map=new Map;set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}};function jt(r){switch(r){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function rt(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer}function st(r){return typeof Blob<"u"&&r instanceof Blob}function ot(r){return typeof FormData<"u"&&r instanceof FormData}function Ut(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}var it="Content-Type",at="Accept",ht="X-Request-URL",ft="text/plain",pt="application/json",Ft=`${pt}, ${ft}, */*`,j=class r{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(t,e,n,s){var i,c;this.url=e,this.method=t.toUpperCase();let o;if(jt(this.method)||s?(this.body=n!==void 0?n:null,o=s):o=n,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params),this.transferCache=o.transferCache),(i=this.headers)!=null||(this.headers=new O),(c=this.context)!=null||(this.context=new ge),!this.params)this.params=new D,this.urlWithParams=e;else{let a=this.params.toString();if(a.length===0)this.urlWithParams=e;else{let d=e.indexOf("?"),h=d===-1?"?":d<e.length-1?"&":"";this.urlWithParams=e+h+a}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||rt(this.body)||st(this.body)||ot(this.body)||Ut(this.body)?this.body:this.body instanceof D?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||ot(this.body)?null:st(this.body)?this.body.type||null:rt(this.body)?null:typeof this.body=="string"?ft:this.body instanceof D?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?pt:null}clone(t={}){var E,M,b,l;let e=t.method||this.method,n=t.url||this.url,s=t.responseType||this.responseType,o=(E=t.transferCache)!=null?E:this.transferCache,i=t.body!==void 0?t.body:this.body,c=(M=t.withCredentials)!=null?M:this.withCredentials,a=(b=t.reportProgress)!=null?b:this.reportProgress,d=t.headers||this.headers,h=t.params||this.params,p=(l=t.context)!=null?l:this.context;return t.setHeaders!==void 0&&(d=Object.keys(t.setHeaders).reduce((f,T)=>f.set(T,t.setHeaders[T]),d)),t.setParams&&(h=Object.keys(t.setParams).reduce((f,T)=>f.set(T,t.setParams[T]),h)),new r(e,n,i,{params:h,headers:d,context:p,reportProgress:a,responseType:s,withCredentials:c,transferCache:o})}},C=function(r){return r[r.Sent=0]="Sent",r[r.UploadProgress=1]="UploadProgress",r[r.ResponseHeader=2]="ResponseHeader",r[r.DownloadProgress=3]="DownloadProgress",r[r.Response=4]="Response",r[r.User=5]="User",r}(C||{}),F=class{headers;status;statusText;url;ok;type;constructor(t,e=200,n="OK"){this.headers=t.headers||new O,this.status=t.status!==void 0?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}},ve=class r extends F{constructor(t={}){super(t)}type=C.ResponseHeader;clone(t={}){return new r({headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},K=class r extends F{body;constructor(t={}){super(t),this.body=t.body!==void 0?t.body:null}type=C.Response;clone(t={}){return new r({body:t.body!==void 0?t.body:this.body,headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},H=class extends F{name="HttpErrorResponse";message;error;ok=!1;constructor(t){super(t,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${t.url||"(unknown url)"}`:this.message=`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}},Bt=200,zt=204;function me(r,t){return{body:t,headers:r.headers,context:r.context,observe:r.observe,params:r.params,reportProgress:r.reportProgress,responseType:r.responseType,withCredentials:r.withCredentials,transferCache:r.transferCache}}var Vt=(()=>{class r{handler;constructor(e){this.handler=e}request(e,n,s={}){let o;if(e instanceof j)o=e;else{let a;s.headers instanceof O?a=s.headers:a=new O(s.headers);let d;s.params&&(s.params instanceof D?d=s.params:d=new D({fromObject:s.params})),o=new j(e,n,s.body!==void 0?s.body:null,{headers:a,context:s.context,params:d,reportProgress:s.reportProgress,responseType:s.responseType||"json",withCredentials:s.withCredentials,transferCache:s.transferCache})}let i=se(o).pipe(Ce(a=>this.handler.handle(a)));if(e instanceof j||s.observe==="events")return i;let c=i.pipe(Ne(a=>a instanceof K));switch(s.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return c.pipe(L(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new m(2806,!1);return a.body}));case"blob":return c.pipe(L(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new m(2807,!1);return a.body}));case"text":return c.pipe(L(a=>{if(a.body!==null&&typeof a.body!="string")throw new m(2808,!1);return a.body}));case"json":default:return c.pipe(L(a=>a.body))}case"response":return c;default:throw new m(2809,!1)}}delete(e,n={}){return this.request("DELETE",e,n)}get(e,n={}){return this.request("GET",e,n)}head(e,n={}){return this.request("HEAD",e,n)}jsonp(e,n){return this.request("JSONP",e,{params:new D().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,n={}){return this.request("OPTIONS",e,n)}patch(e,n,s={}){return this.request("PATCH",e,me(s,n))}post(e,n,s={}){return this.request("POST",e,me(s,n))}put(e,n,s={}){return this.request("PUT",e,me(s,n))}static \u0275fac=function(n){return new(n||r)(u(U))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})();var $t=new v("");function mt(r,t){return t(r)}function Xt(r,t){return(e,n)=>t.intercept(e,{handle:s=>r(s,n)})}function Gt(r,t,e){return(n,s)=>je(e,()=>t(n,o=>r(o,s)))}var Jt=new v(""),Ee=new v(""),Wt=new v(""),yt=new v("",{providedIn:"root",factory:()=>!0});function Yt(){let r=null;return(t,e)=>{var o;r===null&&(r=((o=w(Jt,{optional:!0}))!=null?o:[]).reduceRight(Xt,mt));let n=w(ce);if(w(yt)){let i=n.add();return r(t,e).pipe(oe(()=>n.remove(i)))}else return r(t,e)}}var ct=(()=>{class r extends U{backend;injector;chain=null;pendingTasks=w(ce);contributeToStability=w(yt);constructor(e,n){super(),this.backend=e,this.injector=n}handle(e){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(Ee),...this.injector.get(Wt,[])]));this.chain=n.reduceRight((s,o)=>Gt(s,o,this.injector),mt)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(e,s=>this.backend.handle(s)).pipe(oe(()=>this.pendingTasks.remove(n)))}else return this.chain(e,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||r)(u(q),u(xe))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})();var Zt=/^\)\]\}',?\n/,qt=RegExp(`^${ht}:`,"m");function Kt(r){return"responseURL"in r&&r.responseURL?r.responseURL:qt.test(r.getAllResponseHeaders())?r.getResponseHeader(ht):null}var lt=(()=>{class r{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if(e.method==="JSONP")throw new m(-2800,!1);let n=this.xhrFactory;return(n.\u0275loadImpl?Ie(n.\u0275loadImpl()):se(null)).pipe(Le(()=>new Pe(o=>{let i=n.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach((l,f)=>i.setRequestHeader(l,f.join(","))),e.headers.has(at)||i.setRequestHeader(at,Ft),!e.headers.has(it)){let l=e.detectContentTypeHeader();l!==null&&i.setRequestHeader(it,l)}if(e.responseType){let l=e.responseType.toLowerCase();i.responseType=l!=="json"?l:"text"}let c=e.serializeBody(),a=null,d=()=>{if(a!==null)return a;let l=i.statusText||"OK",f=new O(i.getAllResponseHeaders()),T=Kt(i)||e.url;return a=new ve({headers:f,status:i.status,statusText:l,url:T}),a},h=()=>{let{headers:l,status:f,statusText:T,url:Se}=d(),g=null;f!==zt&&(g=typeof i.response>"u"?i.responseText:i.response),f===0&&(f=g?Bt:0);let re=f>=200&&f<300;if(e.responseType==="json"&&typeof g=="string"){let Ot=g;g=g.replace(Zt,"");try{g=g!==""?JSON.parse(g):null}catch(Pt){g=Ot,re&&(re=!1,g={error:Pt,text:g})}}re?(o.next(new K({body:g,headers:l,status:f,statusText:T,url:Se||void 0})),o.complete()):o.error(new H({error:g,headers:l,status:f,statusText:T,url:Se||void 0}))},p=l=>{let{url:f}=d(),T=new H({error:l,status:i.status||0,statusText:i.statusText||"Unknown Error",url:f||void 0});o.error(T)},E=!1,M=l=>{E||(o.next(d()),E=!0);let f={type:C.DownloadProgress,loaded:l.loaded};l.lengthComputable&&(f.total=l.total),e.responseType==="text"&&i.responseText&&(f.partialText=i.responseText),o.next(f)},b=l=>{let f={type:C.UploadProgress,loaded:l.loaded};l.lengthComputable&&(f.total=l.total),o.next(f)};return i.addEventListener("load",h),i.addEventListener("error",p),i.addEventListener("timeout",p),i.addEventListener("abort",p),e.reportProgress&&(i.addEventListener("progress",M),c!==null&&i.upload&&i.upload.addEventListener("progress",b)),i.send(c),o.next({type:C.Sent}),()=>{i.removeEventListener("error",p),i.removeEventListener("abort",p),i.removeEventListener("load",h),i.removeEventListener("timeout",p),e.reportProgress&&(i.removeEventListener("progress",M),c!==null&&i.upload&&i.upload.removeEventListener("progress",b)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||r)(u(Y))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),gt=new v(""),Ht="XSRF-TOKEN",Qt=new v("",{providedIn:"root",factory:()=>Ht}),en="X-XSRF-TOKEN",tn=new v("",{providedIn:"root",factory:()=>en}),Q=class{},nn=(()=>{class r{doc;platform;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,n,s){this.doc=e,this.platform=n,this.cookieName=s}getToken(){if(this.platform==="server")return null;let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=W(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(n){return new(n||r)(u(R),u(P),u(Qt))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})();function rn(r,t){let e=r.url.toLowerCase();if(!w(gt)||r.method==="GET"||r.method==="HEAD"||e.startsWith("http://")||e.startsWith("https://"))return t(r);let n=w(Q).getToken(),s=w(tn);return n!=null&&!r.headers.has(s)&&(r=r.clone({headers:r.headers.set(s,n)})),t(r)}var vt=function(r){return r[r.Interceptors=0]="Interceptors",r[r.LegacyInterceptors=1]="LegacyInterceptors",r[r.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",r[r.NoXsrfProtection=3]="NoXsrfProtection",r[r.JsonpSupport=4]="JsonpSupport",r[r.RequestsMadeViaParent=5]="RequestsMadeViaParent",r[r.Fetch=6]="Fetch",r}(vt||{});function sn(r,t){return{\u0275kind:r,\u0275providers:t}}function Hn(...r){let t=[Vt,lt,ct,{provide:U,useExisting:ct},{provide:q,useFactory:()=>{var e;return(e=w($t,{optional:!0}))!=null?e:w(lt)}},{provide:Ee,useValue:rn,multi:!0},{provide:gt,useValue:!0},{provide:Q,useClass:nn}];for(let e of r)t.push(...e.\u0275providers);return ae(t)}var dt=new v("");function Qn(){return sn(vt.LegacyInterceptors,[{provide:dt,useFactory:Yt},{provide:Ee,useExisting:dt,multi:!0}])}var we=class extends Qe{supportsDOMEvents=!0},Re=class r extends we{static makeCurrent(){He(new r)}onAndCancel(t,e,n,s){return t.addEventListener(e,n,s),()=>{t.removeEventListener(e,n,s)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.remove()}createElement(t,e){return e=e||this.getDefaultDocument(),e.createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return e==="window"?window:e==="document"?t:e==="body"?t.body:null}getBaseHref(t){let e=on();return e==null?null:an(e)}resetBaseElement(){B=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return W(document.cookie,t)}},B=null;function on(){return B=B||document.querySelector("base"),B?B.getAttribute("href"):null}function an(r){return new URL(r,document.baseURI).pathname}var be=class{addToWindow(t){_.getAngularTestability=(n,s=!0)=>{let o=t.findTestabilityInTree(n,s);if(o==null)throw new m(5103,!1);return o},_.getAllAngularTestabilities=()=>t.getAllTestabilities(),_.getAllAngularRootElements=()=>t.getAllRootElements();let e=n=>{let s=_.getAllAngularTestabilities(),o=s.length,i=function(){o--,o==0&&n()};s.forEach(c=>{c.whenStable(i)})};_.frameworkStabilizers||(_.frameworkStabilizers=[]),_.frameworkStabilizers.push(e)}findTestabilityInTree(t,e,n){if(e==null)return null;let s=t.getTestability(e);return s!=null?s:n?J().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}},cn=(()=>{class r{build(){return new XMLHttpRequest}static \u0275fac=function(n){return new(n||r)};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),Me=new v(""),Mt=(()=>{class r{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,n){this._zone=n,e.forEach(s=>{s.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,n,s,o){return this._findPluginFor(n).addEventListener(e,n,s,o)}getZone(){return this._zone}_findPluginFor(e){let n=this._eventNameToPlugin.get(e);if(n)return n;if(n=this._plugins.find(o=>o.supports(e)),!n)throw new m(5101,!1);return this._eventNameToPlugin.set(e,n),n}static \u0275fac=function(n){return new(n||r)(u(Me),u(A))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),te=class{_doc;constructor(t){this._doc=t}manager},ee="ng-app-id";function Et(r){for(let t of r)t.remove()}function Tt(r,t){let e=t.createElement("style");return e.textContent=r,e}function ln(r,t,e,n){var o;let s=(o=r.head)==null?void 0:o.querySelectorAll(`style[${ee}="${t}"],link[${ee}="${t}"]`);if(s)for(let i of s)i.removeAttribute(ee),i instanceof HTMLLinkElement?n.set(i.href.slice(i.href.lastIndexOf("/")+1),{usage:0,elements:[i]}):i.textContent&&e.set(i.textContent,{usage:0,elements:[i]})}function _e(r,t){let e=t.createElement("link");return e.setAttribute("rel","stylesheet"),e.setAttribute("href",r),e}var _t=(()=>{class r{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(e,n,s,o={}){this.doc=e,this.appId=n,this.nonce=s,this.isServer=pe(o),ln(e,n,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,n){for(let s of e)this.addUsage(s,this.inline,Tt);n==null||n.forEach(s=>this.addUsage(s,this.external,_e))}removeStyles(e,n){for(let s of e)this.removeUsage(s,this.inline);n==null||n.forEach(s=>this.removeUsage(s,this.external))}addUsage(e,n,s){let o=n.get(e);o?o.usage++:n.set(e,{usage:1,elements:[...this.hosts].map(i=>this.addElement(i,s(e,this.doc)))})}removeUsage(e,n){let s=n.get(e);s&&(s.usage--,s.usage<=0&&(Et(s.elements),n.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])Et(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[n,{elements:s}]of this.inline)s.push(this.addElement(e,Tt(n,this.doc)));for(let[n,{elements:s}]of this.external)s.push(this.addElement(e,_e(n,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,n){return this.nonce&&n.setAttribute("nonce",this.nonce),this.isServer&&n.setAttribute(ee,this.appId),e.appendChild(n)}static \u0275fac=function(n){return new(n||r)(u(R),u(de),u(ue,8),u(P))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),Te={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},Ae=/%COMP%/g;var Dt="%COMP%",dn=`_nghost-${Dt}`,un=`_ngcontent-${Dt}`,hn=!0,fn=new v("",{providedIn:"root",factory:()=>hn});function pn(r){return un.replace(Ae,r)}function mn(r){return dn.replace(Ae,r)}function At(r,t){return t.map(e=>e.replace(Ae,r))}var wt=(()=>{class r{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(e,n,s,o,i,c,a,d=null,h=null){this.eventManager=e,this.sharedStylesHost=n,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=i,this.platformId=c,this.ngZone=a,this.nonce=d,this.tracingService=h,this.platformIsServer=pe(c),this.defaultRenderer=new z(e,i,a,this.platformIsServer,this.tracingService)}createRenderer(e,n){if(!e||!n)return this.defaultRenderer;this.platformIsServer&&n.encapsulation===k.ShadowDom&&(n=Oe($({},n),{encapsulation:k.Emulated}));let s=this.getOrCreateRenderer(e,n);return s instanceof ne?s.applyToHost(e):s instanceof V&&s.applyStyles(),s}getOrCreateRenderer(e,n){let s=this.rendererByCompId,o=s.get(n.id);if(!o){let i=this.doc,c=this.ngZone,a=this.eventManager,d=this.sharedStylesHost,h=this.removeStylesOnCompDestroy,p=this.platformIsServer,E=this.tracingService;switch(n.encapsulation){case k.Emulated:o=new ne(a,d,n,this.appId,h,i,c,p,E);break;case k.ShadowDom:return new De(a,d,e,n,i,c,this.nonce,p,E);default:o=new V(a,d,n,h,i,c,p,E);break}s.set(n.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=function(n){return new(n||r)(u(Mt),u(_t),u(de),u(fn),u(R),u(P),u(A),u(ue),u(Be,8))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),z=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(t,e,n,s,o){this.eventManager=t,this.doc=e,this.ngZone=n,this.platformIsServer=s,this.tracingService=o}destroy(){}destroyNode=null;createElement(t,e){return e?this.doc.createElementNS(Te[e]||e,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,e){(Rt(t)?t.content:t).appendChild(e)}insertBefore(t,e,n){t&&(Rt(t)?t.content:t).insertBefore(e,n)}removeChild(t,e){e.remove()}selectRootElement(t,e){let n=typeof t=="string"?this.doc.querySelector(t):t;if(!n)throw new m(-5104,!1);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,s){if(s){e=s+":"+e;let o=Te[s];o?t.setAttributeNS(o,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){let s=Te[n];s?t.removeAttributeNS(s,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,s){s&(x.DashCase|x.Important)?t.style.setProperty(e,n,s&x.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&x.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t!=null&&(t[e]=n)}setValue(t,e){t.nodeValue=e}listen(t,e,n,s){var i;if(typeof t=="string"&&(t=J().getGlobalEventTarget(this.doc,t),!t))throw new m(5102,!1);let o=this.decoratePreventDefault(n);return(i=this.tracingService)!=null&&i.wrapEventListener&&(o=this.tracingService.wrapEventListener(t,e,o)),this.eventManager.addEventListener(t,e,o,s)}decoratePreventDefault(t){return e=>{if(e==="__ngUnwrap__")return t;(this.platformIsServer?this.ngZone.runGuarded(()=>t(e)):t(e))===!1&&e.preventDefault()}}};function Rt(r){return r.tagName==="TEMPLATE"&&r.content!==void 0}var De=class extends z{sharedStylesHost;hostEl;shadowRoot;constructor(t,e,n,s,o,i,c,a,d){var M;super(t,o,i,a,d),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let h=s.styles;h=At(s.id,h);for(let b of h){let l=document.createElement("style");c&&l.setAttribute("nonce",c),l.textContent=b,this.shadowRoot.appendChild(l)}let p=(M=s.getExternalStyles)==null?void 0:M.call(s);if(p)for(let b of p){let l=_e(b,o);c&&l.setAttribute("nonce",c),this.shadowRoot.appendChild(l)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,n){return super.insertBefore(this.nodeOrShadowRoot(t),e,n)}removeChild(t,e){return super.removeChild(null,e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},V=class extends z{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(t,e,n,s,o,i,c,a,d){var E;super(t,o,i,c,a),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=s;let h=n.styles;this.styles=d?At(d,h):h,this.styleUrls=(E=n.getExternalStyles)==null?void 0:E.call(n,d)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},ne=class extends V{contentAttr;hostAttr;constructor(t,e,n,s,o,i,c,a,d){let h=s+"-"+n.id;super(t,e,n,o,i,c,a,d,h),this.contentAttr=pn(h),this.hostAttr=mn(h)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,e){let n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}},yn=(()=>{class r extends te{constructor(e){super(e)}supports(e){return!0}addEventListener(e,n,s,o){return e.addEventListener(n,s,o),()=>this.removeEventListener(e,n,s,o)}removeEventListener(e,n,s,o){return e.removeEventListener(n,s,o)}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),bt=["alt","control","meta","shift"],gn={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},vn={alt:r=>r.altKey,control:r=>r.ctrlKey,meta:r=>r.metaKey,shift:r=>r.shiftKey},En=(()=>{class r extends te{constructor(e){super(e)}supports(e){return r.parseEventName(e)!=null}addEventListener(e,n,s,o){let i=r.parseEventName(n),c=r.eventCallback(i.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>J().onAndCancel(e,i.domEventName,c,o))}static parseEventName(e){let n=e.toLowerCase().split("."),s=n.shift();if(n.length===0||!(s==="keydown"||s==="keyup"))return null;let o=r._normalizeKey(n.pop()),i="",c=n.indexOf("code");if(c>-1&&(n.splice(c,1),i="code."),bt.forEach(d=>{let h=n.indexOf(d);h>-1&&(n.splice(h,1),i+=d+".")}),i+=o,n.length!=0||o.length===0)return null;let a={};return a.domEventName=s,a.fullKey=i,a}static matchEventFullKeyCode(e,n){let s=gn[e.key]||e.key,o="";return n.indexOf("code.")>-1&&(s=e.code,o="code."),s==null||!s?!1:(s=s.toLowerCase(),s===" "?s="space":s==="."&&(s="dot"),bt.forEach(i=>{if(i!==s){let c=vn[i];c(e)&&(o+=i+".")}}),o+=s,o===n)}static eventCallback(e,n,s){return o=>{r.matchEventFullKeyCode(o,e)&&s.runGuarded(()=>n(o))}}static _normalizeKey(e){return e==="esc"?"escape":e}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})();function Tr(r,t){return Ke($({rootComponent:r},Tn(t)))}function Tn(r){var t;return{appProviders:[...St,...(t=r==null?void 0:r.providers)!=null?t:[]],platformProviders:Mn}}function wn(){Re.makeCurrent()}function Rn(){return new le}function bn(){return Ue(document),document}var Mn=[{provide:P,useValue:tt},{provide:Fe,useValue:wn,multi:!0},{provide:R,useFactory:bn,deps:[]}];var _n=[{provide:X,useClass:be,deps:[]},{provide:Ze,useClass:G,deps:[A,fe,X]},{provide:G,useClass:G,deps:[A,fe,X]}],St=[{provide:ke,useValue:"root"},{provide:le,useFactory:Rn,deps:[]},{provide:Me,useClass:yn,multi:!0,deps:[R]},{provide:Me,useClass:En,multi:!0,deps:[R]},wt,_t,Mt,{provide:Ye,useExisting:wt},{provide:Y,useClass:cn,deps:[]},[]],wr=(()=>{class r{constructor(){}static \u0275fac=function(n){return new(n||r)};static \u0275mod=he({type:r});static \u0275inj=ie({providers:[...St,..._n],imports:[et,qe]})}return r})();var Rr=(()=>{class r{_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var Dn=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275prov=y({token:r,factory:function(n){let s=null;return n?s=new(n||r):s=u(An),s},providedIn:"root"})}return r})(),An=(()=>{class r extends Dn{_doc;constructor(e){super(),this._doc=e}sanitize(e,n){if(n==null)return null;switch(e){case S.NONE:return n;case S.HTML:return N(n,"HTML")?I(n):We(this._doc,String(n)).toString();case S.STYLE:return N(n,"Style")?I(n):n;case S.SCRIPT:if(N(n,"Script"))return I(n);throw new m(5200,!1);case S.URL:return N(n,"URL")?I(n):Je(String(n));case S.RESOURCE_URL:if(N(n,"ResourceURL"))return I(n);throw new m(5201,!1);default:throw new m(5202,!1)}}bypassSecurityTrustHtml(e){return ze(e)}bypassSecurityTrustStyle(e){return Ve(e)}bypassSecurityTrustScript(e){return $e(e)}bypassSecurityTrustUrl(e){return Xe(e)}bypassSecurityTrustResourceUrl(e){return Ge(e)}static \u0275fac=function(n){return new(n||r)(u(R))};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{q as a,D as b,C as c,K as d,Vt as e,Jt as f,Hn as g,Qn as h,wt as i,Tr as j,wr as k,Rr as l,Dn as m};
|