homebridge-config-ui-x 5.11.3-beta.5 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/package.json +1 -1
  3. package/public/{chunk-TB6TK5G6.js → chunk-3MO7ICHF.js} +1 -1
  4. package/public/{chunk-G7VCQ3TG.js → chunk-3SKLXSFI.js} +1 -1
  5. package/public/{chunk-DCNSUIW7.js → chunk-56HOZZW6.js} +1 -1
  6. package/public/{chunk-772YVX5Y.js → chunk-6SUIFFAZ.js} +1 -1
  7. package/public/{chunk-FG374IPB.js → chunk-7DOT7I4R.js} +1 -1
  8. package/public/{chunk-UO2ZMGZV.js → chunk-7O4JAXGA.js} +1 -1
  9. package/public/{chunk-GQ3WUBAR.js → chunk-A5EOSR6S.js} +1 -1
  10. package/public/{chunk-GTPTOO5P.js → chunk-AIGU7Y6G.js} +1 -1
  11. package/public/{chunk-2VZ2GCND.js → chunk-AK4UTJX2.js} +1 -1
  12. package/public/{chunk-KCN76FJO.js → chunk-BAHYSQO5.js} +1 -1
  13. package/public/{chunk-5ZBV6GIQ.js → chunk-BJKMZCEQ.js} +1 -1
  14. package/public/{chunk-LGMU4LKT.js → chunk-BNHW6YHK.js} +1 -1
  15. package/public/{chunk-VH5H27H2.js → chunk-BNQ6BOCY.js} +1 -1
  16. package/public/{chunk-3E6N6AE4.js → chunk-BPQAV2XG.js} +1 -1
  17. package/public/{chunk-PANOIW5Y.js → chunk-CCKAIEVL.js} +1 -1
  18. package/public/{chunk-2QOONNBG.js → chunk-CJJAQM22.js} +1 -1
  19. package/public/{chunk-3PXXHWW2.js → chunk-D5Z6KR3J.js} +1 -1
  20. package/public/{chunk-AAXZUUFU.js → chunk-DRKO4DTB.js} +1 -1
  21. package/public/{chunk-STIDVYXA.js → chunk-EBANXPKG.js} +1 -1
  22. package/public/{chunk-QXZIEJ3B.js → chunk-GOLMQCNJ.js} +1 -1
  23. package/public/{chunk-2FPSO764.js → chunk-GPTVUF5H.js} +1 -1
  24. package/public/{chunk-FVHWD4KR.js → chunk-HRAMBCZG.js} +1 -1
  25. package/public/{chunk-R6YWI4B6.js → chunk-IQUWZEQX.js} +1 -1
  26. package/public/{chunk-SR7QWPJS.js → chunk-JE6FI7IW.js} +1 -1
  27. package/public/{chunk-RFXZLRVC.js → chunk-JI6C4NXH.js} +1 -1
  28. package/public/{chunk-NGL4ECSY.js → chunk-JJZ232C2.js} +1 -1
  29. package/public/{chunk-J46ZH4OW.js → chunk-KCF7ILFR.js} +1 -1
  30. package/public/{chunk-XYLLF34N.js → chunk-KEKO5EFZ.js} +1 -1
  31. package/public/{chunk-72WIF6RO.js → chunk-KK7LTOA5.js} +1 -1
  32. package/public/{chunk-GEMLIK55.js → chunk-L2Y7HWNA.js} +1 -1
  33. package/public/{chunk-FP47CYMN.js → chunk-LVPMGB27.js} +1 -1
  34. package/public/{chunk-3PRJ4YYI.js → chunk-ML7UNHWF.js} +1 -1
  35. package/public/{chunk-MEE3HK5H.js → chunk-MY5KM2NY.js} +1 -1
  36. package/public/{chunk-SJXDE2KC.js → chunk-N2EK3VS7.js} +1 -1
  37. package/public/{chunk-FJL4CXCM.js → chunk-NBTW66C4.js} +1 -1
  38. package/public/{chunk-2RWTYJFR.js → chunk-NLWU3URB.js} +1 -1
  39. package/public/{chunk-7AW3ETZH.js → chunk-NVN7DYND.js} +1 -1
  40. package/public/{chunk-U24C4LXA.js → chunk-OL7NNVJO.js} +1 -1
  41. package/public/{chunk-IXGFA465.js → chunk-PHO7WRKK.js} +1 -1
  42. package/public/{chunk-BHA6JXFI.js → chunk-PHWW4YF2.js} +1 -1
  43. package/public/{chunk-KDIN2UDH.js → chunk-QPGFU6MO.js} +1 -1
  44. package/public/{chunk-IFPZQ4UP.js → chunk-QTIB6YCV.js} +1 -1
  45. package/public/{chunk-P4T4JEXJ.js → chunk-RZVF77KW.js} +1 -1
  46. package/public/{chunk-RW3NXMBU.js → chunk-SNO4VAGT.js} +1 -1
  47. package/public/{chunk-NLP756ZB.js → chunk-UIZYHRTQ.js} +1 -1
  48. package/public/{chunk-N4GFR6FU.js → chunk-UO2L3YPH.js} +1 -1
  49. package/public/{chunk-HAS2I23V.js → chunk-XCOJYJKE.js} +1 -1
  50. package/public/{chunk-7U6LZHTZ.js → chunk-XKFVEK25.js} +1 -1
  51. package/public/{chunk-KW5SZ373.js → chunk-XPGD2BHY.js} +1 -1
  52. package/public/{chunk-DTQDCIY6.js → chunk-YBNR45V5.js} +1 -1
  53. package/public/chunk-YK5NYQW5.js +1 -0
  54. package/public/{chunk-JIAA6LDZ.js → chunk-ZDEL6332.js} +1 -1
  55. package/public/{chunk-7Y3AGCYD.js → chunk-ZYETXD5U.js} +1 -1
  56. package/public/index.html +1 -1
  57. package/public/{main-EDICWCO2.js → main-YYHATWMC.js} +1 -1
  58. package/public/chunk-6H7DHQM2.js +0 -1
@@ -1 +1 @@
1
- import{c as t}from"./chunk-STIDVYXA.js";import{b as i}from"./chunk-TGQIPKOK.js";import{eb as r,ja as o}from"./chunk-ZRDN4L2J.js";var f=(()=>{class e{static \u0275fac=function(s){return new(s||e)};static \u0275mod=r({type:e});static \u0275inj=o({providers:[t],imports:[i]})}return e})();export{f as a};
1
+ import{c as t}from"./chunk-EBANXPKG.js";import{b as i}from"./chunk-TGQIPKOK.js";import{eb as r,ja as o}from"./chunk-ZRDN4L2J.js";var f=(()=>{class e{static \u0275fac=function(s){return new(s||e)};static \u0275mod=r({type:e});static \u0275inj=o({providers:[t],imports:[i]})}return e})();export{f as a};
@@ -1,4 +1,4 @@
1
- import{M as ne,P as se,a as ue,b as R,c as te,d as y,e as S,f as ie,g as E,h as F,i as W,j}from"./chunk-UO2ZMGZV.js";import{b as D}from"./chunk-TGQIPKOK.js";import{$b as Y,Bc as w,Ca as H,Dc as Z,Ec as L,Ib as U,La as I,Lb as X,Nb as c,Qa as a,Rc as ee,Yb as T,Yc as A,Zb as m,_b as k,a as P,b as $,db as O,eb as v,g as pe,ia as M,ja as C,jb as b,la as J,ma as G,na as f,o as V,pb as q,sa as K,ta as Q,wb as d,xb as p,yb as u,zb as g}from"./chunk-ZRDN4L2J.js";var h=pe(ue(),1);function ce(i,n){if(i&1){let o=U();p(0,"button",6),X("click",function(){K(o);let s=c();return Q(s.removeItem())}),p(1,"span",7),k(2,"\xD7"),u(),p(3,"span"),k(4,"Close"),u()()}if(i&2){let o=c();m(o.widgetStyles().__remove_item__),a(3),m(o.widgetStyles().__screen_reader__)}}function me(i,n){if(i&1&&g(0,"p",8),i&2){let o=c(2);m(o.widgetStyles().__help_block__),d("innerHTML",o.options==null?null:o.options.helpBlock,I)}}function he(i,n){if(i&1&&(p(0,"div"),b(1,me,1,3,"p",3),u()),i&2){let o=c();a(),d("ngIf",o.options==null?null:o.options.helpBlock)}}function fe(i,n){if(i&1&&(p(0,"strong")(1,"span",10),k(2," \u25CF"),u()()),i&2){let o=c(2);m(o.widgetStyles().__required_asterisk__)}}function ge(i,n){if(i&1&&(p(0,"label"),g(1,"span",8),b(2,fe,3,2,"strong",9),u()),i&2){let o,t=c();m((t.options==null?null:t.options.labelHtmlClass)||""),T("sr-only",t.options==null?null:t.options.notitle),q("for","control"+((o=t.layoutNode())==null?null:o._id)),a(),d("innerHTML",t.dynamicTitle,I),a(),d("ngIf",t.options==null?null:t.options.required)}}function _e(i,n){if(i&1&&(p(0,"p")(1,"strong"),k(2,"*"),u(),k(3," = required fields "),u()),i&2){let o=c();a(),m(o.widgetStyles().__required_asterisk__)}}function be(i,n){if(i&1&&g(0,"span",8),i&2){let o=c();m(o.widgetStyles().__field_addon_left__),d("innerHTML",o.options==null?null:o.options.fieldAddonLeft,I)}}function ye(i,n){if(i&1&&g(0,"span",8),i&2){let o=c();m(o.widgetStyles().__field_addon_right__),d("innerHTML",o.options==null?null:o.options.fieldAddonRight,I)}}function Ce(i,n){if(i&1&&g(0,"span",11),i&2){let o=c();T("glyphicon-ok",(o.options==null?null:o.options.enableSuccessState)&&!(o.formControl!=null&&o.formControl.errors))("glyphicon-remove",(o.options==null?null:o.options.enableErrorState)&&(o.formControl==null?null:o.formControl.errors))}}function ve(i,n){if(i&1&&g(0,"p",8),i&2){let o=c(2);m(o.widgetStyles().__help_block__),d("innerHTML",o.options==null?null:o.options.helpBlock,I)}}function ke(i,n){if(i&1&&(p(0,"div"),b(1,ve,1,3,"p",3),u()),i&2){let o=c();a(),d("ngIf",o.options==null?null:o.options.helpBlock)}}function we(i,n){if(i&1&&(p(0,"div"),k(1,"debug: "),p(2,"pre"),k(3),u()()),i&2){let o=c();a(3),Y(o.debugOutput)}}var N=(()=>{let n=class n{constructor(){this.frameworkThemeSubject=new V("default"),this.frameworkTheme$=this.frameworkThemeSubject.asObservable()}requestThemeChange(t){this.frameworkThemeSubject.next(t),this.activeRequestedTheme=t}getActiveRequestedTheme(){return this.activeRequestedTheme}};n.\u0275fac=function(s){return new(s||n)},n.\u0275prov=M({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})(),B=(()=>{let n=class n{applyCssClasses(t,s,e){let r=this.widgetStyles()[t];(!r||h.default.isEmpty(r))&&(r=this.widgetStyles().default),Object.keys(r).forEach(l=>{let _=r[l];_.length&&(s[l]=y(s[l],_)),e&&(s[l]=y(s[l],e))})}flattenWidgetStyles(t){var s={};let e=["__themes__"];return Object.keys(t).forEach(r=>{let l=t[r];if(e.indexOf(r)>=0){s[r]=l;return}h.default.isArray(l)&&(s[r]=l.join(" ")),h.default.isObject(l)&&(s[r]=s[r]||{},Object.keys(l).forEach(_=>{let x=l[_];h.default.isArray(x)?s[r][_]=x.join(" "):s[r][_]=x})),h.default.isString(l)&&(s[r]=l)}),s}constructor(){this.cdr=f(L),this.jsf=f(S),this.jsfFLService=f(F),this.cssFWService=f(N),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.dynamicTitle=null,this.layoutNode=w(void 0),this.layoutIndex=w(void 0),this.dataIndex=w(void 0),this.widgetStyles=Z(void 0),this.defaultStyling={array:{},default:{fieldHtmlClass:"cssfw-form-control"},__themes__:[{name:"notheme",text:"None"}],__remove_item__:"cssfw-remove-item",__array_item_nonref__:{htmlClass:"cssfw-array-item-nonref"},__active__:{activeClass:"cssfw-active"},__array__:{htmlClass:"cssfw-array"},__control_label__:{labelHtmlClass:"cssfw-control-label"},__form_group__:{htmlClass:"cssfw-form-group"},__field_addon_left__:"cssfw-addon-left",__field_addon_right__:"cssfw-addon-right",__help_block__:"cssfw-help-block",__required_asterisk__:"cssfw-required-astersisk",__screen_reader__:"cssfw-screen-reader"};let t=this.cssFWService,e=this.jsfFLService.activeFramework.config||{};this.widgetStyles.set(Object.assign(this.defaultStyling,e.widgetstyles));let r=this.widgetStyles().__themes__[0],l=t.activeRequestedTheme||r.name;this.theme=this.options?.theme||l}ngOnDestroy(){this.frameworkThemeSubs?.unsubscribe(),this.frameworkThemeSubs=null}get showRemoveButton(){let t=this.layoutNode();return!this.options.removable||this.options.readonly||t.type==="$ref"?!1:t.recursiveReference?!0:!t.arrayItem||!this.parentArray||this.parentArray.items.length-1<=this.parentArray.options.minItems?!1:t.arrayItemType==="list"?!0:this.layoutIndex()[this.layoutIndex().length-1]===this.parentArray.items.length-2}ngOnInit(){let t=this.cssFWService;this.frameworkThemeSubs=t.frameworkTheme$.subscribe(e=>{this.theme=e,this.cdr.detectChanges()}),this.initializeFramework();let s=this.layoutNode();s.arrayItem&&s.type!=="$ref"&&(this.parentArray=this.jsf.getParentNode(this),this.parentArray&&(this.isOrderable=s.arrayItemType==="list"&&!this.options.readonly&&this.parentArray.options.orderable))}ngOnChanges(t){this.frameworkInitialized||this.initializeFramework(),this.isDynamicTitle&&this.updateTitle()}initializeFramework(){let t=this.layoutNode();if(t){if(this.options=(0,h.cloneDeep)(t.options),this.widgetLayoutNode=$(P({},t),{options:(0,h.cloneDeep)(t.options)}),this.widgetOptions=this.widgetLayoutNode.options,this.formControl=this.jsf.getFormControl(this),this.options.isInputWidget=te(t.type,["button","checkbox","checkboxes-inline","checkboxes","color","date","datetime-local","datetime","email","file","hidden","image","integer","month","number","password","radio","radiobuttons","radios-inline","radios","range","reset","search","select","submit","tel","text","textarea","time","url","week"]),this.isDynamicTitle=this.options?.title&&/{{.+?}}/.test(this.options.title),this.dynamicTitle=this.options?.title,!["$ref","advancedfieldset","authfieldset","button","card","checkbox","expansion-panel","help","message","msg","section","submit","tabarray","tabs"].includes(t.type)&&/{{.+?}}/.test(this.widgetOptions.title||"")&&this.updateTitle(),this.options.title=this.setTitle(),this.widgetOptions.title&&(this.dynamicTitle=""),this.options.htmlClass=y(this.options.htmlClass,"schema-form-"+t.type),t.type==="array"?this.options.htmlClass=y(this.options.htmlClass,this.widgetStyles().__array__.htmlClass):t.arrayItem&&t.type!=="$ref"?this.options.htmlClass=y(this.options.htmlClass,this.widgetStyles().__array_item_nonref__.htmlClass):this.options.htmlClass=y(this.options.htmlClass,this.widgetStyles().__form_group__.htmlClass),this.widgetOptions.htmlClass="",this.options.labelHtmlClass=y(this.options.labelHtmlClass,this.widgetStyles().__control_label__.labelHtmlClass),this.widgetOptions.activeClass=y(this.widgetOptions.activeClass,this.widgetStyles().__active__.activeClass),this.options.fieldAddonLeft=this.options.fieldAddonLeft||this.options.prepend,this.options.fieldAddonRight=this.options.fieldAddonRight||this.options.append,this.options.title&&t.type!=="tab"&&!this.options.notitle&&this.options.required&&!this.options.title.includes("*")){let s=this.widgetStyles().__required_asterisk__||"text-danger";this.options.title+=` <strong class="${s}">*</strong>`}if(t.type=="optionfieldset"&&(this.options.messageLocation="top"),this.applyCssClasses(t.type,this.widgetOptions,this.options.style),this.formControl&&(this.updateHelpBlock(this.formControl.status),this.formControl.statusChanges.subscribe(s=>this.updateHelpBlock(s)),this.options.debug)){let s=[];this.debugOutput=(0,h.map)(s,e=>JSON.stringify(e,null,2)).join(`
1
+ import{M as ne,P as se,a as ue,b as R,c as te,d as y,e as S,f as ie,g as E,h as F,i as W,j}from"./chunk-7O4JAXGA.js";import{b as D}from"./chunk-TGQIPKOK.js";import{$b as Y,Bc as w,Ca as H,Dc as Z,Ec as L,Ib as U,La as I,Lb as X,Nb as c,Qa as a,Rc as ee,Yb as T,Yc as A,Zb as m,_b as k,a as P,b as $,db as O,eb as v,g as pe,ia as M,ja as C,jb as b,la as J,ma as G,na as f,o as V,pb as q,sa as K,ta as Q,wb as d,xb as p,yb as u,zb as g}from"./chunk-ZRDN4L2J.js";var h=pe(ue(),1);function ce(i,n){if(i&1){let o=U();p(0,"button",6),X("click",function(){K(o);let s=c();return Q(s.removeItem())}),p(1,"span",7),k(2,"\xD7"),u(),p(3,"span"),k(4,"Close"),u()()}if(i&2){let o=c();m(o.widgetStyles().__remove_item__),a(3),m(o.widgetStyles().__screen_reader__)}}function me(i,n){if(i&1&&g(0,"p",8),i&2){let o=c(2);m(o.widgetStyles().__help_block__),d("innerHTML",o.options==null?null:o.options.helpBlock,I)}}function he(i,n){if(i&1&&(p(0,"div"),b(1,me,1,3,"p",3),u()),i&2){let o=c();a(),d("ngIf",o.options==null?null:o.options.helpBlock)}}function fe(i,n){if(i&1&&(p(0,"strong")(1,"span",10),k(2," \u25CF"),u()()),i&2){let o=c(2);m(o.widgetStyles().__required_asterisk__)}}function ge(i,n){if(i&1&&(p(0,"label"),g(1,"span",8),b(2,fe,3,2,"strong",9),u()),i&2){let o,t=c();m((t.options==null?null:t.options.labelHtmlClass)||""),T("sr-only",t.options==null?null:t.options.notitle),q("for","control"+((o=t.layoutNode())==null?null:o._id)),a(),d("innerHTML",t.dynamicTitle,I),a(),d("ngIf",t.options==null?null:t.options.required)}}function _e(i,n){if(i&1&&(p(0,"p")(1,"strong"),k(2,"*"),u(),k(3," = required fields "),u()),i&2){let o=c();a(),m(o.widgetStyles().__required_asterisk__)}}function be(i,n){if(i&1&&g(0,"span",8),i&2){let o=c();m(o.widgetStyles().__field_addon_left__),d("innerHTML",o.options==null?null:o.options.fieldAddonLeft,I)}}function ye(i,n){if(i&1&&g(0,"span",8),i&2){let o=c();m(o.widgetStyles().__field_addon_right__),d("innerHTML",o.options==null?null:o.options.fieldAddonRight,I)}}function Ce(i,n){if(i&1&&g(0,"span",11),i&2){let o=c();T("glyphicon-ok",(o.options==null?null:o.options.enableSuccessState)&&!(o.formControl!=null&&o.formControl.errors))("glyphicon-remove",(o.options==null?null:o.options.enableErrorState)&&(o.formControl==null?null:o.formControl.errors))}}function ve(i,n){if(i&1&&g(0,"p",8),i&2){let o=c(2);m(o.widgetStyles().__help_block__),d("innerHTML",o.options==null?null:o.options.helpBlock,I)}}function ke(i,n){if(i&1&&(p(0,"div"),b(1,ve,1,3,"p",3),u()),i&2){let o=c();a(),d("ngIf",o.options==null?null:o.options.helpBlock)}}function we(i,n){if(i&1&&(p(0,"div"),k(1,"debug: "),p(2,"pre"),k(3),u()()),i&2){let o=c();a(3),Y(o.debugOutput)}}var N=(()=>{let n=class n{constructor(){this.frameworkThemeSubject=new V("default"),this.frameworkTheme$=this.frameworkThemeSubject.asObservable()}requestThemeChange(t){this.frameworkThemeSubject.next(t),this.activeRequestedTheme=t}getActiveRequestedTheme(){return this.activeRequestedTheme}};n.\u0275fac=function(s){return new(s||n)},n.\u0275prov=M({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})(),B=(()=>{let n=class n{applyCssClasses(t,s,e){let r=this.widgetStyles()[t];(!r||h.default.isEmpty(r))&&(r=this.widgetStyles().default),Object.keys(r).forEach(l=>{let _=r[l];_.length&&(s[l]=y(s[l],_)),e&&(s[l]=y(s[l],e))})}flattenWidgetStyles(t){var s={};let e=["__themes__"];return Object.keys(t).forEach(r=>{let l=t[r];if(e.indexOf(r)>=0){s[r]=l;return}h.default.isArray(l)&&(s[r]=l.join(" ")),h.default.isObject(l)&&(s[r]=s[r]||{},Object.keys(l).forEach(_=>{let x=l[_];h.default.isArray(x)?s[r][_]=x.join(" "):s[r][_]=x})),h.default.isString(l)&&(s[r]=l)}),s}constructor(){this.cdr=f(L),this.jsf=f(S),this.jsfFLService=f(F),this.cssFWService=f(N),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.dynamicTitle=null,this.layoutNode=w(void 0),this.layoutIndex=w(void 0),this.dataIndex=w(void 0),this.widgetStyles=Z(void 0),this.defaultStyling={array:{},default:{fieldHtmlClass:"cssfw-form-control"},__themes__:[{name:"notheme",text:"None"}],__remove_item__:"cssfw-remove-item",__array_item_nonref__:{htmlClass:"cssfw-array-item-nonref"},__active__:{activeClass:"cssfw-active"},__array__:{htmlClass:"cssfw-array"},__control_label__:{labelHtmlClass:"cssfw-control-label"},__form_group__:{htmlClass:"cssfw-form-group"},__field_addon_left__:"cssfw-addon-left",__field_addon_right__:"cssfw-addon-right",__help_block__:"cssfw-help-block",__required_asterisk__:"cssfw-required-astersisk",__screen_reader__:"cssfw-screen-reader"};let t=this.cssFWService,e=this.jsfFLService.activeFramework.config||{};this.widgetStyles.set(Object.assign(this.defaultStyling,e.widgetstyles));let r=this.widgetStyles().__themes__[0],l=t.activeRequestedTheme||r.name;this.theme=this.options?.theme||l}ngOnDestroy(){this.frameworkThemeSubs?.unsubscribe(),this.frameworkThemeSubs=null}get showRemoveButton(){let t=this.layoutNode();return!this.options.removable||this.options.readonly||t.type==="$ref"?!1:t.recursiveReference?!0:!t.arrayItem||!this.parentArray||this.parentArray.items.length-1<=this.parentArray.options.minItems?!1:t.arrayItemType==="list"?!0:this.layoutIndex()[this.layoutIndex().length-1]===this.parentArray.items.length-2}ngOnInit(){let t=this.cssFWService;this.frameworkThemeSubs=t.frameworkTheme$.subscribe(e=>{this.theme=e,this.cdr.detectChanges()}),this.initializeFramework();let s=this.layoutNode();s.arrayItem&&s.type!=="$ref"&&(this.parentArray=this.jsf.getParentNode(this),this.parentArray&&(this.isOrderable=s.arrayItemType==="list"&&!this.options.readonly&&this.parentArray.options.orderable))}ngOnChanges(t){this.frameworkInitialized||this.initializeFramework(),this.isDynamicTitle&&this.updateTitle()}initializeFramework(){let t=this.layoutNode();if(t){if(this.options=(0,h.cloneDeep)(t.options),this.widgetLayoutNode=$(P({},t),{options:(0,h.cloneDeep)(t.options)}),this.widgetOptions=this.widgetLayoutNode.options,this.formControl=this.jsf.getFormControl(this),this.options.isInputWidget=te(t.type,["button","checkbox","checkboxes-inline","checkboxes","color","date","datetime-local","datetime","email","file","hidden","image","integer","month","number","password","radio","radiobuttons","radios-inline","radios","range","reset","search","select","submit","tel","text","textarea","time","url","week"]),this.isDynamicTitle=this.options?.title&&/{{.+?}}/.test(this.options.title),this.dynamicTitle=this.options?.title,!["$ref","advancedfieldset","authfieldset","button","card","checkbox","expansion-panel","help","message","msg","section","submit","tabarray","tabs"].includes(t.type)&&/{{.+?}}/.test(this.widgetOptions.title||"")&&this.updateTitle(),this.options.title=this.setTitle(),this.widgetOptions.title&&(this.dynamicTitle=""),this.options.htmlClass=y(this.options.htmlClass,"schema-form-"+t.type),t.type==="array"?this.options.htmlClass=y(this.options.htmlClass,this.widgetStyles().__array__.htmlClass):t.arrayItem&&t.type!=="$ref"?this.options.htmlClass=y(this.options.htmlClass,this.widgetStyles().__array_item_nonref__.htmlClass):this.options.htmlClass=y(this.options.htmlClass,this.widgetStyles().__form_group__.htmlClass),this.widgetOptions.htmlClass="",this.options.labelHtmlClass=y(this.options.labelHtmlClass,this.widgetStyles().__control_label__.labelHtmlClass),this.widgetOptions.activeClass=y(this.widgetOptions.activeClass,this.widgetStyles().__active__.activeClass),this.options.fieldAddonLeft=this.options.fieldAddonLeft||this.options.prepend,this.options.fieldAddonRight=this.options.fieldAddonRight||this.options.append,this.options.title&&t.type!=="tab"&&!this.options.notitle&&this.options.required&&!this.options.title.includes("*")){let s=this.widgetStyles().__required_asterisk__||"text-danger";this.options.title+=` <strong class="${s}">*</strong>`}if(t.type=="optionfieldset"&&(this.options.messageLocation="top"),this.applyCssClasses(t.type,this.widgetOptions,this.options.style),this.formControl&&(this.updateHelpBlock(this.formControl.status),this.formControl.statusChanges.subscribe(s=>this.updateHelpBlock(s)),this.options.debug)){let s=[];this.debugOutput=(0,h.map)(s,e=>JSON.stringify(e,null,2)).join(`
2
2
  `)}this.frameworkInitialized=!0}}updateHelpBlock(t){this.options.helpBlock=t==="INVALID"&&this.options.enableErrorState&&this.formControl.errors&&(this.formControl.dirty||this.options.feedbackOnRender)?this.jsf.formatErrors(this.formControl.errors,this.options.validationMessages):this.options.description||this.options.help||null}setTitle(){switch(this.layoutNode().type){case"button":case"checkbox":case"section":case"help":case"msg":case"submit":case"message":case"tabarray":case"tabs":case"$ref":return null;case"advancedfieldset":return this.widgetOptions.expandable=!0,this.widgetOptions.title="Advanced options",null;case"authfieldset":return this.widgetOptions.expandable=!0,this.widgetOptions.title="Authentication settings",null;case"fieldset":return this.widgetOptions.title=this.options.title,null;case"array":return this.widgetOptions.title=this.options.title,null;default:return this.widgetOptions.title=null,this.jsf.setItemTitle(this)}}updateTitle(){this.dynamicTitle=this.jsf.parseText(this.options?.title,this.jsf.getFormControlValue(this),this.jsf.getFormControlGroup(this)?.value,this.dataIndex()[this.dataIndex().length-1])}removeItem(){this.jsf.removeItem(this)}};n.\u0275fac=function(s){return new(s||n)},n.\u0275cmp=O({type:n,selectors:[["css-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"],widgetStyles:[1,"widgetStyles"]},outputs:{widgetStyles:"widgetStylesChange"},standalone:!1,features:[H],decls:12,vars:24,consts:[["type","button",3,"class","click",4,"ngIf"],[4,"ngIf"],[3,"class","sr-only",4,"ngIf"],[3,"class","innerHTML",4,"ngIf"],[3,"layoutNode","dataIndex","layoutIndex"],["aria-hidden","true","class","form-control-feedback glyphicon",3,"glyphicon-ok","glyphicon-remove",4,"ngIf"],["type","button",3,"click"],["aria-hidden","true"],[3,"innerHTML"],[3,"class",4,"ngIf"],[1,"text-danger",2,"font-size","0.5em","vertical-align","super"],["aria-hidden","true",1,"form-control-feedback","glyphicon"]],template:function(s,e){if(s&1&&(p(0,"div"),b(1,ce,5,4,"button",0)(2,he,2,1,"div",1)(3,ge,3,7,"label",2)(4,_e,4,2,"p",1),p(5,"div"),b(6,be,1,3,"span",3),g(7,"select-widget-widget",4),b(8,ye,1,3,"span",3),u(),b(9,Ce,1,4,"span",5)(10,ke,2,1,"div",1),u(),b(11,we,4,1,"div",1)),s&2){let r,l,_,x;m((e.options==null?null:e.options.htmlClass)||""),T("has-feedback",(e.options==null?null:e.options.feedback)&&(e.options==null?null:e.options.isInputWidget)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender)))("has-error",(e.options==null?null:e.options.enableErrorState)&&(e.formControl==null?null:e.formControl.errors)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender)))("has-success",(e.options==null?null:e.options.enableSuccessState)&&!(e.formControl!=null&&e.formControl.errors)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender))),q("data-bs-theme",e.theme)("data-theme",e.theme),a(),d("ngIf",e.showRemoveButton),a(),d("ngIf",(e.options==null?null:e.options.messageLocation)==="top"&&((r=e.layoutNode())==null?null:r.type)!=="array"),a(),d("ngIf",(e.options==null?null:e.options.title)&&((l=e.layoutNode())==null?null:l.type)!=="tab"&&((l=e.layoutNode())==null?null:l.type)!=="array"),a(),d("ngIf",((_=e.layoutNode())==null?null:_.type)==="submit"&&(e.jsf==null||e.jsf.formOptions==null?null:e.jsf.formOptions.fieldsRequired)),a(),T("input-group",(e.options==null?null:e.options.fieldAddonLeft)||(e.options==null?null:e.options.fieldAddonRight)),a(),d("ngIf",e.options==null?null:e.options.fieldAddonLeft),a(),d("layoutNode",e.widgetLayoutNode)("dataIndex",e.dataIndex())("layoutIndex",e.layoutIndex()),a(),d("ngIf",e.options==null?null:e.options.fieldAddonRight),a(),d("ngIf",(e.options==null?null:e.options.feedback)&&(e.options==null?null:e.options.isInputWidget)&&!(e.options!=null&&e.options.fieldAddonRight)&&!e.layoutNode().arrayItem&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender))),a(),d("ngIf",(e.options==null?null:e.options.messageLocation)!=="top"&&((x=e.layoutNode())==null?null:x.type)!=="array"),a(),d("ngIf",e.debug&&e.debugOutput)}},dependencies:[ie,ee],styles:[`:host ::ng-deep .list-group-item .form-control-feedback{top:40px}:host ::ng-deep .checkbox,:host ::ng-deep .radio{margin-top:0;margin-bottom:0}:host ::ng-deep .checkbox-inline,:host ::ng-deep .checkbox-inline+.checkbox-inline,:host ::ng-deep .checkbox-inline+.radio-inline,:host ::ng-deep .radio-inline,:host ::ng-deep .radio-inline+.radio-inline,:host ::ng-deep .radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}:host ::ng-deep .checkbox-inline:last-child,:host ::ng-deep .radio-inline:last-child{margin-right:0}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}.checkbox-inline,.checkbox-inline+.checkbox-inline,.checkbox-inline+.radio-inline,.radio-inline,.radio-inline+.radio-inline,.radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}.checkbox-inline:last-child,.radio-inline:last-child{margin-right:0}.ng-invalid.ng-touched{border:1px solid #f44336}
3
3
  `],encapsulation:2});let i=n;return i})(),xe=new J("CSS_FRAMEWORK_CFG"),oe;(function(i){class n{}i.csscategories=n})(oe||(oe={}));var le=(()=>{let n=class n{};n.\u0275fac=function(s){return new(s||n)},n.\u0275mod=v({type:n}),n.\u0275inj=C({providers:[S,F,E,N],imports:[j,A,W]});let i=n;return i})(),re=(()=>{let n=class n extends R{constructor(t){super(),this.cssFWService=f(N),this.name="css",this.framework=B,this.name=t.name,this.text=t.text||this.name,this.stylesheets=t.stylesheets,this.scripts=t.scripts,this.config=t,this.widgets=t.widgets}getActiveTheme(){let t=this.cssFWService.getActiveRequestedTheme(),s=this.config?.widgetstyles?.__themes__,e=s&&s[0];if(t&&(e={name:t,text:t},s)){let r=s.filter(l=>l.name==t);e=r&&r[0]||e}return e}requestThemeChange(t){this.cssFWService.requestThemeChange(t)}registerTheme(t,s=!0){let r=(this.config?.widgetstyles?.__themes__||[]).filter(l=>t.name==l.name);if(r&&r[0]){if(s)return r[0].text=t.text,!0;if(!s)return!1}if(!r||r.length==0){let l=this.config;return l.widgetstyles=this.config.widgetstyles||{},l.widgetstyles.__themes__=l.widgetstyles.__themes__||[],l.widgetstyles.__themes__.push(t),!0}}unregisterTheme(t){let s=this.config?.widgetstyles?.__themes__,e=-1;return s&&(s.forEach((r,l)=>{t==r.name&&(e=l)}),e>=0)?(s.splice(e,1),!0):!1}getConfig(){return this.config}};n.\u0275fac=function(s){return new(s||n)(G(xe))},n.\u0275prov=M({token:n,factory:n.\u0275fac});let i=n;return i})();var Se=(()=>{let n=class n{constructor(){this.changeDetector=f(L),this.jsf=f(S),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.layoutNode=w(void 0),this.layoutIndex=w(void 0),this.dataIndex=w(void 0)}ngOnInit(){}ngOnChanges(){}};n.\u0275fac=function(s){return new(s||n)},n.\u0275cmp=O({type:n,selectors:[["bootstrap-5-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,features:[H],decls:2,vars:3,consts:[[3,"layoutNode","layoutIndex","dataIndex"]],template:function(s,e){s&1&&(p(0,"div"),g(1,"css-framework",0),u()),s&2&&(a(),d("layoutNode",e.layoutNode())("layoutIndex",e.layoutIndex())("dataIndex",e.dataIndex()))},dependencies:[B],styles:[`:host ::ng-deep .list-group-item .list-group-item-hb .form-control-feedback{top:40px}:host ::ng-deep .checkbox,:host ::ng-deep .radio{margin-top:0;margin-bottom:0}:host ::ng-deep .checkbox-inline,:host ::ng-deep .checkbox-inline+.checkbox-inline,:host ::ng-deep .checkbox-inline+.radio-inline,:host ::ng-deep .radio-inline,:host ::ng-deep .radio-inline+.radio-inline,:host ::ng-deep .radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}:host ::ng-deep .checkbox-inline:last-child,:host ::ng-deep .radio-inline:last-child{margin-right:0}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}.input-group .form-control:first-child,.input-group-text:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text:first-child{border-right:0}.input-group .form-control:last-child,.input-group-text:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text:last-child{border-left:0}.input-group .form-control:not(:first-child):not(:last-child),.input-group-text:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.btn-close>span:first-child{display:none}
4
4
  `],encapsulation:2});let i=n;return i})(),Me={name:"bootstrap-5",text:"Bootstrap 5",scripts:["//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"],stylesheets:["//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"],widgetstyles:{__themes__:[{name:"bootstrap5_default",text:"Bootstrap5 default"},{name:"dark",text:"Dark"},{name:"light",text:"Light"}],$ref:{fieldHtmlClass:"btn btn-primary"},__array_item_nonref__:{htmlClass:"list-group-item list-group-item-hb"},__form_group__:{htmlClass:"form-group"},__control_label__:{labelHtmlClass:"control-label"},__active__:{activeClass:"active"},__required_asterisk__:"text-danger",__screen_reader__:"visually-hidden",__remove_item__:"btn-close float-end",__help_block__:"help-block grey-text small",__field_addon_left__:"input-group-text",__field_addon_right__:"input-group-text","alt-date":{},"alt-datetime":{},__array__:{htmlClass:"list-group list-group-hb"},array:{},authfieldset:{},advancedfieldset:{},button:{fieldHtmlClass:"btn btn-sm btn-primary"},checkbox:{fieldHtmlClass:"form-check-input"},checkboxes:{fieldHtmlClass:"form-check-input"},checkboxbuttons:{fieldHtmlClass:"visually-hidden",htmlClass:"btn-group",itemLabelHtmlClass:"btn"},"checkboxes-inline":{htmlClass:"form-check-input",itemLabelHtmlClass:"form-check-inline"},date:{},"datetime-local":{},fieldset:{},integer:{},number:{},optionfieldset:{},password:{},radiobuttons:{fieldHtmlClass:"visually-hidden",htmlClass:"btn-group",itemLabelHtmlClass:"btn"},radio:{fieldHtmlClass:"form-check-input"},radios:{fieldHtmlClass:"form-check-input"},"radios-inline":{htmlClass:"form-check form-check-inline",itemLabelHtmlClass:"form-check-label"},range:{},section:{},selectfieldset:{},select:{fieldHtmlClass:"form-select"},submit:{fieldHtmlClass:"btn btn-primary"},text:{},tabs:{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},tabarray:{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},"one-of":{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},textarea:{},default:{fieldHtmlClass:"form-control"}}},Te=(()=>{let n=class n extends re{constructor(){let t=f(N);super(Me),this.framework=Se,this.cssFWService=t}};n.\u0275fac=function(s){return new(s||n)},n.\u0275prov=M({token:n,factory:n.\u0275fac});let i=n;return i})(),ae=(()=>{let n=class n{};n.\u0275fac=function(s){return new(s||n)},n.\u0275mod=v({type:n}),n.\u0275inj=C({providers:[S,F,E,{provide:R,useClass:Te,multi:!0}],imports:[j,A,W,le,j]});let i=n;return i})();var de=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=v({type:i});static \u0275inj=C({providers:[ne],imports:[ae,D]})}return i})();var nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=v({type:i});static \u0275inj=C({providers:[se],imports:[D,de]})}return i})();export{nt as a};
@@ -1,2 +1,2 @@
1
- import{C as Y,D as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,q as J,r as Q,y as X}from"./chunk-3PGUQRQW.js";import{a as ae}from"./chunk-G7VCQ3TG.js";import{b as oe}from"./chunk-GEMLIK55.js";import{b as re}from"./chunk-3PXXHWW2.js";import{k as ee,l as te,n as ie,p as U,q as ne}from"./chunk-6H7DHQM2.js";import{$b as _,Ib as I,La as W,Lb as x,Nb as g,Pc as H,Qa as n,Sc as N,Xb as O,_b as l,ac as f,ad as R,db as V,h as S,kc as L,lc as B,mc as E,md as q,na as w,pb as M,qb as z,rb as T,rc as a,sa as C,sc as s,ta as b,wb as m,x as h,xb as o,yb as r,zb as u}from"./chunk-ZRDN4L2J.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=g();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=g();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),_(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),f(" ",s(8,8,"setup.button_get_started")," "),n(3),_(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=g();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=g();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=g();n(2),_(s(3,16,"setup.create_account")),n(3),_(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),f(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),f(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),f(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&f(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=g();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=g();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=g();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=g();n(2),_(s(3,6,"setup_wizard_restore")),n(3),_(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),f(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&f(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&f(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&f(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),_(s(2,1,"form.button_continue")))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=g();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),_(s(3,3,"setup_wizard_complete_title")),n(3),_(s(6,5,"setup_wizard_completed")),n(3),_(s(9,7,"form.button_continue")))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
1
+ import{C as Y,D as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,q as J,r as Q,y as X}from"./chunk-3PGUQRQW.js";import{a as ae}from"./chunk-3SKLXSFI.js";import{b as oe}from"./chunk-L2Y7HWNA.js";import{b as re}from"./chunk-D5Z6KR3J.js";import{k as ee,l as te,n as ie,p as U,q as ne}from"./chunk-YK5NYQW5.js";import{$b as _,Ib as I,La as W,Lb as x,Nb as g,Pc as H,Qa as n,Sc as N,Xb as O,_b as l,ac as f,ad as R,db as V,h as S,kc as L,lc as B,mc as E,md as q,na as w,pb as M,qb as z,rb as T,rc as a,sa as C,sc as s,ta as b,wb as m,x as h,xb as o,yb as r,zb as u}from"./chunk-ZRDN4L2J.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=g();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=g();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),_(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),f(" ",s(8,8,"setup.button_get_started")," "),n(3),_(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=g();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=g();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=g();n(2),_(s(3,16,"setup.create_account")),n(3),_(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),f(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),f(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),f(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&f(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=g();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=g();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=g();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=g();n(2),_(s(3,6,"setup_wizard_restore")),n(3),_(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),f(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&f(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&f(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&f(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),_(s(2,1,"form.button_continue")))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=g();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),_(s(3,3,"setup_wizard_complete_title")),n(3),_(s(6,5,"setup_wizard_completed")),n(3),_(s(9,7,"form.button_continue")))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
2
2
  \r`).forEach(v=>{if(v&&!/^[⠇⠏⠋⠙⠹⠸]+$/.test(v)){let y=document.createElement("div"),le=/\x1B\[(\d{1,2}(;\d{1,2})?)?[mGK]/g;y.innerHTML=v.replace(le,""),v.includes("[0;31m")?y.classList.add("red-text"):v.includes("[0;32m")?y.classList.add("green-text"):v.includes("[0;33m")?y.classList.add("orange-text"):v.includes("[0;36m")&&y.classList.add("cyan-text"),i.appendChild(y),i.scrollTop=i.scrollHeight}})}),this.restoreStarted=!0,this.restoreInProgress=!0,this.progress=75,yield h(this.io.request("do-restore")),this.progress=80,this.restoreInProgress=!1,yield h(this.$api.put("/backup/restart",{})),this.step="restarting",this.progress=85,window.localStorage.removeItem(U.jwt.tokenKey),this.$auth.token=null;let F=document.createElement("div");F.classList.add("orange-text"),F.innerHTML="Starting Homebridge, please wait...",i.appendChild(F),i.scrollTop=i.scrollHeight,yield new Promise(c=>setTimeout(c,3e3)),this.progress=88,yield new Promise(c=>setTimeout(c,3e3)),this.progress=91,yield new Promise(c=>setTimeout(c,3e3)),this.progress=94,yield new Promise(c=>setTimeout(c,3e3)),this.progress=97,yield new Promise(c=>setTimeout(c,3e3)),this.progress=99;let se=setInterval(()=>S(this,null,function*(){try{yield h(this.$api.get("/auth/settings")),clearInterval(se),this.progress=100,this.restoreUploading=!1,this.step="restore-complete"}catch{}}),1e3)}catch(e){console.error(e),this.restoreUploading=!1,this.restoreFailed=!0,this.progress=20,this.step="restore-backup",this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}finally{this.io&&this.io.end()}})}setBackground(){return S(this,null,function*(){if(this.$settings.settingsLoaded||(yield h(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let e=`${U.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${e}') center/cover`}})}matchPassword(e){let p=e.get("password").value,i=e.get("passwordConfirm").value;if(p!==i)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=V({type:t,selectors:[["ng-component"]],decls:10,vars:14,consts:[[1,"setup-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","setup-card","d-flex","py-4","flex-column"],["ngSrc","assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],[1,"progress","w-100","my-4"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar","progress-bar-striped","bg-success",3,"ngClass"],[1,"w-100","d-flex","flex-column","align-items-center","mb-2"],[1,"mb-3","text-center"],[1,"mb-4","small","grey-text","text-center",3,"innerHTML"],["type","button",1,"btn","btn-lg","btn-primary","mb-4",3,"click"],["href","javascript:void(0)",1,"grey-text",3,"click"],[1,"mb-4","small","grey-text","text-center"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"input-group","mb-4"],[1,"input-group-text","custom-input"],[1,"fas","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"fas","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ms-0",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"form-control","custom-input","mb-3",3,"change"],["type","button",1,"btn","btn-primary","me-0",3,"click","disabled"],[1,"fas","fa-circle-notch","fa-spin"],["id","output",1,"font-monospace","small","alert","alert-info","w-100","text-start","mt-1","mb-0"],["href","/login",1,"btn","btn-lg","btn-primary","mt-4"],[1,"mb-3"],["href","/",1,"btn","btn-lg","btn-primary"]],template:function(p,i){p&1&&(o(0,"div",0)(1,"div",1),u(2,"img",2),o(3,"div",3),u(4,"div",4),r(),z(5,ue,12,12,"div",5)(6,ge,31,39,"div",5)(7,he,15,12,"div",5)(8,ve,7,2,"div",5)(9,ye,10,9,"div",5),r()()),p&2&&(m("ngStyle",B(7,pe,i.backgroundStyle))("ngClass",B(9,de,!i.backgroundStyle)),n(4),O("width",i.progress+"%"),m("ngClass",B(11,ce,i.loading||i.restoreUploading)),M("aria-valuenow",i.progress),n(),T(i.step==="welcome"?5:i.step==="create-account"?6:i.step==="restore-backup"?7:L(13,me).includes(i.step)?8:i.step==="setup-complete"?9:-1))},dependencies:[H,R,Y,A,G,j,D,X,Z,J,Q,N,te],styles:["body{overflow:scroll!important} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.setup-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.setup-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}.progress[_ngcontent-%COMP%]{background-color:#ddd}#output[_ngcontent-%COMP%]{height:200px;overflow-y:scroll;white-space:pre-wrap}"]})}return t})();export{He as SetupWizardComponent};