@mxtommy/kip 3.4.0-beta.3 → 3.4.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.
- package/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/public/assets/help-docs/menu.json +2 -2
- package/public/{chunk-7NWUY2IT.js → chunk-2GTOB75T.js} +1 -1
- package/public/{chunk-SDZFIHEU.js → chunk-2IGGX6BI.js} +2 -2
- package/public/{chunk-BBFXHJPT.js → chunk-7ICUQ4VK.js} +6 -6
- package/public/{chunk-ZB2SENV6.js → chunk-AERKQXJA.js} +15 -15
- package/public/{chunk-MOHOEYTL.js → chunk-BJZD62ZD.js} +1 -1
- package/public/{chunk-NNBCRGF2.js → chunk-BK65F7S6.js} +1 -1
- package/public/{chunk-ZXWZCYPU.js → chunk-EGXTT4GK.js} +1 -1
- package/public/{chunk-KC3DYEZK.js → chunk-F5AFZMSJ.js} +1 -1
- package/public/{chunk-646JL6NE.js → chunk-FQWKFMCL.js} +1 -1
- package/public/{chunk-6E3N2KJB.js → chunk-GSG5IFZ7.js} +1 -1
- package/public/{chunk-6NAA5NCK.js → chunk-HTFWAMIE.js} +1 -1
- package/public/chunk-IJ7MVHXO.js +4 -0
- package/public/{chunk-ZAFJN4CD.js → chunk-IMRKPLTP.js} +1 -1
- package/public/{chunk-7JLLYN2R.js → chunk-JITOBNFA.js} +1 -1
- package/public/{chunk-CZQKWXAW.js → chunk-KE3BK62I.js} +1 -1
- package/public/{chunk-BY7CHFFV.js → chunk-KP4DUCFG.js} +1 -1
- package/public/{chunk-7U4R7KOL.js → chunk-KUPVE24U.js} +1 -1
- package/public/{chunk-Y3BDLHDK.js → chunk-MRXTLXGU.js} +1 -1
- package/public/{chunk-7UO2PGXP.js → chunk-OGPSK2OV.js} +1 -1
- package/public/{chunk-3S26JNVT.js → chunk-PYQ6T3Y3.js} +1 -1
- package/public/{chunk-AL6XMKY7.js → chunk-QBA5REXT.js} +1 -1
- package/public/{chunk-553NPOIS.js → chunk-ROXSW22U.js} +1 -1
- package/public/chunk-RPHEZR7W.js +1 -0
- package/public/{chunk-SZDXY4IJ.js → chunk-UMSIBYU7.js} +1 -1
- package/public/chunk-VYP5YLKW.js +4 -0
- package/public/{chunk-XYG3VN7Q.js → chunk-X2CUXUMC.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-SXBYKFCK.js → main-2QGKGFMT.js} +17 -15
- package/public/chunk-DSTFA3XL.js +0 -6
- package/public/chunk-S4JY2BC4.js +0 -4
- package/public/chunk-TNCDFK3R.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-AL6XMKY7.js";import{f as ne,j as ie}from"./chunk-SZDXY4IJ.js";import{j as N}from"./chunk-3S26JNVT.js";import{a as V}from"./chunk-TNCDFK3R.js";import{a as te}from"./chunk-Y3BDLHDK.js";import{B as Z,C as ee,f as L,g as P,l as I,q as Q,x as X}from"./chunk-S4JY2BC4.js";import{$b as i,Aa as d,Ba as p,Bc as x,Cc as w,Ce as A,Cf as H,Db as C,Dc as y,Ef as z,Ff as Y,Gf as $,Kc as O,Rc as T,Zb as g,_b as n,ac as h,ec as b,f as k,gc as f,gf as R,hc as v,if as j,lf as W,mb as c,mf as q,pf as J,rc as _,sf as U,tf as B,ua as S,ud as D,vd as F,wc as o,wf as G,xb as E,zc as M,zf as K}from"./chunk-ZB2SENV6.js";var ae=()=>({standalone:!1});function re(r,m){r&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function le(r,m){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",32)(2,"mat-label"),o(3,"Scope"),i(),n(4,"mat-select",33),y("ngModelChange",function(t){d(e);let a=v();return w(a.saveConfigScope,t)||(a.saveConfigScope=t),p(t)}),n(5,"mat-option",34),o(6," Global "),i(),n(7,"mat-option",35),o(8," User "),i()()(),n(9,"mat-form-field",36)(10,"mat-label"),o(11,"Configuration Name"),i(),n(12,"input",37),y("ngModelChange",function(t){d(e);let a=v();return w(a.saveConfigName,t)||(a.saveConfigName=t),p(t)}),i()(),C(13,re,2,0,"div",38),i()}if(r&2){let e=v();c(4),x("ngModel",e.saveConfigScope),c(8),x("ngModel",e.saveConfigName),g("ngModelOptions",O(4,ae)),c(),g("ngIf",!e.hasToken)}}function se(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ce(r,m){if(r&1&&(n(0,"mat-option",43),o(1),i()),r&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function ge(r,m){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",41),y("ngModelChange",function(t){d(e);let a=v();return w(a.deleteConfigItem,t)||(a.deleteConfigItem=t),p(t)}),C(5,ce,2,3,"mat-option",42),i()()()}if(r&2){let e=v();c(4),x("ngModel",e.deleteConfigItem),c(),g("ngForOf",e.serverConfigList)}}function de(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function pe(r,m){if(r&1&&(n(0,"mat-option",43),o(1),i()),r&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function me(r,m){if(r&1&&(n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",44),C(5,pe,2,3,"mat-option",42),i()()()),r&2){let e=v();c(5),g("ngForOf",e.serverConfigList)}}function fe(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Pe=(()=>{class r{appSettingsService=S(P);storageSvc=S(L);appService=S(V);auth=S(I);fb=S(z);pageTitle="Configurations";hasToken=!1;isTokenTypeDevice=!1;tokenSub;supportApplicationData=!1;serverConfigList=[];serverUpgradableConfigList=[];copyConfigForm;storageLocation=null;locations=["Local Storage","Server Storage"];saveConfigName=null;saveConfigScope=null;deleteConfigItem;jsonData=null;ngOnInit(){this.tokenSub=this.auth.authToken$.subscribe(e=>{e&&e.token?(this.hasToken=!0,this.isTokenTypeDevice=e.isDeviceAccessToken,e.isDeviceAccessToken?this.saveConfigScope="global":this.saveConfigScope="user"):this.hasToken=!1}),this.copyConfigForm=this.fb.group({sourceTarget:[{value:"",disabled:!1},j.required]}),this.supportApplicationData=this.storageSvc.isAppDataSupported,this.getServerConfigList()}getServerConfigList(e){this.supportApplicationData&&this.storageSvc.listConfigs(e).then(l=>{let t=l.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(l=>{switch(l.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+l.statusText+". Signal K configuration must meet the following requirements; 1) Security enabled. 2) Application Data Storage Interface: On. 3) Either Allow Readonly Access enabled, or connecting with a user.",0,!1);break;default:this.appService.sendSnackbarNotification("Error listing server configurations: "+l,3e3,!1);break}})}saveConfig(e,l,t,a,s){if(this.supportApplicationData){if(l==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(l,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${l}] storage scope`,5e3,!1),a||this.getServerConfigList()):this.appService.sendSnackbarNotification("Error saving configuration to server",0,!1)}}saveToLocalstorage(e){this.appSettingsService.replaceConfig("appConfig",e.app,!1),this.appSettingsService.replaceConfig("dashboardsConfig",e.dashboards,!1),this.appSettingsService.replaceConfig("themeConfig",e.theme,!1)}copyConfig(){return k(this,null,function*(){let e=null;try{yield this.storageSvc.getConfig(this.copyConfigForm.value.sourceTarget.scope,this.copyConfigForm.value.sourceTarget.name).then(l=>{e=l})}catch(l){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+l.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,l,t,a){this.storageSvc.removeItem(e,l,t),this.appService.sendSnackbarNotification(`Configuration [${l}] deleted from [${e}] storage scope`,5e3,!1),a||this.getServerConfigList()}resetConfigToDefault(){this.appSettingsService.resetSettings()}resetConnectionToDefault(){this.appSettingsService.resetConnection()}loadDemoConfig(){this.appSettingsService.loadDemoConfig()}getActiveConfig(){let e;return this.appSettingsService.useSharedConfig?e=this.getLocalConfigFromMemory():e=this.getLocalConfigFromLocalStorage(),e}getLocalConfigFromMemory(){return{app:this.appSettingsService.getAppConfig(),dashboards:this.appSettingsService.getDashboardConfig(),theme:this.appSettingsService.getThemeConfig()}}getLocalConfigFromLocalStorage(){return{app:this.appSettingsService.loadConfigFromLocalStorage("appConfig"),dashboards:this.appSettingsService.loadConfigFromLocalStorage("dashboardsConfig"),theme:this.appSettingsService.loadConfigFromLocalStorage("themeConfig")}}downloadJsonConfig(){let e=this.getActiveConfig(),l=JSON.stringify(e,null,2),t=new Blob([l],{type:"application/json"}),a=window.URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="KipConfig.json",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}uploadJsonConfig(e){let t=e.target.files?.[0];if(t&&t.type==="application/json"){let a=new FileReader;a.onload=s=>{try{this.jsonData=JSON.parse(s.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(u){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",u)}},a.readAsText(t)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(l){return new(l||r)};static \u0275cmp=E({type:r,selectors:[["settings-config"]],decls:85,vars:11,consts:[["saveConfigForm","ngForm"],["elseBlock",""],["deleteConfigForm","ngForm"],["fileInput",""],[3,"pageTitle"],[1,"page-content"],["routerLink","/help"],[1,"flex-container"],[1,"flex-item-rounded-card","rounded-card-color"],["name","saveConfigForm",3,"ngSubmit"],[2,"margin-bottom","16px"],[4,"ngIf","ngIfElse"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit","color","accent",3,"disabled"],["name","deleteConfigForm",3,"ngSubmit"],[3,"ngSubmit","formGroup"],[1,"flex-item-reset","rounded-card-color"],[1,"config-operation-container",2,"margin-top","20px"],[1,"download-txt"],[1,"download-btn","btn-div"],["mat-flat-button","","type","button",1,"adv-btn",3,"click"],[1,"upload-txt"],[1,"upload-btn","btn-div"],["type","file","accept",".json","hidden","",3,"change"],["mat-flat-button","",1,"adv-btn",3,"click"],[1,"demo-txt"],[1,"demo-btn","btn-div"],[1,"reset-txt"],[1,"reset-btn","btn-div"],[1,"config-txt"],[1,"config-btn","btn-div"],[2,"width","25%"],["name","serverConfiScope","required","",3,"ngModelChange","ngModel"],["value","global"],["value","user"],[2,"width","70%","padding-left","3%"],["matInput","","name","serverConfigName","placeholder","Enter a name for the configuration","required","",3,"ngModelChange","ngModel","ngModelOptions"],[4,"ngIf"],[1,"no-token-notice"],[2,"width","100%"],["name","selectedDeleteItem","required","",3,"ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","sourceTarget"]],template:function(l,t){if(l&1){let a=b();h(0,"page-header",4),n(1,"div",5)(2,"p"),o(3," Recommended Reading: To understand configuration management and storage options, consult the "),n(4,"a",6),o(5,"Configuration Management Help"),i(),o(6," section. "),i(),n(7,"div",7)(8,"div",8)(9,"form",9,0),f("ngSubmit",function(){return d(a),p(t.saveConfig(t.getActiveConfig(),t.saveConfigScope,t.saveConfigName))}),n(11,"h2"),o(12,"Backup"),i(),n(13,"p",10),o(14," Create a backup of the current active configuration on the server. "),i(),C(15,le,14,5,"div",11)(16,se,3,0,"ng-template",null,1,T),n(18,"div",12),h(19,"mat-divider",13),n(20,"button",14),o(21," Create "),i()()()(),n(22,"div",8)(23,"form",15,2),f("ngSubmit",function(){return d(a),p(t.deleteConfig(t.deleteConfigItem.scope,t.deleteConfigItem.name))}),n(25,"h2"),o(26,"Delete"),i(),n(27,"p",10),o(28," Select a backup configuration to permanently delete from the server. "),i(),C(29,ge,6,2,"div",11)(30,de,3,0,"ng-template",null,1,T),n(32,"div",12),h(33,"mat-divider",13),n(34,"button",14),o(35," Delete "),i()()()(),n(36,"div",8)(37,"form",16),f("ngSubmit",function(){return d(a),p(t.copyConfig())}),n(38,"h2"),o(39,"Restore"),i(),n(40,"p",10),o(41," Replace the current configuration with a backup from the server. "),i(),C(42,me,6,1,"div",11)(43,fe,3,0,"ng-template",null,1,T),n(45,"div",12),h(46,"mat-divider",13),n(47,"button",14),o(48," Restore "),i()()()(),n(49,"div",17)(50,"h2"),o(51,"Advanced"),i(),n(52,"div",18)(53,"div",19)(54,"p"),o(55,"Download the active configuration to a file."),i()(),n(56,"div",20)(57,"button",21),f("click",function(){return d(a),p(t.downloadJsonConfig())}),o(58," Download "),i()(),n(59,"div",22)(60,"p"),o(61," Select a configuration file to upload. The file must be a valid KIP configuration file of JSON format. "),i()(),n(62,"div",23)(63,"input",24,3),f("change",function(u){return d(a),p(t.uploadJsonConfig(u))}),i(),n(65,"button",25),f("click",function(){d(a);let u=_(64);return p(u.click())}),o(66," Upload "),i()(),n(67,"div",26)(68,"p"),o(69," Load the demonstration configuration and connection to Signal K demo server. WARNING: This will completely reset all your settings. "),i()(),n(70,"div",27)(71,"button",21),f("click",function(){return d(a),p(t.loadDemoConfig())}),o(72," Demo "),i()(),n(73,"div",28)(74,"p"),o(75," Reset all your settings to default. The default configuration has a single Getting Started instruction widget. Your Signal K server connection settings will remain. "),i()(),n(76,"div",29)(77,"button",21),f("click",function(){return d(a),p(t.resetConfigToDefault())}),o(78," Default "),i()(),n(79,"div",30)(80,"p"),o(81," Clear the current connection configuration. This only affects Connectivity tab settings. "),i()(),n(82,"div",31)(83,"button",21),f("click",function(){return d(a),p(t.resetConnectionToDefault())}),o(84," Connection "),i()()()()()()}if(l&2){let a=_(10),s=_(17),u=_(24);g("pageTitle",t.pageTitle),c(15),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.hasToken||!a.valid),c(9),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.hasToken||!u.valid),c(3),g("formGroup",t.copyConfigForm),c(5),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.copyConfigForm.valid)}},dependencies:[N,F,Y,B,R,W,q,H,U,J,te,A,X,Q,ie,ne,Z,D,$,G,K,oe,ee],styles:['[_nghost-%COMP%]{display:block;height:100%;width:100%}.page-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 63px);overflow-y:scroll;scroll-behavior:smooth;padding:0 24px 10px}.flex-item-copy[_ngcontent-%COMP%]{flex:2 1 41%;padding:10px 20px;border-radius:15px}.flex-item-reset[_ngcontent-%COMP%]{flex:1 1 100%;padding:10px 20px;border-radius:15px}a[_ngcontent-%COMP%]{font-size:14px}a[_ngcontent-%COMP%]:hover{text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:link, a[_ngcontent-%COMP%]:visited{color:#8ab4f8;text-decoration:none}.warningText[_ngcontent-%COMP%]{padding-left:15px}.no-token-notice[_ngcontent-%COMP%]{height:58px;contain:content;text-align:center;font-style:italic}.mat-mdc-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-right:16px;margin-left:16px}.config-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-basis:100%;flex:1;margin:0 10px}.sources-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.sources-radio-button[_ngcontent-%COMP%]{margin:5px;margin-left:0!important}.select-config[_ngcontent-%COMP%]{margin-left:0}.config-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.btn-div[_ngcontent-%COMP%]{align-self:center}.adv-btn[_ngcontent-%COMP%]{width:100%}.config-operation-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:[col-start] auto [col1-end] min-content [col2-end];grid-template-rows:[row-start] max-content [row1-end] max-content [row2-end];grid-template-areas:"download-txt download-btn" "upload-txt upload-btn" "demo-txt demo-btn" "reset-txt reset-btn" "config-txt config-btn";row-gap:20px;column-gap:10px}.upload-txt[_ngcontent-%COMP%]{grid-area:upload-txt}.upload-btn[_ngcontent-%COMP%]{grid-area:upload-btn}.download-txt[_ngcontent-%COMP%]{grid-area:download-txt}.download-btn[_ngcontent-%COMP%]{grid-area:download-btn}.demo-txt[_ngcontent-%COMP%]{grid-area:demo-txt}.demo-btn[_ngcontent-%COMP%]{grid-area:demo-btn}.reset-txt[_ngcontent-%COMP%]{grid-area:reset-txt}.reset-btn[_ngcontent-%COMP%]{grid-area:reset-btn}.config-txt[_ngcontent-%COMP%]{grid-area:config-txt}.config-btn[_ngcontent-%COMP%]{grid-area:config-btn}']})}return r})();export{Pe as SettingsConfigComponent};
|
|
1
|
+
import{a as oe}from"./chunk-QBA5REXT.js";import{f as ne,j as ie}from"./chunk-UMSIBYU7.js";import{j as N}from"./chunk-PYQ6T3Y3.js";import{a as V}from"./chunk-RPHEZR7W.js";import{a as te}from"./chunk-MRXTLXGU.js";import{C as Z,D as ee,g as L,h as P,m as I,r as Q,y as X}from"./chunk-VYP5YLKW.js";import{Ac as w,Ae as A,Af as H,Bb as C,Bc as y,Cf as z,Df as Y,Ef as $,Ic as O,Pc as T,Xb as g,Yb as n,Zb as i,_b as h,cc as b,ec as f,ef as R,f as k,fc as v,gf as j,jf as W,kb as c,kf as q,nf as J,pc as _,qf as U,rf as B,sa as S,sd as D,td as F,uc as o,uf as G,vb as E,xc as M,xf as K,ya as d,za as p,zc as x}from"./chunk-AERKQXJA.js";var ae=()=>({standalone:!1});function re(r,m){r&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function le(r,m){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",32)(2,"mat-label"),o(3,"Scope"),i(),n(4,"mat-select",33),y("ngModelChange",function(t){d(e);let a=v();return w(a.saveConfigScope,t)||(a.saveConfigScope=t),p(t)}),n(5,"mat-option",34),o(6," Global "),i(),n(7,"mat-option",35),o(8," User "),i()()(),n(9,"mat-form-field",36)(10,"mat-label"),o(11,"Configuration Name"),i(),n(12,"input",37),y("ngModelChange",function(t){d(e);let a=v();return w(a.saveConfigName,t)||(a.saveConfigName=t),p(t)}),i()(),C(13,re,2,0,"div",38),i()}if(r&2){let e=v();c(4),x("ngModel",e.saveConfigScope),c(8),x("ngModel",e.saveConfigName),g("ngModelOptions",O(4,ae)),c(),g("ngIf",!e.hasToken)}}function se(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ce(r,m){if(r&1&&(n(0,"mat-option",43),o(1),i()),r&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function ge(r,m){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",41),y("ngModelChange",function(t){d(e);let a=v();return w(a.deleteConfigItem,t)||(a.deleteConfigItem=t),p(t)}),C(5,ce,2,3,"mat-option",42),i()()()}if(r&2){let e=v();c(4),x("ngModel",e.deleteConfigItem),c(),g("ngForOf",e.serverConfigList)}}function de(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function pe(r,m){if(r&1&&(n(0,"mat-option",43),o(1),i()),r&2){let e=m.$implicit;g("value",e),c(),M(" ",e.scope," / ",e.name," ")}}function me(r,m){if(r&1&&(n(0,"div")(1,"mat-form-field",40)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",44),C(5,pe,2,3,"mat-option",42),i()()()),r&2){let e=v();c(5),g("ngForOf",e.serverConfigList)}}function fe(r,m){r&1&&(n(0,"div",39)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Pe=(()=>{class r{appSettingsService=S(P);storageSvc=S(L);appService=S(V);auth=S(I);fb=S(z);pageTitle="Configurations";hasToken=!1;isTokenTypeDevice=!1;tokenSub;supportApplicationData=!1;serverConfigList=[];serverUpgradableConfigList=[];copyConfigForm;storageLocation=null;locations=["Local Storage","Server Storage"];saveConfigName=null;saveConfigScope=null;deleteConfigItem;jsonData=null;ngOnInit(){this.tokenSub=this.auth.authToken$.subscribe(e=>{e&&e.token?(this.hasToken=!0,this.isTokenTypeDevice=e.isDeviceAccessToken,e.isDeviceAccessToken?this.saveConfigScope="global":this.saveConfigScope="user"):this.hasToken=!1}),this.copyConfigForm=this.fb.group({sourceTarget:[{value:"",disabled:!1},j.required]}),this.supportApplicationData=this.storageSvc.isAppDataSupported,this.getServerConfigList()}getServerConfigList(e){this.supportApplicationData&&this.storageSvc.listConfigs(e).then(l=>{let t=l.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(l=>{switch(l.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+l.statusText+". Signal K configuration must meet the following requirements; 1) Security enabled. 2) Application Data Storage Interface: On. 3) Either Allow Readonly Access enabled, or connecting with a user.",0,!1);break;default:this.appService.sendSnackbarNotification("Error listing server configurations: "+l,3e3,!1);break}})}saveConfig(e,l,t,a,s){if(this.supportApplicationData){if(l==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(l,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${l}] storage scope`,5e3,!1),a||this.getServerConfigList()):this.appService.sendSnackbarNotification("Error saving configuration to server",0,!1)}}saveToLocalstorage(e){this.appSettingsService.replaceConfig("appConfig",e.app,!1),this.appSettingsService.replaceConfig("dashboardsConfig",e.dashboards,!1),this.appSettingsService.replaceConfig("themeConfig",e.theme,!1)}copyConfig(){return k(this,null,function*(){let e=null;try{yield this.storageSvc.getConfig(this.copyConfigForm.value.sourceTarget.scope,this.copyConfigForm.value.sourceTarget.name).then(l=>{e=l})}catch(l){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+l.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,l,t,a){this.storageSvc.removeItem(e,l,t),this.appService.sendSnackbarNotification(`Configuration [${l}] deleted from [${e}] storage scope`,5e3,!1),a||this.getServerConfigList()}resetConfigToDefault(){this.appSettingsService.resetSettings()}resetConnectionToDefault(){this.appSettingsService.resetConnection()}loadDemoConfig(){this.appSettingsService.loadDemoConfig()}getActiveConfig(){let e;return this.appSettingsService.useSharedConfig?e=this.getLocalConfigFromMemory():e=this.getLocalConfigFromLocalStorage(),e}getLocalConfigFromMemory(){return{app:this.appSettingsService.getAppConfig(),dashboards:this.appSettingsService.getDashboardConfig(),theme:this.appSettingsService.getThemeConfig()}}getLocalConfigFromLocalStorage(){return{app:this.appSettingsService.loadConfigFromLocalStorage("appConfig"),dashboards:this.appSettingsService.loadConfigFromLocalStorage("dashboardsConfig"),theme:this.appSettingsService.loadConfigFromLocalStorage("themeConfig")}}downloadJsonConfig(){let e=this.getActiveConfig(),l=JSON.stringify(e,null,2),t=new Blob([l],{type:"application/json"}),a=window.URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="KipConfig.json",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}uploadJsonConfig(e){let t=e.target.files?.[0];if(t&&t.type==="application/json"){let a=new FileReader;a.onload=s=>{try{this.jsonData=JSON.parse(s.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(u){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",u)}},a.readAsText(t)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(l){return new(l||r)};static \u0275cmp=E({type:r,selectors:[["settings-config"]],decls:85,vars:11,consts:[["saveConfigForm","ngForm"],["elseBlock",""],["deleteConfigForm","ngForm"],["fileInput",""],[3,"pageTitle"],[1,"page-content"],["routerLink","/help"],[1,"flex-container"],[1,"flex-item-rounded-card","rounded-card-color"],["name","saveConfigForm",3,"ngSubmit"],[2,"margin-bottom","16px"],[4,"ngIf","ngIfElse"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit","color","accent",3,"disabled"],["name","deleteConfigForm",3,"ngSubmit"],[3,"ngSubmit","formGroup"],[1,"flex-item-reset","rounded-card-color"],[1,"config-operation-container",2,"margin-top","20px"],[1,"download-txt"],[1,"download-btn","btn-div"],["mat-flat-button","","type","button",1,"adv-btn",3,"click"],[1,"upload-txt"],[1,"upload-btn","btn-div"],["type","file","accept",".json","hidden","",3,"change"],["mat-flat-button","",1,"adv-btn",3,"click"],[1,"demo-txt"],[1,"demo-btn","btn-div"],[1,"reset-txt"],[1,"reset-btn","btn-div"],[1,"config-txt"],[1,"config-btn","btn-div"],[2,"width","25%"],["name","serverConfiScope","required","",3,"ngModelChange","ngModel"],["value","global"],["value","user"],[2,"width","70%","padding-left","3%"],["matInput","","name","serverConfigName","placeholder","Enter a name for the configuration","required","",3,"ngModelChange","ngModel","ngModelOptions"],[4,"ngIf"],[1,"no-token-notice"],[2,"width","100%"],["name","selectedDeleteItem","required","",3,"ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["formControlName","sourceTarget"]],template:function(l,t){if(l&1){let a=b();h(0,"page-header",4),n(1,"div",5)(2,"p"),o(3," Recommended Reading: To understand configuration management and storage options, consult the "),n(4,"a",6),o(5,"Configuration Management Help"),i(),o(6," section. "),i(),n(7,"div",7)(8,"div",8)(9,"form",9,0),f("ngSubmit",function(){return d(a),p(t.saveConfig(t.getActiveConfig(),t.saveConfigScope,t.saveConfigName))}),n(11,"h2"),o(12,"Backup"),i(),n(13,"p",10),o(14," Create a backup of the current active configuration on the server. "),i(),C(15,le,14,5,"div",11)(16,se,3,0,"ng-template",null,1,T),n(18,"div",12),h(19,"mat-divider",13),n(20,"button",14),o(21," Create "),i()()()(),n(22,"div",8)(23,"form",15,2),f("ngSubmit",function(){return d(a),p(t.deleteConfig(t.deleteConfigItem.scope,t.deleteConfigItem.name))}),n(25,"h2"),o(26,"Delete"),i(),n(27,"p",10),o(28," Select a backup configuration to permanently delete from the server. "),i(),C(29,ge,6,2,"div",11)(30,de,3,0,"ng-template",null,1,T),n(32,"div",12),h(33,"mat-divider",13),n(34,"button",14),o(35," Delete "),i()()()(),n(36,"div",8)(37,"form",16),f("ngSubmit",function(){return d(a),p(t.copyConfig())}),n(38,"h2"),o(39,"Restore"),i(),n(40,"p",10),o(41," Replace the current configuration with a backup from the server. "),i(),C(42,me,6,1,"div",11)(43,fe,3,0,"ng-template",null,1,T),n(45,"div",12),h(46,"mat-divider",13),n(47,"button",14),o(48," Restore "),i()()()(),n(49,"div",17)(50,"h2"),o(51,"Advanced"),i(),n(52,"div",18)(53,"div",19)(54,"p"),o(55,"Download the active configuration to a file."),i()(),n(56,"div",20)(57,"button",21),f("click",function(){return d(a),p(t.downloadJsonConfig())}),o(58," Download "),i()(),n(59,"div",22)(60,"p"),o(61," Select a configuration file to upload. The file must be a valid KIP configuration file of JSON format. "),i()(),n(62,"div",23)(63,"input",24,3),f("change",function(u){return d(a),p(t.uploadJsonConfig(u))}),i(),n(65,"button",25),f("click",function(){d(a);let u=_(64);return p(u.click())}),o(66," Upload "),i()(),n(67,"div",26)(68,"p"),o(69," Load the demonstration configuration and connection to Signal K demo server. WARNING: This will completely reset all your settings. "),i()(),n(70,"div",27)(71,"button",21),f("click",function(){return d(a),p(t.loadDemoConfig())}),o(72," Demo "),i()(),n(73,"div",28)(74,"p"),o(75," Reset all your settings to default. The default configuration has a single Getting Started instruction widget. Your Signal K server connection settings will remain. "),i()(),n(76,"div",29)(77,"button",21),f("click",function(){return d(a),p(t.resetConfigToDefault())}),o(78," Default "),i()(),n(79,"div",30)(80,"p"),o(81," Clear the current connection configuration. This only affects Connectivity tab settings. "),i()(),n(82,"div",31)(83,"button",21),f("click",function(){return d(a),p(t.resetConnectionToDefault())}),o(84," Connection "),i()()()()()()}if(l&2){let a=_(10),s=_(17),u=_(24);g("pageTitle",t.pageTitle),c(15),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.hasToken||!a.valid),c(9),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.hasToken||!u.valid),c(3),g("formGroup",t.copyConfigForm),c(5),g("ngIf",t.hasToken)("ngIfElse",s),c(5),g("disabled",!t.copyConfigForm.valid)}},dependencies:[N,F,Y,B,R,W,q,H,U,J,te,A,X,Q,ie,ne,Z,D,$,G,K,oe,ee],styles:['[_nghost-%COMP%]{display:block;height:100%;width:100%}.page-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 63px);overflow-y:scroll;scroll-behavior:smooth;padding:0 24px 10px}.flex-item-copy[_ngcontent-%COMP%]{flex:2 1 41%;padding:10px 20px;border-radius:15px}.flex-item-reset[_ngcontent-%COMP%]{flex:1 1 100%;padding:10px 20px;border-radius:15px}a[_ngcontent-%COMP%]{font-size:14px}a[_ngcontent-%COMP%]:hover{text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:link, a[_ngcontent-%COMP%]:visited{color:#8ab4f8;text-decoration:none}.warningText[_ngcontent-%COMP%]{padding-left:15px}.no-token-notice[_ngcontent-%COMP%]{height:58px;contain:content;text-align:center;font-style:italic}.mat-mdc-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-right:16px;margin-left:16px}.config-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-basis:100%;flex:1;margin:0 10px}.sources-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.sources-radio-button[_ngcontent-%COMP%]{margin:5px;margin-left:0!important}.select-config[_ngcontent-%COMP%]{margin-left:0}.config-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.btn-div[_ngcontent-%COMP%]{align-self:center}.adv-btn[_ngcontent-%COMP%]{width:100%}.config-operation-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:[col-start] auto [col1-end] min-content [col2-end];grid-template-rows:[row-start] max-content [row1-end] max-content [row2-end];grid-template-areas:"download-txt download-btn" "upload-txt upload-btn" "demo-txt demo-btn" "reset-txt reset-btn" "config-txt config-btn";row-gap:20px;column-gap:10px}.upload-txt[_ngcontent-%COMP%]{grid-area:upload-txt}.upload-btn[_ngcontent-%COMP%]{grid-area:upload-btn}.download-txt[_ngcontent-%COMP%]{grid-area:download-txt}.download-btn[_ngcontent-%COMP%]{grid-area:download-btn}.demo-txt[_ngcontent-%COMP%]{grid-area:demo-txt}.demo-btn[_ngcontent-%COMP%]{grid-area:demo-btn}.reset-txt[_ngcontent-%COMP%]{grid-area:reset-txt}.reset-btn[_ngcontent-%COMP%]{grid-area:reset-btn}.config-txt[_ngcontent-%COMP%]{grid-area:config-txt}.config-btn[_ngcontent-%COMP%]{grid-area:config-btn}']})}return r})();export{Pe as SettingsConfigComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as p,p as u}from"./chunk-VYP5YLKW.js";import{Ia as i,Ld as s,Rc as c,Tc as a,m as l,na as g,o as m,sa as n}from"./chunk-AERKQXJA.js";var h="3.4.0";var C=(()=>{class o{MODE_PATH="self.environment.mode";configurableThemeColors=[{label:"Contrast",value:"contrast"},{label:"Blue",value:"blue"},{label:"Green",value:"green"},{label:"Orange",value:"orange"},{label:"Yellow",value:"yellow"},{label:"Pink",value:"pink"},{label:"Purple",value:"purple"},{label:"Grey",value:"grey"}];snackbarAppNotifications=new l;cssThemeColorRoles$=new m(null);_cssThemeColorRoles=null;_settings=n(p);_data=n(u);isNightMode=i(!1);_useAutoNightMode=s(this._settings.getAutoNightModeAsO(),{requireSync:!0});_theme=s(this._settings.getThemeNameAsO(),{requireSync:!0});_redNightMode=s(this._settings.getRedNightModeAsO(),{requireSync:!0});_environmentMode=s(this._data.subscribePath(this.MODE_PATH,"default"));appVersion=i(h);browserVersion=i("Unknown");osVersion=i("Unknown");constructor(){a(()=>{this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")}),a(()=>{let t=this._environmentMode().data.value;this._useAutoNightMode()&&(this.isNightMode.set(t==="night"),this.toggleDayNightMode())}),a(()=>{let t=this._redNightMode();c(()=>{t?this.toggleDayNightMode():this.toggleDayNightMode()})}),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue(),this.browserVersion.set(this.getBrowserVersion()),this.osVersion.set(this.getOSVersion()),console.log("*********** KIP Version Information ***********"),console.log(`** App Version: ${this.appVersion()}`),console.log(`** Browser Version: ${this.browserVersion()}`),console.log(`** OS Version: ${this.osVersion()}`),console.log("***********************************************")}sendSnackbarNotification(t,e=1e4,r=!1){this.snackbarAppNotifications.next({message:t,duration:e,silent:r})}getSnackbarAppNotifications(){return this.snackbarAppNotifications.asObservable()}readThemeCssRoleVariables(){let t=document.body,e=getComputedStyle(t),r={background:e.getPropertyValue("--mat-sys-background").trim(),cardColor:e.getPropertyValue("--kip-widget-card-background-color").trim(),blue:e.getPropertyValue("--kip-blue-color").trim(),blueDim:e.getPropertyValue("--kip-blue-dim-color").trim(),blueDimmer:e.getPropertyValue("--kip-blue-dimmer-color").trim(),green:e.getPropertyValue("--kip-green-color").trim(),greenDim:e.getPropertyValue("--kip-green-dim-color").trim(),greenDimmer:e.getPropertyValue("--kip-green-dimmer-color").trim(),grey:e.getPropertyValue("--kip-grey-color").trim(),greyDim:e.getPropertyValue("--kip-grey-dim-color").trim(),greyDimmer:e.getPropertyValue("--kip-grey-dimmer-color").trim(),orange:e.getPropertyValue("--kip-orange-color").trim(),orangeDim:e.getPropertyValue("--kip-orange-dim-color").trim(),orangeDimmer:e.getPropertyValue("--kip-orange-dimmer-color").trim(),pink:e.getPropertyValue("--kip-pink-color").trim(),pinkDim:e.getPropertyValue("--kip-pink-dim-color").trim(),pinkDimmer:e.getPropertyValue("--kip-pink-dimmer-color").trim(),purple:e.getPropertyValue("--kip-purple-color").trim(),purpleDim:e.getPropertyValue("--kip-purple-dim-color").trim(),purpleDimmer:e.getPropertyValue("--kip-purple-dimmer-color").trim(),contrast:e.getPropertyValue("--kip-contrast-color").trim(),contrastDim:e.getPropertyValue("--kip-contrast-dim-color").trim(),contrastDimmer:e.getPropertyValue("--kip-contrast-dimmer-color").trim(),yellow:e.getPropertyValue("--kip-yellow-color").trim(),yellowDim:e.getPropertyValue("--kip-yellow-dim-color").trim(),yellowDimmer:e.getPropertyValue("--kip-yellow-dimmer-color").trim(),port:e.getPropertyValue("--kip-port-color").trim(),starboard:e.getPropertyValue("--kip-starboard-color").trim(),zoneNominal:e.getPropertyValue("--kip-zone-nominal-color").trim(),zoneAlert:e.getPropertyValue("--kip-zone-alert-color").trim(),zoneWarn:e.getPropertyValue("--kip-zone-warn-color").trim(),zoneAlarm:e.getPropertyValue("--kip-zone-alarm-color").trim(),zoneEmergency:e.getPropertyValue("--kip-zone-emergency-color").trim()};this.cssThemeColorRoles$.next(r)}get cssThemeColors(){return this._cssThemeColorRoles}setBrightness(t,e=!1){let r=document.body;r.style.setProperty("--kip-nightModeBrightness",`${t}`);let d=e?" sepia(0.5) hue-rotate(-30deg)":"";r.style.setProperty("--kip-nightModeFilters",d)}toggleDayNightMode(){this.isNightMode()?this._redNightMode()?(document.body.classList.toggle("night-theme",!0),this.setBrightness(1,!1)):(this.setBrightness(this._settings.getNightModeBrightness(),!0),document.body.classList.remove("night-theme"),this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")):(document.body.classList.remove("night-theme"),this._theme()==="light-theme"&&document.body.classList.toggle("light-theme",this._theme()==="light-theme"),this.setBrightness(1,!1)),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue()}getBrowserVersion(){let t=navigator.userAgent,e="Unknown";return t.includes("Edg")?e=`Edge ${t.match(/Edg\/(\d+)/)?.[1]}`:t.includes("Chrome")&&!t.includes("Edg")&&!t.includes("Chromium")?e=`Chrome ${t.match(/Chrome\/(\d+)/)?.[1]}`:t.includes("Chromium")?e=`Chromium ${t.match(/Chromium\/(\d+)/)?.[1]}`:t.includes("Firefox")?e=`Firefox ${t.match(/Firefox\/(\d+)/)?.[1]}`:t.includes("Safari")&&!t.includes("Chrome")&&!t.includes("Chromium")?e=`Safari ${t.match(/Version\/(\d+)/)?.[1]}`:(t.includes("Opera")||t.includes("OPR"))&&(e=`Opera ${t.match(/(Opera|OPR)\/(\d+)/)?.[2]}`),e}getOSVersion(){let t=navigator.platform,e=navigator.userAgent;return t.startsWith("Mac")?"macOS":t.startsWith("Win")?"Windows":/Linux/.test(t)?e.includes("ARM")||e.includes("aarch64")||e.includes("Raspberry")||t.includes("armv7l")||t.includes("armv8l")?"Raspberry Pi":"Linux":"Unknown OS"}static \u0275fac=function(e){return new(e||o)};static \u0275prov=g({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();export{C as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{q as Ze,r as Je,u as et}from"./chunk-
|
|
1
|
+
import{q as Ze,r as Je,u as et}from"./chunk-PYQ6T3Y3.js";import{A as $e,B as Xe,v as qe,w as Qe,z as Ue}from"./chunk-VYP5YLKW.js";import{$c as Q,Aa as be,Bb as we,Ca as ne,Db as E,E as _e,Gc as De,Ha as ve,Hc as q,Ia as H,J as j,K as te,Ma as Me,Pa as Y,Q as ye,Qb as C,Rb as w,Re as Be,Sb as O,Se as je,Vc as ke,Ve as de,Xb as _,Yb as c,Yd as Ie,Zb as d,Zd as Ee,_b as A,af as me,bf as pe,cc as re,cf as Ge,dc as Oe,dd as m,ea as ie,ec as x,ed as le,ee as Ae,fa as ae,fc as h,ga as k,gc as S,ge as V,gf as He,hc as u,he as L,ic as K,ie as Re,if as Ye,jc as R,kb as l,kc as f,ke as Fe,lc as g,le as ce,m as D,ne as Le,nf as ze,oa as G,ob as Ce,oe as N,pc as xe,qa as v,qd as Te,rc as y,re as Pe,sa as o,tc as Se,uc as F,uf as Ke,vb as M,vc as oe,wb as z,wc as se,we as Ve,xe as Ne,ya as T,z as ee,za as I,ze as We}from"./chunk-AERKQXJA.js";var lt=["*",[["mat-option"],["ng-container"]]],ct=["*","mat-option, ng-container"],dt=["text"],mt=[[["mat-icon"]],"*"],pt=["mat-icon","*"];function ht(a,s){if(a&1&&A(0,"mat-pseudo-checkbox",1),a&2){let e=h();_("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function ut(a,s){if(a&1&&A(0,"mat-pseudo-checkbox",3),a&2){let e=h();_("disabled",e.disabled)}}function ft(a,s){if(a&1&&(c(0,"span",4),F(1),d()),a&2){let e=h();l(),se("(",e.group.label,")")}}var W=new v("MAT_OPTION_PARENT_COMPONENT"),B=new v("MatOptgroup"),tt=(()=>{class a{label;disabled=!1;_labelId=o(V).getId("mat-optgroup-label-");_inert;constructor(){let e=o(W,{optional:!0});this._inert=e?.inertGroups??!1}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=M({type:a,selectors:[["mat-optgroup"]],hostAttrs:[1,"mat-mdc-optgroup"],hostVars:3,hostBindings:function(t,i){t&2&&C("role",i._inert?null:"group")("aria-disabled",i._inert?null:i.disabled.toString())("aria-labelledby",i._inert?null:i._labelId)},inputs:{label:"label",disabled:[2,"disabled","disabled",m]},exportAs:["matOptgroup"],features:[q([{provide:B,useExisting:a}])],ngContentSelectors:ct,decls:5,vars:4,consts:[["role","presentation",1,"mat-mdc-optgroup-label",3,"id"],[1,"mdc-list-item__primary-text"]],template:function(t,i){t&1&&(S(lt),c(0,"span",0)(1,"span",1),F(2),u(3),d()(),u(4,1)),t&2&&(y("mdc-list-item--disabled",i.disabled),_("id",i._labelId),l(2),se("",i.label," "))},styles:[`.mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return a})(),U=class{source;isUserInput;constructor(s,e=!1){this.source=s,this.isUserInput=e}},P=(()=>{class a{_element=o(Y);_changeDetectorRef=o(Q);_parent=o(W,{optional:!0});group=o(B,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=o(V).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=H(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new E;_text;_stateChanges=new D;constructor(){let e=o(Ie);e.load(Ne),e.load(Ee),this._signalDisableRipple=!!this._parent&&ve(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,t){let i=this._getHostElement();typeof i.focus=="function"&&i.focus(t)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!L(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new U(this,e))}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=M({type:a,selectors:[["mat-option"]],viewQuery:function(t,i){if(t&1&&R(dt,7),t&2){let n;f(n=g())&&(i._text=n.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(t,i){t&1&&x("click",function(){return i._selectViaInteraction()})("keydown",function(r){return i._handleKeydown(r)}),t&2&&(Oe("id",i.id),C("aria-selected",i.selected)("aria-disabled",i.disabled.toString()),y("mdc-list-item--selected",i.selected)("mat-mdc-option-multiple",i.multiple)("mat-mdc-option-active",i.active)("mdc-list-item--disabled",i.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",m]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:pt,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(t,i){t&1&&(S(mt),w(0,ht,1,2,"mat-pseudo-checkbox",1),u(1),c(2,"span",2,0),u(4,1),d(),w(5,ut,1,1,"mat-pseudo-checkbox",3),w(6,ft,2,1,"span",4),A(7,"div",5)),t&2&&(O(i.multiple?0:-1),l(5),O(!i.multiple&&i.selected&&!i.hideSingleSelectionIndicator?5:-1),l(),O(i.group&&i.group._inert?6:-1),l(),_("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},dependencies:[Ze,Ve],styles:[`.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}
|
|
3
3
|
`],encapsulation:2,changeDetection:0})}return a})();function ue(a,s,e){if(e.length){let t=s.toArray(),i=e.toArray(),n=0;for(let r=0;r<a+1;r++)t[r].group&&t[r].group===i[n]&&n++;return n}return 0}function fe(a,s,e,t){return a<e?a:a+s>e+t?Math.max(0,a-t+s):e}var gt=["mat-internal-form-field",""],_t=["*"],Qt=(()=>{class a{labelPosition;static \u0275fac=function(t){return new(t||a)};static \u0275cmp=M({type:a,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(t,i){t&2&&y("mdc-form-field--align-end",i.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:gt,ngContentSelectors:_t,decls:1,vars:0,template:function(t,i){t&1&&(S(),u(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
|
|
4
4
|
`],encapsulation:2,changeDetection:0})}return a})();var Z=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=z({type:a});static \u0275inj=G({imports:[We,N,Je,P]})}return a})();var Ct=["trigger"],wt=["panel"],Ot=[[["mat-select-trigger"]],"*"],xt=["mat-select-trigger","*"];function St(a,s){if(a&1&&(c(0,"span",4),F(1),d()),a&2){let e=h();l(),oe(e.placeholder)}}function Dt(a,s){a&1&&u(0)}function kt(a,s){if(a&1&&(c(0,"span",11),F(1),d()),a&2){let e=h(2);l(),oe(e.triggerValue)}}function Tt(a,s){if(a&1&&(c(0,"span",5),w(1,Dt,1,0)(2,kt,2,1,"span",11),d()),a&2){let e=h();l(),O(e.customTrigger?1:2)}}function It(a,s){if(a&1){let e=re();c(0,"div",12,1),x("keydown",function(i){T(e);let n=h();return I(n._handleKeydown(i))}),u(2,1),d()}if(a&2){let e=h();Se(De("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),y("mat-select-panel-animations-enabled",!e._animationsDisabled),_("ngClass",e.panelClass),C("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var ge=new v("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let a=o(ne);return()=>de(a)}});function nt(a){let s=o(ne);return()=>de(s)}var rt=new v("MAT_SELECT_CONFIG"),ot={provide:ge,deps:[],useFactory:nt},st=new v("MatSelectTrigger"),J=class{source;value;constructor(s,e){this.source=s,this.value=e}},Et=(()=>{class a{_viewportRuler=o(Be);_changeDetectorRef=o(Q);_elementRef=o(Y);_dir=o(Le,{optional:!0});_idGenerator=o(V);_renderer=o(Ce);_parentFormField=o(Qe,{optional:!0});ngControl=o(Ye,{self:!0,optional:!0});_liveAnnouncer=o(Ae);_defaultOptions=o(rt,{optional:!0});_animationsDisabled=Pe();_initialized=new D;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,n=ue(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&n===1?i.scrollTop=0:i.scrollTop=fe(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new J(this,e)}_scrollStrategyFactory=o(ge);_panelOpen=!1;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new D;_errorStateTracker;stateChanges=new D;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=H(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(He.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=_e(()=>{let e=this.options;return e?e.changes.pipe(ie(e),ae(()=>j(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(ae(()=>this.optionSelectionChanges))});openedChange=new E;_openedStream=this.openedChange.pipe(te(e=>e),ee(()=>{}));_closedStream=this.openedChange.pipe(te(e=>!e),ee(()=>{}));selectionChange=new E;valueChange=new E;constructor(){let e=o($e),t=o(ze,{optional:!0}),i=o(Ke,{optional:!0}),n=o(new ke("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Xe(e,this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=n==null?0:parseInt(n)||0,this.id=this.id}ngOnInit(){this._selectionModel=new et(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(k(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(k(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(ie(null),k(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby")}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(ye(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&ce(this._trackedModal,"aria-owns",t),Fe(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;ce(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",n=>{n.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,n=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&n&&!L(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let b=this.selected;r.onKeydown(e);let p=this.selected;p&&b!==p&&this._liveAnnouncer.announce(p.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,n=i===40||i===38,r=t.isTyping();if(n&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!L(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let b=this.options.some(p=>!p.disabled&&!p.selected);this.options.forEach(p=>{p.disabled||(b?p.select():p.deselect())})}else{let b=t.activeItemIndex;t.onKeydown(e),this._multiple&&n&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==b&&t.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!L(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else{let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return!1;try{return(i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch{return!1}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof me?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Re(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=j(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(k(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),j(...this.options.map(t=>t._stateChanges)).pipe(k(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next()}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=M({type:a,selectors:[["mat-select"]],contentQueries:function(t,i,n){if(t&1&&(K(n,st,5),K(n,P,5),K(n,B,5)),t&2){let r;f(r=g())&&(i.customTrigger=r.first),f(r=g())&&(i.options=r),f(r=g())&&(i.optionGroups=r)}},viewQuery:function(t,i){if(t&1&&(R(Ct,5),R(wt,5),R(pe,5)),t&2){let n;f(n=g())&&(i.trigger=n.first),f(n=g())&&(i.panel=n.first),f(n=g())&&(i._overlayDir=n.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:19,hostBindings:function(t,i){t&1&&x("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(C("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),y("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",m],disableRipple:[2,"disableRipple","disableRipple",m],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:le(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",m],placeholder:"placeholder",required:[2,"required","required",m],multiple:[2,"multiple","multiple",m],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",m],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",le],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",m]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[q([{provide:qe,useExisting:a},{provide:W,useExisting:a}]),Me],ngContentSelectors:xt,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(t,i){if(t&1){let n=re();S(Ot),c(0,"div",2,0),x("click",function(){return T(n),I(i.open())}),c(3,"div",3),w(4,St,2,1,"span",4)(5,Tt,3,1,"span",5),d(),c(6,"div",6)(7,"div",7),be(),c(8,"svg",8),A(9,"path",9),d()()()(),we(10,It,3,10,"ng-template",10),x("detach",function(){return T(n),I(i.close())})("backdropClick",function(){return T(n),I(i.close())})("overlayKeydown",function(b){return T(n),I(i._handleOverlayKeydown(b))})}if(t&2){let n=xe(1);l(3),C("id",i._valueId),l(),O(i.empty?4:5),l(6),_("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||n)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[me,pe,Te],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|