(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{24422:function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return n}));var o=i(24423),r=i(8564);class n{didCreate(){const t=r.default.getMonitorIdFromActiveRoute();this.monitorActivityStore=new o.default,this.monitorActivityStore.setActiveMonitorId(t)}didActivate(){const t=r.default.getMonitorIdFromActiveRoute();this.monitorActivityStore.isOffline||this.monitorActivityStore.getActivitiesByMonitor({monitorId:t,page:1},!0),this.monitorActivityStore.setActiveMonitorId(t)}}},24423:function(t,e,i){"use strict";i.r(e),function(t){i.d(e,"default",(function(){return h}));var o,r,n,a,s,l,c,p,d,u,b=i(1654),g=i(5942),y=i(8258);function v(t,e,i,o){i&&Object.defineProperty(t,e,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(o):void 0})}function f(t,e,i,o,r){var n={};return Object.keys(o).forEach((function(t){n[t]=o[t]})),n.enumerable=!!n.enumerable,n.configurable=!!n.configurable,("value"in n||n.initializer)&&(n.writable=!0),n=i.slice().reverse().reduce((function(i,o){return o(t,e,i)||i}),n),r&&void 0!==n.initializer&&(n.value=n.initializer?n.initializer.call(r):void 0,n.initializer=void 0),void 0===n.initializer&&(Object.defineProperty(t,e,n),n=null),n}let h=(o=b.action.bound,n=f((r=class{constructor(){v(this,"loading",n,this),v(this,"loadingMore",a,this),v(this,"loaded",s,this),v(this,"error",l,this),v(this,"nextPage",c,this),v(this,"activeMonitorId",p,this),v(this,"moreLoading",d,this),v(this,"isOpen",u,this),this.masterMonitorStore=new y.default,Object(b.reaction)((()=>this.masterMonitorStore.isOffline),(async t=>{!t&&this.activeMonitorId&&await this.getActivitiesByMonitor({monitorId:this.activeMonitorId,page:1},!1)}))}get isOffline(){return this.masterMonitorStore.isOffline}get values(){return this.masterMonitorStore.getJobTemplateActivities(this.activeMonitorId).map((t=>({action:t.action,actor:t.actor,context:t.context,createdAt:t.createdAt,deletedAt:t.deletedAt,entityId:t.entityId,id:t.id,team:t.team,timestamp:t.timestamp,entityType:t.entityType})))}setIsOpen(t){this.isOpen=t}update(e){t.has(e,"loading")&&(this.loading=e.loading),t.has(e,"loaded")&&(this.loaded=e.loaded),t.has(e,"loadingMore")&&(this.loadingMore=e.loadingMore),t.has(e,"error")&&(this.error=e.error),t.has(e,"nextPage")&&(this.nextPage=e.nextPage)}async getActivitiesByMonitor(e,i){const{monitorId:o,members:r,page:n}=e;i&&this.masterMonitorStore.clearJobTemplateActivities(o),this.update({loading:!0,loaded:!1,error:!1});try{await Object(g.getStore)("SyncStatusStore").onSyncAvailable();const e=await this.masterMonitorStore.loadMonitorActivities({monitorId:o,members:r,page:n});if(200==e.status){const i=t.get(e,"body.meta",{});this.update({loading:!1,loaded:!0,nextPage:i.nextUrl?parseInt(i.nextUrl.split("page=")[1],10):null})}else this.update({loading:!1,loaded:!0,error:!0})}catch(t){pm.logger.error(`MonitorActivitiesStore~getActivitiesByMonitor: ${t.error.name}: ${t.error.message}`)}}setActiveMonitorId(t){this.activeMonitorId=t}setMoreLoading(t){this.moreLoading=t}}).prototype,"loading",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),a=f(r.prototype,"loadingMore",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),s=f(r.prototype,"loaded",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),l=f(r.prototype,"error",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),c=f(r.prototype,"nextPage",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),p=f(r.prototype,"activeMonitorId",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),d=f(r.prototype,"moreLoading",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),u=f(r.prototype,"isOpen",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),f(r.prototype,"isOffline",[b.computed],Object.getOwnPropertyDescriptor(r.prototype,"isOffline"),r.prototype),f(r.prototype,"values",[b.computed],Object.getOwnPropertyDescriptor(r.prototype,"values"),r.prototype),f(r.prototype,"setIsOpen",[b.action],Object.getOwnPropertyDescriptor(r.prototype,"setIsOpen"),r.prototype),f(r.prototype,"update",[b.action],Object.getOwnPropertyDescriptor(r.prototype,"update"),r.prototype),f(r.prototype,"getActivitiesByMonitor",[o],Object.getOwnPropertyDescriptor(r.prototype,"getActivitiesByMonitor"),r.prototype),f(r.prototype,"setActiveMonitorId",[b.action],Object.getOwnPropertyDescriptor(r.prototype,"setActiveMonitorId"),r.prototype),f(r.prototype,"setMoreLoading",[b.action],Object.getOwnPropertyDescriptor(r.prototype,"setMoreLoading"),r.prototype),r)}.call(this,i(2751))}}]);