1(self.webpackChunkESI_Portal=self.webpackChunkESI_Portal||[]).push([[699],{8035:(F,Z,s)=>{"use strict";s.d(Z,{t:()=>Q});var e=s(4650),l=s(7947),_=s(6228),D=s(209),T=s.n(D),I=s(4209),w=s(2402),x=s(6895),C=s(4006);const u=["dateInput"];function E(O,P){if(1&O){const c=e.EpF();e.TgZ(0,"input",3),e.NdJ("ngModelChange",function(f){return e.CHM(c),e.oxw().time=f})("ngModelChange",function(){return e.CHM(c),e.oxw().onChangeDateTimeDebounced()}),e.qZA()}if(2&O){const c=e.oxw();e.Q6J("disabled",c.disabled)("ngModel",c.time)("name",c.name+"-time")}}const y=function(O){return{invalid:O}},N=function(){return{dateInputFormat:"DD-MM-YYYY"}};let Q=(()=>{class O extends l.H{constructor(c){super(c),this._glService=c,this.disabled=!1,this.invalid=!1,this.name="",this.dateOnly=!1,this.utc=!0,this.value="",this.max=null,this.changedValue=new e.vpe,this.date=null,this.time=null,this.datepickerOpen=!1,this.datepickerDate=null,this.onChangeDateTimeDebounced=null,this.dayjs=_.ZP,this.prevValue=null}get datepickerValue(){return this.value?this.utc?this.dayjs(this.value).utc(!1).add((new Date).getTimezoneOffset(),"minutes").toDate():this.dayjs(this.value).toDate():null}ngOnInit(){this.onChangeDateTimeDebounced=T()(this.onChangeDateTime,500),this.value&&this.setDatepickerValue()}ngOnChanges(c){c.value&&this.setDateTime()}onChangeDateTime(){let c=(0,_.mx)(this.date,["DD-MM-YYYY","D-M-YYYY"]),v=(0,_.ZP)(this.time,"HH:mm",!1),f=null;this.dateOnly?c.isValid()?(f=(0,_.ZP)(`${c.format("DD-MM-YYYY")}`,"DD-MM-YYYY"),this.utc&&(f=f.utc(!0)),f=f.format()):f="Invalid Date":c.isValid()?(f=v.isValid()?(0,_.ZP)(`${c.format("DD-MM-YYYY")} ${v.format("HH:mm")}`,"DD-MM-YYYY HH:mm"):(0,_.ZP)(`${c.format("DD-MM-YYYY")}`,"DD-MM-YYYY"),this.utc&&(f=f.utc(!0)),f=f.format()):f="Invalid Date",this.emitChanges(f)}setDatepickerValue(){this.datepickerDate=this.datepickerValue}setDateTime(){if(!this.value)return this.date="",void(this.time="");let v=(0,_.ZP)(this.value);this.utc&&(v=_.ZP.utc(this.value)),v.isValid()&&(this.time=v.format("HH:mm"),this.date=v.format("DD-MM-YYYY"))}updateFromDatepicker(c){this.date=this.utc?(0,_.ZP)(c).utc(!0).format("DD-MM-YYYY"):(0,_.ZP)(c).format("DD-MM-YYYY"),this.onChangeDateTimeDebounced(),this.datepickerOpen=!1}registerOnTouched(c){this.onTouched=()=>null}registerOnChange(c){this.onChange=c}registerOnKeyUp(){this.onKeyup=c=>{}}setDisabledState(c){this.disabled=c}emitChanges(c){null===this.prevValue&&"Invalid Date"===c.toString()||(this.changedValue.emit(c),this.prevValue=c)}}return O.\u0275fac=function(c){return new(c||O)(e.Y36(I.U))},O.\u0275cmp=e.Xpm({type:O,selectors:[["DateTimeInput"]],viewQuery:function(c,v){if(1&c&&e.Gf(u,5),2&c){let f;e.iGM(f=e.CRH())&&(v.dateInput=f.first)}},inputs:{disabled:"disabled",invalid:"invalid",name:"name",dateOnly:"dateOnly",utc:"utc",value:"value",max:"max"},outputs:{changedValue:"changedValue"},features:[e.qOj,e.TTD],decls:3,vars:11,consts:[[1,"dateinput-container"],["type","text","readonly","","bsDatepicker","",3,"bsValue","disabled","ngClass","name","placeholder","bsConfig","maxDate","bsValueChange"],["class","smaller-input","type","text","placeholder","hh:mm",3,"disabled","ngModel","name","ngModelChange",4,"ngIf"],["type","text","placeholder","hh:mm",1,"smaller-input",3,"disabled","ngModel","name","ngModelChange"]],template:function(c,v){1&c&&(e.TgZ(0,"div",0)(1,"input",1),e.NdJ("bsValueChange",function(Y){return v.updateFromDatepicker(Y)}),e.qZA(),e.YNc(2,E,1,3,"input",2),e.qZA()),2&c&&(e.xp6(1),e.Q6J("bsValue",v.datepickerDate)("disabled",v.disabled)("ngClass",e.VKq(8,y,v.invalid))("name",v.name+"-date")("placeholder",v.config.dateFormat)("bsConfig",e.DdM(10,N))("maxDate",v.max?v.max:null),e.xp6(1),e.Q6J("ngIf",!v.dateOnly))},directives:[w.Y5,w.Np,x.mk,x.O5,C.Fj,C.JJ,C.On],styles:[".dateinput-container[_ngcontent-%COMP%]{display:inline-flex;position:relative}.dateinput-container[_ngcontent-%COMP%] bs-datepicker-inline[_ngcontent-%COMP%]{position:absolute;z-index:2;top:30px;left:0}.smaller-input[_ngcontent-%COMP%]{margin-left:5px}"]}),O})()},5724:(F,Z,s)=>{"use strict";s.d(Z,{F:()=>j});var e=s(4650),l=s(4002),_=s(6895),D=s(4687),T=s(388);const I=["form"];function w(a,m){if(1&a&&(e.ynx(0),e.TgZ(1,"h3"),e._uU(2),e.qZA(),e._UZ(3,"hr"),e.BQk()),2&a){const n=e.oxw(2);e.xp6(2),e.Oqu(n.headerName?n.headerName:n.deviceTemplate.name)}}function x(a,m){if(1&a){const n=e.EpF();e.ynx(0),e.TgZ(1,"app-device-form",5,6),e.NdJ("validated",function(g){e.CHM(n);const M=e.oxw(2);return M.saveDevice(g,M.deviceModal)}),e.qZA(),e.BQk()}if(2&a){const n=e.oxw(2);e.xp6(1),e.Q6J("disabled",n.disabled)("initialDevice",n.shownDevice)}}function C(a,m){if(1&a&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&a){const n=e.oxw(3);e.xp6(1),e.hij(" No ",n.deviceTemplate.name.toLowerCase()," added yet. ")}}function u(a,m){1&a&&e.GkF(0)}function E(a,m){if(1&a){const n=e.EpF();e.TgZ(0,"div",13),e.NdJ("click",function(g){e.CHM(n);const M=e.oxw().$implicit;return e.oxw(4).deleteDevice(M),g.preventDefault()}),e._uU(1," Delete "),e.qZA()}}const y=function(a,m){return{$implicit:a,index:m}};function N(a,m){if(1&a){const n=e.EpF();e.TgZ(0,"div",9)(1,"div",10)(2,"div",11),e._uU(3),e.qZA(),e.YNc(4,u,1,0,"ng-container",12),e.TgZ(5,"div")(6,"div",13),e.NdJ("click",function(g){const A=e.CHM(n).$implicit;return e.oxw(4).viewDevice(A),g.preventDefault()}),e._uU(7," View "),e.qZA(),e.YNc(8,E,2,0,"div",14),e.qZA()()()}if(2&a){const n=m.$implicit,d=m.index,g=e.oxw(4),M=e.MAs(3);e.xp6(3),e.Oqu(n.identifier),e.xp6(1),e.Q6J("ngTemplateOutlet",M)("ngTemplateOutletContext",e.WLB(4,y,n,d)),e.xp6(4),e.Q6J("ngIf",!g.disabled)}}function Q(a,m){if(1&a&&e.YNc(0,N,9,7,"div",8),2&a){const n=e.oxw(3);e.Q6J("ngForOf",n.devices)}}function O(a,m){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const n=e.oxw(4);e.xp6(1),e.hij("You've reached the maximum of ",n.deviceTemplate.maxDeviceAmount," items.")}}function P(a,m){if(1&a){const n=e.EpF();e.ynx(0),e.TgZ(1,"button",15),e.NdJ("click",function(g){return e.CHM(n),e.oxw(3).addDevice(g),g.preventDefault()}),e._uU(2),e.qZA(),e.YNc(3,O,2,1,"span",0),e.BQk()}if(2&a){const n=e.oxw(3);e.xp6(1),e.Q6J("disabled",!n.canAdd),e.xp6(1),e.hij(" Add ",n.deviceTemplate.name," "),e.xp6(1),e.Q6J("ngIf",!n.canAdd)}}function c(a,m){if(1&a&&(e.YNc(0,C,2,1,"p",3),e.YNc(1,Q,1,1,"ng-template",null,7,e.W1O),e.YNc(3,P,4,3,"ng-container",0)),2&a){const n=e.MAs(2),d=e.oxw(2);e.Q6J("ngIf",0===d.devices.length)("ngIfElse",n),e.xp6(3),e.Q6J("ngIf",!d.disabled)}}function v(a,m){if(1&a&&(e.TgZ(0,"div"),e.YNc(1,w,4,1,"ng-container",0),e.YNc(2,x,3,2,"ng-container",3),e.YNc(3,c,4,3,"ng-template",null,4,e.W1O),e.qZA()),2&a){const n=e.MAs(4),d=e.oxw();e.xp6(1),e.Q6J("ngIf",d.showHeader),e.xp6(1),e.Q6J("ngIf",d.isSingleDevice)("ngIfElse",n)}}function f(a,m){if(1&a){const n=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){return e.CHM(n),e.oxw(),e.MAs(6).validateAndEmit()}),e._uU(1),e.qZA()}if(2&a){const n=e.oxw(3);e.xp6(1),e.AsE(" ",n.addOrEditAction?n.disabled?"View":"Edit":"Add"," ",n.deviceTemplate.name," ")}}function Y(a,m){if(1&a){const n=e.EpF();e.TgZ(0,"div",20)(1,"div",21)(2,"h3",22),e._uU(3),e.qZA()(),e.TgZ(4,"div",23)(5,"app-device-form",5,6),e.NdJ("validated",function(g){e.CHM(n),e.oxw();const M=e.MAs(1);return e.oxw().saveDevice(g,M)}),e.qZA()(),e.TgZ(7,"div",24),e.YNc(8,f,2,2,"button",25),e.TgZ(9,"button",26),e.NdJ("click",function(g){e.CHM(n),e.oxw();const M=e.MAs(1);return e.oxw().cancelEdit(M),g.preventDefault()}),e._uU(10),e.qZA()()()}if(2&a){const n=e.oxw(2);e.xp6(3),e.AsE("",n.disabled?"":n.addOrEditAction," ",n.shownDevice.name,""),e.xp6(2),e.Q6J("disabled",n.disabled)("initialDevice",n.shownDevice),e.xp6(3),e.Q6J("ngIf",!n.disabled),e.xp6(2),e.hij(" ",n.disabled?"Close":"Cancel"," ")}}const B=function(){return{show:!0}};function k(a,m){if(1&a){const n=e.EpF();e.TgZ(0,"div",16,17),e.NdJ("onHidden",function(){return e.CHM(n),e.oxw().showDeviceModal=!1}),e.TgZ(2,"div",18),e.YNc(3,Y,11,6,"div",19),e.qZA()()}if(2&a){const n=e.oxw();
1e.Q6J("config",e.DdM(2,B)),e.xp6(3),e.Q6J("ngIf",n.shownDevice)}}function H(a,m){if(1&a&&(e.ynx(0),e.TgZ(1,"tr")(2,"td",30),e._uU(3,"EIAPP Certificate Number"),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA()(),e.TgZ(6,"tr")(7,"td",30),e._uU(8,"Engine type"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA()(),e.BQk()),2&a){const n=e.oxw().$implicit;e.xp6(5),e.Oqu(n.getValueByName("EIAPPCErtificateNumber")),e.xp6(5),e.Oqu(n.getValueByName("FuelConfiguration"))}}function q(a,m){if(1&a&&(e.ynx(0),e.TgZ(1,"tr")(2,"td",30),e._uU(3,"Fuel Type"),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA()(),e.TgZ(6,"tr")(7,"td",30),e._uU(8,"Power generation capacity"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA()(),e.BQk()),2&a){const n=e.oxw().$implicit;e.xp6(5),e.Oqu(n.getValueByName("FuelType")),e.xp6(5),e.hij("",n.getValueByName("PowerGenerationCapacity")," kW")}}function S(a,m){if(1&a&&(e.ynx(0),e.TgZ(1,"tr")(2,"td",30),e._uU(3,"Boiler Fuel Type"),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA()(),e.BQk()),2&a){const n=e.oxw().$implicit;e.xp6(5),e.Oqu(n.getValueByName("BoilerFuelType"))}}function L(a,m){if(1&a&&(e.ynx(0),e.TgZ(1,"tr")(2,"td",30),e._uU(3,"Type"),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA()(),e.TgZ(6,"tr")(7,"td",30),e._uU(8,"Cause"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA()(),e.BQk()),2&a){const n=e.oxw().$implicit;e.xp6(5),e.Oqu(n.getValueByName("Type")),e.xp6(5),e.Oqu(n.getValueByName("Cause"))}}function $(a,m){if(1&a&&(e.ynx(0),e.TgZ(1,"tr")(2,"td",30),e._uU(3),e.qZA()(),e.BQk()),2&a){const n=e.oxw().index;e.xp6(3),e.hij("OPS Hatch ",n+1,"")}}function K(a,m){if(1&a&&(e.TgZ(0,"table"),e.ynx(1,28),e.YNc(2,H,11,2,"ng-container",29),e.YNc(3,q,11,2,"ng-container",29),e.YNc(4,S,6,1,"ng-container",29),e.YNc(5,L,11,2,"ng-container",29),e.YNc(6,$,4,1,"ng-container",29),e.BQk(),e.qZA()),2&a){const n=m.$implicit;e.xp6(1),e.Q6J("ngSwitch",n.abbreviation),e.xp6(1),e.Q6J("ngSwitchCase","DG"),e.xp6(1),e.Q6J("ngSwitchCase","FC"),e.xp6(1),e.Q6J("ngSwitchCase","BO"),e.xp6(1),e.Q6J("ngSwitchCase","ISS"),e.xp6(1),e.Q6J("ngSwitchCase","OPS")}}let j=(()=>{class a{constructor(){this.existingDevices=[],this.showHeader=!0,this.deletedFilterStatus=l.Lh.Deleted,this.headerName=null,this.disabled=!1,this.deviceUpdate=new e.vpe,this.showDeviceModal=!1,this.shownDevice=null,this.addOrEditAction="Add"}get devices(){return this.existingDevices?this.existingDevices.filter(n=>n.name===this.deviceTemplate.name&&n.feStatus!==this.deletedFilterStatus).sort((n,d)=>n.getNumberFromIdentifier()-d.getNumberFromIdentifier()):[]}get canAdd(){const n=this.deviceTemplate.maxDeviceAmount;return null===n||0===n||this.existingDevices.length<n}get isSingleDevice(){return this.deviceTemplate&&1===this.deviceTemplate.maxDeviceAmount}ngOnInit(){if(this.isSingleDevice)if(0===this.devices.length)this.addDevice(!1);else{const n=new l.AS(this.devices[0]);n.feStatus=l.Lh.Updated,this.shownDevice=n}}singleDeviceValidate(){this.form.validateAndEmit()}deleteDevice(n){const d=new l.AS(n);d.feStatus=l.Lh.Deleted,this.saveDevice(d)}addDevice(n=!0){const d=new l.AS(this.deviceTemplate,!0);let g;if(this.devices.length)try{g=`${this.deviceTemplate.abbreviation}${this.devices[this.devices.length-1].getNumberFromIdentifier()+1}`}catch{g=`${this.deviceTemplate.abbreviation}${this.devices[this.devices.length+1]}`}else g=this.deviceTemplate.abbreviation+"1";d.identifier=g,d.feStatus=l.Lh.Added,this.viewDevice(d,n),this.addOrEditAction="Add"}viewDevice(n,d=!0){this.shownDevice=n,this.shownDevice.feStatus===l.Lh.Unchanged&&(this.shownDevice.feStatus=l.Lh.Updated),d&&(this.showDeviceModal=!0),this.addOrEditAction="Edit"}saveDevice(n,d){n.feStatus!==l.Lh.Deleted?n.valid&&(this.deviceUpdate.emit(n),d&&d.hide(),this.shownDevice=null):this.deviceUpdate.emit(n)}cancelEdit(n){n.hide(),this.shownDevice=null}}return a.\u0275fac=function(n){return new(n||a)},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-device-crud"]],viewQuery:function(n,d){if(1&n&&e.Gf(I,5),2&n){let g;e.iGM(g=e.CRH())&&(d.form=g.first)}},inputs:{deviceTemplate:"deviceTemplate",existingDevices:"existingDevices",showHeader:"showHeader",deletedFilterStatus:"deletedFilterStatus",headerName:"headerName",disabled:"disabled"},outputs:{deviceUpdate:"deviceUpdate"},decls:4,vars:2,consts:[[4,"ngIf"],["bsModal","","class","modal fade","tabindex","-1","role","dialog","aria-labelledby","dialog-auto-name",3,"config","onHidden",4,"ngIf"],["preview",""],[4,"ngIf","ngIfElse"],["crud",""],[3,"disabled","initialDevice","validated"],["form",""],["deviceList",""],["class","",4,"ngFor","ngForOf"],[1,""],[1,"device-preview"],[1,"d-id"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"button-esi","main","button-esi--aw",3,"click"],["class","button-esi main button-esi--aw",3,"click",4,"ngIf"],[1,"button-esi","main","mt-2","mb-5",3,"disabled","click"],["bsModal","","tabindex","-1","role","dialog","aria-labelledby","dialog-auto-name",1,"modal","fade",3,"config","onHidden"],["deviceModal","bs-modal"],[1,"modal-dialog","modal
1-xl"],["class","modal-content",4,"ngIf"],[1,"modal-content"],[1,"modal-header"],[1,"m-0"],[1,"modal-body"],[1,"modal-footer","d-flex","justify-content-lg-start"],["class","button-esi main button-esi--aw","type","button",3,"click",4,"ngIf"],["type","button",1,"button-esi","cancel-link","button-esi--aw",3,"click"],["type","button",1,"button-esi","main","button-esi--aw",3,"click"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"d-preview-title"]],template:function(n,d){1&n&&(e.YNc(0,v,5,3,"div",0),e.YNc(1,k,4,3,"div",1),e.YNc(2,K,7,6,"ng-template",null,2,e.W1O)),2&n&&(e.Q6J("ngIf",d.deviceTemplate),e.xp6(1),e.Q6J("ngIf",d.showDeviceModal))},directives:[_.O5,D.p,_.sg,_.tP,T.oB,_.RF,_.n9],styles:[".device-preview[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;border:1px solid black;border-radius:5px;padding:15px;margin-bottom:20px}.device-preview[_ngcontent-%COMP%] .d-id[_ngcontent-%COMP%]{font-size:25px}.device-preview[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:70%;max-width:600px}.device-preview[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] .d-preview-title[_ngcontent-%COMP%]{font-weight:600}.device-preview[_ngcontent-%COMP%] table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:15px;padding-bottom:10px;width:300px}"]}),a})()},4687:(F,Z,s)=>{"use strict";s.d(Z,{p:()=>R});var e=s(4650),l=s(4002),_=s(7940),D=s(5637),T=s(8778),I=s(7947),w=s(4209),x=s(4835),C=s(3285),u=s(6895),E=s(4006),y=s(6228),N=s(8035);const Q=["input"],O=["dateInput"],P=function(o){return{invalid:o}};function c(o,p){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",6,7),e.NdJ("keyup",function(r){return e.CHM(t),e.oxw(2).emitChanges(r)}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("disabled",t.disabled)("ngClass",e.VKq(5,P,t.invalid))("name",t.propFormName)("disabled",t.isIdentifierProp||!!t.prop.computedFormula)("value",t.value?t.value:"")}}function v(o,p){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",8,7),e.NdJ("keyup",function(r){return e.CHM(t),e.oxw(2).emitChanges(r)}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("disabled",t.disabled)("ngClass",e.VKq(5,P,t.invalid))("name",t.propFormName)("disabled",t.isIdentifierProp||!!t.prop.computedFormula||t.disabled)("value",t.value?t.value:"")}}function f(o,p){if(1&o&&(e.ynx(0)(1,1),e.YNc(2,c,3,7,"ng-container",2),e.YNc(3,v,3,7,"ng-container",5),e.BQk()()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngSwitch",t.prop.dataType),e.xp6(1),e.Q6J("ngSwitchCase",t.dataType.Time)}}function Y(o,p){if(1&o&&(e.TgZ(0,"option",10),e._uU(1),e.qZA()),2&o){const t=p.$implicit,i=e.oxw(2);e.Q6J("value",i.cleanRegexEscapeChars(t)),e.xp6(1),e.hij(" ",i.cleanRegexEscapeChars(t)," ")}}function B(o,p){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"select",9),e.NdJ("change",function(r){return e.CHM(t),e.oxw().emitChanges(r)}),e.TgZ(2,"option",10),e._uU(3,"Select value"),e.qZA(),e.YNc(4,Y,2,2,"option",11),e.qZA(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngClass",e.VKq(6,P,t.invalid))("disabled",t.disabled)("name",t.propFormName)("value",t.value),e.xp6(1),e.Q6J("value",null),e.xp6(2),e.Q6J("ngForOf",t.prop.possibleValues)}}function k(o,p){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"DateTimeInput",12),e.NdJ("changedValue",function(r){return e.CHM(t),e.oxw().emitChanges(null,r)}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("value",t.value)("dateOnly",!0)}}function H(o,p){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",13),e.NdJ("change",function(r){return e.CHM(t),e.oxw().emitChanges(r)}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngClass",e.VKq(4,P,t.invalid))("disabled",t.disabled)("name",t.propFormName)("checked",1==t.value||!0===t.value||"true"===t.value)}}function q(o,p){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"div")(2,"input",16),e.NdJ("change",function(r){const b=e.CHM(t).$implicit;return e.oxw(2).emitChanges(r,b)}),e.qZA(),e.TgZ(3,"span",17),e._uU(4),e.qZA()(),e.BQk()}if(2&o){const t=p.$implicit,i=e.oxw(2);e.xp6(2),e.Q6J("ngClass",e.VKq(6,P,i.invalid))("disabled",i.disabled)("name",i.prop.name+"-"+i.nameExtension)("value",t)("checked",i.value==t),e.xp6(2),e.Oqu(t)}}function S(o,p){if(1&o&&(e.ynx(0),e.TgZ(1,"div",14),e.YNc(2,q,5,8,"ng-container",15),e.qZA(),e.BQk()),2&o){const t=e.oxw();e.xp6(2),e.Q6J("ngForOf",t.prop.possibleValues)}}function L(o,p){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"DateTimeInput",18),e.NdJ("changedValue",function(r){return e.CHM(t),e.oxw().emitChanges(null,r)}
1),e.qZA(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("value",t.value)("utc",!0)}}function $(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const r=e.oxw();return r.emitInfoModal(r.prop)}),e._uU(1,"i"),e.qZA()}}let K=(()=>{class o{constructor(){this.disabled=!1,this.invalid=!1,this.showInfoModal=new e.vpe,this.config=T.e,this.value=null,this.timeValue=null,this.datepickerOpen=!1,this.nameExtension=null,this.dayjs=y.ZP,this.dataType=l.Q4,this.feComp=l.oq}onStepUp(t){}get isIdentifierProp(){return"identifier"===this.prop.name.toLowerCase()}setDate(t){this.emitChanges(null,y.ZP.utc(t).format())}registerOnTouched(t){this.onTouched=()=>null}registerOnChange(t){this.onChange=t}registerOnKeyUp(){this.onKeyup=t=>{}}setDisabledState(t){this.disabled=t}ngOnInit(){this.value=this.inputModel,this.registerOnKeyUp(),this.prop=new l.YY(this.propInput),this.propFormName=`${this.prop.name}-${this.prop.id}`,this.nameExtension=899*Math.random()+100,setTimeout(()=>{this._setDateInputValue(this.inputModel)})}writeValue(t){this.value=t}cleanRegexEscapeChars(t){return t.replaceAll("\\+","+")}emitInfoModal(t){const i=!Array.isArray(t.contentfulId);this.showInfoModal.emit({title:t.description,paragraphs:i?t.contentfulId:[t.contentfulId],isKey:i})}emitChanges(t,i){const r=this.prop.feComponent===l.oq.DateTime,h=r&&i===this.timeValue,b=r&&(0,y.ZP)(this.timeValue,"HH:mm",!0).isValid();if(!t&&i){if(h){const U=(0,y.ZP)(this.value);b&&U.isValid()&&(this.value=y.ZP.utc(`${U.format("DD-MM-YYYY")} ${this.timeValue}`,"DD-MM-YYYY HH:mm").format(),this.onChange(this.value))}else{if(r)if(b){const U=y.ZP.utc(i).format("DD-MM-YYYY");this.value=y.ZP.utc(`${U} ${this.timeValue}`,"DD-MM-YYYY HH:mm").format()}else i=y.ZP.utc(i).startOf("day").format(),this._setDateInputValue(i);this.value=i,this.onChange(i)}return}if(!t||!t.target)return;const J=t.target;let V=J.value;this.prop.feComponent===l.oq.Checkbox&&(V=J.checked.toString()),this.prop.feComponent===l.oq.RadioButton&&(V=i),this.value=V,this.onChange(V),this._setDateInputValue(this.value)}_setDateInputValue(t){t&&this.prop.feComponent===l.oq.DateTime&&(this.timeValue=(0,y.ZP)(t).format("HH:mm"))}}return o.\u0275fac=function(t){return new(t||o)}
1,o.\u0275cmp=e.Xpm({type:o,selectors:[["app-device-property"]],viewQuery:function(t,i){if(1&t&&(e.Gf(Q,5),e.Gf(O,5)),2&t){let r;e.iGM(r=e.CRH())&&(i.input=r.first),e.iGM(r=e.CRH())&&(i.dateInput=r.first)}},hostBindings:function(t,i){1&t&&e.NdJ("change",function(){return i.onChange(i.value)})("blur",function(){return i.onTouched()})("keyup",function(){return i.onKeyup()})},inputs:{disabled:"disabled",propInput:"propInput",inputModel:"inputModel",invalid:"invalid"},outputs:{showInfoModal:"showInfoModal"},features:[e._Bn([{provide:E.JU,useExisting:(0,e.Gpc)(()=>o),multi:!0}])],decls:11,vars:9,consts:[[1,"wrapper"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","info-btn",3,"click",4,"ngIf"],[1,"bold","value-description"],[4,"ngSwitchDefault"],["placeholder","hh:mm","type","text",3,"disabled","ngClass","name","value","keyup"],["input",""],["type","text",3,"disabled","ngClass","name","value","keyup"],[3,"ngClass","disabled","name","value","change"],[3,"value"],[3,"value",4,"ngFor","ngForOf"],[3,"value","dateOnly","changedValue"],["type","checkbox",3,"ngClass","disabled","name","checked","change"],[1,"radio-container"],[4,"ngFor","ngForOf"],["type","radio",3,"ngClass","disabled","name","value","checked","change"],[1,"bold"],[3,"value","utc","changedValue"],[1,"info-btn",3,"click"]],template:function(t,i){1&t&&(e.TgZ(0,"div",0),e.ynx(1,1),e.YNc(2,f,4,2,"ng-container",2),e.YNc(3,B,5,8,"ng-container",2),e.YNc(4,k,2,2,"ng-container",2),e.YNc(5,H,2,6,"ng-container",2),e.YNc(6,S,3,1,"ng-container",2),e.YNc(7,L,2,2,"ng-container",2),e.YNc(8,$,2,0,"span",3),e.TgZ(9,"span",4),e._uU(10),e.qZA(),e.BQk(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngSwitch",i.prop.feComponent),e.xp6(1),e.Q6J("ngSwitchCase",i.feComp.Text),e.xp6(1),e.Q6J("ngSwitchCase",i.feComp.Dropdown),e.xp6(1),e.Q6J("ngSwitchCase",i.feComp.Date),e.xp6(1),e.Q6J("ngSwitchCase",i.feComp.Checkbox),e.xp6(1),e.Q6J("ngSwitchCase",i.feComp.RadioButton),e.xp6(1),e.Q6J("ngSwitchCase",i.feComp.DateTime),e.xp6(1),e.Q6J("ngIf",i.prop.contentfulId),e.xp6(2),e.hij(" ",i.prop.valueDescription," "))},directives:[u.RF,u.n9,u.mk,u.ED,E.YN,E.Kr,u.sg,N.t,u.O5],styles:[".value-description[_ngcontent-%COMP%]{margin-left:5px}.radio-container[_ngcontent-%COMP%]{display:inline-flex;flex-direction:row;align-items:center;height:80%;flex-wrap:wrap}.radio-container[_ngcontent-%COMP%] .bold[_ngcontent-%COMP%]{margin-left:5px;margin-right:10px}.info-btn[_ngcontent-%COMP%]{width:20px;height:20px;margin-left:5px;margin-right:5px;border-radius:50%;background-color:#000;color:#fff;display:inline-flex;justify-content:center;align-items:center;font-weight:600;cursor:pointer}.dateinput-backdrop[_ngcontent-%COMP%]{z-index:1;position:absolute;height:100vw;width:100vh;top:0;left:0}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{width:170px}.smaller-input[_ngcontent-%COMP%]{margin-left:5px;width:100px!important}"]}),o})();function j(o,p){1&o&&(e.TgZ(0,"span",8),e._uU(1,"*"),e.qZA())}function a(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"div")(1,"app-device-property",10),e.NdJ("ngModelChange",function(r){return e.CHM(t),e.oxw().$implicit.propertyValues[0].propertyValue=r})("ngModelChange",function(){return e.CHM(t),e.oxw(5).device.calculateComputedValues()})("showInfoModal",function(r){return e.CHM(t),e.oxw(5).showInfoModal(r)}),e.qZA()()}if(2&o){const t=e.oxw(),i=t.$implicit,r=t.index,h=e.oxw(4);e.Gre("form-row-cell ","form-row-cell--"+i.feComponent.toLowerCase(),""),e.xp6(1),e.s9C("name","prop-"+r),e.Q6J("disabled",h.disabled)("propInput",i)("inputModel",i.propertyValues[0].propertyValue)("ngModel",i.propertyValues[0].propertyValue)("invalid",h.hasError(i.id))}}function m(o,p){if(1&o&&(e.ynx(0),e.YNc(1,a,2,9,"div",9),e.BQk()),2&o){const t=p.$implicit,i=e.oxw(2).$implicit,r=e.oxw(2);e.xp6(1),e.Q6J("ngIf",i.showProp(t,r.device))}}function n(o,p){if(1&o&&(e.TgZ(0,"div",4)(1,"div",5)(2,"span",6),e._uU(3),e.YNc(4,j,2,0,"span",7),e.qZA()(),e.YNc(5,m,2,1,"ng-container",2),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(3),e.hij(" ",t.props[0].description?t.props[0].description:t.props[0].name," "),e.xp6(1),e.Q6J("ngIf",!t.props[0].nullable),e.xp6(1),e.Q6J("ngForOf",t.props)}}
1function d(o,p){if(1&o&&(e.ynx(0),e.YNc(1,n,6,3,"div",3),e.BQk()),2&o){const t=p.$implicit,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.showFormGroup(i.device))}}function g(o,p){if(1&o&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&o){const t=p.$implicit;e.xp6(1),e.hij(" ",t.message," ")}}function M(o,p){if(1&o&&(e.ynx(0),e.TgZ(1,"div",11)(2,"ul"),e.YNc(3,g,2,1,"li",2),e.qZA()(),e.BQk()),2&o){const t=e.oxw(2);e.xp6(3),e.Q6J("ngForOf",t.formErrors)}}function A(o,p){if(1&o&&(e.TgZ(0,"div")(1,"div",1),e.YNc(2,d,2,1,"ng-container",2),e.YNc(3,M,4,1,"ng-container",0),e.qZA()()),2&o){const t=e.oxw();e.xp6(2),e.Q6J("ngForOf",t.formGroups),e.xp6(1),e.Q6J("ngIf",t.formErrors.length>0)}}let R=(()=>{class o extends I.H{constructor(t,i,r){super(t),this._glService=t,this.texts=i,this.modalService=r,this.initialDevice=null,this.disabled=!1,this.validated=new e.vpe,this.formGroups=[],this.config=T.e,this.formErrors=[]}ngOnInit(){this.device=new l.AS(this.initialDevice),this._setFormGroupsByFeOrder()}validateAndEmit(){this.device.properties=[...this.formGroups.flatMap(i=>i.props)];const t=(0,D.ZP)(this.device,!0);this.device.properties.forEach(i=>{i.propIsEnabled(this.device)||i.resetValue()}),t.valid?(this.device.valid=!0,this.formErrors=[]):(this.device.valid=!1,this.formErrors=t.errors),this.device.convertCommasToDotsForNumbers(),this.validated.emit(this.device)}hasError(t){return this.formErrors.some(i=>i.propId===t)}showInfoModal(t){this.modalService.openInfoModal(t.title,t.paragraphs)}_setFormGroupsByFeOrder(){const t=this.device.properties.map(h=>h.feOrder),i=(0,_.Z)(t);i.sort((h,b)=>h-b);const r=[];i.forEach(h=>{const b={feOrder:h,props:this.device.properties.filter(J=>J.feOrder===h)};r.push(new G(b))}),this.formGroups=[...r]}_logDistinctPropTypes(){const t=this.device.properties.map(b=>b.dataType),i=this.device.properties.map(b=>b.feComponent),r=(0,_.Z)(t),h=(0,_.Z)(i);console.log({uniqueComponents:h,uniqueTypes:r})}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(w.U),e.Y36(x.N),e.Y36(C.Z))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-device-form"]],inputs:{initialDevice:"initialDevice",disabled:"disabled"},outputs:{validated:"validated"},features:[e.qOj],decls:1,vars:1,consts:[[4,"ngIf"],[1,"form-container"],[4,"ngFor","ngForOf"],["class","esi-form-row",4,"ngIf"],[1,"esi-form-row"],[1,"form-row-cell","form-row-cell--title"],[1,"bold"],["class","required-field",4,"ngIf"],[1,"required-field"],[3,"class",4,"ngIf"],[3,"name","disabled","propInput","inputModel","ngModel","invalid","ngModelChange","showInfoModal"],[1,"error-list-container"]],template:function(t,i){1&t&&e.YNc(0,A,4,2,"div",0),2&t&&e.Q6J("ngIf",i.device&&i.formGroups.length>0)},directives:[u.O5,u.sg,K,E.JJ,E.On],styles:[".prop-name[_ngcontent-%COMP%]{font-size:bold}.form-container[_ngcontent-%COMP%]{width:100%}.form-container[_ngcontent-%COMP%] .esi-form-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;width:100%;margin-bottom:15px}.form-container[_ngcontent-%COMP%] .form-row-cell[_ngcontent-%COMP%]{display:inline-flex;padding-right:20px}.form-container[_ngcontent-%COMP%] .form-row-cell--title[_ngcontent-%COMP%]{width:310px}.form-container[_ngcontent-%COMP%] .form-row-cell--title[_ngcontent-%COMP%] .bold[_ngcontent-%COMP%]{max-width:290px}.form-container[_ngcontent-%COMP%] .form-row-cell--title[_ngcontent-%COMP%] .required-field[_ngcontent-%COMP%]{margin:0;display:inline}.form-container[_ngcontent-%COMP%] .form-row-cell--text[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:200px}.form-container[_ngcontent-%COMP%] .form-row-cell--radiobutton[_ngcontent-%COMP%]{align-items:center}.error-list-container[_ngcontent-%COMP%]{display:block;width:100%;margin-top:10px;border:1px solid #e32b2a;border-radius:5px;background-color:#fcc}.error-list-container[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .error-list-container[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:0;padding:0}.error-list-container[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{padding:10px;font-size:12px;margin-left:20px}"]}),o})();class G{constructor(p){this.feOrder=p.feOrder,this.props=p.props}showFormGroup(p){return this.props.map(i=>this.showProp(i,p)).some(i=>!0===i)}showProp(p,t){return(t.type===p.propertyValues[0].deviceType||!p.propertyValues[0].deviceType)&&p.propIsEnabled(t)}}},5230:(F,Z,s)=>{"use strict";s.d(Z,{r:()=>w});var e=s(7947),l=s(4650),_=s(4209),D=s(6895);function T(x,C){if(1&x&&(l.TgZ(0,"li"),l._uU(1),l.qZA()),2&x){const u=C.$implicit;l.xp6(1),l.hij(" ",u," ")}}function I(x,C){if(1&x&&(l.TgZ(0,"div",1)(1,"ul"),l.YNc(2,T,2,1,"li",2),l.qZA()()),2&x){const u=l.oxw();l.xp6(2),l.Q6J("ngForOf",u.errors)}}let w=(()=>{class x extends e.H{constructor(u){super(u),this.glService=u,this.validatedObject=null}get showList(){return this.validatedObject?!!this.validatedObject.errorList.length:this.hasFormErrors()}get errors(){return this.validatedObject?this.validatedObject.errorList:this.getErrorTexts()}}return x.\u0275fac=function(u){return new(u||x)(l.Y36(_.U))},x.\u0275cmp=l.Xpm({type:x,selectors:[["app-form-error-list"]],inputs:{validatedObject:"validatedObject"},features:[l.qOj],decls:1,vars:1,consts:[["class","error-list-container",4,"ngIf"],[1,"error-list-container"],[4,"ngFor","ngForOf"]],template:function(u,E){1&u&&l.YNc(0,I,3,1,"div",0),2&u&&l.Q6J("ngIf",E.showList)},directives:[D.O5,D.sg],styles:[".error-list-container[_ngcontent-%COMP%]{display:block;width:100%;margin-top:10px;border:1px solid #e32b2a;border-radius:5px;background-color:#fcc}.error-list-container[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .error-list-container[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:0;padding:0}.error-list-container[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{padding:10px;font-size:12px;margin-left:20px}"]}),x})()},209:F=>{function Z(s,e,l){var _,D,T,I,w;function x(){var u=Date.now()-I;u<e&&u>=0?_=setTimeout(x,e-u):(_=null,l||(w=s.apply(T,D),T=D=null))}null==e&&(e=100);var C=function(){T=this,D=arguments,I=Date.now();var u=l&&!_;return _||(_=setTimeout(x,e)),u&&(w=s.apply(T,D),T=D=null),w};return C.clear=function(){_&&(clearTimeout(_),_=null)},C.flush=function(){_&&(w=s.apply(T,D),T=D=null,clearTimeout(_),_=null)},C}Z.debounce=Z,F.exports=Z}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.