/*! For license information please see module-3.bundle.js.LICENSE.txt */
"use strict";(self.webpackChunkapplication=self.webpackChunkapplication||[]).push([[555],{3779:(e,t,s)=>{s.r(t),s.d(t,{default:()=>a});var i=s(6178),r=s(1669);class a extends i.BaseModule{constructor(){super("bBoxMonitor"),this.REQ_GET_DATA="getData",this.RESP_DATA="data"}initialize(e,t){super.initialize(e,t),r("#bbm-refreshBt").on("click",r.proxy(this._onUpdateIntervalChange,this)),this._zonesFilterDD=r("#bbm-zonesDD").kendoDropDownList({change:r.proxy(this._onFilterChange,this)}).data("kendoDropDownList"),r("#bbm-usernameIn").on("input",r.proxy(this._onFilterChange,this)),r("#bbm-clearBt").on("click",r.proxy(this._onClearFilterClick,this)),this._intervalDropDown=r("#bbm-intervalDD").kendoDropDownList({valueTemplate:'<span class="text-muted pr-1">Interval:</span><span>#:data.text#</span>',change:r.proxy(this._onUpdateIntervalChange,this)}).data("kendoDropDownList"),this._grid=r("#bbm-grid").kendoGrid({scrollable:!0,sortable:!0,selectable:!1,columns:[{field:"zone",width:150,title:"Zone"},{field:"userId",width:100,title:"User ID"},{field:"userName",width:250,title:"Username"},{field:"sessionId",width:150,title:"BlueBox Session Id"},{field:"lastReq",width:100,title:"Last Request"},{field:"lastPoll",width:100,title:"Last Polling"},{field:"queueSize",width:100,title:"Queued Messages"}],noRecords:{template:"No BlueBox sessions."},dataSource:[]}).data("kendoGrid"),this._requestData()}destroy(){super.destroy(),r("#bbm-refreshBt").off("click"),r("#bbm-usernameIn").off("input"),r("#bbm-clearBt").off("click"),clearTimeout(this._requestTimer)}onExtensionCommand(e,t){if(e==this.RESP_DATA){let e=t.getSFSArray("clients"),s=[],i=[];for(let t=0;t<e.size();t++){let r=e.getSFSArray(t),a={zone:r.getUtfString(0),userId:r.getInt(1),userName:r.getUtfString(2),sessionId:r.getUtfString(3),lastReq:r.getLong(4)+"s ago",lastPoll:r.getLong(5)+"s ago",queueSize:r.getInt(6)};s.push(a),i.indexOf(a.zone)<0&&i.push(a.zone)}i.sort((function(e,t){return e.localeCompare(t)})),i.unshift("[any]");let a=this._zonesFilterDD.value(),n=i.indexOf(a);n<0&&(n=0),this._zonesFilterDD.setDataSource(i),this._zonesFilterDD.select(n);const o=r(".k-grid-content",this._grid.wrapper).scrollLeft();let l=this._grid.dataSource.sort(),d=new kendo.data.DataSource({sort:l,data:s});this._setFilters(d),this._grid.setDataSource(d),r(".k-grid-content",this._grid.wrapper).scrollLeft(o),r("#bbm-totalSessions").text(s.length)}}_onUpdateIntervalChange(){this._requestData()}_onFilterChange(){this._setFilters(this._grid.dataSource)}_onClearFilterClick(){this._zonesFilterDD.select(0),r("#bbm-usernameIn").val("")}_requestData(){clearTimeout(this._requestTimer),this.smartFox.isConnected&&(this.sendExtensionRequest(this.REQ_GET_DATA),this._requestTimer=setTimeout(r.proxy(this._requestData,this),1e3*Number(this._intervalDropDown.value())))}_setFilters(e){let t=[];this._zonesFilterDD.select()>0&&t.push({field:"zone",operator:"eq",value:this._zonesFilterDD.value()}),""!=r("#bbm-usernameIn").val()&&t.push({field:"userName",operator:"contains",value:r("#bbm-usernameIn").val()}),e.filter(t),r("#bbm-displayedSessions").text(e.total())}}}}]);