/*! For license information please see main.ab56e3d1.js.LICENSE.txt */ !function(){var e={7228:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},9842:function(e,t,n){var r=n(9754),i=n(7067),o=n(8585);e.exports=function(e){var t=i();return function(){var n,i=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return o(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},9754:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2205:function(e,t,n){var r=n(9489);e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},430:function(e){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},7067:function(e){e.exports=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},6860:function(e){e.exports=function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8206:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},8585:function(e,t,n){var r=n(8).default,i=n(1506);e.exports=function(e,t){if(t&&("object"===r(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},9489:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},319:function(e,t,n){var r=n(3646),i=n(6860),o=n(379),a=n(8206);e.exports=function(e){return r(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},8:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},379:function(e,t,n){var r=n(7228);e.exports=function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},5957:function(e,t,n){var r=n(9754),i=n(9489),o=n(430),a=n(9100);function s(t){var n="function"===typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!o(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},7757:function(e,t,n){e.exports=n(8937)},4534:function(e,t,n){"use strict";var r=n(7757),i=n(3269).default,o=n(4575).default,a=n(3913).default,s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AppServer=void 0;var l=n(1230),c=n(1902),u=n(3501),p=n(4658),d=n(4529),h=n(6130),f=n(840),g=n(4451),v=n(1224),m=n(6840),y=n(4406),b=n(4643),x=n(496),w=n(1502),_=n(3098),S=n(9488),k=n(4071),C=n(4729),j=n(4614),M=n(5108),E=n(7372),O=n(644),I=n(7799),P=n(3878),T=n(1379),A=n(1252),N=n(9022),D=n(9862),R=n(2255),L=n(1140),F=n(7072),z=n(5980),B=n(6224),V=n(9497),H=n(3864),U=n(4182),W=n(4738),G=n(1203),q=n(8345),K=n(2316),Y=n(3805),X=n(9838),Z=n(3680),$=n(3274),J=n(3815),Q=n(5821),ee=n(6159),te=n(5488),ne=n(2073),re=n(6571),ie=n(4411),oe=n(9965),ae=function(){function e(){o(this,e),this.tempoKeepalive=2e3,this.keepAliveId=-1,this.error=new y.Subject,this.connectionLost=new y.Subject,this.newState=new y.Subject}return a(e,[{key:"state",get:function(){return this.lastState}},{key:"isConnected",get:function(){return this.connected}},{key:"login",value:function(e){var t;return s(this,void 0,void 0,r.mark((function n(){var o,a,s,y,w,_,S,k,C,j=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.dispose(),o=e.username.toUpperCase(),this.http=new N.HttpService(e.host),a=[{Name:"clientProductDescription",Value:e.productName},{Name:"clientProductName",Value:e.productName},{Name:"clientProductCompany",Value:e.productCompany},{Name:"clientProductVersion",Value:e.applicationVersion},{Name:"clientProcessName",Value:navigator.userAgent},{Name:"noCookie",Value:!0}],e.datas){s=i(Object.getOwnPropertyNames(e.datas));try{for(s.s();!(y=s.n()).done;)w=y.value,a.push({Name:w,Value:null===(t=e.datas[w])||void 0===t?void 0:t.toString()})}catch(r){s.e(r)}finally{s.f()}}return n.next=7,this.http.post("AppVisionService.svc/OpenExt",JSON.stringify(a));case 7:return _=n.sent,n.next=10,_.json();case 10:return S=n.sent,this.http.addGlobalHeaders("SessionID",S),k={Authorization:"Basic "+R.Base64Helper.encode(o+":"+e.password)},"@SINGLESIGNON"===o&&(k=null),n.next=16,this.http.post("AppVisionService.svc/Login",JSON.stringify([{Name:"username",Value:o},{Name:"password",Value:e.password}]),"POST",k);case 16:return _=n.sent,n.next=19,this.http.post("AppVisionService.svc/AddFilterNotifications",'"All"');case 19:return n.next=21,this.http.get("AppVisionService.svc/StartNotifications?send=false");case 21:return this.areaManager=new x.AreaManager(this.http),n.next=24,this.areaManager.loadInternal();case 24:return this.groupManager=new c.GroupManager(this.http),n.next=27,this.groupManager.loadInternal();case 27:return this.variableManager=new l.VariableManager(this.http),n.next=30,this.variableManager.loadInternal();case 30:return this.userManager=new p.UserManager(this.http),n.next=33,this.userManager.loadInternal();case 33:return this.optionManager=new u.OptionManager(this.http),n.next=36,this.optionManager.loadInternal(this.userManager);case 36:return this.fileManager=new d.FileManager(this.http),n.next=39,this.fileManager.loadInternal();case 39:return this.eventManager=new h.EventManager(this.http),this.alarmManager=new f.AlarmManager(this.http),n.next=43,this.alarmManager.loadInternal();case 43:return this.protocolManager=new m.ProtocolManager(this.http),n.next=46,this.protocolManager.loadInternal();case 46:return this.scenarioManager=new b.ScenarioManager(this.http),n.next=49,this.scenarioManager.loadInternal();case 49:return this.environmentManager=new D.EnvironmentManager(this.http,this.fileManager,this.optionManager),n.next=52,this.environmentManager.loadInternal();case 52:return this.licenseManager=new $.LicenseManager(this.http),n.next=55,this.licenseManager.loadInternal();case 55:return this.overlayManager=new ie.OverlayManager(this.http),n.next=58,this.overlayManager.loadInternal();case 58:this.operandManager=new g.OperandManager(this.variableManager,this.areaManager,this.alarmManager,this.groupManager,this.userManager,this.protocolManager),this.commandManager=new T.CommandManager,this.videoManager=new A.VideoManager(this.http,this.variableManager),this.holidayManager=new Y.HolidayManager(this.http),this.userMessageManager=new X.UserMessageManager(this.http,this.optionManager),this.rtManager=new v.RTManager(this.http),this.chatManager=new J.ChatManager(this.http,this.fileManager),this.deviceManager=new ne.DeviceManager(this.http),this.customColorManager=new re.RowCustomColorManager(this.optionManager,this.areaManager,this.alarmManager),this.httpOData=new N.HttpService(e.host),C=e.password,"@SINGLESIGNON"===o&&(o=this.userManager.currentUser.Name,C="@SingleSignOn"),this.httpOData.addGlobalHeaders("Authorization","Basic "+R.Base64Helper.encode(o+":"+C)),this.visitorManager=new Z.VisitorManager(this.httpOData),this.categoryManager=new L.CategoryManager(this.httpOData),this.departmentManager=new z.DepartmentManager(this.httpOData),this.rightManager=new H.RightManager(this.httpOData),this.badgesManager=new V.BadgeManager(this.httpOData),this.accessProfileManager=new B.AccessProfileManager(this.httpOData,this.rightManager),this.badgeTypeManager=new U.BadgeTypeManager(this.httpOData,this.rightManager),this.zoneManager=new W.ZoneManager(this.httpOData),this.personZoneManager=new q.PersonZoneManager(this.httpOData),this.peopleManager=new F.PeopleManager(this.httpOData),this.connected=!0,this.keepAliveId=setTimeout((function(){return j.keepAlive()}),this.tempoKeepalive);case 83:case"end":return n.stop()}}),n,this)})))}},{key:"logout",value:function(){return s(this,void 0,void 0,r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.connected=!1,clearTimeout(this.keepAliveId),this.dispose(),e.prev=3,e.next=6,this.http.get("AppVisionService.svc/Close");case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(3);case 10:case"end":return e.stop()}}),e,this,[[3,8]])})))}},{key:"keepAlive",value:function(){return s(this,void 0,void 0,r.mark((function e(){var t,n,o,a,s,l,c,u,p,d,h,f=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.http.get("AppVisionService.svc/KeepAlive");case 3:return t=e.sent,e.next=6,t.json();case 6:if(n=e.sent,this.connected){e.next=9;break}return e.abrupt("return");case 9:if(!(n<0)){e.next=11;break}throw new Error("Unknown session id");case 11:if(!(n>0)){e.next=31;break}return e.next=14,this.http.get("AppVisionService.svc/GetNotifications?count=100");case 14:return o=e.sent,e.prev=15,e.next=18,o.json();case 18:if(a=e.sent,this.connected){e.next=21;break}return e.abrupt("return");case 21:s=[],l=i(a);try{for(l.s();!(c=l.n()).done;)if(u=c.value,Array.isArray(u.Data)){p=i(u.Data);try{for(p.s();!(d=p.n()).done;)h=d.value,s.push(h)}catch(r){p.e(r)}finally{p.f()}}else s.push(u.Data)}catch(r){l.e(r)}finally{l.f()}s.length>0&&this.handleNewEvents(s),e.next=31;break;case 27:e.prev=27,e.t0=e.catch(15),console.error("[AppServer] - Failed parse notifications.",e.t0),this.error.next("Error parse notif resp : "+e.t0.toString());case 31:e.next=41;break;case 33:if(e.prev=33,e.t1=e.catch(0),this.connected){e.next=37;break}return e.abrupt("return");case 37:return console.error("[AppServer] - Connection lost with appServer, keepalive failed",e.t1),this.connected=!1,this.connectionLost.next(e.t1),e.abrupt("return");case 41:this.keepAliveId=setTimeout((function(){return f.keepAlive()}),this.tempoKeepalive);case 42:case"end":return e.stop()}}),e,this,[[0,33],[15,27]])})))}},{key:"handleNewEvents",value:function(e){var t=this,n=[],r=[],i=[],o=[],a=[],s=[],l=[],c=[],u=[],p=[],d=[],h=[],f=[],g=[],v=[],m=[],y=null,b=null;e.forEach((function(e){try{if(void 0!==e.__type)switch(e.__type){case"ServerState:#Prysm.AppVision.Data":b=new K.ServerState(e);break;case"AlarmInfo:#Prysm.AppVision.Data":r.push(new _.AlarmInfo(e));break;case"EventRow:#Prysm.AppVision.Data":n.push(new w.EventRow(e));break;case"VariableState:#Prysm.AppVision.Data":i.push(new S.VariableState(e));break;case"VariableRow:#Prysm.AppVision.Data":o.push(new k.VariableRow(e));break;case"AreaRow:#Prysm.AppVision.Data":a.push(new C.AreaRow(e));break;case"AreaState:#Prysm.AppVision.Data":s.push(new j.AreaState(e));break;case"GroupRow:#Prysm.AppVision.Data":l.push(new M.GroupRow(e));break;case"GroupState:#Prysm.AppVision.Data":c.push(new E.GroupState(e));break;case"ProtocolState:#Prysm.AppVision.Data":u.push(new O.ProtocolState(e));break;case"ScenarioState:#Prysm.AppVision.Data":p.push(new I.ScenarioState(e));break;case"FileInfoRow:#Prysm.AppVision.Data":d.push(new P.FileInfoRow(e));break;case"OptionRow:#Prysm.AppVision.Data":h.push(new G.OptionRow(e));break;case"ChatMessageRow:#Prysm.AppVision.Data":f.push(new Q.ChatMessage(e));break;case"Talk:#Prysm.AppVision.Data":g.push(new Q.Talk(e));break;case"UserState:#Prysm.AppVision.Data":y=new ee.UserState(e);break;case"UserRow:#Prysm.AppVision.Data":v.push(new te.UserRow(e));break;case"OverlayItem:#Prysm.AppVision.Data":m.push(new oe.OverlayItem(e))}else"string"===typeof e&&e.startsWith("CommandClient;")&&(console.log("[AppServer] - Command receive : "+e),t.commandManager.updateCommand(e))}catch(x){console.error("[AppServer] - Error reading event : "+x.toString()),t.error.next("Error reading event : "+x.toString())}})),o.length>0&&this.variableManager.updateRowsInternal(o),i.length>0&&(this.variableManager.updateStatesInternal(i),i.forEach((function(e){return n.push(w.EventRow.parseFromVarState(e))}))),n.length>0&&this.eventManager.updateEventsInternal(n),r.length>0&&this.alarmManager.updateAlarmsInternal(r),a.length>0&&this.areaManager.updateRowsInternal(a),s.length>0&&this.areaManager.updateStatesInternal(s),l.length>0&&this.groupManager.updateRowsInternal(l),c.length>0&&this.groupManager.updateStatesInternal(c),u.length>0&&this.protocolManager.updateStatesInternal(u),p.length>0&&this.scenarioManager.updateStatesInternal(p),d.length>0&&this.fileManager.updateRowsInternal(d),h.length>0&&this.optionManager.updateRowsInternal(h),f.length>0&&this.chatManager.updateMessagesInternal(f),g.length>0&&this.chatManager.updateTalksInternal(g),v.length>0&&this.userManager.updateRowsInternal(v),m.length>0&&this.overlayManager.updateInternal(m),b&&(this.lastState=b,this.newState.next(b)),y&&this.userManager.updateStateInternal(y)}},{key:"dispose",value:function(){this.connected&&(this.connected=!1),this.keepAliveId>0&&clearTimeout(this.keepAliveId),this.alarmManager=null,this.optionManager=null,this.userManager=null,this.variableManager=null,this.groupManager=null,this.areaManager=null,this.fileManager=null,this.eventManager=null,this.rtManager=null,this.operandManager=null,this.protocolManager=null,this.scenarioManager=null,this.commandManager=null,this.videoManager=null,this.environmentManager=null,this.peopleManager=null,this.categoryManager=null,this.departmentManager=null,this.accessProfileManager=null,this.badgesManager=null,this.rightManager=null,this.badgeTypeManager=null,this.chatManager=null,this.deviceManager=null,this.http=null,this.httpOData=null,this.lastState=null,this.keepAliveId=-1,this.error=new y.Subject,this.connectionLost=new y.Subject,this.newState=new y.Subject}}]),e}();t.AppServer=ae},1171:function(e,t,n){"use strict";var r=n(319).default,i=n(3269).default,o=n(4575).default,a=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.AlarmsHelper=void 0;var s=n(3098),l=n(5118),c=function(){function e(){o(this,e)}return a(e,null,[{key:"isAlarmFromGroup",value:function(e,t){if(t.startsWith("$G.")&&(t=t.substring(3)),0===e.groups.length)return!1;if(e.groups.indexOf(t)>=0)return!0;var n,r=i(e.groups);try{for(r.s();!(n=r.n()).done;){if(n.value.startsWith(t+"."))return!0}}catch(o){r.e(o)}finally{r.f()}return!1}},{key:"updateAlarmsList",value:function(e,t){var n=r(e);return t.forEach((function(e){switch(e.Event){case s.AlarmEvent.Start:case s.AlarmEvent.Resume:case s.AlarmEvent.Update:case s.AlarmEvent.Report:case s.AlarmEvent.End:case s.AlarmEvent.Acknowledge:var t=n.findIndex((function(t){return t.Id===e.Alarm.Id}));t>=0?n[t]=e.Alarm:n.unshift(e.Alarm);break;case s.AlarmEvent.Delete:var r=n.findIndex((function(t){return t.Id===e.Alarm.Id}));r>=0&&n.splice(r,1)}})),n}},{key:"getStatusRtKey",value:function(e){switch(e){case l.AlarmStatus.AcknowledgeWaiting:return"AlarmStatus.AcknowledgeWaiting";case l.AlarmStatus.Closed:return"AlarmStatus.Closed";case l.AlarmStatus.Processing:return"AlarmStatus.Processing";case l.AlarmStatus.ProcessWaiting:return"AlarmStatus.ProcessWaiting";default:return"None"}}},{key:"compare",value:function(e,t){return e.WaitAcknowledge&&!t.WaitAcknowledge?-1:!e.WaitAcknowledge&&t.WaitAcknowledge?1:e.Severity>t.Severity?-1:e.Severityt.dateStart?-1:e.dateStart0&&this.recursiveForEach(s[t],t,n)}}catch(l){a.e(l)}finally{a.f()}}}]),e}();t.m=a},2255:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Base64Helper=void 0;var s=function(){function e(){i(this,e)}return o(e,null,[{key:"encode",value:function(t){if(window.btoa)return window.btoa(t);var n,r,i,o,a,s,l,c="",u=0;for(t=e.utf8Encode(t);u>2,a=(3&n)<<4|(r=t.charCodeAt(u++))>>4,s=(15&r)<<2|(i=t.charCodeAt(u++))>>6,l=63&i,isNaN(r)?s=l=64:isNaN(i)&&(l=64),c=c+e.keyStr.charAt(o)+e.keyStr.charAt(a)+e.keyStr.charAt(s)+e.keyStr.charAt(l);return c}},{key:"decode",value:function(t){if(window.atob)return window.atob(t);var n,r,i,o,a,s,l="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,r=(15&o)<<4|(a=e.keyStr.indexOf(t.charAt(c++)))>>2,i=(3&a)<<6|(s=e.keyStr.indexOf(t.charAt(c++))),l+=String.fromCharCode(n),64!==a&&(l+=String.fromCharCode(r)),64!==s&&(l+=String.fromCharCode(i));return l=e.utf8Decode(l)}},{key:"blobToBase64",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=new FileReader).readAsDataURL(e),t.abrupt("return",new Promise((function(e){n.onloadend=function(){e(n.result)}})));case 3:case"end":return t.stop()}}),t)})))}},{key:"base64ToBlob",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.decode(t.split(",")[1]),i=new Array(r.length),o=0;o127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}},{key:"utf8Decode",value:function(e){for(var t="",n=0,r=0,i=0,o=0;n191&&r<224?(i=e.charCodeAt(n+1),t+=String.fromCharCode((31&r)<<6|63&i),n+=2):(i=e.charCodeAt(n+1),o=e.charCodeAt(n+2),t+=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o),n+=3);return t}}]),e}();t.Base64Helper=s,s.keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},6e3:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ColorHelper=void 0;var o=function(){function e(){r(this,e)}return i(e,null,[{key:"xamlToCssColor",value:function(e){return(null===e||void 0===e?void 0:e.startsWith("#"))?"#"+e.substring(3)+e.substring(1,3):e}},{key:"addOpacity",value:function(e,t){return(null===e||void 0===e?void 0:e.startsWith("#"))?e.substring(0,7)+Math.round(255*t).toString(16):e}}]),e}();t.ColorHelper=o},8838:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.DateHelper=void 0;var o=function(){function e(){r(this,e)}return i(e,null,[{key:"toJSDate",value:function(e){return new Date(parseInt(e.DateTime.replace(/[^0-9 +]/g,"")))}},{key:"strToJSDate",value:function(e){if(!e)return null;var t=e.split("+").shift();return new Date(parseInt(t.replace(/[^0-9 +]/g,"")))}},{key:"stringToDate",value:function(e){return new Date(Date.parse(e))}},{key:"toDateTimeString",value:function(e){if(null==e)return"";var t=e.getDate(),n=e.getMonth()+1,r=e.getFullYear(),i=e.getHours(),o=e.getMinutes(),a=e.getSeconds();return t<10&&(t="0"+t),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),r+"-"+n+"-"+t+"T"+i+":"+o+":"+a}},{key:"toDateString",value:function(e){if(null==e)return"";var t=e.getDate(),n=e.getMonth()+1;return t<10&&(t="0"+t),n<10&&(n="0"+n),e.getFullYear()+"-"+n+"-"+t}},{key:"today",value:function(){var e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())}}]),e}();t.DateHelper=o},8789:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.FileParser=void 0;var o=n(9175),a=function(){function e(){r(this,e)}return i(e,null,[{key:"parseWebEnvironment",value:function(e){var t,n,r=JSON.parse(e),i=new o.LayoutModel;i.mode=r.layout.mode,r.layout.containers&&r.layout.containers.forEach((function(e){var t=new o.ContainerModel(e.name);t.isSelectable=e.isSelectable,t.hasMenu=e.hasMenu,t.allowDragAndDrop=e.allowDragAndDrop,e.document&&(t.document=new o.DocumentModel,t.document.name=e.document.name,e.document.args&&e.document.args.forEach((function(e){var n=new o.Args;Object.assign(n,e),t.document.args.push(n)}))),i.containers.push(t)})),r.layout.properties&&Object.keys(r.layout.properties).forEach((function(e){var t=new o.LayoutPanelProperties;Object.assign(t,r.layout.properties[e]),i.properties.set(e,t)}));var a=new o.EnvironmentModel;return a.isSideBarVisible=null===(t=r.isSideBarVisible)||void 0===t||t,a.isHeaderVisible=null===(n=r.isHeaderVisible)||void 0===n||n,a.layout=i,a}},{key:"parseClassicContext",value:function(e){var t=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("layout")[0];if(t){var n;n=t.getAttribute("type").split(".").pop().toLowerCase().startsWith("video")?this.parseVideoLayout(t):this.parseClientLayout(t);var r=new o.EnvironmentModel;return r.layout=n,r}return null}},{key:"parseVideoLayout",value:function(e){var t=e.getAttribute("type"),n=1,r=new o.LayoutModel;switch(r.mode=t.split(".").pop().toLowerCase(),r.mode){case"videox1":n=1;break;case"videox2":n=2;break;case"videox3":n=3;break;case"x4":case"videox4":n=4;break;case"videox6":case"videox6b":n=6;break;case"videox8":n=8;break;case"videox9":n=9;break;case"videox10":n=10;break;case"videox12":n=12;break;case"videox13":n=13;break;case"videox16":n=16}for(var i=0;i1){var h=d[0],f=d[1];null!=h&&null!=f&&u.push({name:h,value:f})}else u.push({name:"",value:c[p].innerHTML})}s.document={name:l.getAttribute("name"),args:u}}return s}return null}}]),e}();t.FileParser=a},6415:function(e,t,n){"use strict";var r=n(3269).default,i=n(4575).default,o=n(3913).default;t.z=void 0;var a=function(){function e(){i(this,e)}return o(e,null,[{key:"isFromGroup",value:function(e,t){if(t.startsWith("$G.")&&(t=t.substring(3)),e.groups&&Array.isArray(e.groups)){if(e.groups.indexOf(t)>=0)return!0;var n,i=r(e.groups);try{for(i.s();!(n=i.n()).done;){if(n.value.startsWith(t+"."))return!0}}catch(c){i.e(c)}finally{i.f()}}if(e.FullGroupNames&&Array.isArray(e.FullGroupNames)){if(e.FullGroupNames.indexOf(t)>=0)return!0;var o,a=r(e.FullGroupNames);try{for(a.s();!(o=a.n()).done;){if(o.value.startsWith(t+"."))return!0}}catch(c){a.e(c)}finally{a.f()}}if(e.GroupNames&&Array.isArray(e.GroupNames)){if(e.GroupNames.indexOf(t)>=0)return!0;var s,l=r(e.GroupNames);try{for(l.s();!(s=l.n()).done;){if(s.value.startsWith(t+"."))return!0}}catch(c){l.e(c)}finally{l.f()}}return!1}}]),e}();t.z=a},730:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Helper=void 0;var o=function(){function e(){r(this,e)}return i(e,null,[{key:"delay",value:function(e){return new Promise((function(t){return setTimeout(t,e)}))}},{key:"getParameter",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t)for(var r=t.split("\r\n"),i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=parseInt(e);return isNaN(n)&&(n=t),n}))},{key:"parseFloat",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=parseFloat(e);return isNaN(n)&&(n=t),n}))},{key:"parseBool",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(null===e||void 0===e?void 0:e.toLowerCase()){case"true":case"1":case"on":case"yes":return!0;default:return t}}},{key:"convertRegExpPattern",value:function(e){return e?"^"+e.replace("$","\\$").replace(".","\\.").replace("*","(.*)")+"$":null}},{key:"guid",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},{key:"incrementName",value:function(e){for(var t=-1,n=0;n0)return e[e.length-1]>="A"&&e[e.length-1]<"Z"||e[e.length-1]>="a"&&e[e.length-1]<"z"?e.substring(0,e.length-1)+String.fromCharCode(e[e.length-1].charCodeAt(0)+1):"Z"==e[e.length-1]?e.substring(0,e.length-1)+"AA":"z"==e[e.length-1]?e.substring(0,e.length-1)+"aa":e+"1";e="0",t=0}for(var r=e.length-t,i=e.substring(0,t),o=this.parseInt(e.substring(t))+1,a=o.toString().length,s=0;s="0"&&e<="9"}}]),e}();t.Helper=o},6207:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpHelper=t.DEFAULT_HTTP_TIMEOUT=void 0,t.DEFAULT_HTTP_TIMEOUT=1e4;var s=function(){function e(){i(this,e)}return o(e,null,[{key:"fetchWithTimeout",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.DEFAULT_HTTP_TIMEOUT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,void 0,void 0,r.mark((function t(){var o,a,s;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new AbortController,a=setTimeout((function(){return o.abort("Timeout")}),n),t.next=4,fetch(e,Object.assign(Object.assign({},i),{signal:o.signal}));case 4:return s=t.sent,clearTimeout(a),t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})))}}]),e}();t.HttpHelper=s},2613:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.StringHelper=void 0;var o=function(){function e(){r(this,e)}return i(e,null,[{key:"getParentName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n=e.lastIndexOf(t);return n>-1?e.substring(0,n):""}},{key:"truncate",value:function(e,t){return t>e.length?e.substring(0,t):e.substring(0,t)+"..."}},{key:"isNullOrEmpty",value:function(e){return null==e||""===e}},{key:"toAlphaNum",value:function(e,t){return e?e.replace(/[\W_]+/g,null!==t&&void 0!==t?t:"_"):e}},{key:"trim",value:function(e,t){for(var n=0,r=e.length-1;e[n]===t;)n++;for(;e[r]===t;)r--;return e.slice(n,r+1)}},{key:"format",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0)try{var n,i=(new DOMParser).parseFromString(e,"text/xml"),o=i.getElementsByTagName("Timetable")[0];switch(null===(t=i.getElementsByTagName("Type")[0])||void 0===t?void 0:t.innerHTML){case"Daily":n=a.TimetableType.Daily;break;case"Weekly":n=a.TimetableType.Weekly;break;case"WeeklyWithHolidays":n=a.TimetableType.WeeklyWithHolidays}var s=o.getElementsByTagName("Items")[0].getElementsByTagName("TimetableItem"),l=o.getElementsByTagName("DefaultItems")[0],c=void 0;void 0!=l&&(c=l.getElementsByTagName("TimetableItem"));var u=o.getElementsByTagName("ItemsWithPeriod")[0],p=void 0;void 0!=u&&(p=u.getElementsByTagName("TimetableWithPeriod"));var d=[];if(void 0!=s)for(var h=0;h\r\n ",t+="\r\n ",e.Items.forEach((function(e){t+="\r\n ",t+=""+e.TotalMinutes+"\r\n ",t+=""+e.Value+"\r\n ",t+="\r\n "})),t+="\r\n ",void 0!=e.DefaultItems?(t+="\r\n ",e.DefaultItems.forEach((function(e){t+="\r\n ",t+=""+e.TotalMinutes+"\r\n ",t+=""+e.Value+"\r\n ",t+="\r\n "})),t+="\r\n "):t+="\r\n ",void 0!=e.ItemsWithPeriod&&(t+="\r\n ",e.ItemsWithPeriod.forEach((function(e){t+="\r\n ",t+=""+s.DateHelper.toDateTimeString(e.start)+"\r\n ",t+=""+s.DateHelper.toDateTimeString(e.end)+"\r\n ",t+="",e.Items.forEach((function(e){t+="\r\n ",t+=""+e.TotalMinutes+"\r\n ",t+=""+e.Value+"\r\n ",t+="\r\n "})),t+="\r\n ",t+="\r\n "})),t+="\r\n "),t+=""}},{key:"compareItems",value:function(e,t){if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!=t.length)return!1;for(var n=0;n/g,">\n").replace(/\]\]/g,"]]\n"),r=[];return n.split("\n").map((function(e){if((e=e.trim())&&!(e.indexOf("?xml")>-1))if(0==e.indexOf("<")&&e.indexOf("CDATA")<0){var n=t._parseTag(e);r.push(n),e.match(/\/\s*>$/)&&r.push(t._parseTag(""))}else r[r.length-1].value+=" ".concat(t._parseValue(e))})),this._convertTagsArrayToTree(r)[0]}},{key:"_encodeCDATAValues",value:function(e){for(var t=new RegExp(/1&&(e=e.replace(n[1],encodeURIComponent(n[1]))),n=t.exec(e);return e}},{key:"_parseTag",value:function(e){var t=e.match(/([^\s]*)=('([^']*?)'|"([^"]*?)")|([\/?\w\-\:]+)/g),n=new o;return n.name=t.shift().replace(/\/\s*$/,""),t.map((function(e){var t=e.split("=");if(!(t.length<2)){var r=t[0],i="";i=2===t.length?t[1]:(t=t.slice(1)).join("="),n.attributes[r]="string"===typeof i?i.replace(/^"/g,"").replace(/^'/g,"").replace(/"$/g,"").replace(/'$/g,"").trim():i}})),n}},{key:"_parseValue",value:function(e){return e.indexOf("CDATA")<0?e.trim():e.substring(e.lastIndexOf("[")+1,e.indexOf("]"))}},{key:"_convertTagsArrayToTree",value:function(e){for(var t=[];e.length>0;){var n=e.shift();if(n.value.indexOf("-1||n.name.match(/\/$/))n.name=n.name.replace(/\/$/,"").trim(),n.value=n.value.substring(0,n.value.indexOf("0&&(e.children.map((function(e){n+=t._toString(e)})),n+=""),n}},{key:"_convertTagToText",value:function(e){var t="<"+e.name;for(var n in e.attributes)t+=" "+n+'="'+e.attributes[n]+'"';return e.value.length>0?t+=">"+e.value:t+=">",0===e.children.length&&(t+=""),t}}]),e}();t.XmlParser=a},8468:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.AccessProfileRightRow=void 0;var o=n(8838),a=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"validityStart",get:function(){return o.DateHelper.stringToDate(this.ValidityStart)}},{key:"validityEnd",get:function(){return o.DateHelper.stringToDate(this.ValidityEnd)}}]),e}();t.AccessProfileRightRow=a},864:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.AccessProfileRow=void 0;var o=n(8468),a=r((function e(t){var n;i(this,e),this.Id=0,this.Name="",this.Description="",Object.assign(this,t),(null===(n=t.AccessProfileRights)||void 0===n?void 0:n.length)>0&&(this.AccessProfileRights=t.AccessProfileRights.map((function(e){return new o.AccessProfileRightRow(e)})))}));t.AccessProfileRow=a},3098:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.AlarmInfo=t.AlarmEvent=void 0;var o=n(5118);!function(e){e[e.Start=0]="Start",e[e.End=1]="End",e[e.Update=2]="Update",e[e.Acknowledge=3]="Acknowledge",e[e.Report=4]="Report",e[e.Resume=5]="Resume",e[e.Delete=6]="Delete",e[e.Transfer=7]="Transfer",e[e.None=8]="None"}(t.AlarmEvent||(t.AlarmEvent={}));var a=r((function e(t){i(this,e),Object.assign(this,t),this.Alarm=new o.AlarmRow(t.Alarm)}));t.AlarmInfo=a},5118:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.AlarmRow=t.AlarmStatus=void 0;var o,a=n(8838);!function(e){e[e.None=0]="None",e[e.AcknowledgeWaiting=10]="AcknowledgeWaiting",e[e.Processing=20]="Processing",e[e.ProcessWaiting=30]="ProcessWaiting",e[e.Closed=100]="Closed"}(o=t.AlarmStatus||(t.AlarmStatus={}));var s=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"dateAck",get:function(){return a.DateHelper.toJSDate(this.DateAck)}},{key:"dateStart",get:function(){return a.DateHelper.toJSDate(this.DateStart)}},{key:"dateReceive",get:function(){return a.DateHelper.toJSDate(this.DateReceive)}},{key:"dateReport",get:function(){return a.DateHelper.toJSDate(this.DateReport)}},{key:"dateEnd",get:function(){return a.DateHelper.toJSDate(this.DateEnd)}},{key:"status",get:function(){return this.WaitAcknowledge?o.AcknowledgeWaiting:this.WaitProcess?o.ProcessWaiting:this.WaitReport?o.Processing:o.Closed}},{key:"groups",get:function(){return""!==this.GroupNames&&this.GroupNames?this.GroupNames.split(","):[]}},{key:"attachments",get:function(){return""!==this.Attachments&&this.Attachments?this.Attachments.split("\n"):[]}},{key:"addAttachment",value:function(e){var t=this.attachments;t.push(e),this.Attachments=t.join("\n")}}]),e}();t.AlarmRow=s},4729:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default,o=n(2205).default,a=n(9842).default;Object.defineProperty(t,"__esModule",{value:!0}),t.AreaRow=void 0;var s=n(5327),l=n(4614),c=function(e){o(n,e);var t=a(n);function n(e){var r;return i(this,n),null==(r=t.call(this,e)).State&&(r.State=new l.AreaState({Id:r.Id})),r}return r(n)}(s.TreeRow);t.AreaRow=c},4614:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.AreaState=void 0;var o=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"isAlarm",get:function(){return this.AlarmCount>0}},{key:"isAlarmAcknowledgeWaiting",get:function(){return this.AlarmAcknowledgeWaitingCount>0}},{key:"isAlarmProcessing",get:function(){return this.AlarmProcessingCount>0}},{key:"isAlarmProcessWaiting",get:function(){return this.AlarmProcessWaitingCount>0}},{key:"isAlarmClosed",get:function(){return this.AlarmClosedCount>0}}]),e}();t.AreaState=o},6071:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.BadgeRow=void 0;var o=n(730),a=n(5893),s=function(){function e(t){r(this,e),this.Code="",this.Format="",this.Info="",this.Status=null,this.BadgeTypeId=null,Object.assign(this,t),t.Person&&(this.Person=new a.PersonRow(t.Person))}return i(e,[{key:"setStatus",value:function(e){var t,n;if(this.Status=e,0===e){var r=o.Helper.parseInt(null===(n=null===(t=this.Info)||void 0===t?void 0:t.match(/\((\d+)\)/))||void 0===n?void 0:n[1],null);r&&(this.PersonId=r)}else this.Person&&(this.Info="".concat(this.Person.LastName," ").concat(this.Person.FirstName," (").concat(this.Person.Id,")")),this.PersonId=null}}]),e}();t.BadgeRow=s},835:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.BadgeType=void 0;var o=r((function e(t){i(this,e),this.Parameters="",Object.assign(this,t)}));t.BadgeType=o},6604:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Camera=t.CameraMode=void 0;var s,l=n(8838),c=n(9022),u=n(730);!function(e){e[e.Live=0]="Live",e[e.Playback=1]="Playback"}(s=t.CameraMode||(t.CameraMode={}));var p=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;i(this,e),this.http=t,this.sessionId=u.Helper.guid(),this.mode=s.Live,this.row=n,this.playbackSpeed=o,r&&(this.dateStart=r,this.mode=s.Playback)}return o(e,[{key:"connect",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="videogateway/streaming?video="+this.row.Name+"&id="+this.sessionId,this.dateStart&&(t+="&date="+l.DateHelper.toDateTimeString(this.dateStart)),e.next=4,this.http.get(t);case 4:return n=e.sent,e.next=7,n.json();case 7:(i=e.sent).server.id>0?this.streamerHttp=new c.HttpService(i.server.uri+i.streamer):this.streamerHttp=new c.HttpService(this.http.host+i.streamer);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"streamerUri",get:function(){return this.streamerHttp.host}},{key:"getStreamingUri",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){var t="",n="websocket"===e.protocol&&"app"===e.streamType?this.streamerHttp.host.replace("http","ws"):this.streamerHttp.host;return null!=e.httpMultipartType&&(t+="&multipart_content_type="+e.httpMultipartType),n+"video?id="+this.sessionId+"&stream_type="+e.streamType+t}return this.streamerHttp.host+"video?id="+this.sessionId}},{key:"getStreamInfo",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("streaminfo/?id="+this.sessionId+"&rnd="+(new Date).getTime());case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"continuousMove",value:function(e,t){return a(this,void 0,void 0,r.mark((function n(){return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.streamerHttp.get("ptz/?id="+this.sessionId+"&command=continuousmove&x="+e+"&y="+t);case 2:case"end":return n.stop()}}),n,this)})))}},{key:"continuousZoom",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.streamerHttp.get("ptz/?id="+this.sessionId+"&command=continuouszoom&z="+e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"getPresets",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("ptz/?id="+this.sessionId+"&command=getpresets");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getPatterns",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("ptz/?id="+this.sessionId+"&command=getpatterns");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"gotoPreset",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.streamerHttp.get("ptz/?id="+this.sessionId+"&command=gotopreset&preset="+e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"runPattern",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.streamerHttp.get("ptz/?id="+this.sessionId+"&command=runpattern&pattern="+e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"goToHome",value:function(){return a(this,void 0,void 0,r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("ptz/?id="+this.sessionId+"&command=gotohomeposition");case 2:case"end":return e.stop()}}),e,this)})))}},{key:"setPlaybackPosition",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.dateStart=e,t.next=3,this.streamerHttp.get("playback/?id="+this.sessionId+"&command=playbackposition&date="+l.DateHelper.toDateTimeString(this.dateStart));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"setPlaybackSpeed",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.streamerHttp.get("playback/?id="+this.sessionId+"&command=playbackspeed&speed="+e);case 2:this.playbackSpeed=e;case 3:case"end":return t.stop()}}),t,this)})))}},{key:"resume",value:function(){return a(this,void 0,void 0,r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("video/?id="+this.sessionId+"&command=resume");case 2:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(){return a(this,void 0,void 0,r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("video/?id="+this.sessionId+"&command=pause");case 2:case"end":return e.stop()}}),e,this)})))}},{key:"stepBackward",value:function(){return a(this,void 0,void 0,r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("playback/?id="+this.sessionId+"&command=stepBackward");case 2:case"end":return e.stop()}}),e,this)})))}},{key:"stepForward",value:function(){return a(this,void 0,void 0,r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("playback/?id="+this.sessionId+"&command=stepForward");case 2:case"end":return e.stop()}}),e,this)})))}},{key:"snapshot",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.streamerHttp.get("video/?id="+this.sessionId+"&command=snapshot");case 2:return t=e.sent,e.next=5,t.blob();case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getCapabilities",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.streamerHttp.get("capabilities?details="+e);case 2:return n=t.sent,t.next=5,n.json();case 5:return i=t.sent,t.abrupt("return",i);case 7:case"end":return t.stop()}}),t,this)})))}}]),e}();t.Camera=p},8186:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.CategoryRow=void 0;var o=n(730),a=n(2613),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;r(this,e),this.Id=0,this.Name="",this.Description="",this.BadgeDesign="",this.AccessProfileId=null,this.IsVisitor=!1,this.Parameters="",this.DefaultValidityPeriod="",Object.assign(this,t)}return i(e,[{key:"getValidityPeriod",value:function(){var e=new Date;if(a.StringHelper.isNullOrEmpty(this.DefaultValidityPeriod))e.setFullYear(e.getFullYear()+10);else{var t=this.DefaultValidityPeriod.split(""),n=t.pop().toLowerCase(),r=o.Helper.parseInt(t.join(),0);if(r>0)switch(n){case"h":e.setHours(e.getHours()+r);break;case"d":e.setDate(e.getDate()+r);break;case"m":e.setMonth(e.getMonth()+r);break;case"y":e.setFullYear(e.getFullYear()+r);break;default:e.setFullYear(e.getFullYear()+10)}}return{start:new Date,end:e}}}]),e}();t.CategoryRow=s},5821:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Talk=t.ChatMessage=void 0;var o=n(8838),a=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"date",get:function(){return o.DateHelper.toJSDate(this.Date)}}]),e}();t.ChatMessage=a;var s=function(){function e(t){r(this,e),Object.assign(this,t),t.LastMessage&&(this.LastMessage=new a(t.LastMessage))}return i(e,[{key:"createdDate",get:function(){return o.DateHelper.toJSDate(this.CreatedDate)}}]),e}();t.Talk=s},6492:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ClientInfo=void 0;var o=r((function e(t){i(this,e),Object.assign(this,t)}));t.ClientInfo=o},3182:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.CommandParser=void 0;var o=n(5516),a=n(713),s=function(){function e(){r(this,e)}return i(e,null,[{key:"parse",value:function(e){var t=e.split(";");if(t.length<2)return null;var n=t[0],r=t[1];try{switch(n){case"@Open":return new o.OpenCommand(r);case"@Load":return new a.LoadCommand(r);default:return null}}catch(i){console.error("Cannot parse command : "+i)}}}]),e}();t.CommandParser=s},713:function(e,t,n){"use strict";var r=n(319).default,i=n(4575).default,o=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.LoadCommand=void 0;var a=n(9175),s=function(){function e(t){i(this,e);var n=t.split(","),r=parseInt(n[0]);if(0!==r&&1!==r)throw Error("Invalid argument windowNb = "+r);this._containerName=n[1],this._viewName=n[2],this._args=a.Args.fromString(n.slice(3).join(","),",")}return o(e,[{key:"containerName",get:function(){return this._containerName}},{key:"viewName",get:function(){return this._viewName}},{key:"args",get:function(){return r(this._args)}}]),e}();t.LoadCommand=s},5516:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.OpenCommand=void 0;var o=n(730),a=n(9175),s=function(){function e(t){r(this,e);var n=t.split(",");this._viewName=n[0];for(var i=1;i0&&this.checkType(r[0])&&(e=r[0])}else if(e instanceof s.AreaState){var n=e;null!=(r=p.AlarmsHelper.sortAlarmArray(this.alarmManager.getAlarms(0,(function(e){return e.AreaId==n.Id}))))&&this.checkType(r[0])&&(e=r)}else if(e instanceof c.GroupState){var r;n=e;null!=(r=p.AlarmsHelper.sortAlarmArray(this.alarmManager.getAlarms(0,(function(e){return e.GroupNames==n.Name}))))&&this.checkType(r[0])&&(e=r)}if(!this.checkType(e))return!1;if(e instanceof l.EventRow){var i=e;return!!this.checkArea(i.AreaId)&&!!this.checkGroup(i.GroupNames)}if(e instanceof u.VariableState&&null!=e.Row){var o=e;return!!this.checkArea(o.Row.AreaId)&&!!this.checkGroups(o.Row.FullGroupNames)}if(e instanceof a.AlarmRow){var d=e;return!!this.checkSeverity(d.Severity)&&(!!this.checkArea(d.AreaId)&&!!this.checkGroup(d.GroupNames))}return!1}},{key:"checkType",value:function(e){if(o.StringHelper.isNullOrEmpty(this.filterType))return!1;if(e instanceof a.AlarmRow){var t=e;return this.checkAlarmStatus(t.status,t.WaitEnd)}if(e instanceof l.EventRow)return this.filterType.includes("Event");if(e instanceof u.VariableState){var n=e.Row;if(null!=n&&n.IsAlarm){var r=this.alarmManager.getAlarms(1,(function(e){return e.SourceName==n.Name}));if(null!=r&&r.length>0)return this.checkAlarmStatus(r[0].status,r[0].WaitEnd)}return this.filterType.includes("VariableState")}return!1}},{key:"checkAlarmStatus",value:function(e,t){switch(e){case a.AlarmStatus.AcknowledgeWaiting:return this.filterType.includes(t?"Alarm.WaitAckActive":"Alarm.WaitAckInactive");case a.AlarmStatus.Processing:return this.filterType.includes("Alarm.Processing");case a.AlarmStatus.ProcessWaiting:return this.filterType.includes("Alarm.Waiting")}return this.filterType.includes("Alarm.Closed")}},{key:"checkSeverity",value:function(e){return 0==this.filterSeverityMin&&0==this.filterSeverityMax||e>=this.filterSeverityMin&&e<=this.filterSeverityMax}},{key:"checkArea",value:function(e){if(o.StringHelper.isNullOrEmpty(this.filterArea))return!0;if(null==e)return!1;var t=this.areaManager.getAreaById(e);return null!=t&&(t.Name==this.filterArea||t.Name.startsWith(this.filterArea+"."))}},{key:"checkGroup",value:function(e){if(o.StringHelper.isNullOrEmpty(this.filterGroup))return!0;if(o.StringHelper.isNullOrEmpty(e))return!1;var t=e.split(",");return this.checkGroups(t)}},{key:"checkGroups",value:function(e){var t=this;return!!o.StringHelper.isNullOrEmpty(this.filterGroup)||(e.forEach((function(e){if(e==t.filterGroup||e.startsWith(t.filterGroup+"."))return!0})),!1)}}]),e}();t.CustomColor=d},5195:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.DepartmentRow=void 0;var o=r((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i(this,e),this.Id=0,this.Name="",this.Description="",this.AccessProfileId=null,this.Parameters="",Object.assign(this,t)}));t.DepartmentRow=o},6999:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceInfos=t.DeviceType=void 0,function(e){e[e.Mobile=0]="Mobile",e[e.PC=1]="PC",e[e.Other=100]="Other"}(t.DeviceType||(t.DeviceType={}));var o=r((function e(t){i(this,e),Object.assign(this,t)}));t.DeviceInfos=o},9175:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Args=t.DocumentModel=t.ContainerModel=t.LayoutPanelProperties=t.LayoutModel=t.EnvironmentModel=void 0;var o=r((function e(){i(this,e),this.isSideBarVisible=!0,this.isHeaderVisible=!0}));t.EnvironmentModel=o;var a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"videox1",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];i(this,e),this.containers=[],this.mode=t,this.containers=n,this.properties=new Map}return r(e,null,[{key:"createDefault",value:function(t){return new e("x"+t.length,t.map((function(e,t){return new l("c"+(t+1),{name:e})})))}}]),e}();t.LayoutModel=a;var s=r((function e(){i(this,e)}));t.LayoutPanelProperties=s;var l=r((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i(this,e),this.name=t,this.document=n}));t.ContainerModel=l;var c=r((function e(){i(this,e),this.args=[]}));t.DocumentModel=c;var u=function(){function e(){i(this,e)}return r(e,null,[{key:"fromString",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return t?t.split(n).map((function(t){var n=new e;n.name=t;var r=t.indexOf("=");return r>0&&(n.name=t.substring(0,r).trim(),n.value=t.substring(r+1)),n})):[]}},{key:"getValue",value:function(e,t){var n;return t=null===t||void 0===t?void 0:t.toLowerCase(),null===(n=null===e||void 0===e?void 0:e.find((function(e){return e.name.toLowerCase()===t})))||void 0===n?void 0:n.value}}]),e}();t.Args=u},1502:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.EventRow=t.EventSubType=t.EventType=void 0;var o,a,s=n(8838),l=n(730),c=n(4071),u=n(8247);!function(e){e[e.None=0]="None",e[e.Server=100]="Server",e[e.Protocol=200]="Protocol",e[e.User=300]="User",e[e.Variable=400]="Variable",e[e.VariableReaderGranted=500]="VariableReaderGranted",e[e.VariableReaderDenied=550]="VariableReaderDenied",e[e.AlarmChanged=600]="AlarmChanged",e[e.AreaOrGroupChanged=700]="AreaOrGroupChanged"}(o=t.EventType||(t.EventType={})),function(e){e[e.None=0]="None",e[e.ServerMin=100]="ServerMin",e[e.ServerInfo=101]="ServerInfo",e[e.ServerError=102]="ServerError",e[e.ServerStoreError=103]="ServerStoreError",e[e.ServerStarting=109]="ServerStarting",e[e.ServerStarted=110]="ServerStarted",e[e.ServerStop=111]="ServerStop",e[e.ServerClose=112]="ServerClose",e[e.ServerSynchronizing=113]="ServerSynchronizing",e[e.ServerInitializing=114]="ServerInitializing",e[e.ServerExecuteProcess=115]="ServerExecuteProcess",e[e.ServerInvokeMethod=116]="ServerInvokeMethod",e[e.ServerSaveConfiguration=117]="ServerSaveConfiguration",e[e.ServerImportTable=118]="ServerImportTable",e[e.ServerExportTable=119]="ServerExportTable",e[e.ServerUserLock=120]="ServerUserLock",e[e.ServerSendMail=121]="ServerSendMail",e[e.ServerSendSMS=122]="ServerSendSMS",e[e.RedundantChecking=123]="RedundantChecking",e[e.ServerActiveLicenseByCode=130]="ServerActiveLicenseByCode",e[e.ServerCheckDatabase=131]="ServerCheckDatabase",e[e.ServerRestoreConfiguration=132]="ServerRestoreConfiguration",e[e.ServerRestoreHisto=133]="ServerRestoreHisto",e[e.ServerSaveHisto=134]="ServerSaveHisto",e[e.ServerRebuildIndexes=135]="ServerRebuildIndexes",e[e.ServerReorganizeIndexes=136]="ServerReorganizeIndexes",e[e.ServerExecuteSql=137]="ServerExecuteSql",e[e.ServerCyclePresets=138]="ServerCyclePresets",e[e.ServerScenario=139]="ServerScenario",e[e.ClientOpen=151]="ClientOpen",e[e.ClientClose=152]="ClientClose",e[e.ClientTimeout=153]="ClientTimeout",e[e.ClientCommand=154]="ClientCommand",e[e.ServerMax=199]="ServerMax",e[e.ProtocolMin=200]="ProtocolMin",e[e.ProtocolStart=201]="ProtocolStart",e[e.ProtocolStop=202]="ProtocolStop",e[e.ProtocolRestart=203]="ProtocolRestart",e[e.ProtocolLogin=210]="ProtocolLogin",e[e.ProtocolSynchronise=211]="ProtocolSynchronise",e[e.ProtocolLogout=212]="ProtocolLogout",e[e.ProtocolError=215]="ProtocolError",e[e.ProtocolInfo=216]="ProtocolInfo",e[e.ProtocolRefresh=217]="ProtocolRefresh",e[e.ProtocolDownload=218]="ProtocolDownload",e[e.ProtocolDownloadStarting=219]="ProtocolDownloadStarting",e[e.ProtocolDownloadComplete=220]="ProtocolDownloadComplete",e[e.ProtocolStartByUser=251]="ProtocolStartByUser",e[e.ProtocolStopByUser=252]="ProtocolStopByUser",e[e.ProtocolMax=299]="ProtocolMax",e[e.UserMin=300]="UserMin",e[e.UserLogin=301]="UserLogin",e[e.UserLogout=302]="UserLogout",e[e.UserAckAlarm=303]="UserAckAlarm",e[e.UserReportAlarm=304]="UserReportAlarm",e[e.UserCancelAlarm=305]="UserCancelAlarm",e[e.UserMaskAlarm=306]="UserMaskAlarm",e[e.UserResumeAlarm=307]="UserResumeAlarm",e[e.UserUpdateAlarm=308]="UserUpdateAlarm",e[e.UserWaitingAlarm=309]="UserWaitingAlarm",e[e.UserLockVar=310]="UserLockVar",e[e.UserStop=311]="UserStop",e[e.UserDriverDownload=312]="UserDriverDownload",e[e.UserDriverUpload=313]="UserDriverUpload",e[e.UserDriverRefresh=314]="UserDriverRefresh",e[e.UserDriverExecute=315]="UserDriverExecute",e[e.UserRemoveAllAlarms=316]="UserRemoveAllAlarms",e[e.UserUpdateEvent=317]="UserUpdateEvent",e[e.UserTransferAlarm=318]="UserTransferAlarm",e[e.UserLoginError=319]="UserLoginError",e[e.UserChangePassword=320]="UserChangePassword",e[e.UserMessageCreate=321]="UserMessageCreate",e[e.UserMessageAlarmCreate=322]="UserMessageAlarmCreate",e[e.UserMessageUpdate=323]="UserMessageUpdate",e[e.UserVideo=330]="UserVideo",e[e.UserClientClose=350]="UserClientClose",e[e.UserPrint=351]="UserPrint",e[e.UserExport=352]="UserExport",e[e.UserReadHisto=353]="UserReadHisto",e[e.UserMax=399]="UserMax",e[e.VarUpdateMin=400]="VarUpdateMin",e[e.VarUpdate=401]="VarUpdate",e[e.VarUpdateByUser=402]="VarUpdateByUser",e[e.VarUpdateAlarm=403]="VarUpdateAlarm",e[e.VarUpdateAlarmByUser=404]="VarUpdateAlarmByUser",e[e.VarUpdateMax=499]="VarUpdateMax",e[e.VarReaderMin=500]="VarReaderMin",e[e.VarReaderNok=550]="VarReaderNok",e[e.VarReaderMax=599]="VarReaderMax",e[e.GroupChanged=701]="GroupChanged",e[e.AreaChanged=702]="AreaChanged"}(a=t.EventSubType||(t.EventSubType={}));var p=function(){function e(t){r(this,e),Object.assign(this,t),this.Info&&(this.Info=this.Info.substring(0,50))}return i(e,[{key:"type",get:function(){return o[this.TypeInt]}},{key:"subType",get:function(){return a[this.SubTypeInt]}},{key:"date",get:function(){return s.DateHelper.toJSDate(this.Date)}},{key:"groups",get:function(){return""!==this.GroupNames&&this.GroupNames?this.GroupNames.split(","):[]}},{key:"attachments",get:function(){return""!==this.Attachments&&this.Attachments?this.Attachments.split("\n"):[]}},{key:"getParameter",value:function(e){if(this.Parameters){var t=this.Parameters.find((function(t){return t.Name===e}));if(t)return t.Value}return null}}],[{key:"parseFromVarState",value:function(t){var n,r,i,s,p,d=new e({Description:t.OriginDesc,Date:t.Date,Info:t.Info,TypeInt:o.Variable,SubTypeInt:t.OriginId>0?a.VarUpdateByUser:a.VarUpdate,OriginId:t.OriginId,OriginDesc:t.OriginDesc,StateDesc:t.valueDesc,Parameters:t.Parameters,Source:t.Name,SourceId:t.Id,Quality:t.Quality,AreaId:null===(n=t.Row)||void 0===n?void 0:n.AreaId,AreaDesc:null===(r=t.Row)||void 0===r?void 0:r.AreaDescription,GroupNames:null===(i=t.Row)||void 0===i?void 0:i.FullGroupNames.join(","),GroupDesc:null===(s=t.Row)||void 0===s?void 0:s.FullGroupDescriptions});if((null===(p=t.Row)||void 0===p?void 0:p.Type)===c.VariableType.Reader){var h=l.Helper.parseInt(t.Value);d.TypeInt=h0}},{key:"isAlarmAcknowledgeWaiting",get:function(){return this.AlarmAcknowledgeWaitingCount>0}},{key:"isAlarmProcessing",get:function(){return this.AlarmProcessingCount>0}},{key:"isAlarmProcessWaiting",get:function(){return this.AlarmProcessWaitingCount>0}},{key:"isAlarmClosed",get:function(){return this.AlarmClosedCount>0}}]),e}();t.GroupState=o},7496:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.HolidayRow=void 0;var o=function(){function e(t){r(this,e),this.Id=0,this.Culture="",this.Extension="",this.CustomExtension="",this.Url="",Object.assign(this,t)}return i(e,[{key:"date",get:function(){return new Date(parseInt(this.Date.replace(/[^0-9 +]/g,"")))}}]),e}();t.HolidayRow=o},4866:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default,o=n(1506).default,a=n(2205).default,s=n(9842).default,l=n(5957).default;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpError=void 0;var c=function(e){a(n,e);var t=s(n);function n(e,r,a){var s;return i(this,n),(s=t.call(this,r)).statusCode=e,s.body=a,Object.setPrototypeOf(o(s),n.prototype),s}return r(n)}(l(Error));t.HttpError=c},2693:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ModifRow=t.ModifType=void 0;var o,a=n(8838);!function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Change=2]="Change",e[e.Delete=4]="Delete"}(o=t.ModifType||(t.ModifType={}));var s=function(){function e(t){r(this,e),Object.assign(this,t),null!==this.Info&&(this.Info=this.Info.substring(0,50))}return i(e,[{key:"date",get:function(){return a.DateHelper.toJSDate(this.Date)}},{key:"type",get:function(){return o[this.Type]}}]),e}();t.ModifRow=s},1203:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.OptionRow=void 0;var o=r((function e(t){i(this,e),Object.assign(this,t)}));t.OptionRow=o},9965:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.OverlayItem=void 0;var o=n(8838),a=n(730),s=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"date",get:function(){return o.DateHelper.toJSDate(this.Date)}},{key:"position",get:function(){try{var e=this.PositionString.split(",");if(2===e.length)return e.map(a.Helper.parseFloat)}catch(t){}return[0,0]}},{key:"size",get:function(){try{var e=this.SizeString.split(",");if(2===e.length)return e.map(a.Helper.parseInt)}catch(t){}return[0,0]}}]),e}();t.OverlayItem=s},2209:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.PersonRightRow=void 0;var o=n(8838),a=function(){function e(t){r(this,e),this.ValidityStart="",this.ValidityEnd="",this.ValidityInfo="",Object.assign(this,t)}return i(e,[{key:"validityStart",get:function(){return o.DateHelper.stringToDate(this.ValidityStart)}},{key:"validityEnd",get:function(){return o.DateHelper.stringToDate(this.ValidityEnd)}}]),e}();t.PersonRightRow=a},5893:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.PersonRow=void 0;var o=n(8838),a=n(6071),s=n(8186),l=n(2209),c=function(){function e(t){var n,i;r(this,e),this.FirstName="",this.LastName="",this.CompanyId="",this.Address="",this.Phone="",this.Email="",this.Photo="",this.Notes="",this.PinCode="",this.Info1="",this.Info2="",this.Info3="",this.Info4="",this.Info5="",this.Info6="",this.Info7="",this.Info8="",this.Info9="",this.Id=0,this.CategoryId=null,this.DepartmentId=null,this.IsActive=this.IsAntipassback=!0,this.Badges=[],Object.assign(this,t),(null===(n=t.Badges)||void 0===n?void 0:n.length)>0&&(this.Badges=t.Badges.map((function(e){return new a.BadgeRow(e)}))),t.Category&&(this.Category=new s.CategoryRow(t.Category)),t.Department&&(this.Department=new s.CategoryRow(t.Department)),(null===(i=t.PersonRights)||void 0===i?void 0:i.length)>0&&(this.PersonRights=t.PersonRights.map((function(e){return new l.PersonRightRow(e)})))}return i(e,[{key:"validityStart",get:function(){return o.DateHelper.stringToDate(this.ValidityStart)}},{key:"validityEnd",get:function(){return o.DateHelper.stringToDate(this.ValidityEnd)}},{key:"FullName",get:function(){return(null!=this.LastName?this.LastName:"")+" "+(null!=this.FirstName?this.FirstName:"")}}]),e}();t.PersonRow=c},2034:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.PersonZone=void 0;var o=n(8838),a=n(5893),s=n(9872),l=function(){function e(t){r(this,e),Object.assign(this,t),t.Zone&&(this.Zone=new s.Zone(t.Zone)),t.Person&&(this.Person=new a.PersonRow(t.Person))}return i(e,[{key:"dateInput",get:function(){return o.DateHelper.stringToDate(this.DateInput)}}]),e}();t.PersonZone=l},6940:function(e,t,n){"use strict";var r=n(319).default,i=n(3269).default,o=n(4575).default,a=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileRow=void 0;var s=n(730),l=function(){function e(t){var n=this;o(this,e),Object.assign(this,t),this.options={},this.DbOptions&&this.DbOptions.split(/[\r\n]/).filter((function(e){return e})).map((function(e){return e.split("=")})).forEach((function(e){return n.options[e[0]]=e[1]}))}return a(e,[{key:"filters",get:function(){return this.Filters?this.Filters.split(","):[]}},{key:"rights",get:function(){return this.DbRoles?this.DbRoles.split(","):[]}},{key:"checkRight",value:function(e){return this.IsAdmin||this.rights.indexOf(e)>-1}},{key:"checkCommandException",value:function(e){if(!e||!this.CommandExceptions)return!1;var t=e.split("=")[0],n=this.CommandExceptions.replace(" ","").replace("=*","").split(/\n|\r/).filter((function(e){return e}));if(n.indexOf(e)>-1)return!0;if(n.indexOf(t)>-1)return!0;var r,o=i(n);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.indexOf("*")>-1){var l=new RegExp(s.Helper.convertRegExpPattern(a));if(l.test(e))return!0;if(l.test(t))return!0}}}catch(c){o.e(c)}finally{o.f()}return!1}},{key:"addRight",value:function(e){if(this.rights.indexOf(e)<0){var t=[].concat(r(this.rights),[e]);this.DbRoles=t.join(",")}}},{key:"removeRight",value:function(e){var t=this.rights.indexOf(e);if(t>=0){var n=r(this.rights);n.splice(t,1),this.DbRoles=n.join(",")}}},{key:"addFilter",value:function(e){if(this.filters.indexOf(e)<0){var t=[].concat(r(this.filters),[e]);this.Filters=t.join(",")}}},{key:"removeFilter",value:function(e){var t=this.filters.indexOf(e);if(t>=0){var n=r(this.filters);n.splice(t,1),this.Filters=n.join(",")}}}]),e}();t.ProfileRow=l},316:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolRow=void 0;var o=r((function e(t){i(this,e),Object.assign(this,t)}));t.ProtocolRow=o},644:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolState=t.ProtocolStatus=void 0;var o,a=n(8838);!function(e){e[e.Started=0]="Started",e[e.Synchronized=1]="Synchronized",e[e.Downloading=2]="Downloading",e[e.Stopped=3]="Stopped",e[e.Fault=4]="Fault"}(o=t.ProtocolStatus||(t.ProtocolStatus={}));var s=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"date",get:function(){return a.DateHelper.toJSDate(this.Date)}},{key:"dateStart",get:function(){return a.DateHelper.toJSDate(this.DateStart)}},{key:"status",get:function(){return o[this.Status]}}]),e}();t.ProtocolState=s},8247:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReaderStatus=void 0,function(e){e[e.BadgeForServerChecking=0]="BadgeForServerChecking",e[e.BadgeOk=10]="BadgeOk",e[e.BadgeOkByUser=11]="BadgeOkByUser",e[e.BadgeOkWithoutPassing=12]="BadgeOkWithoutPassing",e[e.BadgeOkOut=13]="BadgeOkOut",e[e.BadgeOkUnknown=40]="BadgeOkUnknown",e[e.BadgeOkAlarm=48]="BadgeOkAlarm",e[e.BadgeOkDuress=49]="BadgeOkDuress",e[e.BadgeNok=50]="BadgeNok",e[e.BadgeNokSchedule=51]="BadgeNokSchedule",e[e.BadgeNokSite=52]="BadgeNokSite",e[e.BadgeNokGroup=53]="BadgeNokGroup",e[e.BadgeNokCode=54]="BadgeNokCode",e[e.BadgeNokLock=55]="BadgeNokLock",e[e.BadgeNokInactive=56]="BadgeNokInactive",e[e.BadgeNokBlacklist=57]="BadgeNokBlacklist",e[e.BadgeNokPeriod=58]="BadgeNokPeriod",e[e.BadgeNokPincode=59]="BadgeNokPincode",e[e.BadgeNokUnknown=60]="BadgeNokUnknown",e[e.BadgeNokMax=99]="BadgeNokMax"}(t.ReaderStatus||(t.ReaderStatus={}))},9741:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;t.Z=void 0;var o=n(6e3),a=n(3098),s=n(5118),l=n(4614),c=n(1502),u=n(7372),p=n(4071),d=n(9488),h=n(2613),f=n(1171),g=function(){function e(t){r(this,e),this.server=t}return i(e,[{key:"getBackgroundColor",value:function(e){var t,n,r,i=this.server.customColorManager.getCustomColor(e);if(i&&!h.StringHelper.isNullOrEmpty(i.background))return i.background;if(e instanceof s.AlarmRow&&(t=e),e instanceof d.VariableState&&(n=e),e instanceof c.EventRow&&(r=e),(null===r||void 0===r?void 0:r.TypeInt)===c.EventType.Variable&&(null===r||void 0===r?void 0:r.SourceId)){var o=this.server.variableManager.getRowById(r.SourceId);o&&(n=this.server.variableManager.getStateByName(o.Name))}if(n&&(t=this.server.alarmManager.getAlarms().filter((function(e){return e.SourceId===n.Id})).pop()),e instanceof l.AreaState){var g=e,v=this.server.areaManager.getAreaByName(g.Name);t=f.AlarmsHelper.sortAlarmArray(this.server.alarmManager.getAlarmsByArea(v))[0]}if(e instanceof u.GroupState){var m=e;t=f.AlarmsHelper.sortAlarmArray(this.server.alarmManager.getAlarmsByGroupName(m.Name))[0]}if(t){switch(t.status){case s.AlarmStatus.AcknowledgeWaiting:return this.getColor(t.WaitEnd?"App.Color.Alarm.WaitAck.Background":"App.Color.Alarm.WaitAckEnded.Background");case s.AlarmStatus.Processing:return this.getColor("App.Color.Alarm.Processing.Background");case s.AlarmStatus.ProcessWaiting:return this.getColor("App.Color.Alarm.Waiting.Background")}return this.getColor("App.Color.Alarm.Background")}if(r){if(r.TypeInt===c.EventType.User)return r.SubTypeInt===c.EventSubType.UserMessageAlarmCreate?this.getColor("App.Color.Alarm.WaitAck.Background"):this.getColor("App.Color.Event.User.Background");if(r.TypeInt===c.EventType.Server)return this.getColor("App.Color.Event.Server.Background");if(r.TypeInt===c.EventType.Protocol)return r.SubTypeInt===c.EventSubType.ProtocolStartByUser||r.SubTypeInt===c.EventSubType.ProtocolStopByUser?this.getColor("App.Color.Event.User.Background"):this.getColor("App.Color.Event.Protocol.Background");if(r.TypeInt===c.EventType.VariableReaderGranted)return this.getColor("App.Color.Event.Reader.Granted.Background");if(r.TypeInt===c.EventType.VariableReaderDenied)return this.getColor("App.Color.Event.Reader.Denied.Background");if(r.TypeInt===c.EventType.AreaOrGroupChanged)return this.getColor("App.Color.State.Groups.Background");if(r.TypeInt===c.EventType.AlarmChanged&&(r.SubTypeInt===a.AlarmEvent.Start||r.SubTypeInt===a.AlarmEvent.Update))return this.getColor("App.Color.Alarm.WaitAck.Background");if(r.TypeInt===c.EventType.Variable){if(r.SubTypeInt===c.EventSubType.VarUpdateAlarm||r.SubTypeInt===c.EventSubType.VarUpdateAlarmByUser)return this.getColor("App.Color.Alarm.Background");if(r.SubTypeInt===c.EventSubType.VarUpdateByUser)return this.getColor("App.Color.Event.User.Background")}}if(n&&n.Row){if(n.OriginId>0)return this.getColor("App.Color.Event.User.Background");switch(n.Row.Type){case p.VariableType.Bool:case p.VariableType.Enum:case p.VariableType.Timetable:return this.getColor("App.Color.State.Enum.Background");case p.VariableType.String:return this.getColor("App.Color.State.Text.Background");case p.VariableType.Int:case p.VariableType.Double:return this.getColor("App.Color.State.Numeric.Background")}}return this.getColor("App.Color.Default.Background")}},{key:"getForegroundColor",value:function(e){var t,n,r,i=this.server.customColorManager.getCustomColor(e);if(i&&!h.StringHelper.isNullOrEmpty(i.foreground))return i.foreground;if(e instanceof s.AlarmRow&&(t=e),e instanceof d.VariableState&&(n=e),e instanceof c.EventRow&&(r=e),(null===r||void 0===r?void 0:r.TypeInt)===c.EventType.Variable&&(null===r||void 0===r?void 0:r.SourceId)){var o=this.server.variableManager.getRowById(r.SourceId);o&&(n=this.server.variableManager.getStateByName(o.Name))}if(n&&(t=this.server.alarmManager.getAlarms().filter((function(e){return e.SourceId===n.Id})).pop()),e instanceof l.AreaState){var g=e,v=this.server.areaManager.getAreaByName(g.Name);t=f.AlarmsHelper.sortAlarmArray(this.server.alarmManager.getAlarmsByArea(v))[0]}if(e instanceof u.GroupState===!0){var m=e;t=f.AlarmsHelper.sortAlarmArray(this.server.alarmManager.getAlarmsByGroupName(m.Name))[0]}if(t){switch(t.status){case s.AlarmStatus.AcknowledgeWaiting:return this.getColor(t.WaitEnd?"App.Color.Alarm.WaitAck.Foreground":"App.Color.Alarm.WaitAckEnded.Foreground");case s.AlarmStatus.Processing:return this.getColor("App.Color.Alarm.Processing.Foreground");case s.AlarmStatus.ProcessWaiting:return this.getColor("App.Color.Alarm.Waiting.Foreground")}return this.getColor("App.Color.Alarm.Foreground")}if(r)switch(r.TypeInt){case c.EventType.User:return this.getColor("App.Color.Event.User.Foreground");case c.EventType.Server:return this.getColor("App.Color.Event.Server.Foreground");case c.EventType.Protocol:return r.SubTypeInt===c.EventSubType.ProtocolStartByUser||r.SubTypeInt===c.EventSubType.ProtocolStopByUser?this.getColor("App.Color.Event.User.Foreground"):this.getColor("App.Color.Event.Protocol.Foreground");case c.EventType.VariableReaderGranted:return this.getColor("App.Color.Event.Reader.Granted.Foreground");case c.EventType.VariableReaderDenied:return this.getColor("App.Color.Event.Reader.Denied.Foreground");case c.EventType.AreaOrGroupChanged:return this.getColor("App.Color.State.Groups.Foreground");case c.EventType.AlarmChanged:if(r.SubTypeInt===a.AlarmEvent.Start||r.SubTypeInt===a.AlarmEvent.Update)return this.getColor("App.Color.Alarm.WaitAck.Foreground");break;case c.EventType.Variable:if(r.SubTypeInt===c.EventSubType.VarUpdateAlarm||r.SubTypeInt===c.EventSubType.VarUpdateAlarmByUser)return this.getColor("App.Color.Alarm.Foreground");if(r.SubTypeInt===c.EventSubType.VarUpdateByUser)return this.getColor("App.Color.Event.User.Foreground")}if(n&&n.Row){if(n.OriginId>0)return this.getColor("App.Color.Event.User.Foreground");switch(n.Row.Type){case p.VariableType.Bool:case p.VariableType.Enum:case p.VariableType.Timetable:return this.getColor("App.Color.State.Enum.Foreground");case p.VariableType.String:return this.getColor("App.Color.State.Text.Foreground");case p.VariableType.Int:case p.VariableType.Double:return this.getColor("App.Color.State.Numeric.Foreground")}}return this.getColor("App.Color.Default.Foreground")}},{key:"getColor",value:function(e){return o.ColorHelper.xamlToCssColor(this.server.optionManager.get(e))}}]),e}();t.Z=g},9385:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ScenarioRow=void 0;var o=n(7799),a=r((function e(t){var n;i(this,e),Object.assign(this,t),(null===(n=t.Instances)||void 0===n?void 0:n.length)>0?this.Instances=t.Instances.map((function(e){return new o.ScenarioState(e)})):this.Instances=[]}));t.ScenarioRow=a},7799:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ScenarioTriggerOrigin=t.ScenarioState=t.ScenarioStatus=void 0,function(e){e[e.Stopped=0]="Stopped",e[e.Running=1]="Running"}(t.ScenarioStatus||(t.ScenarioStatus={}));var o=r((function e(t){i(this,e),Object.assign(this,t)}));t.ScenarioState=o;var a=r((function e(){i(this,e)}));t.ScenarioTriggerOrigin=a},2316:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ServerState=void 0;var o=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"cpuPercent",get:function(){return+(100*this.CpuCounter).toFixed(1)}}]),e}();t.ServerState=o},5203:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.TimetableWithPeriod=t.TimetableItem=t.Timetable=t.TimetableType=void 0;var o,a=n(8838);!function(e){e[e.Daily=0]="Daily",e[e.Weekly=1]="Weekly",e[e.WeeklyWithHolidays=2]="WeeklyWithHolidays"}(o=t.TimetableType||(t.TimetableType={}));var s=r((function e(t){i(this,e),Object.assign(this,t)}));t.Timetable=s;var l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i(this,e),Object.assign(this,t)}return r(e,[{key:"getDay",get:function(){return this.TotalMinutes/1440}},{key:"getHour",get:function(){return this.TotalMinutes/60%24}},{key:"getMinute",get:function(){return this.TotalMinutes%60}},{key:"isValid",value:function(e){if(this.Day<0)return!1;switch(e){case o.Daily:return 0==this.Day;case o.Weekly:return this.Day<7;case o.WeeklyWithHolidays:return this.Day<10;default:return!1}}},{key:"equals",value:function(e){return null!=e&&(e.TotalMinutes==this.TotalMinutes&&e.Value==this.Value)}},{key:"isHoliday",get:function(){return this.Day>=7}}]),e}();t.TimetableItem=l;var c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i(this,e),Object.assign(this,t)}return r(e,[{key:"start",get:function(){return a.DateHelper.stringToDate(this.Start)}},{key:"end",get:function(){return a.DateHelper.stringToDate(this.End)}},{key:"match",value:function(e){return this.start.getTime()<=e&&e1&&void 0!==arguments[1]?arguments[1]:".",n=new Map;return e.forEach((function(e){return n.set(e.Name,e)})),e.filter((function(e){return e.Name.includes(t)})).forEach((function(e){var r=a.StringHelper.getParentName(e.Name,t),i=n.get(r);i&&(e.parent=i,i.items||(i.items=[]),i.items.push(e))})),e.filter((function(e){return null==e.parent}))}},{key:"deepCloneArray",value:function(e,t){var n=this,r=[];return e.forEach((function(e){var i=new t(e);r.push(i),e.parent&&(i.parent=new t(e)),e.items&&e.items.length>0&&(i.items=n.deepCloneArray(e.items,t))})),r}},{key:"insertOrUpdateItemInArray",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=n.Name.split(".").length;if(r===i){var o=t.findIndex((function(e){return e.Id===n.Id}));return o>=0?t[o]=n:t.push(n),!0}var a=t.find((function(e){return n.Name.startsWith(e.Name)}));return!!a&&e.insertOrUpdateItemInArray(a.items,n,a.Name.split(".").length+1)}},{key:"getItemById",value:function(t,n){var r=t.find((function(e){return e.Id===n}));if(r)return r;if(null!=r)return null;for(var i=0;i0&&(r=e.getItemById(t[i].items,n)))return r}},{key:"getItemByName",value:function(t,n){var i,o=t.find((function(e){return e.Name===n}));if(o)return o;var a,s=r(t);try{for(s.s();!(a=s.n()).done;){var l=a.value;if((null===(i=l.items)||void 0===i?void 0:i.length)>0&&(o=e.getItemByName(l.items,n)))return o}}catch(c){s.e(c)}finally{s.f()}return null}}]),e}();t.TreeRow=s},6465:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.UserMessageRow=t.UserMessageStatus=void 0;var o=n(8838);!function(e){e[e.InProgress=1]="InProgress",e[e.WaitAck=5]="WaitAck",e[e.Completed=10]="Completed"}(t.UserMessageStatus||(t.UserMessageStatus={}));var a=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"dateCreate",get:function(){return o.DateHelper.toJSDate(this.DateCreate)}}]),e}();t.UserMessageRow=a},5488:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.UserRow=void 0;var o=n(8838),a=n(6159),s=function(){function e(t){var n=this;r(this,e),Object.assign(this,t),t.State&&(this.State=new a.UserState(t.State)),this.options={},this.DbOptions&&this.DbOptions.split(/[\r\n]/).filter((function(e){return e})).map((function(e){return e.split("=")})).forEach((function(e){return n.options[e[0]]=e[1]}))}return i(e,[{key:"fullName",get:function(){return(this.FirstName?this.FirstName+" ":"")+this.LastName}},{key:"passwordDate",get:function(){return o.DateHelper.strToJSDate(this.PasswordDate)},set:function(e){this.PasswordDate="/Date("+e.getTime()+")/"}},{key:"checkRight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.profile){if(this.profile.checkRight(e))return!0;if(this.profile.checkCommandException(t))return!0}return!1}}]),e}();t.UserRow=s},6159:function(e,t,n){"use strict";var r=n(3913).default,i=n(4575).default;Object.defineProperty(t,"__esModule",{value:!0}),t.UserState=void 0;var o=n(5821),a=r((function e(t){var n;i(this,e),this.UnreadTalks=[],Object.assign(this,t),(null===(n=t.UnreadTalks)||void 0===n?void 0:n.length)>0&&(this.UnreadTalks=t.UnreadTalks.map((function(e){return new o.ChatMessage(e)})))}));t.UserState=a},9797:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueRow=void 0;var o=n(8838),a=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"date",get:function(){return o.DateHelper.toJSDate(this.Date)}}]),e}();t.ValueRow=a},4071:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default,o=n(1506).default,a=n(2205).default,s=n(9842).default;Object.defineProperty(t,"__esModule",{value:!0}),t.VariableRow=t.VariableBufferType=t.VariableType=void 0;var l=n(2613),c=n(5327);!function(e){e[e.Node=0]="Node",e[e.Bool=1]="Bool",e[e.Int=2]="Int",e[e.String=3]="String",e[e.Enum=4]="Enum",e[e.Double=5]="Double",e[e.Timetable=6]="Timetable",e[e.Buffer=7]="Buffer",e[e.Calendar=8]="Calendar",e[e.Reader=10]="Reader",e[e.Video=11]="Video",e[e.Audio=12]="Audio"}(t.VariableType||(t.VariableType={})),function(e){e[e.Byte=0]="Byte",e[e.SByte=1]="SByte",e[e.UInt16=2]="UInt16",e[e.Int16=3]="Int16",e[e.UInt32=4]="UInt32",e[e.Int32=5]="Int32",e[e.UInt64=6]="UInt64",e[e.Int64=7]="Int64",e[e.Double=9]="Double",e[e.Bit=10]="Bit"}(t.VariableBufferType||(t.VariableBufferType={}));var u=function(e){a(n,e);var t=s(n);function n(e){var i;return r(this,n),i=t.call(this,e),Object.assign(o(i),e),i}return i(n,[{key:"hasLeaf",value:function(){return 0!==this.Type||this.items.some((function(e){return e.hasLeaf()}))}}],[{key:"getTreeByType",value:function(e,t){var r=e.filter((function(e){return 0===e.Type||e.Type===t})).map((function(e){return new n(e)})),i=new Map;return r.forEach((function(e){return i.set(e.Name,e)})),r.filter((function(e){return e.Name.includes(".")})).forEach((function(e){var t=l.StringHelper.getParentName(e.Name,"."),n=i.get(t);n&&(e.parent=n,n.items||(n.items=[]),n.items.push(e))})),r.filter((function(e){return null==e.parent}))}}]),n}(c.TreeRow);t.VariableRow=u},9488:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.VariableState=void 0;var o=n(8838),a=function(){function e(t){r(this,e),Object.assign(this,t)}return i(e,[{key:"photo",get:function(){return this.Parameters&&-1!==this.Parameters.findIndex((function(e){return"photo"===e.Name.toLowerCase()}))?this.Parameters.find((function(e){return"photo"===e.Name.toLowerCase()})).Value:null}},{key:"valueDesc",get:function(){if(null==this.Value)return"";var e="";return this.IsLocked&&(e+="(L) "),this.IsAlarmMasked&&(e+="(M) "),e+this.formatValueDesc()}},{key:"date",get:function(){return o.DateHelper.toJSDate(this.Date)}},{key:"formatValueDesc",value:function(){var e,t=this,n=+this.Value;if((null===(e=this.Row)||void 0===e?void 0:e.StateDescs)&&-1!==this.Row.StateDescs.indexOf(":")&&!isNaN(n)){var r=this.Row.StateDescs.indexOf("\r\n")>-1?"\r\n":"\n",i=this.Row.StateDescs.split(r).map((function(e){return{value:e.split(":")[0],label:e.split(":")[1]}}));if(-1!==i.findIndex((function(e){return e.value.startsWith("b")}))&&0!==n){var o="";return i.filter((function(e){return e.value.startsWith("b")})).forEach((function(e){var t=+e.value.substring(1);isNaN(t)||0!==(n&1<0&&(this.ZoneReaderIns=t.ZoneReaderIns.map((function(e){return new a(e)}))),(null===(r=t.ZoneReaderOuts)||void 0===r?void 0:r.length)>0&&(this.ZoneReaderOuts=t.ZoneReaderOuts.map((function(e){return new s(e)})))}));t.Zone=o;var a=r((function e(t){i(this,e),Object.assign(this,t)}));t.ZoneReaderIn=a;var s=r((function e(t){i(this,e),Object.assign(this,t)}));t.ZoneReaderOut=s},6224:function(e,t,n){"use strict";var r=n(3269).default,i=n(7757),o=n(3913).default,a=n(4575).default,s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessProfileManager=void 0;var l=n(730),c=n(8468),u=n(864),p=o((function e(t){a(this,e),Object.assign(this,t),t.AccessProfile&&(this.AccessProfile=new u.AccessProfileRow(t.AccessProfile))})),d=function(){function e(t,n){a(this,e),this.http=t,this.rightManager=n}return o(e,[{key:"getAll",value:function(){return s(this,void 0,void 0,i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/AccessProfiles?$expand=AccessProfileRights,Categories,Departments");case 2:if(204!==(t=e.sent).status){e.next=5;break}return e.abrupt("return",[]);case 5:return e.next=7,t.json();case 7:return n=e.sent,e.abrupt("return",n.value.map((function(e){return new u.AccessProfileRow(e)})));case 9:case"end":return e.stop()}}),e,this)})))}},{key:"add",value:function(e){var t;return s(this,void 0,void 0,i.mark((function n(){var o,a,s,c,p,d,h,f;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(o=l.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.AccessProfile",n.next=4,this.http.post("AppControlDataService.svc/AccessProfiles",JSON.stringify(o));case 4:return a=n.sent,n.next=7,a.json();case 7:if(s=n.sent,(c=new u.AccessProfileRow(s)).AccessProfileRights=[],!((null===(t=e.AccessProfileRights)||void 0===t?void 0:t.length)>0)){n.next=31;break}p=r(e.AccessProfileRights),n.prev=12,p.s();case 14:if((d=p.n()).done){n.next=23;break}return(h=d.value).AccessProfileId=c.Id,n.next=19,this.rightManager.addAccessProfileRight(h);case 19:f=n.sent,c.AccessProfileRights.push(f);case 21:n.next=14;break;case 23:n.next=28;break;case 25:n.prev=25,n.t0=n.catch(12),p.e(n.t0);case 28:return n.prev=28,p.f(),n.finish(28);case 31:return n.abrupt("return",c);case 32:case"end":return n.stop()}}),n,this,[[12,25,28,31]])})))}},{key:"update",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return s(this,void 0,void 0,i.mark((function o(){var a,s,u,p,d,h,f,g,v,m;return i.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if((a=l.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.AccessProfile",!n){i.next=28;break}return i.next=5,this.http.get("AppControlDataService.svc/AccessProfileRights?$filter=AccessProfileId eq "+e.Id);case 5:if(204===(s=i.sent).status){i.next=28;break}return i.next=9,s.json();case 9:u=i.sent,p=u.value.map((function(e){return new c.AccessProfileRightRow(e)})),d=r(p),i.prev=12,d.s();case 14:if((h=d.n()).done){i.next=20;break}return f=h.value,i.next=18,this.rightManager.deleteAccessProfileRight(f);case 18:i.next=14;break;case 20:i.next=25;break;case 22:i.prev=22,i.t0=i.catch(12),d.e(i.t0);case 25:return i.prev=25,d.f(),i.finish(25);case 28:return i.next=30,this.http.post("AppControlDataService.svc/AccessProfiles("+e.Id+")",JSON.stringify(a),"MERGE");case 30:if(!(n&&(null===(t=e.AccessProfileRights)||void 0===t?void 0:t.length)>0)){i.next=48;break}g=r(e.AccessProfileRights),i.prev=32,g.s();case 34:if((v=g.n()).done){i.next=40;break}return m=v.value,i.next=38,this.rightManager.addAccessProfileRight(m);case 38:i.next=34;break;case 40:i.next=45;break;case 42:i.prev=42,i.t1=i.catch(32),g.e(i.t1);case 45:return i.prev=45,g.f(),i.finish(45);case 48:case"end":return i.stop()}}),o,this,[[12,22,25,28],[32,42,45,48]])})))}},{key:"delete",value:function(e){return s(this,void 0,void 0,i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/AccessProfiles("+e+")",null,"DELETE");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"getPersonProfiles",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppControlDataService.svc/People("+e+")/PersonProfiles?$expand=AccessProfile");case 2:if(204!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.next=7,n.json();case 7:return r=t.sent,t.abrupt("return",r.value.map((function(e){return e.AccessProfile})));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"getInheritedPersonProfiles",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n,r,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=[],null==e.DepartmentId){t.next=10;break}return t.next=4,this.http.get("AppControlDataService.svc/Departments("+e.DepartmentId+")/AccessProfile?$expand=AccessProfileRights");case 4:if(204===(r=t.sent).status){t.next=10;break}return t.next=8,r.json();case 8:o=t.sent,n.push(new u.AccessProfileRow(o));case 10:if(null==e.CategoryId){t.next=19;break}return t.next=13,this.http.get("AppControlDataService.svc/Categories("+e.CategoryId+")/AccessProfile?$expand=AccessProfileRights");case 13:if(204===(a=t.sent).status){t.next=19;break}return t.next=17,a.json();case 17:s=t.sent,n.push(new u.AccessProfileRow(s));case 19:return t.abrupt("return",n);case 20:case"end":return t.stop()}}),t,this)})))}},{key:"addPersonProfile",value:function(e,t){return s(this,void 0,void 0,i.mark((function n(){var r,o,a;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(r={AccessProfileId:t,PersonId:e})["odata.type"]="Prysm.AppControl.Data.PersonProfile",n.next=4,this.http.post("AppControlDataService.svc/People("+e+")/PersonProfiles",JSON.stringify(r));case 4:return o=n.sent,n.next=7,o.json();case 7:return a=n.sent,n.abrupt("return",new p(a));case 9:case"end":return n.stop()}}),n,this)})))}},{key:"deletePersonProfile",value:function(e,t){return s(this,void 0,void 0,i.mark((function n(){return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.http.post("AppControlDataService.svc/PersonProfiles(AccessProfileId="+t+",PersonId="+e+")",null,"DELETE");case 2:case"end":return n.stop()}}),n,this)})))}}]),e}();t.AccessProfileManager=d},840:function(e,t,n){"use strict";var r=n(319).default,i=n(7757),o=n(3269).default,a=n(4575).default,s=n(3913).default,l=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AlarmManager=void 0;var c=n(4406),u=n(5118),p=n(3098),d=n(1502),h=n(1171),f=function(){function e(t){a(this,e),this.http=t,this.alarmsChanged=new c.Subject}return s(e,[{key:"getAlarms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null==t&&(t=function(){return!0}),e>0?this.alarms.filter(t).slice(0,e).map((function(e){return new u.AlarmRow(e)})):this.alarms.filter(t).map((function(e){return new u.AlarmRow(e)}))}},{key:"getById",value:function(e){return this.alarms.find((function(t){return t.Id===e}))}},{key:"getAlarmsByArea",value:function(e){var t,n=[],r=o(this.alarms);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.AreaId&&e.isChild(i.AreaId)&&n.push(i)}}catch(a){r.e(a)}finally{r.f()}return n.map((function(e){return new u.AlarmRow(e)}))}},{key:"getAlarmsByGroupName",value:function(e){return this.alarms.filter((function(t){return h.AlarmsHelper.isAlarmFromGroup(t,e)})).map((function(e){return new u.AlarmRow(e)}))}},{key:"count",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null==e&&(e=function(){return!0}),this.alarms.filter(e).length}},{key:"acknowledgeByName",value:function(e){return l(this,void 0,void 0,i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/AcknowledgeAlarmByName?opName="+e,null);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"acknowledgeById",value:function(e){return l(this,void 0,void 0,i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppVisionService.svc/AcknowledgeAlarmById?Id="+e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"mask",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6e4;return l(this,void 0,void 0,i.mark((function r(){return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.http.get("AppVisionService.svc/MaskAlarm?opName=".concat(e,"&isMasked=").concat(t,"&tempo=").concat(n));case 2:case"end":return r.stop()}}),r,this)})))}},{key:"report",value:function(e,t,n){return l(this,void 0,void 0,i.mark((function r(){var o,a;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.http.post("AppVisionService.svc/ReportAlarm?id="+e+"&alarmWaiting="+n,JSON.stringify([{Name:"@Report",Value:t}]));case 2:return o=r.sent,r.next=5,o.json();case 5:return a=r.sent,r.abrupt("return",a);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"transfer",value:function(e,t){return l(this,void 0,void 0,i.mark((function n(){var r,o;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.http.get("AppVisionService.svc/TransferAlarmById?id="+e+"&transferUserId="+t);case 2:return r=n.sent,n.next=5,r.json();case 5:return o=n.sent,n.abrupt("return",o);case 7:case"end":return n.stop()}}),n,this)})))}},{key:"getAlarmEvents",value:function(e){return l(this,void 0,void 0,i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppVisionService.svc/GetAlarmEvents?alarmId="+e);case 2:return n=t.sent,t.next=5,n.json();case 5:return r=t.sent,t.abrupt("return",r.map((function(e){return new d.EventRow(e)})));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"addAlarm",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,u=arguments.length>8&&void 0!==arguments[8]&&arguments[8];return l(this,void 0,void 0,i.mark((function l(){var p;return i.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.http.get("AppVisionService.svc/AddAlarm?severity=".concat(e,"&state=").concat(t,"&description=").concat(n,"&info=").concat(r,"&areaName=").concat(o,"&groupNames=").concat(a,"&videolink=").concat(s,"&attachments=").concat(c,"&waitReport=").concat(u));case 2:return p=i.sent,i.next=5,p.json();case 5:return i.abrupt("return",i.sent);case 6:case"end":return i.stop()}}),l,this)})))}},{key:"addAlarmRow",value:function(e){return l(this,void 0,void 0,i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/AddAlarmRow",JSON.stringify(e));case 2:return n=t.sent,t.next=5,n.json();case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"updateAlarm",value:function(e){return l(this,void 0,void 0,i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/UpdateAlarm",JSON.stringify(e));case 2:return n=t.sent,t.next=5,n.json();case 5:return r=t.sent,t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getHistoAlarms",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2500;return l(this,void 0,void 0,i.mark((function l(){var c,p,d;return i.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return c="AppVisionService.svc/GetHistoAlarms?minId=0"+"&maxCount=".concat(s)+"&dateStart=".concat(e.toISOString())+"&dateEnd=".concat(t.toISOString())+"&filters=Severity>=".concat(o,",Severity<=").concat(a),n&&""!==n&&(c+=","+n),r&&r.length>0&&(c+="&userIds="+r.join(",")),i.next=5,this.http.get(c);case 5:return p=i.sent,i.next=8,p.json();case 8:return d=i.sent,i.abrupt("return",d.map((function(e){return new u.AlarmRow(e)})));case 10:case"end":return i.stop()}}),l,this)})))}},{key:"getHistoAlarmById",value:function(e){return l(this,void 0,void 0,i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppVisionService.svc/GetHistoAlarmById?alarmId="+e);case 2:return n=t.sent,t.next=5,n.json();case 5:return r=t.sent,t.abrupt("return",new u.AlarmRow(r));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"updateAlarmsInternal",value:function(e){var t=this;e.forEach((function(e){switch(e.Event){case p.AlarmEvent.Start:case p.AlarmEvent.Resume:case p.AlarmEvent.Acknowledge:case p.AlarmEvent.Report:case p.AlarmEvent.End:case p.AlarmEvent.Update:var n=t.alarms.findIndex((function(t){return t.Id===e.Alarm.Id}));if(n>=0){var i=r(t.alarms);i[n]=e.Alarm,t.alarms=i}else t.alarms=[].concat(r(t.alarms),[e.Alarm]);break;case p.AlarmEvent.Delete:var o=t.alarms.findIndex((function(t){return t.Id===e.Alarm.Id}));if(o>=0){var a=r(t.alarms);a.splice(o,1),t.alarms=a}}})),this.alarms=this.alarms.sort(h.AlarmsHelper.compare),this.alarmsChanged.next(e)}},{key:"loadInternal",value:function(){return l(this,void 0,void 0,i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetCurrentAlarms");case 2:return t=e.sent,e.next=5,t.json();case 5:n=e.sent,this.alarms=n.map((function(e){return new u.AlarmRow(e)}));case 7:case"end":return e.stop()}}),e,this)})))}}]),e}();t.AlarmManager=f},496:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AreaManager=void 0;var s=n(4406),l=n(4729),c=n(4614),u=n(5327),p=function(){function e(t){i(this,e),this.http=t,this.rowsUpdated=new s.Subject,this.statesChanged=new s.Subject}return o(e,[{key:"count",get:function(){return this.areas.length}},{key:"getAreaTree",value:function(){var e=this.areas.map((function(e){return new l.AreaRow(e)}));return u.TreeRow.init(e)}},{key:"getAreaById",value:function(e){var t=this.areas.find((function(t){return t.Id===e}));return t?new l.AreaRow(t):null}},{key:"getAreaByName",value:function(e){e.startsWith("$A.")&&(e=e.substring(3));var t=this.areas.find((function(t){return t.Name.toLowerCase()===e.toLowerCase()}));return t?new l.AreaRow(t):null}},{key:"loadInternal",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetAreaStates");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,i=n.map((function(e){return new c.AreaState(e)})),e.next=9,this.http.get("AppVisionService.svc/GetAreas");case 9:return t=e.sent,e.next=12,t.json();case 12:n=e.sent,this.areas=n.map((function(e){return new l.AreaRow(e)})),this.areas.forEach((function(e){var t=i.find((function(t){return t.Id===e.Id}));t&&(e.State=t)}));case 15:case"end":return e.stop()}}),e,this)})))}},{key:"updateRowsInternal",value:function(e){var t=this,n=[];e.forEach((function(e){var r=t.areas.findIndex((function(t){return t.Id===e.Id}));r>=0?t.areas[r]=e:t.areas.push(e),n.push(e)})),n.length>0&&this.rowsUpdated.next(n)}},{key:"updateStatesInternal",value:function(e){var t=this,n=[];e.forEach((function(e){var r=t.areas.find((function(t){return t.Id===e.Id}));r&&(r.State=e,n.push(e))})),n.length>0&&this.statesChanged.next(n)}}]),e}();t.AreaManager=p},9497:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BadgeManager=void 0;var s=n(730),l=n(6071),c=function(){function e(t){i(this,e),this.http=t}return o(e,[{key:"getAll",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/Badges?$expand=Person");case 2:if(204!==(t=e.sent).status){e.next=5;break}return e.abrupt("return",[]);case 5:return e.next=7,t.json();case 7:return n=e.sent,e.abrupt("return",n.value.map((function(e){return new l.BadgeRow(e)})));case 9:case"end":return e.stop()}}),e,this)})))}},{key:"addToPerson",value:function(e,t){return a(this,void 0,void 0,r.mark((function n(){var i,o,a;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(i=s.Helper.lightCloneObject(t))["odata.type"]="Prysm.AppControl.Data.Badge",n.next=4,this.http.post("AppControlDataService.svc/People("+e+")/Badges",JSON.stringify(i));case 4:return o=n.sent,n.next=7,o.json();case 7:return a=n.sent,n.abrupt("return",new l.BadgeRow(a));case 9:case"end":return n.stop()}}),n,this)})))}},{key:"getFromPerson",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppControlDataService.svc/People("+e+")/Badges");case 2:if(204!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.next=7,n.json();case 7:return i=t.sent,t.abrupt("return",i.map((function(e){return new l.BadgeRow(e)})));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"delete",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/Badges(BadgeTypeId="+e.BadgeTypeId+",Code='"+e.Code+"',Format='"+e.Format+"')",null,"DELETE");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"update",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Badge",t.next=4,this.http.post("AppControlDataService.svc/Badges(BadgeTypeId="+e.BadgeTypeId+",Code='"+e.Code+"',Format='"+e.Format+"')",JSON.stringify(n),"PUT");case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getFromBadgeType",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppControlDataService.svc/Badges?$expand=Person&$filter=BadgeTypeId eq "+e);case 2:if(204!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.next=7,n.json();case 7:return i=t.sent,t.abrupt("return",i.value.map((function(e){return new l.BadgeRow(e)})));case 9:case"end":return t.stop()}}),t,this)})))}}]),e}();t.BadgeManager=c},4182:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BadgeTypeManager=void 0;var s=n(730),l=n(835),c=function(){function e(t,n){i(this,e),this.http=t,this.rightManager=n}return o(e,[{key:"getAll",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/BadgeTypes");case 2:if(204!==(t=e.sent).status){e.next=5;break}return e.abrupt("return",[]);case 5:return e.next=7,t.json();case 7:return n=e.sent,e.abrupt("return",n.value.map((function(e){return new l.BadgeType(e)})));case 9:case"end":return e.stop()}}),e,this)})))}},{key:"add",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i,o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.BadgeType",t.next=4,this.http.post("AppControlDataService.svc/BadgeTypes",JSON.stringify(n));case 4:return i=t.sent,t.next=7,i.json();case 7:return o=t.sent,t.abrupt("return",new l.BadgeType(o));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"delete",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/BadgeTypes("+e+")",null,"DELETE");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"update",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.BadgeType",t.next=4,this.http.post("AppControlDataService.svc/BadgeTypes("+e.Id+")",JSON.stringify(n),"MERGE");case 4:case"end":return t.stop()}}),t,this)})))}}]),e}();t.BadgeTypeManager=c},1140:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CategoryManager=void 0;var s=n(730),l=n(8186),c=function(){function e(t){i(this,e),this.http=t}return o(e,[{key:"getAll",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/Categories");case 2:if(204!==(t=e.sent).status){e.next=5;break}return e.abrupt("return",[]);case 5:return e.next=7,t.json();case 7:return n=e.sent,e.abrupt("return",n.value.map((function(e){return new l.CategoryRow(e)})));case 9:case"end":return e.stop()}}),e,this)})))}},{key:"add",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i,o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Category",t.next=4,this.http.post("AppControlDataService.svc/Categories",JSON.stringify(n));case 4:return i=t.sent,t.next=7,i.json();case 7:return o=t.sent,t.abrupt("return",new l.CategoryRow(o));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"delete",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/Categories("+e+")",null,"DELETE");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"update",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Category",t.next=4,this.http.post("AppControlDataService.svc/Categories("+e.Id+")",JSON.stringify(n),"MERGE");case 4:case"end":return t.stop()}}),t,this)})))}}]),e}();t.CategoryManager=c},3815:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ChatManager=void 0;var s=n(4406),l=n(8838),c=n(5821),u=function(){function e(t,n){i(this,e),this.http=t,this.fileManager=n,this.newMessages=new s.Subject,this.talksUpdated=new s.Subject,this.talksDeleted=new s.Subject}return o(e,[{key:"addMessage",value:function(e){var t;return a(this,void 0,void 0,r.mark((function n(){var i,o,a,s,u;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i={TalkId:e.talkId,MessageType:null!==(t=e.type)&&void 0!==t?t:"Text"},"File"!=e.type||!e.attachedFile){n.next=9;break}return o=l.DateHelper.today(),a="Config/Histo/Chat/"+o.getFullYear()+"_"+("0"+(o.getMonth()+1)).slice(-2)+"/"+o.getDate()+"/Talk_"+e.talkId+"/"+e.attachedFile.fileName,n.next=6,this.fileManager.putFile(a,e.attachedFile.blob);case 6:i.Message=a,n.next=10;break;case 9:i.Message=e.content;case 10:return n.next=12,this.http.post("AppVisionService.svc/ChatManager/AddMessage",JSON.stringify(i),"POST");case 12:return s=n.sent,n.next=15,s.json();case 15:return u=n.sent,n.abrupt("return",new c.ChatMessage(u));case 17:case"end":return n.stop()}}),n,this)})))}},{key:"addTalk",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={Members:e.members,Title:e.title},t.next=3,this.http.post("AppVisionService.svc/ChatManager/AddTalk",JSON.stringify(n),"POST");case 3:return i=t.sent,t.t0=c.Talk,t.next=7,i.json();case 7:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"getMessages",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return a(this,void 0,void 0,r.mark((function i(){var o;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.http.get("AppVisionService.svc/ChatManager/GetMessages?talkid="+e+"&count="+t+"&page="+n);case 2:return o=r.sent,r.next=5,o.json();case 5:return r.abrupt("return",r.sent.map((function(e){return new c.ChatMessage(e)})));case 6:case"end":return r.stop()}}),i,this)})))}},{key:"getTalk",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppVisionService.svc/ChatManager/GetTalk?id="+e);case 2:return n=t.sent,t.next=5,n.json();case 5:return i=t.sent,t.abrupt("return",new c.Talk(i));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getTalks",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/ChatManager/GetTalks");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,e.abrupt("return",n.map((function(e){return new c.Talk(e)})));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"updateTalk",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={Id:e.id,Members:e.members,Title:e.title},t.next=3,this.http.post("AppVisionService.svc/ChatManager/UpdateTalk",JSON.stringify(n));case 3:return i=t.sent,t.t0=c.Talk,t.next=7,i.json();case 7:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"readMessage",value:function(e,t){return a(this,void 0,void 0,r.mark((function n(){var i;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.http.post("AppVisionService.svc/ChatManager/SetMessageRead?talkId="+e+"&messageId="+t,null);case 2:return i=n.sent,n.t0=c.Talk,n.next=6,i.json();case 6:return n.t1=n.sent,n.abrupt("return",new n.t0(n.t1));case 8:case"end":return n.stop()}}),n,this)})))}},{key:"leaveTalk",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/ChatManager/LeaveTalk?talkId="+e,null);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"closeTalk",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/ChatManager/CloseTalk?talkId="+e,null);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"updateMessagesInternal",value:function(e){this.newMessages.next(e)}},{key:"updateTalksInternal",value:function(e){var t=e.filter((function(e){return e.Id>=0})),n=e.filter((function(e){return e.Id<0}));t.length>0&&this.talksUpdated.next(t),n.length>0&&this.talksDeleted.next(n)}}]),e}();t.ChatManager=u},1379:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.CommandManager=void 0;var o=n(4406),a=n(3182),s=function(){function e(){r(this,e),this.commandReceived=new o.Subject}return i(e,[{key:"updateCommand",value:function(e){var t=e.replace("CommandClient;",""),n=a.CommandParser.parse(t);null!=e&&this.commandReceived.next(n)}}]),e}();t.CommandManager=s},5980:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DepartmentManager=void 0;var s=n(730),l=n(5195),c=function(){function e(t){i(this,e),this.http=t}return o(e,[{key:"getAll",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/Departments");case 2:if(204!==(t=e.sent).status){e.next=5;break}return e.abrupt("return",[]);case 5:return e.next=7,t.json();case 7:return n=e.sent,e.abrupt("return",n.value.map((function(e){return new l.DepartmentRow(e)})));case 9:case"end":return e.stop()}}),e,this)})))}},{key:"add",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i,o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Department",t.next=4,this.http.post("AppControlDataService.svc/Departments",JSON.stringify(n));case 4:return i=t.sent,t.next=7,i.json();case 7:return o=t.sent,t.abrupt("return",new l.DepartmentRow(o));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"delete",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/Departments("+e+")",null,"DELETE");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"update",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Department",t.next=4,this.http.post("AppControlDataService.svc/Departments("+e.Id+")",JSON.stringify(n),"MERGE");case 4:case"end":return t.stop()}}),t,this)})))}}]),e}();t.DepartmentManager=c},2073:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceManager=void 0;var s=n(6999),l=function(){function e(t){i(this,e),this.http=t}return o(e,[{key:"registerDevice",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i,o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={DeviceId:e.deviceId,DeviceName:e.deviceName,Type:e.type},t.next=3,this.http.post("AppVisionService.svc/DeviceManager/Register",JSON.stringify(n),"POST");case 3:return i=t.sent,t.next=6,i.json();case 6:return o=t.sent,t.abrupt("return",new s.DeviceInfos(o));case 8:case"end":return t.stop()}}),t,this)})))}}]),e}();t.DeviceManager=l},9862:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentManager=void 0;var s=n(8789),l=function(){function e(t,n,r){i(this,e),this.http=t,this.fileManager=n,this.optionManager=r}return o(e,[{key:"createEnvironment",value:function(e,t){var n,i;return a(this,void 0,void 0,r.mark((function o(){var a,s;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.toLowerCase().endsWith(".webenv")||(e+=".webenv"),a={isSideBarVisible:null===(n=t.isSideBarVisible)||void 0===n||n,isHeaderVisible:null===(i=t.isHeaderVisible)||void 0===i||i,layout:{containers:t.layout.containers,mode:t.layout.mode,properties:{}}},t.layout.properties&&t.layout.properties.forEach((function(e,t){a.layout.properties[t]=e})),s=JSON.stringify(a),r.next=6,this.fileManager.putFile("Config/Param/Client/"+e,new Blob([s],{type:"application/json"}));case 6:this.environments.indexOf(e)<0&&this.environments.push(e);case 7:case"end":return r.stop()}}),o,this)})))}},{key:"getEnvironment",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.fileManager.getFile("Config/Param/Client/"+e);case 2:if(n=t.sent,!e.endsWith(".webenv")){t.next=7;break}return t.abrupt("return",s.FileParser.parseWebEnvironment(n));case 7:if(!e.endsWith(".ctx")){t.next=9;break}return t.abrupt("return",s.FileParser.parseClassicContext(n));case 9:return t.abrupt("return",null);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"loadInternal",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n,i,o,a,l,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===(t=this.optionManager.get("WebApp.Main.Homepage"))||void 0===t?void 0:t.endsWith(".webenv"))){e.next=12;break}return e.prev=2,e.next=5,this.fileManager.getFile("Config/Param/Client/"+t);case 5:n=e.sent,this.homeEnv=s.FileParser.parseWebEnvironment(n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.error(e.t0);case 12:if(!(null===(i=this.optionManager.get("WebApp.Main.Homepage.Mobile"))||void 0===i?void 0:i.endsWith(".webenv"))){e.next=24;break}return e.prev=14,e.next=17,this.fileManager.getFile("Config/Param/Client/"+i);case 17:o=e.sent,this.homeEnvMobile=s.FileParser.parseWebEnvironment(o),e.next=24;break;case 21:e.prev=21,e.t1=e.catch(14),console.error(e.t1);case 24:return e.prev=24,e.next=27,this.http.get("Config/Param/Client/?action=PROPFIND&pattern=*.webenv");case 27:return a=e.sent,e.next=30,a.json();case 30:l=e.sent,this.environments=l,e.next=37;break;case 34:e.prev=34,e.t2=e.catch(24),console.error(e.t2);case 37:return e.prev=37,e.next=40,this.http.get("Config/Param/Client/?action=PROPFIND&pattern=*.ctx");case 40:return c=e.sent,e.next=43,c.json();case 43:u=e.sent,this.contexts=u,e.next=50;break;case 47:e.prev=47,e.t3=e.catch(37),console.error(e.t3);case 50:case"end":return e.stop()}}),e,this,[[2,9],[14,21],[24,34],[37,47]])})))}}]),e}();t.EnvironmentManager=l},6130:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;var s=n(4406),l=n(1502),c=n(2693),u=function(){function e(t){i(this,e),this.http=t,this.newEvents=new s.Subject}return o(e,[{key:"getHistoEvents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2500;return a(this,void 0,void 0,r.mark((function a(){var c,u,p;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c="AppVisionService.svc/GetHistoEvents?minId=0&maxCount=".concat(s,"&dateStart=").concat(e.toISOString(),"&dateEnd=").concat(t.toISOString()),null!=n&&""!==n&&(c+="&filters="+n),(null===i||void 0===i?void 0:i.length)>0&&(c+="&types="+i.join(",")),(null===o||void 0===o?void 0:o.length)>0&&(c+="&subtypes="+o.join(",")),r.next=6,this.http.get(c);case 6:return u=r.sent,r.next=9,u.json();case 9:return p=r.sent,r.abrupt("return",p.map((function(e){return new l.EventRow(e)})));case 11:case"end":return r.stop()}}),a,this)})))}},{key:"getHistoModifs",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2500;return a(this,void 0,void 0,r.mark((function i(){var o,a,s;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o="AppVisionService.svc/GetHistoModifs?minId=0&maxCount=".concat(n,"&dateStart=").concat(e.toISOString(),"&dateEnd=").concat(t.toISOString()),r.next=3,this.http.get(o);case 3:return a=r.sent,r.next=6,a.json();case 6:return s=r.sent,r.abrupt("return",s.map((function(e){return new c.ModifRow(e)})));case 8:case"end":return r.stop()}}),i,this)})))}},{key:"updateEvent",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/UpdateEvent",JSON.stringify(e));case 2:return n=t.sent,t.next=5,n.json();case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"addEvent",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post(encodeURI("AppVisionService.svc/AddEventRow"),JSON.stringify(e));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"updateEventsInternal",value:function(e){e&&this.newEvents.next(e)}}]),e}();t.EventManager=u},4529:function(e,t,n){"use strict";var r=n(3269).default,i=n(7757),o=n(4575).default,a=n(3913).default,s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FileManager=void 0;var l=n(5327),c=n(3878),u=n(4406),p=function(){function e(t){o(this,e),this.http=t,this.rowsUpdated=new u.Subject}return a(e,[{key:"getFileTree",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0?this.fileInfos.filter((function(e){return 5===e.TypeInt||t.indexOf(e.TypeInt)>-1})).map((function(e){return new c.FileInfoRow(e)})):this.fileInfos.map((function(e){return new c.FileInfoRow(e)}));return l.TreeRow.init(r,"\\")}},{key:"getAll",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0?this.fileInfos.filter((function(e){return t.indexOf(e.TypeInt)>-1})).map((function(e){return new c.FileInfoRow(e)})):this.fileInfos.map((function(e){return new c.FileInfoRow(e)}))}},{key:"getFile",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get(e);case 2:return n=t.sent,t.next=5,n.text();case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"deleteFile",value:function(e){return s(this,void 0,void 0,i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get(e+"?action=DELETE");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"putFile",value:function(e,t,n){return s(this,void 0,void 0,i.mark((function r(){return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.http.post(e,t,"PUT",n);case 2:case"end":return r.stop()}}),r,this)})))}},{key:"getConfigFileUrl",value:function(e){return this.http.host+"config/"+e}},{key:"getResourceFileUrl",value:function(e){return this.http.host+"resources/"+e}},{key:"getFileUrl",value:function(e){return new URL(e,this.http.host+"Config/Param/Client/").toString()}},{key:"getAppControlPhotoUrl",value:function(e){return new URL(e,this.http.host+"Config/Param/AppControl/Photos/").toString()}},{key:"loadInternal",value:function(){return s(this,void 0,void 0,i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetFileInfos");case 2:return t=e.sent,e.next=5,t.json();case 5:n=e.sent,this.fileInfos=n.filter((function(e){return 2===(2&e.ContextInt)}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"updateRowsInternal",value:function(e){var t,n=this,i=r(e.filter((function(e){return 2===(2&e.ContextInt)})));try{var o=function(){var e=t.value,r=n.fileInfos.findIndex((function(t){return t.Id===e.Id}));r>=0?n.fileInfos[r]=e:n.fileInfos.push(e)};for(i.s();!(t=i.n()).done;)o()}catch(c){i.e(c)}finally{i.f()}var a,s=r(e.filter((function(e){return e.Id<0})));try{var l=function(){var e=a.value,t=n.fileInfos.findIndex((function(t){return t.Id===Math.abs(e.Id)}));t>=0&&n.fileInfos.splice(t,1)};for(s.s();!(a=s.n()).done;)l()}catch(c){s.e(c)}finally{s.f()}this.rowsUpdated.next(e)}}]),e}();t.FileManager=p},1902:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GroupManager=void 0;var s=n(4406),l=n(5108),c=n(7372),u=n(5327),p=function(){function e(t){i(this,e),this.http=t,this.rowsUpdated=new s.Subject,this.statesChanged=new s.Subject}return o(e,[{key:"count",get:function(){return this.groups.length}},{key:"getGroupTree",value:function(){var e=this.groups.map((function(e){return new l.GroupRow(e)}));return u.TreeRow.init(e)}},{key:"getGroupById",value:function(e){var t=this.groups.find((function(t){return t.Id===e}));return t?new l.GroupRow(t):null}},{key:"getGroupByName",value:function(e){e.startsWith("$G.")&&(e=e.substring(3));var t=this.groups.find((function(t){return t.Name.toLowerCase()===e.toLowerCase()}));return t?new l.GroupRow(t):null}},{key:"loadInternal",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetGroupStates");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,i=n.map((function(e){return new c.GroupState(e)})),e.next=9,this.http.get("AppVisionService.svc/GetGroups");case 9:return t=e.sent,e.next=12,t.json();case 12:n=e.sent,this.groups=n.map((function(e){return new l.GroupRow(e)})),this.groups.forEach((function(e){var t=i.find((function(t){return t.Id===e.Id}));t&&(e.State=t)}));case 15:case"end":return e.stop()}}),e,this)})))}},{key:"updateRowsInternal",value:function(e){var t=this,n=[];e.forEach((function(e){var r=t.groups.findIndex((function(t){return t.Id===e.Id}));r>=0?t.groups[r]=e:t.groups.push(e),n.push(e)})),n.length>0&&this.rowsUpdated.next(n)}},{key:"updateStatesInternal",value:function(e){var t=this,n=[];e.forEach((function(e){var r=t.groups.find((function(t){return t.Id===e.Id}));r&&(r.State=e,n.push(e))})),n.length>0&&this.statesChanged.next(n)}}]),e}();t.GroupManager=p},3805:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.HolidayManager=void 0;var s=n(7496),l=function(){function e(t){i(this,e),this.http=t}return o(e,[{key:"getAll",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetHolidays");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,e.abrupt("return",n.map((function(e){return new s.HolidayRow(e)})));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"add",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/AddHoliday",JSON.stringify(e),"POST");case 2:return n=t.sent,t.next=5,n.text();case 5:return i=t.sent,t.abrupt("return",parseInt(i));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"delete",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/DeleteHoliday",JSON.stringify(e));case 2:t.sent;case 3:case"end":return t.stop()}}),t,this)})))}}]),e}();t.HolidayManager=l},3274:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseManager=void 0;var s=function(){function e(t){i(this,e),this.infos=new Map,this.http=t}return o(e,[{key:"get",value:function(e){return this.infos.get(e)||null}},{key:"loadInternal",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.infos.clear(),e.next=3,this.http.get("AppVisionService.svc/GetLicenseInfos");case 3:return t=e.sent,e.next=6,t.json();case 6:e.sent.forEach((function(e){n.infos.set(e.Name,e.Value)}));case 8:case"end":return e.stop()}}),e,this)})))}}]),e}();t.LicenseManager=s},4451:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.OperandManager=void 0;var o=function(){function e(t,n,i,o,a,s){r(this,e),this.op=new Proxy(this,{get:function(e,t){return e.read(t)},set:function(e,t,n){return e.write(t,n),!0}}),this.variableManager=t,this.alarmManager=i,this.areaManager=n,this.groupManager=o,this.userManager=a,this.protocolManager=s}return i(e,[{key:"write",value:function(e,t){if(!e.startsWith("$V."))throw new Error("Invalid operand");this.variableManager.set(e.substring(3),t.toString())}},{key:"read",value:function(e){return e.startsWith("$V.")?this.readVariable(e.substring(3)):e.startsWith("$A.")||e.startsWith("$G.")?this.readArea(e.substring(3)):e.startsWith("$U#")?this.readUser(e.substring(3)):e}},{key:"readVariable",value:function(e){var t,n,r,i,o,a,s,l,c,u,p=-1,d=e.match(/\.b[0-9]+$/);d&&(e=e.slice(0,d.index),p=parseInt(d[0].substring(2)));var h=e.split("#");h.length>1&&(e=h[0],u=h[1]);var f=this.variableManager.getRowByName(e);if(!f)return null;switch(u){case"Name":return f.Name;case"Desc":return f.FullDescription;case"WaitAck":var g=this.alarmManager.getAlarms().find((function(e){return e.SourceId===f.Id}));return!!g&&g.WaitAcknowledge;case"Alarm":return!!this.alarmManager.getAlarms().find((function(e){return e.SourceId===f.Id}));case"AreaDesc":var v=this.areaManager.getAreaById(f.AreaId);return v?v.Description:"";case"AreaName":var m=this.areaManager.getAreaById(f.AreaId);return m?m.Name:"";case"Date":return null===(t=f.State)||void 0===t?void 0:t.Date;case"Id":return f.Id;case"Info":return null===(n=f.State)||void 0===n?void 0:n.Info;case"Instructions":var y=this.alarmManager.getAlarms().find((function(e){return e.SourceId===f.Id}));return y?y.Instructions:null;case"IsAlarmMasked":return null===(r=f.State)||void 0===r?void 0:r.IsAlarmMasked;case"IsLocked":return null===(i=f.State)||void 0===i?void 0:i.IsLocked;case"MaxSeverity":var b=this.alarmManager.getAlarms().find((function(e){return e.SourceId===f.Id}));if(!b)return;return b.Severity;case"PreviousDate":return null===(o=f.State)||void 0===o?void 0:o.PreviousDate;case"PreviousValue":return null===(a=f.State)||void 0===a?void 0:a.PreviousValue;case"Quality":return null===(s=f.State)||void 0===s?void 0:s.Quality;case"WaitEnd":var x=this.alarmManager.getAlarms().find((function(e){return e.SourceId===f.Id}));return!!x&&x.WaitEnd;case"WaitReport":var w=this.alarmManager.getAlarms().find((function(e){return e.SourceId===f.Id}));return!!w&&w.WaitReport;case"WaitProcess":var _=this.alarmManager.getAlarms().find((function(e){return e.SourceId===f.Id}));return!!_&&_.WaitProcess;case"Sound":return;case"State":return null===(l=f.State)||void 0===l?void 0:l.valueDesc;case"Parameters":return f.FullParameters;case"SParameters":return null===(c=f.State)||void 0===c?void 0:c.Parameters;case"Symbol":case"Synoptic":case"CustomField1":case"CustomField2":case"CustomField3":case"CustomField4":case"CustomField5":return"";case"VideoLink":return f.FullVideoLink;default:var S=null===f||void 0===f?void 0:f.State.Value;return p>-1?parseInt(S)>>p&1:S}}},{key:"readArea",value:function(e){var t,n,r,i,o,a,s,l,c,u,p,d,h,f,g,v,m=e.split("#");m.length>1&&(e=m[0],v=m[1]);var y=this.areaManager.getAreaByName(e);if(!y)return null;switch(v){case"Name":return y.Name;case"Desc":return y.FullDescription;case"WaitAck":return null===(t=y.State)||void 0===t?void 0:t.isAlarmAcknowledgeWaiting;case"Alarm":return null===(n=y.State)||void 0===n?void 0:n.isAlarm;case"Id":return y.Id;case"AlarmProcessing":return null===(r=y.State)||void 0===r?void 0:r.isAlarmProcessing;case"AlarmWaiting":return null===(i=y.State)||void 0===i?void 0:i.isAlarmProcessWaiting;case"AlarmClosed":return null===(o=y.State)||void 0===o?void 0:o.isAlarmClosed;case"AlarmCount":return null===(a=y.State)||void 0===a?void 0:a.AlarmCount;case"WaitAckCount":return null===(s=y.State)||void 0===s?void 0:s.AlarmAcknowledgeWaitingCount;case"AlarmProcessingCount":return null===(l=y.State)||void 0===l?void 0:l.AlarmProcessingCount;case"AlarmWaitingCount":return null===(c=y.State)||void 0===c?void 0:c.AlarmProcessWaitingCount;case"AlarmClosedCount":return null===(u=y.State)||void 0===u?void 0:u.AlarmClosedCount;case"LockedCount":return null===(p=y.State)||void 0===p?void 0:p.LockedCount;case"MaskedCount":return null===(d=y.State)||void 0===d?void 0:d.MaskedCount;case"MaxSeverity":return null===(h=y.State)||void 0===h?void 0:h.MaxSeverity;case"OrValue":return null===(f=y.State)||void 0===f?void 0:f.OrValue;case"AndValue":return null===(g=y.State)||void 0===g?void 0:g.AndValue;default:return y.State}}},{key:"readGroup",value:function(e){var t,n,r,i,o,a,s,l,c,u,p,d,h,f,g,v=e.split("#");v.length>1&&(e=v[0],g=v[1]);var m=this.groupManager.getGroupByName(e);if(!m)return null;switch(g){case"Name":return m.Name;case"Desc":return m.FullDescription;case"WaitAck":return m.State.isAlarmAcknowledgeWaiting;case"Alarm":return null===(t=m.State)||void 0===t?void 0:t.isAlarm;case"Id":return m.Id;case"AlarmProcessing":return null===(n=m.State)||void 0===n?void 0:n.isAlarmProcessing;case"AlarmWaiting":return null===(r=m.State)||void 0===r?void 0:r.isAlarmProcessWaiting;case"AlarmClosed":return null===(i=m.State)||void 0===i?void 0:i.isAlarmClosed;case"AlarmCount":return null===(o=m.State)||void 0===o?void 0:o.AlarmCount;case"WaitAckCount":return null===(a=m.State)||void 0===a?void 0:a.AlarmAcknowledgeWaitingCount;case"AlarmProcessingCount":return null===(s=m.State)||void 0===s?void 0:s.AlarmProcessingCount;case"AlarmWaitingCount":return null===(l=m.State)||void 0===l?void 0:l.AlarmProcessWaitingCount;case"AlarmClosedCount":return null===(c=m.State)||void 0===c?void 0:c.AlarmClosedCount;case"LockedCount":return null===(u=m.State)||void 0===u?void 0:u.LockedCount;case"MaskedCount":return null===(p=m.State)||void 0===p?void 0:p.MaskedCount;case"MaxSeverity":return null===(d=m.State)||void 0===d?void 0:d.MaxSeverity;case"OrValue":return null===(h=m.State)||void 0===h?void 0:h.OrValue;case"AndValue":return null===(f=m.State)||void 0===f?void 0:f.AndValue;default:return m.State}}},{key:"readUser",value:function(e){var t=this.userManager.currentUser;if(!t)return null;if(e.startsWith("Profile."))return e=e.substring(8),t.profile.hasOwnProperty(e)?t.profile[e]:(console.warn("$U#Profile.".concat(e," is not supported")),null);if(t.hasOwnProperty(e))return t[e];switch(e){case"Fullname":return t.fullName;case"Options":return t.options;default:return console.warn("$U#".concat(e," is not supported")),null}}}]),e}();t.OperandManager=o},3501:function(e,t,n){"use strict";var r=n(3269).default,i=n(7757),o=n(4575).default,a=n(3913).default,s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OptionManager=void 0;var l=n(4406),c=function(){function e(t){o(this,e),this.http=t,this.rowsUpdated=new l.Subject}return a(e,[{key:"get",value:function(e){return this.options[e]}},{key:"set",value:function(e,t){return s(this,void 0,void 0,i.mark((function n(){return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.http.post("AppVisionService.svc/SetOption?name="+e,JSON.stringify(t));case 2:this.options[e]=t;case 3:case"end":return n.stop()}}),n,this)})))}},{key:"updateRowsInternal",value:function(e){var t,n=r(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.options[i.Name]=i.Value}}catch(o){n.e(o)}finally{n.f()}this.rowsUpdated.next(e)}},{key:"loadInternal",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n,o,a,s,l,c,u,p,d,h,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.options={},this.loadDefaultOptions(),t.next=4,this.http.get("AppVisionService.svc/GetOptions");case 4:return n=t.sent,t.next=7,n.json();case 7:o=t.sent,a=r(o);try{for(a.s();!(s=a.n()).done;)l=s.value,this.options[l.Name]=l.Value}catch(i){a.e(i)}finally{a.f()}for(c=0,u=Object.keys(e.currentUser.profile.options);c0&&this.itemAdded.next(n),i.length>0&&this.itemDeleted.next(i),o.length>0&&this.itemUpdated.next(o)}}]),e}();t.OverlayManager=p},7072:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PeopleManager=void 0;var s=n(730),l=n(5893),c=function(){function e(t){i(this,e),this.http=t}return o(e,[{key:"getAll",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,void 0,void 0,r.mark((function n(){var i,o,a;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=(null===(e=null===t||void 0===t?void 0:t.expands)||void 0===e?void 0:e.join(","))||"",n.next=3,this.http.get("AppControlDataService.svc/People?$expand="+i);case 3:if(204!==(o=n.sent).status){n.next=6;break}return n.abrupt("return",[]);case 6:return n.next=8,o.json();case 8:return a=n.sent,n.abrupt("return",a.value.map((function(e){return new l.PersonRow(e)})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"count",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/People/$count",{Accept:"*/*"});case 2:return t=e.sent,e.next=5,t.text();case 5:return n=e.sent,e.abrupt("return",parseInt(n));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"add",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i,o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Person",t.next=4,this.http.post("AppControlDataService.svc/People",JSON.stringify(n));case 4:return i=t.sent,t.next=7,i.json();case 7:return o=t.sent,t.abrupt("return",new l.PersonRow(o));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"delete",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/People("+e+")",null,"DELETE");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"update",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=s.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Person",t.next=4,this.http.post("AppControlDataService.svc/People("+e.Id+")",JSON.stringify(n),"MERGE");case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getFromDepartment",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppControlDataService.svc/People?$filter=DepartmentId eq "+e);case 2:if(204!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.next=7,n.json();case 7:return i=t.sent,t.abrupt("return",i.value.map((function(e){return new l.PersonRow(e)})));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"getFromCategory",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppControlDataService.svc/People?$filter=CategoryId eq "+e);case 2:if(204!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.next=7,n.json();case 7:return i=t.sent,t.abrupt("return",i.value.map((function(e){return new l.PersonRow(e)})));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"getFromAccessProfile",value:function(e){return a(this,void 0,void 0,r.mark((function t(){var n,i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppControlDataService.svc/PersonProfiles?$expand=Person&$filter=AccessProfileId eq "+e);case 2:if(204!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.next=7,n.json();case 7:return i=t.sent,t.abrupt("return",i.value.map((function(e){return new l.PersonRow(e.Person)})));case 9:case"end":return t.stop()}}),t,this)})))}}]),e}();t.PeopleManager=c},8345:function(e,t,n){"use strict";var r=n(7757),i=n(319).default,o=n(4575).default,a=n(3913).default,s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PersonZoneManager=void 0;var l=n(730),c=n(2034),u=function(){function e(t){o(this,e),this.http=t}return a(e,[{key:"getAll",value:function(){var e,t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(this,void 0,void 0,r.mark((function a(){var s,l,u,p;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=(null===o||void 0===o?void 0:o.expands.join(","))||"",l=[],(null===(e=null===o||void 0===o?void 0:o.filterZone)||void 0===e?void 0:e.length)>0&&(l=[].concat(i(l),i(o.filterZone.map((function(e){return"ZoneId eq "+e}))))),(null===(t=null===o||void 0===o?void 0:o.filterCategories)||void 0===t?void 0:t.length)>0&&(l=[].concat(i(l),i(o.filterCategories.map((function(e){return"Person/CategoryId eq "+e}))))),(null===(n=null===o||void 0===o?void 0:o.filterDepartments)||void 0===n?void 0:n.length)>0&&(l=[].concat(i(l),i(o.filterDepartments.map((function(e){return"Person/DepartmentId eq "+e}))))),r.next=7,this.http.get("AppControlDataService.svc/PersonZones()?$orderby=Person/LastName&$expand="+s+"&$filter="+l.join(" and "));case 7:if(204!==(u=r.sent).status){r.next=10;break}return r.abrupt("return",[]);case 10:return r.next=12,u.json();case 12:return p=r.sent,r.abrupt("return",p.value.map((function(e){return new c.PersonZone(e)})));case 14:case"end":return r.stop()}}),a,this)})))}},{key:"add",value:function(e){return s(this,void 0,void 0,r.mark((function t(){var n,i,o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=l.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.PersonZone",t.next=4,this.http.post("AppControlDataService.svc/PersonZones",JSON.stringify(n));case 4:return i=t.sent,t.next=7,i.json();case 7:return o=t.sent,t.abrupt("return",new c.PersonZone(o));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"delete",value:function(e){return s(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/PersonZones(PersonId="+e.PersonId+",ZoneId="+e.ZoneId+")",null,"DELETE");case 2:case"end":return t.stop()}}),t,this)})))}}]),e}();t.PersonZoneManager=u},6840:function(e,t,n){"use strict";var r=n(3269).default,i=n(7757),o=n(319).default,a=n(4575).default,s=n(3913).default,l=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolManager=void 0;var c=n(4406),u=n(316),p=n(644),d=function(){function e(t){a(this,e),this.http=t,this.statesChanged=new c.Subject}return s(e,[{key:"protocols",get:function(){return o(this.rows.values())}},{key:"protocolsStates",get:function(){return o(this.states.values())}},{key:"startProtocol",value:function(e){return l(this,void 0,void 0,i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppVisionService.svc/StartProtocol?protocolName="+e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"stopProtocol",value:function(e){return l(this,void 0,void 0,i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppVisionService.svc/StopProtocol?protocolName="+e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"sendDownload",value:function(e,t){return l(this,void 0,void 0,i.mark((function n(){return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.http.get("AppVisionService.svc/SendDownloadToProtocol?varNames="+e.join()+"¶meter="+t);case 2:case"end":return n.stop()}}),n,this)})))}},{key:"loadInternal",value:function(){return l(this,void 0,void 0,i.mark((function e(){var t,n,o,a,s,l,c,d,h,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetProtocolStates");case 2:return t=e.sent,e.next=5,t.json();case 5:n=e.sent,this.states=new Map,o=r(n);try{for(o.s();!(a=o.n()).done;)s=a.value,this.states.set(s.Name,new p.ProtocolState(s))}catch(i){o.e(i)}finally{o.f()}return e.next=11,this.http.get("AppVisionService.svc/GetProtocols");case 11:return t=e.sent,e.next=14,t.json();case 14:n=e.sent,this.rows=new Map,l=r(n);try{for(l.s();!(c=l.n()).done;)d=c.value,h=new u.ProtocolRow(d),null!=(f=this.states.get(d.Name))&&(f.Row=h,h.State=f),this.rows.set(d.Name,h)}catch(i){l.e(i)}finally{l.f()}case 18:case"end":return e.stop()}}),e,this)})))}},{key:"updateStatesInternal",value:function(e){var t=this,n=[];e.forEach((function(e){var r=t.rows.get(e.Name);r&&(r.State=e,e.Row=r,t.states.set(e.Name,e),n.push(e))})),n.length>0&&this.statesChanged.next(n)}}]),e}();t.ProtocolManager=d},3864:function(e,t,n){"use strict";var r=n(3269).default,i=n(7757),o=n(4575).default,a=n(3913).default,s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RightManager=void 0;var l=n(730),c=n(8468),u=n(2209),p=n(5893),d=function(){function e(t){o(this,e),this.http=t}return a(e,[{key:"addAccessProfileRight",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n,r,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=l.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.AccessProfileRight",t.next=4,this.http.post("AppControlDataService.svc/AccessProfiles("+e.AccessProfileId+")/AccessProfileRights",JSON.stringify(n));case 4:return r=t.sent,t.next=7,r.json();case 7:return o=t.sent,t.abrupt("return",new c.AccessProfileRightRow(o));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"deleteAccessProfileRight",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="AccessProfileId="+e.AccessProfileId+",CrisisLevel="+e.CrisisLevel+",ReaderId="+e.ReaderId,t.next=3,this.http.post("AppControlDataService.svc/AccessProfileRights("+n+")",null,"DELETE");case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getAccessProfileRights",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppControlDataService.svc/AccessProfiles("+e+")/AccessProfileRights");case 2:if(204!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.next=7,n.json();case 7:return r=t.sent,t.abrupt("return",r.value.map((function(e){return new c.AccessProfileRightRow(e)})));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"getPeopleRightMapByReader",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n,o,a,s,l,c,u,d,h,f,g,v,m,y,b,x,w,_,S,k,C,j,M,E,O,I,P;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],t.next=3,this.http.get("AppControlDataService.svc/AccessProfileRights?$expand=AccessProfile,AccessProfile/People,AccessProfile/People/Person,AccessProfile/Categories,AccessProfile/Categories/People,AccessProfile/Departments,AccessProfile/Departments/People&$filter=ReaderId eq "+e);case 3:if(204===(o=t.sent).status){t.next=11;break}return t.next=7,o.json();case 7:a=t.sent,s=a.value,l=r(s);try{for(l.s();!(c=l.n()).done;){u=c.value,d=r(u.AccessProfile.People);try{for(d.s();!(h=d.n()).done;)f=h.value,n.push({accessProfileId:u.AccessProfile.Id,person:new p.PersonRow(f.Person),ttId:u.TimetableId})}catch(i){d.e(i)}finally{d.f()}g=r(u.AccessProfile.Departments);try{for(g.s();!(v=g.n()).done;){m=v.value,y=r(m.People);try{for(y.s();!(b=y.n()).done;)x=b.value,n.push({accessProfileId:u.AccessProfile.Id,person:new p.PersonRow(x),ttId:u.TimetableId})}catch(i){y.e(i)}finally{y.f()}}}catch(i){g.e(i)}finally{g.f()}w=r(u.AccessProfile.Categories);try{for(w.s();!(_=w.n()).done;){S=_.value,k=r(S.People);try{for(k.s();!(C=k.n()).done;)j=C.value,n.push({accessProfileId:u.AccessProfile.Id,person:new p.PersonRow(j),ttId:u.TimetableId})}catch(i){k.e(i)}finally{k.f()}}}catch(i){w.e(i)}finally{w.f()}}}catch(i){l.e(i)}finally{l.f()}case 11:return t.next=13,this.http.get("AppControlDataService.svc/PersonRights?$expand=Person&$filter=ReaderId eq "+e);case 13:if(204===(o=t.sent).status){t.next=21;break}return t.next=17,o.json();case 17:M=t.sent,E=M.value,O=r(E);try{for(O.s();!(I=O.n()).done;)P=I.value,n.push({person:new p.PersonRow(P.Person),ttId:P.TimetableId})}catch(i){O.e(i)}finally{O.f()}case 21:return t.abrupt("return",n);case 22:case"end":return t.stop()}}),t,this)})))}},{key:"getPersonAccessExceptions",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppControlDataService.svc/People("+e+")/PersonRights");case 2:if(204!==(n=t.sent).status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.next=7,n.json();case 7:return r=t.sent,t.abrupt("return",r.value.map((function(e){return new u.PersonRightRow(e)})));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"deletePersonAccessException",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="CrisisLevel="+e.CrisisLevel+",PersonId="+e.PersonId+",ReaderId="+e.ReaderId,t.next=3,this.http.post("AppControlDataService.svc/PersonRights("+n+")",null,"DELETE");case 3:case"end":return t.stop()}}),t,this)})))}},{key:"addPersonAccessException",value:function(e){return s(this,void 0,void 0,i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=l.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.PersonRight",t.next=4,this.http.post("AppControlDataService.svc/People("+e.PersonId+")/PersonRights",JSON.stringify(n));case 4:case"end":return t.stop()}}),t,this)})))}}]),e}();t.RightManager=d},6571:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.RowCustomColorManager=void 0;var o=n(6e3),a=n(5049),s=function(){function e(t,n,i){r(this,e),this.customColors=[],this.optionManager=t,this.areaManager=n,this.alarmManager=i,this.loadInternal()}return i(e,[{key:"getCustomColors",value:function(){return this.customColors}},{key:"getCustomColor",value:function(e){var t;return this.customColors&&this.customColors.forEach((function(n){if(n.isMatch(e))return t=n})),t}},{key:"loadInternal",value:function(){for(var e=[],t=1;;t++){var n="App.CustomColor."+t,r=this.optionManager.get(n+".Filter"),i=this.getColor(n+".Background"),o=this.getColor(n+".Foreground");if(null==r||null==i||null==o)break;e.push(new a.CustomColor(r,i,o,this.alarmManager,this.areaManager))}e&&e.length>0&&(this.customColors=e)}},{key:"getColor",value:function(e){return o.ColorHelper.xamlToCssColor(this.optionManager.get(e))}}]),e}();t.RowCustomColorManager=s},1224:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RTManager=void 0;var s=function(){function e(t){i(this,e),this.labels=new Map,this.http=t}return o(e,[{key:"get",value:function(e){return this.labels.get(e)||e}},{key:"loadFile",value:function(e,t){return a(this,void 0,void 0,r.mark((function n(){return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.length>2&&(t=t.substring(0,2)),n.next=3,this.downloadAndLoadFile(e,t);case 3:case"end":return n.stop()}}),n,this)})))}},{key:"downloadAndLoadFile",value:function(e,t){return a(this,void 0,void 0,r.mark((function n(){var i,o,a,s,l,c,u,p,d;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.http.get("Resources/"+e);case 3:return o=n.sent,n.next=6,o.arrayBuffer();case 6:a=n.sent,i=new TextDecoder("utf-16").decode(a).split("\n"),n.next=14;break;case 10:return n.prev=10,n.t0=n.catch(0),console.error("[RTManager] - Cannot load languages file : '"+e+"'.",n.t0),n.abrupt("return");case 14:s=-1,l=new Map,c=null,u=0,p=0;case 19:if(!(p=0?e.Status===u.ScenarioStatus.Stopped?r.Instances.splice(i,1):r.Instances[i]=e:r.Instances.push(e),n.push(e)}})),n.length>0&&this.statesChanged.next(n)}}]),e}();t.ScenarioManager=d},4658:function(e,t,n){"use strict";var r=n(3269).default,i=n(7757),o=n(319).default,a=n(4575).default,s=n(3913).default,l=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserManager=void 0;var c=n(5488),u=n(6492),p=n(6940),d=n(4406),h=function(){function e(t){a(this,e),this.http=t,this.rows=new Map,this.stateChanged=new d.Subject,this.rowsUpdated=new d.Subject,this.rowsAdded=new d.Subject,this.rowsDeleted=new d.Subject}return s(e,[{key:"getUsers",value:function(){return o(this.rows.values())}},{key:"getConnectedUsers",value:function(){return l(this,void 0,void 0,i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetUsersConnected");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,e.abrupt("return",n.map((function(e){return new u.ClientInfo(e)})));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getProfiles",value:function(){return l(this,void 0,void 0,i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetProfiles");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,e.abrupt("return",n.map((function(e){return new p.ProfileRow(e)})));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getUsersByProfileName",value:function(e){return l(this,void 0,void 0,i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("AppVisionService.svc/GetUsersByProfile?name="+e);case 2:return n=t.sent,t.next=5,n.json();case 5:return r=t.sent,t.abrupt("return",r.map((function(e){return new c.UserRow(e)})));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getUserById",value:function(e){return this.rows.get(e)}},{key:"deleteUser",value:function(e){return l(this,void 0,void 0,i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/DeleteUser",JSON.stringify(e));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"addUser",value:function(e){return l(this,void 0,void 0,i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/AddUser",JSON.stringify(e));case 2:return n=t.sent,t.next=5,n.text();case 5:return r=t.sent,t.abrupt("return",parseInt(r));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"updateProfile",value:function(e){return l(this,void 0,void 0,i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/UpdateProfile",JSON.stringify(e));case 2:return n=t.sent,t.next=5,n.json();case 5:if(t.sent){t.next=8;break}throw new Error("Server returned false");case 8:case"end":return t.stop()}}),t,this)})))}},{key:"checkRight",value:function(e){if(!this.currentUser)return!1;switch(e){case"Display.Left":return this.currentUser.checkRight("Display.Left.Synoptic")||this.currentUser.checkRight("Display.Left.Area")||this.currentUser.checkRight("Display.Left.Group")||this.currentUser.checkRight("Display.Left.Layout")||this.currentUser.checkRight("Display.Left.Standard")||this.currentUser.checkRight("Display.Left.Cycle")||this.currentUser.checkRight("Display.Left.Video");case"Display.Right":return this.currentUser.checkRight("Display.Right.Video")||this.currentUser.checkRight("Display.Right.Audio");case"Display.Left.Synoptic":return this.currentUser.checkRight(e)&&this.currentUser.checkRight("Display.Synoptic");case"Display.Left.Layout":return this.currentUser.checkRight(e)&&this.currentUser.checkRight("Client.ChangeLayout");case"Display.Left.Cycle":return this.currentUser.checkRight(e)&&this.currentUser.checkRight("Client.LoadCycle");case"Display.Left.Video":return this.currentUser.checkRight(e)&&this.currentUser.checkRight("Video.Live");case"Video.PlaybackOnAlarm":return this.currentUser.checkRight("Video.PlaybackOnAlarm")||this.currentUser.checkRight("Video.Playback");case"Video.Ptz":return this.currentUser.checkRight("Video.PtzMove")||this.currentUser.checkRight("Video.PtzGotoPreset")||this.currentUser.checkRight("Video.PtzRunPattern");case"MenuAdministration":return this.currentUser.checkRight("Configure.User")||this.currentUser.checkRight("Server.Maintenance")}return this.currentUser.checkRight(e)}},{key:"changePassword",value:function(e,t,n){return l(this,void 0,void 0,i.mark((function r(){return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.http.post("AppVisionService.svc/ChangePassword",JSON.stringify([{Name:"username",Value:e},{Name:"oldpassword",Value:t},{Name:"newpassword",Value:n}]),"POST",null);case 2:case"end":return r.stop()}}),r,this)})))}},{key:"loadInternal",value:function(){return l(this,void 0,void 0,i.mark((function e(){var t,n,o,a,s,l,u,d;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetCurrentUser");case 2:return t=e.sent,e.next=5,t.json();case 5:return n=e.sent,this.currentUser=new c.UserRow(n),e.next=9,this.http.get("AppVisionService.svc/GetProfileById?id="+this.currentUser.ProfileId);case 9:return t=e.sent,e.next=12,t.json();case 12:return o=e.sent,this.currentUser.profile=new p.ProfileRow(o),e.next=16,this.http.get("AppVisionService.svc/GetUsers");case 16:return t=e.sent,e.next=19,t.json();case 19:a=e.sent,s=a.map((function(e){return new c.UserRow(e)})),l=r(s);try{for(l.s();!(u=l.n()).done;)d=u.value,this.rows.set(d.Id,d)}catch(i){l.e(i)}finally{l.f()}case 23:case"end":return e.stop()}}),e,this)})))}},{key:"updateRowsInternal",value:function(e){var t,n=[],i=[],o=[],a=r(e);try{for(a.s();!(t=a.n()).done;){var s=t.value;s.Id<0?(this.rows.delete(Math.abs(s.Id)),i.push(s)):(this.rows.has(s.Id)?o.push(s):n.push(s),this.rows.set(s.Id,s))}}catch(l){a.e(l)}finally{a.f()}n.length>0&&this.rowsAdded.next(n),i.length>0&&this.rowsDeleted.next(i),o.length>0&&this.rowsUpdated.next(o)}},{key:"updateStateInternal",value:function(e){this.currentUser.State=e,this.stateChanged.next(e)}}]),e}();t.UserManager=h},9838:function(e,t,n){"use strict";var r=n(7757),i=n(319).default,o=n(3269).default,a=n(4575).default,s=n(3913).default,l=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UserMessageManager=void 0;var c=n(3587),u=n(6465),p=function(){function e(t,n){var r,i,s,l,u,p;a(this,e),this.categories=[],this.http=t;var d=n.get("App.Client.UserMessage.MessageObjects");if(d){var h=(new c.XmlParser).parseFromString(d).getElementsByTagName("ArrayOfUserMessageCategory")[0],f=[];if(h){var g=h.getElementsByTagName("UserMessageCategory");if(g){var v,m=o(g);try{for(m.s();!(v=m.n()).done;){var y=v.value,b=[],x=y.getElementsByTagName("Properties")[0];if(x){var w=x.getElementsByTagName("UserMessageCategoryProperty");if(w){var _,S=o(w);try{for(S.s();!(_=S.n()).done;){var k=_.value;b.push({Name:k.getElementsByTagName("Name")[0].value,Description:null===(r=k.getElementsByTagName("Description")[0])||void 0===r?void 0:r.value,Required:"true"===(null===(s=null===(i=k.getElementsByTagName("IsRequired")[0])||void 0===i?void 0:i.value)||void 0===s?void 0:s.toLowerCase()),Values:null===(l=k.getElementsByTagName("Value")[0])||void 0===l?void 0:l.value,Type:null===(u=k.getElementsByTagName("Type")[0])||void 0===u?void 0:u.value})}}catch(C){S.e(C)}finally{S.f()}}}f.push({Description:null===(p=y.getElementsByTagName("Description")[0])||void 0===p?void 0:p.value,Properties:b})}}catch(C){m.e(C)}finally{m.f()}}}this.categories=f}}return s(e,[{key:"getCategories",value:function(){return i(this.categories)}},{key:"getAll",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500;return l(this,void 0,void 0,r.mark((function o(){var a,s,l;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a="AppVisionService.svc/GetUserMessages?minId=0&maxCount=".concat(i,"&dateStart=").concat(e.toISOString()),t&&(a+="&dateEnd=".concat(t.toISOString())),n&&(a+="&filters=".concat(n)),r.next=5,this.http.get(a);case 5:return s=r.sent,r.next=8,s.json();case 8:return l=r.sent,r.abrupt("return",l.map((function(e){return new u.UserMessageRow(e)})));case 10:case"end":return r.stop()}}),o,this)})))}}]),e}();t.UserMessageManager=p},1230:function(e,t,n){"use strict";var r=n(3269).default,i=n(319).default,o=n(7757),a=n(4575).default,s=n(3913).default,l=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VariableManager=void 0;var c=n(4406),u=n(4071),p=n(9488),d=n(9797),h=n(5327),f=n(730),g=function(){function e(t){a(this,e),this.http=t,this.rowsAdded=new c.Subject,this.rowsUpdated=new c.Subject,this.rowsDeleted=new c.Subject,this.statesChanged=new c.Subject}return s(e,[{key:"set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return l(this,void 0,void 0,o.mark((function i(){return o.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return r||(r=[]),r.push({Name:"@name",Value:e}),r.push({Name:"@value",Value:t}),null!==n&&r.push({Name:"@info",Value:n}),i.next=6,this.http.post("AppVisionService.svc/SetVariableExt",JSON.stringify(r));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"lock",value:function(e,t,n){return l(this,void 0,void 0,o.mark((function r(){var i;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i="AppVisionService.svc/LockVariableExt?name=".concat(e,"&isLocked=").concat(t),r.next=3,this.http.post(encodeURI(i),JSON.stringify(n));case 3:case"end":return r.stop()}}),r,this)})))}},{key:"updateVariable",value:function(e){return l(this,void 0,void 0,o.mark((function t(){var n,r,i;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return"AppVisionService.svc/UpdateVariable",n=f.Helper.lightCloneObject(e),t.next=4,this.http.post(encodeURI("AppVisionService.svc/UpdateVariable"),JSON.stringify(n));case 4:return r=t.sent,t.next=7,r.json();case 7:return i=t.sent,t.abrupt("return",i);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"add",value:function(e){return l(this,void 0,void 0,o.mark((function t(){var n,r;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/AddVariable2",JSON.stringify(e),"POST");case 2:return n=t.sent,t.next=5,n.json();case 5:return r=t.sent,t.abrupt("return",new u.VariableRow(r));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"adds",value:function(e){return l(this,void 0,void 0,o.mark((function t(){var n,r;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppVisionService.svc/AddVariables",JSON.stringify(e),"POST");case 2:return n=t.sent,t.next=5,n.json();case 5:return r=t.sent,t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"delete",value:function(e){return l(this,void 0,void 0,o.mark((function t(){var n,r,i;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=f.Helper.lightCloneObject(e),t.next=3,this.http.post("AppVisionService.svc/DeleteVariable",JSON.stringify(n),"POST");case 3:return r=t.sent,t.next=6,r.json();case 6:return i=t.sent,t.abrupt("return",i);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"getRows",value:function(){return i(this.rowsById.values())}},{key:"getStates",value:function(){return i(this.states.values())}},{key:"getRowById",value:function(e){return this.rowsById.get(e)}},{key:"getRowByName",value:function(e){return(e.startsWith("$V.")||e.startsWith("$v."))&&(e=e.substring(3)),this.rowsByName.get(e)}},{key:"getStateByName",value:function(e){return(e.startsWith("$V.")||e.startsWith("$v."))&&(e=e.substring(3)),this.states.get(e)}},{key:"getStateById",value:function(e){var t=this.rowsById.get(e);return null==t?null:this.getStateByName(t.Name)}},{key:"getRowsByType",value:function(e){return this.getRows().filter((function(t){return t.Type===e})).map((function(e){return new u.VariableRow(e)}))}},{key:"getHistoValues",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500;return l(this,void 0,void 0,o.mark((function i(){var a,s,l;return o.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a="AppVisionService.svc/GetHistoValues?index=0"+"&count=".concat(r)+"&dateStart=".concat(e.toISOString())+"&dateEnd=".concat(t.toISOString())+"&names=".concat(n.join(",")),i.next=3,this.http.get(a);case 3:return s=i.sent,i.next=6,s.json();case 6:return l=i.sent,i.abrupt("return",l.map((function(e){return new d.ValueRow(e)})));case 8:case"end":return i.stop()}}),i,this)})))}},{key:"loadInternal",value:function(){return l(this,void 0,void 0,o.mark((function e(){var t,n,a,s,l,c,d,f,g,v;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppVisionService.svc/GetVariableStates");case 2:return t=e.sent,e.next=5,t.json();case 5:n=e.sent,this.states=new Map,a=r(n);try{for(a.s();!(s=a.n()).done;)l=s.value,this.states.set(l.Name,new p.VariableState(l))}catch(o){a.e(o)}finally{a.f()}return e.next=11,this.http.get("AppVisionService.svc/GetVariables");case 11:return t=e.sent,e.next=14,t.json();case 14:n=e.sent,this.rowsByName=new Map,this.rowsById=new Map,c=r(n);try{for(c.s();!(d=c.n()).done;)f=d.value,g=new u.VariableRow(f),(v=this.states.get(f.Name))&&(v.Row=g,g.State=v),this.rowsByName.set(f.Name,g),this.rowsById.set(f.Id,g)}catch(o){c.e(o)}finally{c.f()}h.TreeRow.init(i(this.rowsByName.values()));case 20:case"end":return e.stop()}}),e,this)})))}},{key:"updateRowsInternal",value:function(e){return l(this,void 0,void 0,o.mark((function t(){var n,r,a,s,l,c=this;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],r=[],a=[],s=o.mark((function t(s){var l,p,d,h,f,g;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=e[s],p=c.getRowById(l.Id),null==c.getStateByName(l.Name)&&(d=c.getRows().find((function(e){return e.Id===l.Id})))&&c.rowsByName.delete(d.Name),null!=p){t.next=14;break}if(l.Type===u.VariableType.Node){t.next=9;break}return t.next=7,c.getVariableState(l.Id);case 7:(h=t.sent)&&(l.State=h,h.Row=l,c.states.set(h.Name,h));case 9:c.rowsByName.set(l.Name,l),c.rowsById.set(l.Id,l),n.push(l),t.next=15;break;case 14:!0===l.IsExclude?(f=[l],c.rowsByName.delete(l.Name),c.rowsById.delete(l.Id),c.states.delete(l.Name),l.Type===u.VariableType.Node&&(i(c.rowsByName.keys()).filter((function(e){return e.startsWith(l.Name+".")})).forEach((function(e){return c.rowsByName.delete(e)})),i(c.states.keys()).filter((function(e){return e.startsWith(l.Name+".")})).forEach((function(e){return c.states.delete(e)})),i(c.rowsById).filter((function(e){return e[1].Name.startsWith(l.Name+".")})).forEach((function(e){f.push(e[1]),c.rowsById.delete(e[0])}))),a=[].concat(i(a),f)):((g=p.State)&&(l.State=g,g.Row=l),c.rowsByName.set(l.Name,l),c.rowsById.set(l.Id,l),r.push(l));case 15:case"end":return t.stop()}}),t)})),l=0;case 5:if(!(l0&&this.rowsAdded.next(n),a.length>0&&this.rowsDeleted.next(a),r.length>0&&this.rowsUpdated.next(r);case 13:case"end":return t.stop()}}),t,this)})))}},{key:"updateStatesInternal",value:function(e){var t=this,n=[];e.forEach((function(e){var r=t.rowsByName.get(e.Name);r&&(r.State=e,e.Row=r,t.states.set(e.Name,e),n.push(e))})),n.length>0&&this.statesChanged.next(n)}},{key:"getVariableState",value:function(e){return l(this,void 0,void 0,o.mark((function t(){var n,r;return o.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.http.get("AppVisionService.svc/GetVariableStateById?id="+e);case 3:return n=t.sent,t.next=6,n.json();case 6:return r=t.sent,t.abrupt("return",new p.VariableState(r));case 10:return t.prev=10,t.t0=t.catch(0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,this,[[0,10]])})))}}]),e}();t.VariableManager=g},1252:function(e,t,n){"use strict";var r=n(4575).default,i=n(3913).default;Object.defineProperty(t,"__esModule",{value:!0}),t.VideoManager=void 0;var o=n(6604),a=function(){function e(t,n){r(this,e),this.http=t,this.variableManager=n}return i(e,[{key:"createLiveCamera",value:function(e){e.startsWith("$V.")||(e="$V."+e);var t=this.variableManager.getRows().find((function(t){return"$V."+t.Name===e}));return t?new o.Camera(this.http,t):null}},{key:"createPlaybackCamera",value:function(e,t){e.startsWith("$V.")||(e="$V."+e);var n=this.variableManager.getRows().find((function(t){return"$V."+t.Name===e}));return n?new o.Camera(this.http,n,t):null}}]),e}();t.VideoManager=a},3680:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VisitorManager=void 0;var s=n(8838),l=n(730),c=n(6071),u=n(5833),p=function(){function e(t){i(this,e),this.http=t}return o(e,[{key:"getAll",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,void 0,void 0,r.mark((function n(){var i,o,a;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=(null===(e=null===t||void 0===t?void 0:t.expands)||void 0===e?void 0:e.join(","))||"",n.next=3,this.http.get("AppControlDataService.svc/Visitors?$expand="+i);case 3:if(204!==(o=n.sent).status){n.next=6;break}return n.abrupt("return",[]);case 6:return n.next=8,o.json();case 8:return a=n.sent,n.abrupt("return",a.value.map((function(e){return new u.VisitorRow(e)})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"getById",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a(this,void 0,void 0,r.mark((function i(){var o,a,s;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=(null===(t=null===n||void 0===n?void 0:n.expands)||void 0===t?void 0:t.join(","))||"",r.next=3,this.http.get("AppControlDataService.svc/Visitors("+e+")?$expand="+o);case 3:return a=r.sent,r.next=6,a.json();case 6:return s=r.sent,r.abrupt("return",new u.VisitorRow(s));case 8:case"end":return r.stop()}}),i,this)})))}},{key:"count",value:function(){return a(this,void 0,void 0,r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/Visitors/$count",{Accept:"*/*"});case 2:return t=e.sent,e.next=5,t.text();case 5:return n=e.sent,e.abrupt("return",parseInt(n));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return a(this,void 0,void 0,r.mark((function n(){var i,o,a,u,p;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=new RegExp('"',"g"),t||(t=new c.BadgeRow({})),t.Status||(t.Status=0),e.DateCreation=s.DateHelper.toDateTimeString(new Date),e.DateModification=s.DateHelper.toDateTimeString(new Date),e.DateValidation=s.DateHelper.toDateTimeString(new Date),o='{\n\t\t\t"Visitor": "'.concat(JSON.stringify(l.Helper.lightCloneObject(e)).replace(i,"'"),'",\n\t\t\t"Badge": "').concat(JSON.stringify(l.Helper.lightCloneObject(t)).replace(i,"'"),'"\n\t\t}'),n.next=9,this.http.post("AppControlDataService.svc/AddVisitor",o);case 9:return a=n.sent,n.next=12,a.json();case 12:return u=n.sent,n.next=15,this.getById(parseInt(u.value),{expands:["Person","Person/Badges"]});case 15:return p=n.sent,n.abrupt("return",p);case 17:case"end":return n.stop()}}),n,this)})))}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return a(this,void 0,void 0,r.mark((function n(){var i,o,a;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=new RegExp('"',"g"),t||(t=new c.BadgeRow({})),t.Status||(t.Status=0),o='{\n\t\t\t"Visitor": "'.concat(JSON.stringify(l.Helper.lightCloneObject(e)).replace(i,"'"),'",\n\t\t\t"Badge": "').concat(JSON.stringify(l.Helper.lightCloneObject(t)).replace(i,"'"),'"\n\t\t}'),n.next=6,this.http.post("AppControlDataService.svc/UpdateVisitor",o);case 6:return n.next=8,this.getById(e.Id,{expands:["Person","Person/Badges"]});case 8:return a=n.sent,n.abrupt("return",a);case 10:case"end":return n.stop()}}),n,this)})))}},{key:"delete",value:function(e){return a(this,void 0,void 0,r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/RemoveVisitor?id="+e,null);case 2:case"end":return t.stop()}}),t,this)})))}}]),e}();t.VisitorManager=p},4738:function(e,t,n){"use strict";var r=n(3269).default,i=n(7757),o=n(4575).default,a=n(3913).default,s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ZoneManager=void 0;var l=n(730),c=n(9872),u=function(){function e(t){o(this,e),this.http=t}return a(e,[{key:"getAll",value:function(){return s(this,void 0,void 0,i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/Zones?$expand=ZoneReaderIns,ZoneReaderOuts");case 2:if(204!==(t=e.sent).status){e.next=5;break}return e.abrupt("return",[]);case 5:return e.next=7,t.json();case 7:return n=e.sent,e.abrupt("return",n.value.map((function(e){return new c.Zone(e)})));case 9:case"end":return e.stop()}}),e,this)})))}},{key:"count",value:function(){return s(this,void 0,void 0,i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("AppControlDataService.svc/Zones/$count",{Accept:"*/*"});case 2:return t=e.sent,e.next=5,t.text();case 5:return n=e.sent,e.abrupt("return",parseInt(n));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"add",value:function(e){var t,n;return s(this,void 0,void 0,i.mark((function o(){var a,s,u,p,d,h,f,g,v,m;return i.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return(a=l.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Zone",i.next=4,this.http.post("AppControlDataService.svc/Zones",JSON.stringify(a));case 4:return s=i.sent,i.next=7,s.json();case 7:if(u=i.sent,(p=new c.Zone(u)).ZoneReaderIns=[],p.ZoneReaderOuts=[],!((null===(t=e.ZoneReaderIns)||void 0===t?void 0:t.length)>0)){i.next=30;break}d=r(e.ZoneReaderIns),i.prev=13,d.s();case 15:if((h=d.n()).done){i.next=22;break}return f=h.value,i.next=19,this.http.post("AppControlDataService.svc/Zones(".concat(p.Id,")/ZoneReaderIns"),JSON.stringify({ZoneId:p.Id,ReaderId:f.ReaderId,"odata.type":"Prysm.AppControl.Data.ZoneReaderIn"}));case 19:p.ZoneReaderIns.push(new c.ZoneReaderIn({ZoneId:p.Id,ReaderId:f.ReaderId}));case 20:i.next=15;break;case 22:i.next=27;break;case 24:i.prev=24,i.t0=i.catch(13),d.e(i.t0);case 27:return i.prev=27,d.f(),i.finish(27);case 30:if(!((null===(n=e.ZoneReaderOuts)||void 0===n?void 0:n.length)>0)){i.next=49;break}g=r(e.ZoneReaderOuts),i.prev=32,g.s();case 34:if((v=g.n()).done){i.next=41;break}return m=v.value,i.next=38,this.http.post("AppControlDataService.svc/Zones(".concat(p.Id,")/ZoneReaderOuts"),JSON.stringify({ZoneId:p.Id,ReaderId:m.ReaderId,"odata.type":"Prysm.AppControl.Data.ZoneReaderOut"}));case 38:p.ZoneReaderOuts.push(new c.ZoneReaderOut({ZoneId:p.Id,ReaderId:m.ReaderId}));case 39:i.next=34;break;case 41:i.next=46;break;case 43:i.prev=43,i.t1=i.catch(32),g.e(i.t1);case 46:return i.prev=46,g.f(),i.finish(46);case 49:return i.abrupt("return",p);case 50:case"end":return i.stop()}}),o,this,[[13,24,27,30],[32,43,46,49]])})))}},{key:"delete",value:function(e){return s(this,void 0,void 0,i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("AppControlDataService.svc/Zones("+e+")",null,"DELETE");case 2:case"end":return t.stop()}}),t,this)})))}},{key:"update",value:function(e,t){var n,o,a,u;return s(this,void 0,void 0,i.mark((function s(){var p,d,h,f,g,v,m,y,b,x,w,_,S,k,C,j;return i.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if((p=l.Helper.lightCloneObject(e))["odata.type"]="Prysm.AppControl.Data.Zone",!t){i.next=87;break}return i.next=5,this.http.get("AppControlDataService.svc/Zones("+e.Id+")?$expand=ZoneReaderIns,ZoneReaderOuts");case 5:if(204===(d=i.sent).status){i.next=47;break}return i.next=9,d.json();case 9:if(h=i.sent,f=new c.Zone(h),!((null===(n=f.ZoneReaderIns)||void 0===n?void 0:n.length)>0)){i.next=29;break}g=r(f.ZoneReaderIns),i.prev=13,g.s();case 15:if((v=g.n()).done){i.next=21;break}return m=v.value,i.next=19,this.http.post("AppControlDataService.svc/ZoneReaderIns(ReaderId=".concat(m.ReaderId,",ZoneId=").concat(m.ZoneId,")"),null,"DELETE");case 19:i.next=15;break;case 21:i.next=26;break;case 23:i.prev=23,i.t0=i.catch(13),g.e(i.t0);case 26:return i.prev=26,g.f(),i.finish(26);case 29:if(!((null===(o=f.ZoneReaderOuts)||void 0===o?void 0:o.length)>0)){i.next=47;break}y=r(f.ZoneReaderOuts),i.prev=31,y.s();case 33:if((b=y.n()).done){i.next=39;break}return x=b.value,i.next=37,this.http.post("AppControlDataService.svc/ZoneReaderOuts(ReaderId=".concat(x.ReaderId,",ZoneId=").concat(x.ZoneId,")"),null,"DELETE");case 37:i.next=33;break;case 39:i.next=44;break;case 41:i.prev=41,i.t1=i.catch(31),y.e(i.t1);case 44:return i.prev=44,y.f(),i.finish(44);case 47:if(!((null===(a=e.ZoneReaderIns)||void 0===a?void 0:a.length)>0)){i.next=67;break}w=r(e.ZoneReaderIns),i.prev=49,w.s();case 51:if((_=w.n()).done){i.next=59;break}return S=_.value,l.Helper.lightCloneObject(S)["odata.type"]="Prysm.AppControl.Data.ZoneReaderIn",i.next=57,this.http.post("AppControlDataService.svc/Zones(".concat(e.Id,")/ZoneReaderIns"),JSON.stringify(S));case 57:i.next=51;break;case 59:i.next=64;break;case 61:i.prev=61,i.t2=i.catch(49),w.e(i.t2);case 64:return i.prev=64,w.f(),i.finish(64);case 67:if(!((null===(u=e.ZoneReaderOuts)||void 0===u?void 0:u.length)>0)){i.next=87;break}k=r(e.ZoneReaderOuts),i.prev=69,k.s();case 71:if((C=k.n()).done){i.next=79;break}return j=C.value,l.Helper.lightCloneObject(j)["odata.type"]="Prysm.AppControl.Data.ZoneReaderOut",i.next=77,this.http.post("AppControlDataService.svc/Zones(".concat(e.Id,")/ZoneReaderOuts"),JSON.stringify(j));case 77:i.next=71;break;case 79:i.next=84;break;case 81:i.prev=81,i.t3=i.catch(69),k.e(i.t3);case 84:return i.prev=84,k.f(),i.finish(84);case 87:return i.next=89,this.http.post("AppControlDataService.svc/Zones("+e.Id+")",JSON.stringify(p),"MERGE");case 89:case"end":return i.stop()}}),s,this,[[13,23,26,29],[31,41,44,47],[49,61,64,67],[69,81,84,87]])})))}}]),e}();t.ZoneManager=u},9022:function(e,t,n){"use strict";var r=n(7757),i=n(4575).default,o=n(3913).default,a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpService=void 0;var s=n(6207),l=n(4866),c=function(){function e(t){i(this,e),this.headers={Accept:"application/json","Content-Type":"application/json"},this._host=t,this._host.endsWith("/")||(this._host+="/")}return o(e,[{key:"host",get:function(){return this._host}},{key:"addGlobalHeaders",value:function(e,t){this.headers[e]=t}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.DEFAULT_HTTP_TIMEOUT;return a(this,void 0,void 0,r.mark((function o(){var a,c;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,s.HttpHelper.fetchWithTimeout(this._host+e,i,{headers:Object.assign(Object.assign({},this.headers),t),cache:"no-store"});case 2:if(a=r.sent,!n||a.ok){r.next=15;break}return c=null,r.prev=5,r.next=8,a.text();case 8:c=r.sent,r.next=14;break;case 11:r.prev=11,r.t0=r.catch(5),console.log("cannot json resp");case 14:throw new l.HttpError(a.status,a.statusText,c);case 15:return r.abrupt("return",a);case 16:case"end":return r.stop()}}),o,this,[[5,11]])})))}},{key:"post",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:s.DEFAULT_HTTP_TIMEOUT;return a(this,void 0,void 0,r.mark((function a(){var u,p,d;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return u=Object.assign(Object.assign({},this.headers),i),r.next=3,s.HttpHelper.fetchWithTimeout(this._host+e,c,{method:n,body:t,headers:u,cache:"no-store"});case 3:if(p=r.sent,!o||p.ok){r.next=15;break}return d=null,r.prev=6,r.next=9,p.text();case 9:d=r.sent,r.next=14;break;case 12:r.prev=12,r.t0=r.catch(6);case 14:throw new l.HttpError(p.status,p.statusText,d);case 15:return r.abrupt("return",p);case 16:case"end":return r.stop()}}),a,this,[[6,12]])})))}}]),e}();t.HttpService=c},3197:function(e,t,n){var r;!function(i,o,a,s){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=o.createElement("div"),p=Math.round,d=Math.abs,h=Date.now;function f(e,t,n){return setTimeout(w(e,n),t)}function g(e,t,n){return!!Array.isArray(e)&&(v(e,n[t],n),!0)}function v(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),e.apply(this,arguments)}}l="function"!==typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function O(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;rn[t]})):r.sort()),r}function T(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=G(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,l=a?a.center:o.center,c=t.center=q(r);t.timeStamp=h(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=Z(l,c),t.distance=X(l,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=Y(t.deltaX,t.deltaY);var u=K(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=u.x,t.overallVelocityY=u.y,t.overallVelocity=d(u.x)>d(u.y)?u.x:u.y,t.scale=a?(p=a.pointers,f=r,X(f[0],f[1],H)/X(p[0],p[1],H)):1,t.rotation=a?function(e,t){return Z(t[1],t[0],H)+Z(e[1],e[0],H)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,o,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===s)){var c=t.deltaX-a.deltaX,u=t.deltaY-a.deltaY,p=K(l,c,u);r=p.x,i=p.y,n=d(p.x)>d(p.y)?p.x:p.y,o=Y(c,u),e.lastInterval=t}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=o}(n,t);var p,f;var g=e.element;j(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function G(e){for(var t=[],n=0;n=d(t)?e<0?2:4:t<0?8:16}function X(e,t,n){n||(n=V);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Z(e,t,n){n||(n=V);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(N(this.element),this.evWin,this.domHandler)}};var $={mousedown:1,mousemove:2,mouseup:4},J="mousedown",Q="mousemove mouseup";function ee(){this.evEl=J,this.evWin=Q,this.pressed=!1,U.apply(this,arguments)}x(ee,U,{handler:function(e){var t=$[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:z,srcEvent:e}))}});var te={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ne={2:F,3:"pen",4:z,5:"kinect"},re="pointerdown",ie="pointermove pointerup pointercancel";function oe(){this.evEl=re,this.evWin=ie,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(re="MSPointerDown",ie="MSPointerMove MSPointerUp MSPointerCancel"),x(oe,U,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=te[r],o=ne[e.pointerType]||e.pointerType,a=o==F,s=O(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var ae={touchstart:1,touchmove:2,touchend:4,touchcancel:8},se="touchstart",le="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=se,this.evWin=le,this.started=!1,U.apply(this,arguments)}function ue(e,t){var n=I(e.touches),r=I(e.changedTouches);return 12&t&&(n=P(n.concat(r),"identifier",!0)),[n,r]}x(ce,U,{handler:function(e){var t=ae[e.type];if(1===t&&(this.started=!0),this.started){var n=ue.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:F,srcEvent:e})}}});var pe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},de="touchstart touchmove touchend touchcancel";function he(){this.evTarget=de,this.targetIds={},U.apply(this,arguments)}function fe(e,t){var n=I(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=I(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return j(e.target,l)})),1===t)for(i=0;i-1&&r.splice(e,1)}),2500)}}function ye(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+Pe(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Pe(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Oe},canEmit:function(){for(var e=0;et.threshold&&i&t.direction},attrTest:function(e){return Ne.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Te(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Re,Ne,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ke]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Le,Ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[_e]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Oe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),x(Fe,Ne,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ke]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),x(ze,Ne,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return De.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&B&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Te(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x(Be,Ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Se]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancei;){if(o-i>600){var s=o-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*u/s+p)),Math.min(o,Math.floor(r+(s-l)*u/s+p)),a)}var d=n[r],h=i,f=o;for(t(n,i,r),a(n[o],d)>0&&t(n,i,o);h0;)f--}0===a(n[i],d)?t(n,i,f):t(n,++f,o),f<=r&&(i=f+1),r<=f&&(o=f-1)}}(e,r,i||0,o||e.length-1,a||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function f(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;e(t,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!h(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=f(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(e,t){this.data=f([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,s,l,c,p,d=1/0,h=1/0,f=t;f<=n-t;f++){var g=a(e,0,f,this.toBBox),v=a(e,f,n,this.toBBox),m=(i=g,o=v,s=void 0,l=void 0,c=void 0,p=void 0,s=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),c=Math.min(i.maxX,o.maxX),p=Math.min(i.maxY,o.maxY),Math.max(0,c-s)*Math.max(0,p-l)),y=u(g)+u(v);m=t;h--){var f=e.children[h];s(l,e.leaf?i(f):f),c+=p(l)}return c},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)s(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():o(e[t],this.toBBox)},r}()},1718:function(e,t,n){"use strict";var r=n(7313);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n