(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0c4608c5","chunk-a701221a","chunk-4392cd40","chunk-587a9053","chunk-0fcb0cbc","chunk-5727cefe","chunk-a8639a42"],{"018f":function(t,e,r){"use strict";r("664b")},"0276":function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=function(){var t=this,e=t._self._c;return e(n["a"],{staticClass:"dense-table screen-height-container flex-content",attrs:{id:"staticScheduler",flat:""}},[t.hideHeader?t._e():e(i["d"],[e("h2",[t._v("Configure Static Schedules For "+t._s(t.device.platformGroupName))])]),e(i["c"],{staticClass:"pb-0"},[t.isReady?e("static-irrigation-schedule",{attrs:{id:t.id,isDimmer:t.isDimmer,device:t.device,user:t.user,hideHeader:t.hideHeader,maxIrrigationValveOpenDuration:t.maxIrrigationValveOpenDuration}}):t._e()],1)],1)},o=[],s=r("d0eb"),l=r("8336"),c=r("cc20"),u=r("2b5d"),d=r("8fea"),h=r("169a"),f=r("7679"),p=r("132d"),m=r("67b6"),v=r("43a6"),y=r("2fa4"),g=r("e0c7"),b=r("8654"),w=r("3a2f");function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}var S=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100"},[e(n["a"],{staticClass:"screen-height-container flex-content",attrs:{id:"staticScheduler",flat:""}},[t.hideHeader?t._e():e(i["d"],[e("h2",[t._v("Configure Static Schedule For "+t._s(t.device.platformGroupName))]),e(y["a"]),e(l["a"],{attrs:{outlined:"",color:"primary"},on:{click:t.loadDeviceSchedule}},[t._v("Refresh")])],1),e(i["c"],{staticClass:"d-flex flex-column"},[e("div",{staticStyle:{"text-align":"center"}},[t._v("\n        (click on a table cell to change its value)\n      ")]),e(d["a"],{key:t.updateIndex,staticClass:"flex-grow-auto",staticStyle:{"padding-right":"5px",border:"1px solid silver"},attrs:{width:"100%",headers:t.headers,items:t.scheduleData,"item-key":"name","hide-default-footer":"",loading:t.tableLoading,"fixed-header":"",height:"100%","show-expand":""},on:{"item-expanded":t.getLastExecutionTimes},scopedSlots:t._u([{key:"item.status",fn:function(r){var n=r.item;return[n.status?e(w["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(p["a"],t._g({attrs:{color:n.color}},i),[t._v("opacity")])]}}],null,!0)},[e("span",[t._v("This irrigation schedule is valid")])]):e(w["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(p["a"],t._g({attrs:{color:n.color}},i),[t._v("opacity")])]}}],null,!0)},[e("span",[t._v("No irrigation schedule configured")])])]}},{key:"item.scheduleType",fn:function(r){var n=r.item;return[e("span",{on:{click:function(e){t.editDialogOpen||(t.currentSetting=n.scheduleType)}}},[e(f["a"],{attrs:{large:""},on:{save:function(e){return t.onSettingSave(n,"scheduleType")}}},[e("span",{on:{click:function(e){t.editDialogOpen||(t.currentSetting=n.scheduleType)}}},[t._v(t._s("Cron"==n.scheduleType?"Specific Times":n.scheduleType))]),e(v["a"],{attrs:{slot:"input",label:"Schedule Type"},slot:"input",model:{value:t.currentSetting,callback:function(e){t.currentSetting=e},expression:"currentSetting"}},[e(m["a"],{attrs:{label:"Specific Times",value:"Cron"}}),e(m["a"],{attrs:{label:"Interval",value:"Interval"}}),e(m["a"],{attrs:{label:"None",value:"None"}})],1)],1)],1)]}},{key:"item.schedule",fn:function(r){return["Cron"==r.item.scheduleType?e(f["a"],{attrs:{large:"",persistent:""},on:{save:function(e){return t.onSettingSave(r.item,"schedule")},open:function(e){return t.onScheduleOpen(r.item)},close:t.onScheduleClose},scopedSlots:t._u([{key:"input",fn:function(){return["object"==x(t.currentSetting)?e(u["a"],{attrs:{items:t.cronscheduleItems,"item-text":"label","item-value":"label","return-object":!1,multiple:"",chips:"","deletable-chips":"","small-chips":"",label:"Enter times in 24hr format (hh:mm), separated by a space"},on:{focus:function(e){return t.setScheduleFocus(r.item)}},model:{value:t.currentSetting,callback:function(e){t.currentSetting=e},expression:"currentSetting"}}):t._e()]},proxy:!0}],null,!0)},[r.item.schedule.length>0?t._l(r.item.schedule,(function(r){return e(c["a"],{key:r,staticClass:"mr-1",attrs:{small:""}},[t._v(t._s(t.formatTime(r)))])})):[t._v("[Edit]")]],2):t._e(),"Interval"==r.item.scheduleType?e(f["a"],{attrs:{large:""},on:{save:function(e){return t.onSettingSave(r.item,"interval")},open:function(e){return t.onScheduleOpen(r.item)},close:t.onScheduleClose}},[t._v("\n            "+t._s(t.formatInterval(r.item.interval,"seconds")||"Click here to configure")+"\n            "),e("timespan-input",{attrs:{slot:"input"},slot:"input",model:{value:t.currentSetting,callback:function(e){t.currentSetting=e},expression:"currentSetting"}})],1):t._e()]}},{key:"item.duration",fn:function(r){return[e(f["a"],{attrs:{large:""},on:{save:function(e){return t.onDurationSettingSave(r.item,"duration")}},scopedSlots:t._u([{key:"input",fn:function(){return[e(b["a"],{attrs:{type:"number",label:"Duration (in seconds)",rules:t.durationRules,autofocus:""},model:{value:t.currentSetting,callback:function(e){t.currentSetting=e},expression:"currentSetting"}})]},proxy:!0}],null,!0)},[e("span",{on:{click:function(e){t.currentSetting=r.item.duration}}},[t._v("\n              "+t._s(r.item.duration||"[Edit]")+"\n              "),isNaN(parseInt(r.item.duration))?t._e():e("span",[t._v("s")])])])]}},{key:"item.intensity",fn:function(r){return[e("div",{staticClass:"text-center",staticStyle:{cursor:"pointer","min-width":"250px"},on:{click:function(e){return t.editPhotoperiod(r.item)}}},[t._v("\n            "+t._s(t.getPhotoPeriodAsString(r.item,!0))+"\n          ")])]}},{key:"item.clear",fn:function(r){var n=r.item;return[e(w["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(l["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.deleteSchedule(n)}}},i),[e(p["a"],[t._v("clear")])],1)]}}],null,!0)},[e("span",[t._v("Clear schedule")])])]}},{key:"expanded-item",fn:function(r){var n=r.headers,i=r.item;return[e("td",{attrs:{colspan:n.length}},[e(g["a"],{staticStyle:{float:"left"}},[t._v("Last Irrigated:")]),t._l(i.lastExecuted,(function(r){return e(c["a"],{key:r,staticClass:"ml-1 mt-3",attrs:{small:""}},[t._v(t._s(r))])})),t.tableLoading||0!=i.lastExecuted.length?t._e():e("div",{staticClass:"v-subheader pl-0"},[t._v("\n              No irrigation times found\n            ")]),t.tableLoading?e("div",{staticClass:"v-subheader pl-0"},[t._v("\n              Loading... please wait.\n            ")]):t._e()],2)]}}])})],1),e(i["a"],{staticClass:"justify-center pt-0 pb-0"},[t.isDimmer?e(l["a"],{attrs:{color:"primary"},on:{click:t.saveLightSchedule}},[t._v("Save")]):t._e(),e(l["a"],{attrs:{color:"primary"},on:{click:t.loadDeviceSchedule}},[t._v("Refresh")])],1)],1),e(h["a"],{attrs:{width:"700"},model:{value:t.editLightSchedule,callback:function(e){t.editLightSchedule=e},expression:"editLightSchedule"}},[t.selectedRow?e("photo-period",{staticClass:"vh90",staticStyle:{"max-height":"375px"},attrs:{title:"Level "+t.selectedRow.platformIndex+" Light Schedule",invertable:!0,noInterlights:!0},on:{revalidate:t.onLightScheduleChange},model:{value:t.selectedRow,callback:function(e){t.selectedRow=e},expression:"selectedRow"}}):t._e()],1)],1)},_=[],C=r("c1df"),O=r.n(C),P=r("d67f"),D=r("7c3e"),k=r("62ad"),T=r("0fd9"),j=function(){var t=this,e=t._self._c;return e(T["a"],{staticStyle:{width:"200px"}},[e(k["a"],{staticClass:"pr-1"},[e(b["a"],{attrs:{type:"number",label:"Days"},on:{change:t.onChange},model:{value:t.days,callback:function(e){t.days=e},expression:"days"}})],1),e(k["a"],{staticClass:"pl-1 pr-1"},[e(b["a"],{attrs:{type:"number",label:"Hours"},on:{change:t.onChange},model:{value:t.hours,callback:function(e){t.hours=e},expression:"hours"}})],1),e(k["a"],{staticClass:"pl-1"},[e(b["a"],{attrs:{type:"number",label:"Minutes"},on:{change:t.onChange},model:{value:t.minutes,callback:function(e){t.minutes=e},expression:"minutes"}})],1)],1)},E=[],I={name:"timespaninput",props:["value"],components:{},beforeMount:function(){},mounted:function(){},data:function(){return{days:0,hours:0,minutes:0}},computed:{},watch:{value:{immediate:!0,handler:function(t,e){isNaN(parseInt(t))||(t/=60,this.days=Math.floor(t/1440),this.hours=Math.floor((t-60*this.days*24)/60),this.minutes=t-60*this.days*24-60*this.hours)}}},methods:{onChange:function(){var t=60*this.days*24*60+60*this.hours*60+60*this.minutes;this.$emit("input",t)}}},L=I,A=r("2877"),M=Object(A["a"])(L,j,E,!1,null,null,null),U=M.exports,N=r("372a");function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function G(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */G=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==F(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(F(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function R(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function $(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){R(a,n,i,o,s,"next",t)}function s(t){R(a,n,i,o,s,"throw",t)}o(void 0)}))}}function H(t,e){return q(t)||Y(t,e)||B(t,e)||V()}function V(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function B(t,e){if(t){if("string"==typeof t)return z(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?z(t,e):void 0}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Y(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function q(t){if(Array.isArray(t))return t}var W={name:"static-irrigation-schedule",props:["id","device","user","hideHeader","isDimmer","maxIrrigationValveOpenDuration"],components:{TimespanInput:U,PhotoPeriod:D["a"]},mixins:[N["a"]],beforeMount:function(){for(var t=0;t<24;t++)for(var e=0;e<12;e++)this.cronscheduleItems.push({value:t.toString().padStart(2,"0")+(5*e).toString().padStart(2,"0"),label:t.toString().padStart(2,"0")+":"+(5*e).toString().padStart(2,"0")});this.isDimmer&&this.headers.push({text:"Lights (in your TZ)",value:"intensity",align:"center",sortable:!1,width:100}),this.headers.push({text:"",value:"clear",align:"center",sortable:!1}),this.loadDeviceSchedule()},data:function(){var t=this;return{selectedRow:null,controller_id:0,updateIndex:0,editLightSchedule:!1,editDialogOpen:!1,tableLoading:!1,isReady:!1,currentRow:null,thisTimeKey:null,scheduleInput:[],props:null,item:null,allLightDeviceIds:[],lightGroupings:{},scheduleData:[],cronscheduleItems:[],changedIntensity:{},currentSetting:null,durationRules:[function(t){return!!t||"Required"},function(t){return!isNaN(parseInt(t))&&t>0||"Must be greater than 0"},function(e){return!isNaN(parseInt(e))&&e<=t.maxIrrigationValveOpenDuration||"Value may not be greater than "+t.maxIrrigationValveOpenDuration}],headers:[{align:"center",sortable:!1,text:"Lvl",value:"platformIndex",width:40},{text:"Irrigation Valve",align:"left",sortable:!1,value:"name",width:150},{text:"Valid Sched",value:"status",align:"center",sortable:!1,wdith:50},{text:"Schedule Type",value:"scheduleType",sortable:!1,width:145},{text:"Schedule",value:"schedule",width:200,sortable:!1},{text:"Duration",value:"duration",align:"center",sortable:!1,width:70}],intensityStyle:{"margin-top":"10px"}}},watch:{id:function(t){t&&t>0&&(this.loadDeviceSchedule(),this.changedIntensity={})}},methods:{saveLightSchedule:function(){for(var t=[],e=this,r=0;r<this.scheduleData.length;r++){var n=this.scheduleData[r];if(null!=n.photoperiod&&Object.keys(n.photoperiod).length>2)for(var i=this.lightGroupings[String(r+1)].devices,a=0;a<i.length;a++){var o=i[a],l=n.photoperiod.photoperiodStarttime.substring(0,2)+":"+n.photoperiod.photoperiodStarttime.substring(2,4),c=n.photoperiod.photoperiodEndtime.substring(0,2)+":"+n.photoperiod.photoperiodEndtime.substring(2,4);if(n.photoperiod.inverted){var u=l;l=c,c=u}l!=c?(t.push({controller_id:o.controller_id,name:"Light["+o.device_id+"]",action_id:90,virtualDevice_id:o.device_id,delay:"0s",interval:0,value:n.photoPeriodIntensity,cron:this.createCronFromTimes([l]),deferSchedule:!0}),t.push({controller_id:o.controller_id,name:"Light["+o.device_id+"]",action_id:90,virtualDevice_id:o.device_id,delay:"0s",interval:0,value:0,cron:this.createCronFromTimes([c]),deferSchedule:!0})):n.photoperiod.inverted?t.push({controller_id:o.controller_id,name:"Light["+o.device_id+"]",action_id:90,virtualDevice_id:o.device_id,delay:"0s",interval:0,value:0,cron:this.createCronFromTimes(["00:00"]),deferSchedule:!0}):t.push({controller_id:o.controller_id,name:"Light["+o.device_id+"]",action_id:90,virtualDevice_id:o.device_id,delay:"0s",interval:0,value:n.photoPeriodIntensity,cron:this.createCronFromTimes(["00:00"]),deferSchedule:!0})}}s["a"].post("controllerJobs/saveIgrLightSchedule",this.user.apitoken,{payload:t,deviceIds:e.allLightDeviceIds,controller_id:e.controller_id}).then((function(t){var r=H(t,2),n=r[0],i=r[1];e.activateLights(),n?console.log(n):console.log(i)}))},getSetIntensityCommand:function(t,e,r){return{action_id:90,controller_id:t,virtualDevice_id:e,value:r}},activateLights:function(){for(var t=[],e=0;e<this.scheduleData.length;e++){var r=this.scheduleData[e];if(this.lightGroupings[r.platformIndex])if(null!=r.photoperiod&&r.photoperiod.photoperiod){if(24==r.photoperiod.photoperiod)for(var n=0;n<this.lightGroupings[r.platformIndex].devices.length;n++){var i=this.lightGroupings[r.platformIndex].devices[n];t.push(this.getSetIntensityCommand(i.controller_id,i.device_id,r.photoPeriodIntensity))}else if(r.photoperiod.photoperiodStarttime){var a=this.convertTimeToHours(r.photoperiod.photoperiodStarttime),o=this.convertTimeToHours(r.photoperiod.photoperiodEndtime),l=(new Date).getHours()+(new Date).getMinutes()/60,c=0;l>=a&&l<=o?c=r.photoperiod.inverted?0:r.photoPeriodIntensity:r.photoperiod.inverted&&(c=r.photoPeriodIntensity);for(var u=0;u<this.lightGroupings[r.platformIndex].devices.length;u++){var d=this.lightGroupings[r.platformIndex].devices[u];t.push(this.getSetIntensityCommand(d.controller_id,d.device_id,parseFloat(c)))}}}else for(var h=0;h<this.lightGroupings[r.platformIndex].devices.length;h++){var f=this.lightGroupings[r.platformIndex].devices[h];t.push(this.getSetIntensityCommand(f.controller_id,f.device_id,0))}}if(t.length>0){var p=this;p.isLoading=!0,s["a"].post("controllerCommands",this.user.apitoken,t).then((function(t){var e=H(t,2),r=(e[0],e[1]);p.isLoading=!1,r?P["a"].error("An error occurred. Please try again later."):P["a"].success("Light Commands Sent to Controller.")}))}},saveControllerJob:function(t){var e=this;s["a"].patch("controllerJobs",this.user.apitoken,t).then((function(t){var r=H(t,2),n=(r[0],r[1]);n&&(P["a"].error("An error occurred. Please try again later"),e.loadDeviceSchedule())}))},createInitialPayload:function(t){var e={controller_id:t.controller_id,name:"Valve["+t.device_id+"]",action_id:87,virtualDevice_id:t.device_id,delay:t.duration+"s",interval:t.interval};return t.controllerJobs_id&&(e.id=t.controllerJobs_id),e},saveValveIntervalSchedule:function(t){var e=this.createInitialPayload(t);this.saveControllerJob(e)},createCronFromTimes:function(t){for(var e=[],r=[],n=0;n<t.length;n++){var i=new O.a(t[n],"HH:mm").utc();e.push(i.format("m")),r.push(i.format("H"))}return"0 "+e.join("|")+" "+r.join("|")+" * * * *"},saveValveCronSchedule:function(t){var e=this.createInitialPayload(t);e.cron=this.createCronFromTimes(t.schedule),e.interval=0,this.saveControllerJob(e)},onLightScheduleChange:function(t){for(var e=0;e<this.scheduleData.length;e++)if(this.scheduleData[e].platformIndex==t.platformIndex){this.scheduleData[e].photoperiod.photoperiod=t.photoperiod.photoperiod,this.scheduleData[e].photoperiod.photoperiodStarttime=t.photoperiod.photoperiodStarttime,this.scheduleData[e].photoperiod.photoperiodStarttime=t.photoperiod.photoperiodStarttime,this.scheduleData[e].photoperiod.photoperiodEndtime=t.photoperiod.photoperiodEndtime,this.scheduleData[e].photoPeriodIntensity=t.photoPeriodIntensity,this.scheduleData[e].photoperiod.inverted=t.photoperiod.inverted;break}this.updateIndex++},editPhotoperiod:function(t){var e=!1;t.photoperiod&&t.photoperiod.photoperiod||(t.photoperiod={photoperiod:24,photoperiodStarttime:"0000",photoperiodEndtime:"0000",inverted:!1},t.photoPeriodIntensity=1,e=!0),this.selectedRow=t,this.editLightSchedule=!0,e&&this.onLightScheduleChange(this.selectedRow)},deleteSchedule:function(t){this.deleteIrrigationScheduleNow(t)},deleteScheduleInMemory:function(t){t.status=!1,t.scheduleType="Not Configured",t.schedule=[],t.interval="",t.duration=null,t.color="silver",t.deleted=!0,t.photoperiod=null,t.photoPeriodIntensity=1,t.controllerJobs_id=null},deleteIrrigationScheduleNow:function(t){var e=[];e.push(t.device_id),this.deleteScheduleInMemory(t),this.destroyPguIrrigationSchedule(e)},destroyPguIrrigationSchedule:function(t){s["a"].post("controllerJobs/destroyJobsByDeviceIds",this.user.apitoken,{virtualDevice_ids:t}).then((function(t){var e=H(t,2),r=(e[0],e[1]);r&&P["a"].error("Delete failed. Please try again later.")}))},onScheduleOpen:function(t){if(this.editDialogOpen)return!1;this.editDialogOpen=!0,"Cron"==t.scheduleType||"cron"==t.scheduleType?this.currentSetting=t.schedule:this.currentSetting=t.interval},onScheduleClose:function(){this.editDialogOpen=!1},onDurationSettingSave:function(t,e){var r=parseInt(this.currentSetting);r>0&&r<this.maxIrrigationValveOpenDuration&&this.onSettingSave(t,e)},onSettingSave:function(t,e){var r=!1;if(t[e]=this.currentSetting,"schedule"==e&&this.cronScheduleChange(t[e]),"scheduleType"===e&&"None"===t[e])return t.status=!1,t.scheduleType="Not Configured",t.schedule=[],t.interval="",t.duration=null,t.color="silver",void this.destroyPguIrrigationSchedule([t.device_id]);if(!isNaN(parseInt(t.duration))&&parseInt(t.duration)>0)switch(t.scheduleType){case"Cron":t.schedule.length>0&&(r=!0);break;case"Interval":""!=t.interval&&(r=!0);break}t.status=r,t.status?(t.color="blue",this.saveIrrigationSchedule(t)):t.color="red"},onIntensityChange:function(t){this.changedIntensity[String(t.id)]=t.intensity},sendCommandsToController:function(){s["a"].post("controllerCommands",me.user.apitoken,{action_id:5,controller_id:me.device.controller_id})},saveIrrigationSchedule:function(t){var e=this;return $(G().mark((function r(){var n,i,a,o,l,c,u,d,h;return G().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(n=e,"Interval"!=t.scheduleType){r.next=5;break}e.saveValveIntervalSchedule(t),r.next=18;break;case 5:for(e.saveValveCronSchedule(t),i={facility_id:e.user.facility_id,scheduleType:"cron",device_id:t.device_id,duration:t.duration,seconds:"0"},a=[],o=[],l=0;l<t.schedule.length;l++)c=O()(t.schedule[l],"HH:mm"),a.push(c.utc().format("m")),o.push(c.utc().format("H"));return i.cron="0 "+a.join("|")+" "+o.join("|")+" * * * *",i.hours="1",r.next=14,s["a"].post("valves/scheduleValve",e.user.apitoken,i);case 14:u=r.sent,d=H(u,1),h=d[0],h.success?n.loadDeviceSchedule():P["a"].toast("An error occurred. Please try again later.");case 18:case"end":return r.stop()}}),r)})))()},setScheduleFocus:function(t){this.currentRow=t,this.scheduleInput=t.schedule},getLastExecutionTimes:function(t){var e=this;return $(G().mark((function r(){var n,i,a,o,l,c;return G().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(n=t.value,i=t.item,n){r.next=4;break}return r.abrupt("return");case 4:return e.tableLoading=!0,r.next=7,s["a"].get("devices/getLastIrrigatedTimes",e.user.apitoken,{device_id:i.device_id});case 7:if(a=r.sent,o=H(a,1),l=o[0],l&&l.success)for(i.lastExecuted=[],c=0;c<l.lastIrrigatedTimes.length;c++)c<8&&i.lastExecuted.push(O()(l.lastIrrigatedTimes[c].dbtime).format("MM/DD h:mm a"));else l&&l.message&&P["a"].error(l.message);e.tableLoading=!1;case 12:case"end":return r.stop()}}),r)})))()},loadDeviceSchedule:function(){var t=this;this.tableLoading=!0;var e={},r={},n=[];s["a"].get("devices/getPlatformGroupDevices",t.user.apitoken,{platformGroup_id:t.device.platformGroup_id}).then((function(i){var a=H(i,2),o=a[0],l=a[1];if(l)return P["a"].error("Failed to get LGU ".concat(t.id||t.device.platformGroup_id," data: "),l);t.tableLoading=!1,t.allLightDeviceIds=[];for(var c=o,u=0;u<c.length;u++)switch(c[u].deviceType){case"Valve":var d=c[u].device+" "+c[u].deviceType,h=d.indexOf("["),f=d.indexOf("]");h>=0&&f>=0&&(d=d.substring(0,h)+d.substring(f+1)),n.push({name:d,controller_id:c[u].controller_id,device_id:c[u].device_id,platformGroup_id:c[u].platformGroup_id,status:!1,scheduleType:"Not Configured",schedule:[],interval:null,duration:null,color:"silver",lastExecuted:[],photoperiod:{}});break;case"Light":if(c[u].platform){var p=String(c[u].platform.level);e[p]||(e[p]={parameters:{},devices:[]}),t.allLightDeviceIds.push(c[u].device_id),t.controller_id=c[u].controller_id,e[p].devices.push(c[u]),e[p].parameters=c[u].parameters,r[c[u].device_id]=c[u].platform.level}else console.warn("Could not determine level for light",c[u]);break}for(var m=0;m<n.length;m++)n[m].platformIndex=m+1;return t.lightGroupings=e,t.isReady=!0,s["a"].get("vControllerJobs",t.user.apitoken,{filter:{limit:100,where:{controller_id:c&&c.length&&c[0].controller_id||t.device.controller_id}}})})).then((function(e){var i=H(e,2),a=i[0],o=i[1];if(o)return P["a"].error(o);for(var s=a,l={},c=0;c<s.length;c++)l[s[c].virtualDevice_id]=s[c];for(var u=0;u<n.length;u++)if(l[n[u].device_id]){n[u].status=!0,n[u].color="blue",n[u].controllerJobs_id=l[n[u].device_id].id;var d=l[n[u].device_id];if(d.interval)n[u].scheduleType="Interval",n[u].interval=d.interval;else{n[u].scheduleType="Cron";for(var h=[],f=d.cron.split(" "),p=f[1].split("|"),m=f[2].split("|"),v=0;v<p.length;v++){var y=O.a.utc(m[v],"H").local().format("H");h.push(y.padStart(2,"0")+":"+p[v].padStart(2,"0"))}n[u].schedule=h}d.delay.indexOf("s")?n[u].duration=parseInt(d.delay):n[u].duration=60*parseInt(d.delay)}for(var g=0;g<s.length;g++){var b=s[g];if("Light"==b.vdTypeName){var w=n[r[b.virtualDevice_id]-1];if(w){var x=b.cron.split(" "),S=O.a.utc(x[2],"H").local().format("H"),_=x[1];parseFloat(b.value)>0?(w.photoPeriodIntensity=parseFloat(b.value),w.photoperiod.photoperiodStarttime=S.padStart(2,"0")+_.padStart(2,"0")):w.photoperiod.photoperiodEndtime=S.padStart(2,"0")+_.padStart(2,"0")}}}for(var C=0;C<n.length;C++){var D=n[C];if(D.photoperiod.photoperiodStarttime)if("0000"!=D.photoperiod.photoperiodStarttime||D.photoperiod.photoperiodEndtime){if(D.photoperiod.photoperiodEndtime<D.photoperiod.photoperiodStarttime){D.photoperiod.inverted=!0;var k=D.photoperiod.photoperiodEndtime;D.photoperiod.photoperiodEndtime=D.photoperiod.photoperiodStarttime,D.photoperiod.photoperiodStarttime=k}D.photoperiod.photoperiod=t.convertTimeToHours(D.photoperiod.photoperiodEndtime)-t.convertTimeToHours(D.photoperiod.photoperiodStarttime)}else D.photoperiod.photoperiod=24}t.scheduleData=n}))},convertTimeToHours:function(t){var e=parseInt(t.substring(0,2)),r=parseInt(t.substring(2,4))/60;return e+r},formatTime:function(t){var e=O()(t,"HH:mm");return e.format("h:mm a")},formatInterval:function(t,e){if(!t)return"";if("seconds"!=e){var r=t.split(":");return"Every "+parseInt(r[0])+" hours and "+parseInt(r[1])+" minutes"}t/=60;var n=Math.floor(t/1440),i=Math.floor((t-60*n*24)/60),a=t-60*n*24-60*i,o=[];return n>0&&(i>1?o.push(n+" days "):o.push(n+" day ")),i>0&&(i>1?o.push(i+" hours"):o.push(i+" hour")),a>0&&o.push(a+" minutes"),"Every "+o.join(", ")},cronScheduleChange:function(t){for(var e=[],r=0;r<t.length;r++)for(var n=t[r].split(" "),i=0;i<n.length;i++){var a=n[i].split(":");e.push(a[0].padStart(2,"0")+":"+a[1].padStart(2,"0"))}this.currentRow.schedule=e.sort()}}},J=W,Z=(r("4f6f0"),Object(A["a"])(J,S,_,!1,null,null,null)),X=Z.exports;function K(t,e){return nt(t)||rt(t,e)||tt(t,e)||Q()}function Q(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tt(t,e){if(t){if("string"==typeof t)return et(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?et(t,e):void 0}}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function rt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function nt(t){if(Array.isArray(t))return t}var it={name:"Lgu",props:["id","device","user","hideHeader"],components:{staticIrrigationSchedule:X},beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{item:null,isDimmer:!1,isReady:!1,maxIrrigationValveOpenDuration:600}},watch:{id:function(t){t&&t>0&&this.refresh()}},methods:{refresh:function(){var t=this,e=[s["a"].get("ag_platformGroups/getFeatures",this.user.apitoken,{platformGroupId:this.device.platformGroup_id,feature:"dimmable"}),s["a"].get("ag_platformGroups/getFeatures",this.user.apitoken,{platformGroupId:this.device.platformGroup_id,feature:"Max Valve Open Time"})];Promise.all(e).then((function(e){var r=K(e,2),n=K(r[0],2),i=n[0],a=(n[1],K(r[1],2)),o=a[0];a[1];i&&1==i.length&&(t.isDimmer=i[0].numbervalue),o&&1==o.length&&(t.maxIrrigationValveOpenDuration=o[0].numbervalue),t.isReady=!0}))}}},at=it,ot=Object(A["a"])(at,a,o,!1,null,null,null);e["a"]=ot.exports},"0393":function(t,e,r){"use strict";r("210b");var n=r("604c"),i=r("d9bd");e["a"]=n["a"].extend({name:"v-expansion-panels",provide(){return{expansionPanels:this}},props:{accordion:Boolean,disabled:Boolean,flat:Boolean,hover:Boolean,focusable:Boolean,inset:Boolean,popout:Boolean,readonly:Boolean,tile:Boolean},computed:{classes(){return{...n["a"].options.computed.classes.call(this),"v-expansion-panels":!0,"v-expansion-panels--accordion":this.accordion,"v-expansion-panels--flat":this.flat,"v-expansion-panels--hover":this.hover,"v-expansion-panels--focusable":this.focusable,"v-expansion-panels--inset":this.inset,"v-expansion-panels--popout":this.popout,"v-expansion-panels--tile":this.tile}}},created(){this.$attrs.hasOwnProperty("expand")&&Object(i["a"])("expand","multiple",this),Array.isArray(this.value)&&this.value.length>0&&"boolean"===typeof this.value[0]&&Object(i["a"])(':value="[true, false, true]"',':value="[0, 2]"',this)},methods:{updateItem(t,e){const r=this.getValue(t,e),n=this.getValue(t,e+1);t.isActive=this.toggleMethod(r),t.nextIsActive=this.toggleMethod(n)}}})},"03a4":function(t,e,r){"use strict";var n=r("b047"),i=r.n(n),a=r("d0eb");function o(t,e){return d(t)||u(t,e)||l(t,e)||s()}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function d(t){if(Array.isArray(t))return t}e["a"]={data:function(){return{}},methods:{onImageLoad:i()((function(t){this.$viewer.view(0),this.isLoading=!1}),1e3),inited:function(t){this.$viewer=t},onDisplayImages:function(t){var e=this;e.showViewer=!1,e.isLoading=!0,this.$nextTick((function(){for(var r=[],n=1;n<=4;n++)t["fileUploadUrl"+n]&&r.push(t["fileUploadUrl"+n]);e.images=r,e.showViewer=!0}))},getNutrientDeficiencyDiagnoses:function(){var t=this;a["a"].get("ag_nutrientDeficiencyDiagnoses",this.getUser.apitoken).then((function(e){var r=o(e,2),n=r[0];r[1];t.diagnoses=n}))},getNutrientDeficiencySymptoms:function(){var t=this;a["a"].get("ag_nutrientDeficiencySymptoms",this.getUser.apitoken,{filter:{order:"label",fields:["id","label"]}}).then((function(e){var r=o(e,1),n=r[0];t.nutrientDeficiencySymptoms=n}))},possibleNutrientDeficiencies:function(t){if(t.nutrientDeficiencySymptoms&&0!=t.nutrientDeficiencySymptoms.length){var e=[];t.nutrientDeficiencySymptoms.forEach((function(t){e.push(t.ag_nutrientDeficiencySymptom_id)}));var r=this.nutrientDeficiencySymptoms.filter((function(t){return e.includes(t.id)})),n="<h5>Nutrient Deficiency Symptoms</h5> "+r.map((function(t){return t.label})).join(", "),i=this.diagnoses.filter((function(t){return e.includes(t.ag_nutrientDeficiencySymptom_id)})),a="<h5>Possible Nutrient Deficiencies</h5> "+i.map((function(t){return t.ag_nutrientDeficiency_label})).join(","),o=t.notes?"<h5>Notes</h5> ".concat(t.notes):"";return"".concat(o).concat(n).concat(a)}return t.notes?"<h5>Notes</h5> ".concat(t.notes):"No nutrient deficienies reported"}}}},"0583":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("169a"),l=r("132d"),c=r("0fd9"),u=r("8dd9"),d=r("ba0d"),h=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:"",id:"manualcontroloptions"}},[e(a["c"],[t.ready?e(c["a"],{staticClass:"vfuswitches h-100",attrs:{"no-gutters":""}},[e(o["a"],{staticClass:"h-100",attrs:{sm:"12",md:"6",cols:"12"}},[e(u["a"],{staticClass:"h-100",staticStyle:{overflow:"auto","-webkit-overflow-scrolling":"touch"}},[e(c["a"],{staticStyle:{"padding-left":"20px"},attrs:{"no-gutters":""}},[t._l(t.items,(function(r,n){return[0==n||r.groupName!=t.items[n-1].groupName?e(o["a"],{key:"dt"+n,attrs:{cols:"12"}},[e("h4",[t._v("\n                  "+t._s(r.groupName)+"s\n                  "),"Curtain"===r.deviceType&&t.isCortexVfu&&!t.automaticMode?e("span",{staticClass:"clickable",staticStyle:{color:"#1876d1"},on:{click:t.onJog}},[t._v("[Jog]")]):t._e()])]):t._e(),e(o["a"],{key:n,attrs:{cols:"12",md:"6",sm:"4"}},[e(t.setComponentType(r),{key:r.id,tag:"component",attrs:{id:r.id,label:t.filterBrackets(r.device),state:r.state,parameters:r.parameters,options:r.actions,type:r.deviceType,readonly:t.automaticMode,isPolling:r.isPolling,nextFetchTime:t.nextFetchTime,pctComplete:t.pctComplete,disabled:t.disabled||t.getIsDisabled(r),isSse:t.isSse,suspendEvent:r.suspendEvent,isCortex:t.isCortex},on:{changed:t.changed}})],1)]}))],2)],1)],1),e(o["a"],{staticClass:"hidden-sm-and-down",attrs:{md:"6"}},[1==t.visualization?e("visualize-grow-platform",{ref:"visualPlatformDisplay",staticStyle:{height:"100%"},attrs:{platformGroupId:t.platformGroupId,supportsMicroclimate:t.supportsMicroclimate,"controller-id":t.controllerId},on:{refresh:t.onVisualizerRefresh}}):t._e()],1)],1):t._e()],1),e(s["a"],{attrs:{width:"350"},model:{value:t.showJog,callback:function(e){t.showJog=e},expression:"showJog"}},[e(i["a"],[e(a["d"],[e("h2",{staticStyle:{width:"100%","text-align":"center"}},[t._v("Jog Curtains")])]),e(a["c"],{staticStyle:{height:"210px",overflow:"hidden"}},[e(c["a"],{attrs:{"no-gutters":""}},[e(o["a"],{attrs:{cols:"4"}},[e("h3",{staticStyle:{"text-align":"center","margin-bottom":"55px"}},[t._v("\n              Jog Height\n            ")]),e(d["a"],{staticStyle:{"padding-top":"15px",height:"115px"},attrs:{max:"20",step:"5",min:"1",height:"40",vertical:"",ticks:""},model:{value:t.curtainJogLength,callback:function(e){t.curtainJogLength=e},expression:"curtainJogLength"}})],1),e(o["a"],{attrs:{cols:"8"}},[e(c["a"],{staticClass:"justify-center",attrs:{"no-gutters":""}},[e(o["a"],{attrs:{cols:"6"}},[e("h3",{staticStyle:{"text-align":"center","margin-bottom":"10px"}},[t._v("\n                  Curtain 1\n                ")])]),e(o["a"],{attrs:{cols:"6"}},[e("h3",{staticStyle:{"text-align":"center","margin-bottom":"10px"}},[t._v("\n                  Curtain 2\n                ")])]),e(o["a"],{staticStyle:{"text-align":"center","margin-bottom":"25px"},attrs:{cols:"6"}},[e(n["a"],{attrs:{loading:t.isLoadingJog,color:"primary",large:"",fab:"","tick-size":"4"},on:{click:function(e){return t.jogCurtain(1,"Up")}}},[e(l["a"],[t._v("arrow_upward")])],1)],1),e(o["a"],{staticStyle:{"text-align":"center","margin-bottom":"25px"},attrs:{cols:"6"}},[e(n["a"],{attrs:{loading:t.isLoadingJog,color:"primary",large:"",fab:""},on:{click:function(e){return t.jogCurtain(2,"Up")}}},[e(l["a"],[t._v("arrow_upward")])],1)],1),e(o["a"],{staticStyle:{"text-align":"center"},attrs:{cols:"6"}},[e(n["a"],{attrs:{loading:t.isLoadingJog,color:"primary",large:"",fab:""},on:{click:function(e){return t.jogCurtain(1,"Down")}}},[e(l["a"],[t._v("arrow_downward")])],1)],1),e(o["a"],{staticStyle:{"text-align":"center"},attrs:{cols:"6"}},[e(n["a"],{attrs:{loading:t.isLoadingJog,color:"primary",large:"",fab:""},on:{click:function(e){return t.jogCurtain(2,"Down")}}},[e(l["a"],[t._v("arrow_downward")])],1)],1)],1)],1)],1)],1)],1)],1)],1)},f=[],p=r("2f62"),m=r("d0eb"),v=r("c318"),y=r("25cd"),g=r("4ca6"),b=r("2fa4"),w=function(){var t=this,e=t._self._c;return e("div",{staticClass:"spectrumIntensitySwitch",style:t.customStyle},[e(c["a"],{attrs:{"no-gutters":"",align:"center"}},[e(o["a"],{staticStyle:{"white-space":"nowrap"},attrs:{cols:"1",sm:"2"}},[e(g["a"],{attrs:{overlap:"",color:"#C0C0C0",content:Math.floor(t.whiteValue)+"%",value:t.whiteValue>0,left:""}},[e(g["a"],{staticClass:"smallBadgeText",attrs:{color:"#FF0000",overlap:"",content:Math.floor(t.redValue)+"%",value:t.redValue>0}},[e(l["a"],{staticStyle:{"user-select":"none"},attrs:{color:t.color,large:"",disabled:t.disabled},on:{click:t.onDblClick}},[t._v("wb_incandescent")])],1)],1)],1),t.hideLabel?t._e():e(o["a"],{staticClass:"pl-3",attrs:{cols:"9"}},[e("span",{staticClass:"v-label",staticStyle:{"user-select":"none"},on:{click:t.onClick}},[t._v(t._s(t.label))])])],1),e(s["a"],{attrs:{width:"500",persistent:""},model:{value:t.displaySlider,callback:function(e){t.displaySlider=e},expression:"displaySlider"}},[e(i["a"],[e(a["d"],[e("h2",[t._v(t._s(t.label))]),e(b["a"]),e(n["a"],{attrs:{icon:""},on:{click:function(e){t.displaySlider=!1,t.rwRefresh++}}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],{staticStyle:{"padding-top":"20px"}},[e("red-white-light-spectrum-selector",{key:"rw"+t.rwRefresh,attrs:{lightType_id:"2"},on:{change:t.onSpectrumChange},model:{value:t.val,callback:function(e){t.val=e},expression:"val"}})],1),e(a["a"],{staticClass:"justify-center pt-0"},[e(n["a"],{attrs:{color:"primary",text:""},on:{click:t.onConfirmIntensity}},[t._v("Confirm")])],1)],1)],1)],1)},x=[],S=r("d67f"),_=r("c6a6"),C=r("4bd4"),O=r("8270"),P=r("5d23"),D=r("8654");function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}var T=function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"redWhiteSelector"}},[e(_["a"],{attrs:{disabled:t.isLoading,items:t.presets,label:"Select Preset","item-text":"label","item-value":"id","return-object":""},scopedSlots:t._u([{key:"item",fn:function(r){return["object"!==k(r.item)?[e(P["a"],{domProps:{textContent:t._s(r.item)}})]:[e(O["a"],[e("img",{attrs:{src:r.item.visualization}})]),e(P["a"],[e(P["c"],{domProps:{innerHTML:t._s(r.item.label)}}),e(P["b"],{domProps:{innerHTML:t._s(r.item.description)}})],1)]]}}]),model:{value:t.selectedPreset,callback:function(e){t.selectedPreset=e},expression:"selectedPreset"}}),t.selectedPreset&&t.selectedPreset.visualization?e("div",{staticClass:"visualization",style:{backgroundImage:"url("+t.selectedPreset.visualization+")"}}):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:null==t.selectedPreset||!t.selectedPreset.visualization,expression:"selectedPreset == null || !selectedPreset.visualization"}],staticClass:"visualization",staticStyle:{display:"flex","justify-content":"center","align-items":"center","background-color":"silver"}},[t._v("\n    Custom Settings\n  ")]),e(C["a"],{ref:"form",model:{value:t.isValid,callback:function(e){t.isValid=e},expression:"isValid"}},[e(d["a"],{staticClass:"mt-4",attrs:{label:"White Intensity","thumb-color":"#c0c0c0","thumb-label":"always",min:"0",max:"100",step:"1"},scopedSlots:t._u([{key:"append",fn:function(){return[e(D["a"],{staticClass:"mt-0 pt-0",staticStyle:{width:"60px"},attrs:{"hide-details":"","single-line":"",oninput:"if(this.value < 0 || this.value == '') this.value = 0;",rules:[t.rules.requiredNoBlanks,t.rules.integer,t.rules.numberInRange(t.white,0,100)]},on:{keydown:t.validateSpectrumInput},model:{value:t.white,callback:function(e){t.white=e},expression:"white"}})]},proxy:!0}]),model:{value:t.white,callback:function(e){t.white=e},expression:"white"}}),e(d["a"],{staticClass:"mt-4 redpadding",attrs:{label:"Red Intensity","thumb-color":"red","thumb-label":"always",min:"0",max:"100",step:"1"},scopedSlots:t._u([{key:"append",fn:function(){return[e(D["a"],{staticClass:"mt-0 pt-0",staticStyle:{width:"60px"},attrs:{"hide-details":"","single-line":"",oninput:"if(this.value < 0 || this.value == '') this.value = 0;",rules:[t.rules.requiredNoBlanks,t.rules.integer,t.rules.numberInRange(t.red,0,100)]},on:{keydown:t.validateSpectrumInput},model:{value:t.red,callback:function(e){t.red=e},expression:"red"}})]},proxy:!0}]),model:{value:t.red,callback:function(e){t.red=e},expression:"red"}})],1)],1)},j=[],E=r("c1df"),I=r.n(E),L=(r("ea10"),r("9c4f"));r("b047");function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}function M(t,e){return R(t)||G(t,e)||N(t,e)||U()}function U(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function G(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function R(t){if(Array.isArray(t))return t}function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){V(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t,e,r){return(e=B(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B(t){var e=z(t,"string");return"symbol"==A(e)?e:e+""}function z(t,e){if("object"!=A(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Y={name:"RedWhiteLightSpectrumSelector",props:["value","lightType_id"],mixins:[L["a"]],components:{},beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{isValid:!0,isLoading:!1,selectedPreset:null,presets:[],red:50,white:50}},computed:H({},Object(p["c"])(["getUser"])),watch:{value:{immediate:!0,handler:function(t,e){t&&(this.white=t[0],this.red=t[1])}},white:function(t,e){t>=0&&t<=100?this.selectPreset():this.white=0,this.$emit("change",[this.white,this.red])},red:function(t,e){t>=0&&t<=100?this.selectPreset():this.red=0,this.$emit("change",[this.white,this.red])},lightType_id:function(t,e){this.refresh()},selectedPreset:function(t,e){t.id>0&&(this.red=t.red,this.white=t.white),this.$emit("change",[this.white,this.red])}},methods:{validateSpectrumInput:function(t){var e=t.which?t.which:t.keyCode;return!(e>31&&(e<48||e>57))||(t.preventDefault(),!1)},selectPreset:function(){for(var t=0;t<this.presets.length;t++){var e=this.presets[t];if(e.red==this.red&&e.white==this.white)return void(this.selectedPreset=e)}this.selectedPreset=this.presets[this.presets.length-1]},refresh:function(){var t=this;m["a"].get("ag_lightSpectrums",this.getUser.apitoken,{filter:{fields:["id","label","red","white","wattage","ppf","ppe","visualization"],where:{ag_lightType_id:this.lightType_id},order:"label"}}).then((function(e){var r=M(e,2),n=r[0];r[1];t.presets=n,t.presets.push({id:-1,label:"Custom",red:0,white:0,visualization:null}),t.selectPreset()}))}}},q=Y,W=(r("f704"),r("2877")),J=Object(W["a"])(q,T,j,!1,null,null,null),Z=J.exports;function X(t,e){return rt(t)||et(t,e)||Q(t,e)||K()}function K(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q(t,e){if(t){if("string"==typeof t)return tt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(t,e):void 0}}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function et(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function rt(t){if(Array.isArray(t))return t}var nt={name:"spectrumintensity",components:{RedWhiteLightSpectrumSelector:Z},props:{disabled:{type:Boolean,default:!1},label:{type:[String],default:""},state:{type:[String,Number],default:0},id:{type:[Number],default:0},type:{type:String,default:""},options:{type:Array,default:function(){return[]}},readonly:{type:Boolean,default:!0},pctComplete:{type:[Number],default:0},suspendEvent:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},parameters:{type:Array,default:function(){return[]}},customStyle:{type:Object,default:function(){return{"margin-top":"30px","margin-left":"5px"}}}},data:function(){return{rwRefresh:0,action_id:140,redColor:"#FF0000",whiteColor:"#FFFFFF",whiteValue:null,redValue:null,newRedValue:0,newWhiteValue:0,displaySlider:!1,sliderValue:0,val:null,inTransition:!1,delay:250,clicks:0,timer:null}},watch:{parameters:{deep:!0,immediate:!0,handler:function(t){for(var e=0;e<this.parameters.length;e++)"redIntensity"==this.parameters[e].description&&(this.redValue=Math.round(100*this.parameters[e].numericValue)),"whiteIntensity"==this.parameters[e].description&&(this.whiteValue=Math.round(100*this.parameters[e].numericValue));this.val=[this.whiteValue,this.redValue]}}},computed:{color:function(){return 0==this.redValue&&0==this.whiteValue?"rgb(190,190,190)":"rgb(255,0,255)"}},methods:{onSpectrumChange:function(t){var e=X(t,2),r=e[0],n=e[1];this.newRedValue=n,this.newWhiteValue=r},onClick:function(t){var e=this;this.clicks++,1===this.clicks?this.timer=setTimeout((function(){e.onSingleClick(),e.clicks=0}),this.delay):(clearTimeout(this.timer),e.onDblClick(),e.clicks=0)},onSingleClick:function(){this.readonly?S["a"].error("You cannot change settings when AUTOMATIC mode is ON."):(this.redValue+this.whiteValue>0?(this.redValue=0,this.whiteValue=0):(this.redValue=100,this.whiteValue=100),this.change())},onDblClick:function(){this.readonly?S["a"].error("You cannot change settings when AUTOMATIC mode is ON."):(this.sliderValue=this.displayValue,this.displaySlider=!0)},onConfirmIntensity:function(){this.displaySlider=!1,this.redValue=this.newRedValue,this.whiteValue=this.newWhiteValue,this.change()},value:function(t,e){this.suspendEvent=!0},change:function(){this.suspendEvent||(this.inTransition=!0,this.$emit("changed",{id:this.id,action_id:this.action_id,intensity:this.whiteValue+","+this.redValue}))}}},it=nt,at=(r("8cca"),Object(W["a"])(it,w,x,!1,null,null,null)),ot=at.exports,st=r("32bf"),lt=function(){var t=this,e=t._self._c;return e("div",{ref:"growplatformVisualizer",style:t.image_style,attrs:{title:"Click to refresh"},on:{click:function(e){return t.refresh(!1,e)}}},[e(c["a"],{staticClass:"statuslights hidden-sm-and-down",attrs:{"no-gutters":""}},[e("div",{staticStyle:{width:"100%","text-align":"center"}},[t.supportsMicroclimate?[t.show_co2_gas?t._e():e("img",{staticClass:"vfu-img-status icon1",attrs:{src:"img/vfu/co2_off.png"}}),t.show_co2_gas?e("img",{staticClass:"vfu-img-status icon1",attrs:{src:"img/vfu/co2_on.png"}}):t._e(),"circ"==t.show_fan?e("img",{staticClass:"vfu-img-status icon2",attrs:{src:"img/vfu/fan_on.png"}}):t._e(),e("img",{directives:[{name:"show",rawName:"v-show",value:"off"==t.show_fan,expression:"show_fan == 'off'"}],staticClass:"vfu-img-status icon2",attrs:{src:"img/vfu/fan_off.png"}}),"cool"==t.show_fan?e("img",{staticClass:"vfu-img-status icon2",attrs:{src:"img/vfu/fan_cool.png"}}):t._e()]:t._e(),t.show_watering?e("img",{staticClass:"vfu-img-status icon3",attrs:{src:"img/vfu/water_on.png"}}):t._e(),t.show_watering?t._e():e("img",{staticClass:"vfu-img-status icon3",attrs:{src:"img/vfu/water_off.png"}})],2)])],1)},ct=[];function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function dt(t,e){return vt(t)||mt(t,e)||ft(t,e)||ht()}function ht(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ft(t,e){if(t){if("string"==typeof t)return pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(t,e):void 0}}function pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function mt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function vt(t){if(Array.isArray(t))return t}function yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function gt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(r),!0).forEach((function(e){bt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bt(t,e,r){return(e=wt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wt(t){var e=xt(t,"string");return"symbol"==ut(e)?e:e+""}function xt(t,e){if("object"!=ut(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var St={name:"platformGroupStatus",props:["platformGroupId","supportsMicroclimate","controllerId"],components:{},beforeMount:function(){this.loadImage()},mounted:function(){},data:function(){return{lightsOnImage:null,lightsOffImage:null,curtainsDownImage:null,image_style:{height:"100%","margin-left":"5px","background-image":"","background-size":"contain","background-position":"center center",width:"100%",cursor:"pointer"},background_light:!1,platformGroupInfo:{},platformGroupDevicesList:[],items:[],ready:!1,curtain:!1,show_co2_gas:!1,show_fan:"",show_watering:!1,isLoading:!1}},computed:gt({},Object(p["c"])(["getUser"])),watch:{platformGroupDevicesList:function(t){t&&t.length&&(this.items=t.filter((function(t){return![15,16].includes(t.deviceType_id)})),this.ready=!0)},items:function(t){var e=this,r=!1,n=!1,i=!1,a=!1;t.forEach((function(t){var o=t.device?t.device.toLowerCase():"",s=t.state?t.state.toLowerCase():"";"CO2Valve"==t.deviceType&&"on"==s&&(r=!0),(o.indexOf("fan")>-1||o.indexOf("ecu")>-1)&&(s.indexOf("off")>=0?e.show_fan="off":s.indexOf("cool")>=0?e.show_fan="cool":e.show_fan="circ"),o.indexOf("irrigation")>-1&&"on"==s&&(n=!0),o.indexOf("light")>-1&&"on"==s&&(i=!0),o.indexOf("curtain")>-1&&"open"!=s.toLowerCase()&&(a=!0)})),this.show_co2_gas=r,this.show_watering=n,this.background_light=i,this.curtain=a,this.handleImage()}},methods:{loadImage:function(){var t=this,e=m["a"].get("ag_platformGroups/getFeatures",this.getUser.apitoken,{platformGroupId:this.platformGroupId,feature:"Lights On Image"}),r=m["a"].get("ag_platformGroups/getFeatures",this.getUser.apitoken,{platformGroupId:this.platformGroupId,feature:"Lights Off Image"}),n=m["a"].get("ag_platformGroups/getFeatures",this.getUser.apitoken,{platformGroupId:this.platformGroupId,feature:"Curtains Down Image"}),i=m["a"].get("ag_platformGroups/"+this.platformGroupId,this.getUser.apitoken,{filter:{include:["type",{relation:"cameras",scope:{include:["camera"]}}]}});Promise.all([e,r,n,i]).then((function(e){t.lightsOnImage=e[0][0].length?e[0][0][0].stringvalue:null,t.lightsOffImage=e[1][0].length?e[1][0][0].stringvalue:null,t.curtainsDownImage=e[2][0].length?e[2][0][0].stringvalue:null,t.platformGroupInfo=e[3][0],(t.platformGroupInfo.type.platformGroupType.indexOf("PGU")>=0||t.platformGroupInfo.type.platformGroupType.indexOf("LGU")>=0||t.platformGroupInfo.type.platformGroupType.indexOf("IGR")>=0)&&(t.image_style["background-image"]="url('img/pgu/pgu-lightson.png')",t.image_style["background-size"]="contain",t.image_style["background-position"]="center center"),t.refresh(!0)}))},refresh:function(t,e){if(e&&e.target.dataset.jog)this.jogCurtains(e.target.dataset.jog);else{var r=this;m["a"].get("devices/getPlatformGroupDevices",this.getUser.apitoken,{platformGroup_id:this.platformGroupId}).then((function(e){var n=dt(e,2),i=n[0];n[1];r.isLoading=!1,t||r.$emit("refresh",i),r.platformGroupDevicesList=i}))}},handleImage:function(){var t=this,e=this.platformGroupInfo.cameras.find((function(t){return t.isDefault&&t.camera.streamUrl}));this.platformGroupInfo.cameras.length&&!e&&(e=this.platformGroupInfo.cameras[0]),e?m["a"].get("AWSCloudfront/getCameraStreamUrl",this.getUser.apitoken,{camera_id:e.camera.id}).then((function(e){var r=dt(e,2),n=r[0];r[1];t.image_style["background-image"]="url('".concat(n,"')")})):this.lightsOnImage&&(this.curtain?this.image_style["background-image"]="url('".concat(this.curtainsDownImage,"')"):this.background_light?this.image_style["background-image"]="url('".concat(this.lightsOnImage,"')"):this.image_style["background-image"]="url('".concat(this.lightsOffImage,"')"))}}},_t=St,Ct=(r("ca14"),Object(W["a"])(_t,lt,ct,!1,null,"70251a6a",null)),Ot=Ct.exports,Pt=r("81f6");function Dt(t){return Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(t)}function kt(t,e){return Lt(t)||It(t,e)||jt(t,e)||Tt()}function Tt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jt(t,e){if(t){if("string"==typeof t)return Et(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Et(t,e):void 0}}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function It(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Lt(t){if(Array.isArray(t))return t}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?At(Object(r),!0).forEach((function(e){Ut(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ut(t,e,r){return(e=Nt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nt(t){var e=Ft(t,"string");return"symbol"==Dt(e)?e:e+""}function Ft(t,e){if("object"!=Dt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Gt={name:"zone-devices-manual-control-options",components:{Toggle:v["a"],Dropdown:st["a"],visualizeGrowPlatform:Ot,Intensity:y["a"],SpectrumIntensity:ot},props:{height:{type:Number,default:550},disabled:{type:Boolean,default:!1},isSse:{type:Boolean,default:!1},platformGroupId:{type:[Number,String],default:0},deviceId:{type:[Number,String],default:0},controllerId:{type:[Number,String],default:0},automaticMode:{type:Boolean,default:!0},type:{type:String,default:"VFU"},lastEventReceived:{type:Object,default:null},zoneDevice:{type:Object,required:!1,default:function(){return null}}},data:function(){return{curtainJogLength:6,showJog:!1,ready:!1,visualization:1,isCortex:!1,pctComplete:0,items:[],dimmableLights:!1,supportsMicroclimate:!1,isPolling:!1,pollingService:null,platformGroupDevicesList:[],nextFetchTime:"",labels:{ChilledWaterValve:"Chilled Water Valve",CO2Valve:"CO2 Valve",ECU:"ECUs/Ventilation System",Valve:"Irrigation Valve",SpectrumAdjustableLight:"Light",SwitchableFan:"Fan",ThreeWayValve:"Chilled Water Valve",TwoStageDehumidifier:"Dehumidifier",VFUHumidifier:"Humidifier"},isLoadingJog:!1}},beforeMount:function(){Pt["a"].$on("facility-websocket-message",this.handleSocketMessage),this.refresh()},beforeDestroy:function(){this.killPolling()},computed:Mt(Mt({},Object(p["c"])(["getUser"])),{},{curtains:function(){return this.items.filter((function(t){return"Curtain"===t.deviceType}))},isCortexVfu:function(){return this.zoneDevice&&"CortexVFU"===this.zoneDevice.deviceType}}),methods:{handleSocketMessage:function(t){if("reportState"===t.type||"reportReading"===t.type||"setDeviceParameter"===t.type){var e=t.payload;if("reportState"===t.type?e.data.deviceMessage:"setDeviceParameter"===t.type&&e.data.reason,"Sensor"!==e.deviceType||"Sensor"===e.deviceType&&"reportReading"!==t.type){var r=this.items.filter((function(t){return t.device_id==e.deviceId}))[0];if(r){if(r.suspendEvent=!0,r.state!==e.state?(r.suspendEvent=!0,setTimeout((function(){r.suspendEvent=!1}),500)):r.suspendEvent=!1,"setDeviceParameter"===t.type&&"Light"===e.deviceType&&e.data&&e.data.parameter&&"intensity"===e.data.parameter)for(var n=0;n<r.parameters.length;n++)r.parameters[n].description===e.data.parameter&&r.parameters[n].virtualDevice_id===e.deviceId&&(r.parameters[n].numericValue=parseFloat(e.data.value));r.state=e.state,r.isPolling=!1,this.refreshVisualizer()}}}},onJog:function(){this.showJog=!0},jogCurtain:function(t,e){var r=this,n="Curtain".concat(t,"Jog").concat(e);this.isLoadingJog=!0,m["a"].post("controllerCommands/executeComplexBatchCommand",this.getUser.apitoken,{controller_ids:[this.controllerId],command:n,virtualDeviceType_id:17,intensity:this.curtainJogLength}).then((function(t){var e=kt(t,2),n=(e[0],e[1]);n?S["a"].error("An error occurred. Please try again later."):S["a"].success("Commands were successfully added to the queue"),r.isLoadingJog=!1}))},killPolling:function(){this.pollingService&&(clearInterval(this.pollingService),this.pctComplete=0,this.pollingService=null,this.isPolling=!1,this.nextFetchTime="",this.refreshVisualizer())},startPolling:function(){this.isSse||this.isPolling||(this.isPolling=!0,this.doPolling(),this.pollingService=setInterval(this.doPolling,1e4))},doPolling:function(){var t=this;m["a"].get("controllerCommands",this.getUser.apitoken,{filter:{where:{controller_id:this.controllerId},fields:["action_id","controller_id","id","virtualDevice_id"],include:{relation:"controller",scope:{fields:["lastCommandFetch"]}}}}).then((function(e){var r=kt(e,2),n=r[0];r[1];if(0==n.length)t.killPolling();else{I()(n[0].controller.lastCommandFetch);var i=I()(n[0].controller.lastCommandFetch).add(2,"m"),a=I.a.duration(I()().diff(i)),o=-1*Math.round(a.as("seconds"));t.pctComplete=Math.round((120-o)/120*100),t.nextFetchTime="Next update in about "+o+" seconds "}}))},refreshVisualizer:function(){var t=this;t.$refs.visualPlatformDisplay&&t.$refs.visualPlatformDisplay.refresh(!0)},onVisualizerRefresh:function(t){this.createFilteredDevicesList(t)},refresh:function(){if(this.platformGroupId){var t=this;this.isLoading=!0;var e=[m["a"].get("ag_platformGroups/getFeatures",this.getUser.apitoken,{platformGroupId:this.platformGroupId,feature:"dimmable"}),m["a"].get("devicesAndPlatforms/getPlatformGroupDevices",this.getUser.apitoken,{controller_id:this.controllerId}),m["a"].get("ag_platformGroups/getFeatures",this.getUser.apitoken,{platformGroupId:this.platformGroupId,feature:"microclimate"}),m["a"].get("ag_platformGroups/contains",this.getUser.apitoken,{platformGroupId:this.platformGroupId,hardware_type_category_label:"ECU Controller Board"})];Promise.all(e).then((function(e){var r=kt(e,4),n=kt(r[0],2),i=n[0],a=(n[1],kt(r[1],2)),o=a[0],s=(a[1],kt(r[2],2)),l=s[0],c=(s[1],kt(r[3],2)),u=c[0],d=(c[1],o.filter((function(e){return e.platformGroup_id==t.platformGroupId||!e.platformGroup_id})));o=d,1==u.length&&1==u[0].qty&&(t.isCortex=!0),1==l.length&&(t.supportsMicroclimate=l[0].numbervalue),1==i.length&&(t.dimmableLights=i[0].numbervalue);for(var h=0;h<o.length;h++)o[h].isPolling=!1,o[h].suspendEvent=!1;t.isLoading=!1,t.createFilteredDevicesList(o)}))}},createFilteredDevicesList:function(t){for(var e=[],r=0;r<t.length;r++)if(t[r].actions&&t[r].actions.length>0||t[r].parameters&&t[r].parameters.length>0){if(!this.supportsMicroclimate&&("CO2"==t[r].device||"Humidity"==t[r].device||"Temperature"==t[r].device))continue;t[r].actions.sort((function(t,e){return t.displayName>e.displayName?1:-1})),e.push(t[r])}this.platformGroupDevicesList=e},filterBrackets:function(t){return t.indexOf("[")>-1?t.substring(0,t.indexOf("[")):t},getIsDisabled:function(t){var e=["light","switchablelight","spectrumadjustablelight"].includes(t.deviceType&&t.deviceType.toLowerCase());return!(!this.getUser.facility.lockLights||!e)},setComponentType:function(t){return t.deviceType.includes("SpectrumAdjustableLight")?"spectrum-intensity":t.deviceType.includes("Light")?"intensity":["chilledwatervalve","sensor","valve","curtain","light","switchablelight","bypassvalve","co2valve","vfuhumidifier","vfudehumidifier","switchablefan"].includes(t.deviceType&&t.deviceType.toLowerCase())?"toggle":"dropdown"},checkCoolingStatusForLights:function(t,e){},changed:function(t){var e=t.id,r=t.action_id,n=t.intensity,i=this,a=this.items.filter((function(t){return t.id==e}))[0],o={};switch(a.isPolling=!0,a.deviceType){case"Light":isNaN(n)?("OFF"==a.state?a.state="ON":a.state="OFF",this.checkCoolingStatusForLights(a,"ON"==a.state),o={controller_id:this.controllerId,action_id:r,virtualDevice_id:e,user_id:this.getUser.id}):(this.checkCoolingStatusForLights(a,n>0),1==n?n="1.00":0==n&&(n="0.00"),o={controller_id:this.controllerId,action_id:r,virtualDevice_id:e,user_id:this.getUser.id,value:n},a.isPolling=!1);break;case"SpectrumAdjustableLight":o={controller_id:this.controllerId,action_id:r,virtualDevice_id:e,user_id:this.getUser.id,value:n},a.isPolling=!1;break;default:o={controller_id:this.controllerId,action_id:r,virtualDevice_id:e,user_id:this.getUser.id}}m["a"].post("controllerCommands",this.getUser.apitoken,o).then((function(t){var e=kt(t,2),r=e[0];e[1];r?i.startPolling():S["a"].error("Error sending command. Please try again later.")}))}},watch:{platformGroupDevicesList:{immediate:!1,handler:function(t){if(t&&t.length){this.items=t.filter((function(t){return![15,16,36,44].includes(t.deviceType_id)}));for(var e=0;e<this.items.length;e++)this.items[e].groupName=this.labels[this.items[e].deviceType]||this.items[e].deviceType;this.items.sort((function(t,e){return t.groupName+":"+t.device>e.groupName+":"+e.device?1:-1})),this.ready=!0}}},lastEventReceived:function(t){var e=null;if(t.device_id||(t.device_id=t.deviceId),console.log("val",t),"Sensor"!=t.deviceType||"Sensor"==t.deviceType&&!t.reading){var r=this.items.filter((function(e){return e.device_id==t.device_id}))[0];if(r){if(r.suspendEvent=!0,r.state!=t.state?(r.suspendEvent=!0,setTimeout((function(){r.suspendEvent=!1}),500)):r.suspendEvent=!1,"Light"==t.deviceType&&t.parameters&&""!=t.parameters&&"{}"!=t.parameters){try{e=JSON.parse(t.parameters)}catch(o){e=null,console.log("Invalid parameter JSON",t.parameters)}if(e)for(var n in e)for(var i=0;i<r.parameters.length;i++)r.parameters[i].description==n&&r.parameters[i].virtualDevice_id==t.device_id&&(r.parameters[i].numericValue=e[n])}if("SpectrumAdjustableLight"==t.deviceType&&("whiteIntensity"==t.data.parameter||"redIntensity"==t.data.parameter))for(var a=0;a<r.parameters.length;a++)if(r.parameters[a].description==t.data.parameter){r.parameters[a].numericValue=parseFloat(t.data.value);break}r.state=t.state,r.isPolling=!1,this.refreshVisualizer()}}},platformGroupId:function(t,e){this.refresh()}}},Rt=Gt,$t=(r("df6e"),Object(W["a"])(Rt,h,f,!1,null,null,null));e["a"]=$t.exports},"06b1":function(t,e,r){"use strict";var n=r("8336"),i=r("8fea"),a=r("7679"),o=r("132d"),s=r("8654"),l=function(){var t=this,e=t._self._c;return t.showTable?e(i["a"],{key:t.refreshCounter,attrs:{id:"ecuTestplanTable",headers:t.headers,items:t.value,"hide-default-footer":"",loading:t.isLoading,"must-sort":"",options:t.pagination,"fixed-header":"",height:"100%","item-key":"seq"},scopedSlots:t._u([{key:"item.drag",fn:function(r){r.item;return[e("span",{staticClass:"handle"},[e(o["a"],[t._v("drag_indicator")])],1)]}},{key:"item.actions",fn:function(r){var i=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},[e(n["a"],{attrs:{icon:""},on:{click:function(e){return t.onDeleteClick(i)}}},[e(o["a"],[t._v("delete")])],1)],1)]}},{key:"item.temperature",fn:function(r){var n=r.item;return[e(a["a"],{attrs:{"return-value":n.temperature},on:{"update:returnValue":function(e){return t.$set(n,"temperature",e)},"update:return-value":function(e){return t.$set(n,"temperature",e)},close:function(e){return t.close(n,"temperature")},open:function(e){return t.open(n,"temperature")}},scopedSlots:t._u([{key:"input",fn:function(){return[e(s["a"],{attrs:{label:"Edit","single-line":"",type:"number",suffix:t.tempSuffix,rules:[t.rules.positiveNumber,t.rules.required],disabled:t.disabled},model:{value:n.temperature,callback:function(e){t.$set(n,"temperature",e)},expression:"item.temperature"}})]},proxy:!0}],null,!0)},[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v("\n        "+t._s(n.temperature)+" "+t._s(t.tempSuffix))])])]}},{key:"item.humidity",fn:function(r){var n=r.item;return[e(a["a"],{attrs:{"return-value":n.humidity},on:{"update:returnValue":function(e){return t.$set(n,"humidity",e)},"update:return-value":function(e){return t.$set(n,"humidity",e)},close:function(e){return t.close(n,"humidity")},open:function(e){return t.open(n,"humidity")}},scopedSlots:t._u([{key:"input",fn:function(){return[e(s["a"],{attrs:{label:"Edit","single-line":"",type:"number",suffix:"%",rules:[t.rules.positiveNumber,t.rules.required,t.rules.integer],disabled:t.disabled},model:{value:n.humidity,callback:function(e){t.$set(n,"humidity",e)},expression:"item.humidity"}})]},proxy:!0}],null,!0)},[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n.humidity)+" %")])])]}},{key:"item.co2",fn:function(r){var n=r.item;return[e(a["a"],{attrs:{"return-value":n.co2},on:{"update:returnValue":function(e){return t.$set(n,"co2",e)},"update:return-value":function(e){return t.$set(n,"co2",e)},close:function(e){return t.close(n,"co2")},open:function(e){return t.open(n,"co2")}},scopedSlots:t._u([{key:"input",fn:function(){return[e(s["a"],{attrs:{label:"Edit","single-line":"",type:"number",suffix:"ppm",rules:[t.rules.positiveNumber,t.rules.required,t.rules.integer],disabled:t.disabled},model:{value:n.co2,callback:function(e){t.$set(n,"co2",e)},expression:"item.co2"}})]},proxy:!0}],null,!0)},[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n.co2)+" ppm")])])]}},{key:"item.downlightIntensity",fn:function(r){var n=r.item;return[e(a["a"],{attrs:{"return-value":n.downlightIntensity},on:{"update:returnValue":function(e){return t.$set(n,"downlightIntensity",e)},"update:return-value":function(e){return t.$set(n,"downlightIntensity",e)},close:function(e){return t.close(n,"downlightIntensity")},open:function(e){return t.open(n,"downlightIntensity")}},scopedSlots:t._u([{key:"input",fn:function(){return[e(s["a"],{attrs:{label:"Edit","single-line":"",type:"number",suffix:"%",rules:[t.rules.positiveNumber,t.rules.required,t.rules.integer],disabled:t.disabled},model:{value:n.downlightIntensity,callback:function(e){t.$set(n,"downlightIntensity",e)},expression:"item.downlightIntensity"}})]},proxy:!0}],null,!0)},[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n.downlightIntensity)+" %")])])]}},{key:"item.interlightIntensity",fn:function(r){var n=r.item;return[e(a["a"],{attrs:{"return-value":n.interlightIntensity},on:{"update:returnValue":function(e){return t.$set(n,"interlightIntensity",e)},"update:return-value":function(e){return t.$set(n,"interlightIntensity",e)},close:function(e){return t.close(n,"interlightIntensity")},open:function(e){return t.open(n,"interlightIntensity")}},scopedSlots:t._u([{key:"input",fn:function(){return[e(s["a"],{attrs:{label:"Edit","single-line":"",type:"number",suffix:"%",rules:[t.rules.positiveNumber,t.rules.required,t.rules.integer],disabled:t.disabled},model:{value:n.interlightIntensity,callback:function(e){t.$set(n,"interlightIntensity",e)},expression:"item.interlightIntensity"}})]},proxy:!0}],null,!0)},[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n.interlightIntensity)+" %")])])]}},{key:"item.transitionTime",fn:function(r){var n=r.item;return[e(a["a"],{attrs:{"return-value":n.transitionTime},on:{"update:returnValue":function(e){return t.$set(n,"transitionTime",e)},"update:return-value":function(e){return t.$set(n,"transitionTime",e)},close:function(e){return t.close(n,"transitionTime")},open:function(e){return t.open(n,"transitionTime")}},scopedSlots:t._u([{key:"input",fn:function(){return[e(s["a"],{attrs:{label:"Edit","single-line":"",type:"number",suffix:"minutes",rules:[t.rules.positiveNumber,t.rules.required,t.rules.integer],disabled:t.disabled},model:{value:n.transitionTime,callback:function(e){t.$set(n,"transitionTime",e)},expression:"item.transitionTime"}})]},proxy:!0}],null,!0)},[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n.transitionTime)+" mins")])])]}},{key:"item.onTargetTime",fn:function(r){var n=r.item;return[e(a["a"],{attrs:{"return-value":n.onTargetTime},on:{"update:returnValue":function(e){return t.$set(n,"onTargetTime",e)},"update:return-value":function(e){return t.$set(n,"onTargetTime",e)}},scopedSlots:t._u([{key:"input",fn:function(){return[e(s["a"],{attrs:{label:"Edit","single-line":"",type:"number",suffix:"minutes",rules:[t.rules.positiveNumber,t.rules.required,t.rules.integer],disabled:t.disabled},model:{value:n.onTargetTime,callback:function(e){t.$set(n,"onTargetTime",e)},expression:"item.onTargetTime"}})]},proxy:!0}],null,!0)},[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n.onTargetTime)+" mins")])])]}},{key:"item.seq",fn:function(e){var r=e.item;return[t._v(t._s(r.seq))]}},{key:"item.startTime",fn:function(r){var n=r.item;return[e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(n.startTime))}})]}}],null,!1,3969804476)}):t._e()},c=[],u=r("d67f"),d=r("2f62"),h=r("aa47"),f=r("9c4f"),p=r("a9b3");function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){g(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t){var e=w(t,"string");return"symbol"==m(e)?e:e+""}function w(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var x={name:"",props:["value","isLoading","tempSuffix","disabled"],components:{},mixins:[f["a"],p["a"]],beforeMount:function(){},mounted:function(){this.disabled||this.gridDraggable()},data:function(){return{previousValue:0,showTable:!0,refreshCounter:0,pagination:{itemsPerPage:-1,sortBy:["seq"]},headers:[{text:"",align:"left",sortable:!1,value:"drag",width:20},{text:"",value:"actions",align:"center",sortable:!1,width:20},{text:"Seq",align:"center",sortable:!0,value:"seq",width:80},{text:"Temp",align:"right",sortable:!1,value:"temperature"},{text:"RH",align:"right",sortable:!1,value:"humidity"},{text:"CO2",align:"right",sortable:!1,value:"co2"},{text:"Downlights",align:"right",sortable:!1,value:"downlightIntensity"},{text:"Interlights",align:"right",sortable:!1,value:"interlightIntensity"},{text:"Time to Reach Setpoints",align:"center",sortable:!1,value:"transitionTime"},{text:"Time on Target",align:"center",sortable:!1,value:"onTargetTime"}]}},computed:y({},Object(d["c"])(["getUser"])),watch:{disabled:{handler:function(t,e){if(t)this.headers.shift(),this.headers.shift(),this.value.length&&this.value[0].startTime&&this.headers.splice(1,0,{text:"Start",value:"startTime",width:180});else{var r=this.headers.findIndex((function(t){return"startTime"==t.value}));r>=0&&this.headers.splice(r,1)}},immediate:!0}},methods:{open:function(t,e){this.previousValue=t[e]},close:function(t,e){var r=parseFloat(t[e]);r<0&&(t[e]=this.previousValue,u["a"].error("Values cannot be negative"))},onDeleteClick:function(t){var e=JSON.parse(JSON.stringify(this.value));e=e.filter((function(e){return e.seq!=t.seq})),e.sort((function(t,e){return t.seq>e.seq?1:-1}));for(var r=0;r<e.length;r++)e[r].seq=r+1;this.$emit("input",e)},reRenderComponent:function(){var t=this,e=this;this.refreshCounter++,this.showTable=!1,this.$nextTick().then((function(){e.showTable=!0,setTimeout(t.gridDraggable,250)}))},gridDraggable:function(){var t=this,e=document.querySelector("#ecuTestplanTable tbody");h["a"].create(e,{handle:".handle",onEnd:function(e){var r=e.newIndex,n=e.oldIndex,i=JSON.parse(JSON.stringify(t.value)),a=i.splice(n,1)[0];i.splice(r,0,a);for(var o=i.length-1;o>=0;o--)i[o].seq=o+1;t.$emit("input",i),t.reRenderComponent()}})}}},S=x,_=(r("169aa"),r("2877")),C=Object(_["a"])(S,l,c,!1,null,null,null);e["a"]=C.exports},"06b7":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("8fea"),l=r("132d"),c=r("0fd9"),u=r("2fa4"),d=r("3a2f"),h=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content"},[e(a["d"],[e("h2",[t._v(t._s(t.selectedController.controller_name)+" Media Sensing")]),e(u["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],{staticClass:"d-flex flex-column"},[e(c["a"],{attrs:{justify:"center","no-gutters":""}},[e(o["a"],{staticClass:"pl-1 pr-1 pb-0",attrs:{cols:"2",lg:"2"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate"),noIcon:!0},model:{value:t.selectedStartDate,callback:function(e){t.selectedStartDate=e},expression:"selectedStartDate"}})],1),e(o["a"],{staticClass:"pl-1 pr-1 pb-0",attrs:{cols:"2",lg:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime"),noIcon:!0},model:{value:t.selectedStartTime,callback:function(e){t.selectedStartTime=e},expression:"selectedStartTime"}})],1),e(o["a"],{staticClass:"pl-1 pr-1 pb-0",attrs:{cols:"2",lg:"2"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.endDate"),noIcon:!0},model:{value:t.selectedEndDate,callback:function(e){t.selectedEndDate=e},expression:"selectedEndDate"}})],1),e(o["a"],{staticClass:"pl-1 pr-1 pb-0",attrs:{cols:"2",lg:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.endTime"),noIcon:!0},model:{value:t.selectedEndTime,callback:function(e){t.selectedEndTime=e},expression:"selectedEndTime"}})],1),e(o["a"],{staticClass:"pl-1 pb-0",attrs:{cols:"2",lg:"2"}},[e(d["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"mt-4",attrs:{icon:""},on:{click:t.refresh}},i),[e(l["a"],[t._v("search")])],1)]}}])},[e("span",[t._v("Search")])]),e(d["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"mt-4",attrs:{icon:""},on:{click:t.toggleChart}},i),[e(l["a"],[t._v("auto_graph")])],1)]}}])},[e("span",[t._v("Toggle Charts")])]),e(d["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"mt-4",attrs:{icon:""},on:{click:t.fetchData}},i),[e(l["a"],[t._v("youtube_searched_for")])],1)]}}])},[e("span",[t._v("Download New Readings from Sensors")])]),e(d["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"mt-4",attrs:{icon:""},on:{click:t.resetDates}},i),[e(l["a"],[t._v("refresh")])],1)]}}])},[e("span",[t._v("Reset Dates and Times")])])],1)],1),t.showChart?e("div",{staticStyle:{width:"100%",height:"calc(100% - 70px)",overflow:"auto"}},[e("chart",{attrs:{lights:t.lightRecords,valves:t.valveRecords},model:{value:t.readings,callback:function(e){t.readings=e},expression:"readings"}})],1):t._e(),e(s["a"],{directives:[{name:"show",rawName:"v-show",value:!t.showChart,expression:"!showChart"}],staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,items:t.readings,"fixed-header":"",options:t.pagination,"hide-default-footer":"",height:"100%",loading:t.isLoading},scopedSlots:t._u([{key:"header.fertility",fn:function(r){r.header;return[e("span",{domProps:{innerHTML:t._s("EC (mS/cm)")}})]}},{key:"item.dateTime",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.dateTime))}})]}},{key:"item.temperature",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n[57]?t.formatTemperature(n[57].reading):"--")+"\n        ")])]}},{key:"item.moisture",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n[53]?n[53].reading:"--")+" %\n        ")])]}},{key:"item.fertility",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n[62]?n[62].reading:n[54]?n[54].reading:"--")+"\n        ")])]}}],null,!0)})],1)],1)},f=[],p=r("2f62"),m=r("4458"),v=r("dd20"),y=r("c1df"),g=r.n(y),b=r("d67f"),w=r("d0eb"),x=(r("ea10"),r("a9b3")),S=r("12a1"),_=r("15e6");function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function O(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */O=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==C(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(C(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function P(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function D(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){P(a,n,i,o,s,"next",t)}function s(t){P(a,n,i,o,s,"throw",t)}o(void 0)}))}}function k(t,e){return L(t)||I(t,e)||j(t,e)||T()}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function I(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function L(t){if(Array.isArray(t))return t}function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){U(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function U(t,e,r){return(e=N(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t){var e=F(t,"string");return"symbol"==C(e)?e:e+""}function F(t,e){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var G={name:"xiaomi-sensor",mixins:[x["a"]],components:{VuetifyDatepicker:m["a"],VuetifyTimepicker:v["a"],Chart:_["a"]},data:function(){return{rec:null,showChart:!0,selectedStartDate:null,selectedEndDate:null,selectedStartTime:null,selectedEndTime:null,isLoading:!1,soilsensors:[],readings:[],lightRecords:[],valveRecords:[],showEditor:!1,pagination:{itemsPerPage:-1,sortBy:["dateTime","desc"],sortDesc:[!0]},displayMetric:!1,headers:[{text:"Date/Time",value:"dateTime",groupable:!1},{text:"Temp",value:"temperature",align:"center",groupable:!1},{text:"Moisture (VWC)",value:"moisture",align:"center",groupable:!1},{text:"EC (mS/cm)",value:"fertility",align:"right",groupable:!1}]}},beforeMount:function(){this.displayMetric=w["a"].displayMetric(this.getUser),this.resetDates()},computed:M(M({},Object(p["c"])(["getUser"])),Object(p["c"])("universalDashboard",["selectedController"])),methods:{onClose:function(){this.$store.dispatch("universalDashboard/setShowActiveSoilSensors",!1),this.$store.dispatch("universalDashboard/setSelectedController",null)},fetchData:function(){var t=this;w["a"].post("controllerCommands",t.getUser.apitoken,{controller_id:this.selectedController.controller_id,action_id:141}).then((function(t){var e=k(t,2),r=e[0];e[1];r?b["a"].success("Request submitted"):b["a"].error("An error occurred. Please try again later.")}))},toggleChart:function(){this.showChart=!this.showChart},resetDates:function(){var t=this.nowInTZPref().subtract(2,"days"),e=this.nowInTZPref();this.selectedStartDate=t.clone().format("YYYY-MM-DD"),this.selectedStartTime=t.clone().format("HH:mm"),this.selectedEndDate=e.clone().format("YYYY-MM-DD"),this.selectedEndTime=e.clone().format("HH:mm"),this.refresh()},formatTemperature:function(t){return this.displayMetric?t+" C":Object(S["toFahrenheit"])(t)+" F"},refresh:function(){var t=this;return D(O().mark((function e(){var r,n,i,a,o,s,l,c,u,d,h,f,p,m,v,y;return O().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t,r.isLoading=!0,n={controller_id:t.selectedController.controller_id},i=g()("".concat(t.selectedStartDate," ").concat(t.selectedStartTime)).utc().format("YYYY-MM-DD HH:mm"),a=g()("".concat(t.selectedEndDate," ").concat(t.selectedEndTime)).utc().format("YYYY-MM-DD HH:mm"),n.and=[{begintime:{gte:i}},{begintime:{lte:a}}],e.next=8,Promise.all([w["a"].get("lightDeviceHistories",t.getUser.apitoken,{filter:{where:{and:[{dbtime:{gte:i}},{dbtime:{lte:a}}],controller_id:t.selectedController.controller_id}}}),w["a"].get("valveHistories",t.getUser.apitoken,{filter:{where:{and:[{dbtime:{gte:i}},{dbtime:{lte:a}}],controller_id:t.selectedController.controller_id}}})]);case 8:return o=e.sent,s=k(o,2),l=k(s[0],2),c=l[0],l[1],u=k(s[1],2),d=u[0],u[1],h={},c.forEach((function(t){var e=g.a.utc(t.dbtime).format("YYYY-MM-DD HH:mm");h[e]||(h[e]={dateTime:e,stateId:t.state_id})})),t.lightRecords=Object.keys(h).map((function(t){return h[t]})),f={},d.forEach((function(t){var e=g.a.utc(t.dbtime).format("YYYY-MM-DD HH:mm");f[e]||(f[e]={dateTime:e,stateId:t.state_id})})),t.valveRecords=Object.keys(f).map((function(t){return f[t]})),e.next=24,w["a"].get("sensor-devices/getSoilSensorHistory",t.getUser.apitoken,{controllerId:t.selectedController.controller_id,startDate:i,endDate:a});case 24:p=e.sent,m=k(p,2),v=m[0],m[1],y={},Object.keys(v.data).forEach((function(t){v.data[t].forEach((function(e){e.readings.forEach((function(e){var r=g.a.utc(e.dbtime).format("YYYY-MM-DD HH:mm:ss");y[r]||(y[r]={dateTime:r}),y[r][t]=e}))}))})),t.readings=Object.keys(y).map((function(t){return y[t]})),r.isLoading=!1;case 32:case"end":return e.stop()}}),e)})))()}},watch:{}},R=G,$=r("2877"),H=Object($["a"])(R,h,f,!1,null,null,null);e["a"]=H.exports},"0802":function(t,e,r){},"084c":function(t,e,r){"use strict";var n=r("8336"),i=r("a609"),a=r("b0af"),o=r("99d9"),s=r("132d"),l=r("2fa4"),c=function(){var t=this,e=t._self._c;return e(a["a"],[e(o["d"],[e("h2",[t._v("Configure Air VPD to Leaf VPD Offset Temperature")]),e(l["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(s["a"],[t._v("close")])],1)],1),e(o["c"],[e("div",{staticStyle:{"text-align":"center","padding-bottom":"20px"}},[t._v("\n      Set the estimated delta between air temperature and leaf temperature:\n    ")]),e("div",{staticStyle:{"text-align":"center"}},[e(i["a"],{attrs:{rounded:"",centered:""},model:{value:t.vpdAdjustment,callback:function(e){t.vpdAdjustment=e},expression:"vpdAdjustment"}},[t.useMetric?t._e():e(n["a"],[t._v("0°F")]),t.useMetric?t._e():e(n["a"],[t._v("-1°F")]),t.useMetric?t._e():e(n["a"],[t._v("-2°F")]),t.useMetric?t._e():e(n["a"],[t._v("-3°F")]),t.useMetric?t._e():e(n["a"],[t._v("-4°F")]),t.useMetric?e(n["a"],[t._v("0°C")]):t._e(),t.useMetric?e(n["a"],[t._v("-0.55°C")]):t._e(),t.useMetric?e(n["a"],[t._v("-1.11°C")]):t._e(),t.useMetric?e(n["a"],[t._v("-1.66°C")]):t._e(),t.useMetric?e(n["a"],[t._v("-2.22°C")]):t._e()],1)],1)]),e(o["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.onClose}},[t._v("Close")])],1)],1)},u=[],d=r("2f62");r("c1df"),r("d67f"),r("d0eb");function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t,e,r){return(e=v(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t){var e=y(t,"string");return"symbol"==h(e)?e:e+""}function y(t,e){if("object"!=h(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var g={name:"AirToLeafVpdAdjuster",props:[],components:{},data:function(){return{vpdAdjustment:null}},beforeMount:function(){null==localStorage.getItem("leafVpdOffset")&&localStorage.setItem("leafVpdOffset",0),this.useMetric?this.vpdAdjustment=parseFloat(localStorage.getItem("leafVpdOffset")):this.vpdAdjustment=Math.ceil(parseFloat(localStorage.getItem("leafVpdOffset")))},computed:p(p({},Object(d["c"])(["getUser"])),{},{userUnitPreference:function(){return this.getUser.preferences.find((function(t){return"units"===t.preference}))},useMetric:function(){return this.userUnitPreference&&"metric"===this.userUnitPreference.setting}}),methods:{onClose:function(){this.$emit("close")}},watch:{vpdAdjustment:function(t,e){localStorage.setItem("leafVpdOffset",t),this.$emit("update",t)}}},b=g,w=r("2877"),x=Object(w["a"])(b,c,u,!1,null,null,null);e["a"]=x.exports},"09b7":function(t,e,r){},"0aa3":function(t,e,r){"use strict";var n=r("4ca6"),i=r("8336"),a=r("132d"),o=r("3a2f"),s=function(){var t=this,e=t._self._c;return e(o["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var o=r.on;return[e(i["a"],t._g({class:{"mx-1":t.btnSmall},attrs:{icon:"",small:t.btnSmall,large:t.btnLarge,disabled:t.disabled,loading:t.loading},on:{click:function(e){return t.onClick(e)}}},o),[e(n["a"],{attrs:{left:"",overlap:"",color:"primary",value:-1!=t.badgeCount},scopedSlots:t._u([{key:"badge",fn:function(){return[e("span",[t._v(t._s(t.badgeCount))])]},proxy:!0}],null,!0)},[e(a["a"],{attrs:{color:t.color}},[t._v(t._s(t.icon))])],1)],1)]}}])},[e("span",[t._v(t._s(t.tooltip))])])},l=[],c={name:"",props:["color","onclick","badgeCount","icon","tooltip","className","disabled","loading","size"],components:{},beforeMount:function(){},mounted:function(){},data:function(){return{}},computed:{btnLarge:function(){return!this.size||"large"===this.size},btnSmall:function(){return"small"===this.size}},watch:{},methods:{onClick:function(t){this.$emit("onclick",t)}}},u=c,d=r("2877"),h=Object(d["a"])(u,s,l,!1,null,null,null);e["a"]=h.exports},"0add":function(t,e,r){"use strict";r("ab43")},"0ebe":function(t,e,r){},"0f1d":function(t,e,r){},"0f6a":function(t,e,r){"use strict";r("b74e")},1074:function(t,e,r){},"10e88":function(t,e,r){},"12a1":function(t,e){function r(t,e=0){if(null===t||""===t||void 0===t)throw new Error("Input was null/empty when trying to convert temperature to Celsius.");const r=parseFloat(t),n=1.8*r+32;return o(n,e)}function n(t,e=0){if(null===t||""===t||void 0===t)throw new Error("Input was null/empty when trying to convert temperature to Fahrenheit.");const r=parseFloat(t),n=(r-32)/1.8;return o(n,e)}function i(t,e=0){return r(t,e)+" °F"}function a(t,e=0){return n(t,e)+" °C"}function o(t,e){return e&&"0"!==e?Number(Math.round(t+"e"+e)+"e-"+e):Math.round(t)}t.exports={toFahrenheit:r,toCelsius:n,toFahrenheitFmt:i,toCelsiusFmt:a}},"12ad":function(t,e,r){"use strict";var n=r("0798"),i=r("8336"),a=r("b0af"),o=r("99d9"),s=r("cc20"),l=r("62ad"),c=r("8fea"),u=r("169a"),d=r("132d"),h=r("8860"),f=r("da13"),p=r("5d23"),m=r("e449"),v=r("8e36"),y=r("0fd9"),g=r("1f4f"),b=r("3a2f"),w=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"h-100 d-flex flex-column",attrs:{flat:""}},[t.filters.length||t.$store.state.universalDashboard.filterPlatformGroupCollection?e("div",{staticClass:"d-flex flex-shrink-1 flex-grow-0"},[e("div",{staticClass:"d-flex flex-column w-100"},[e("div",{staticClass:"d-flex w-100"},[t.$store.state.universalDashboard.filterPlatformGroupCollection?e("div",{staticClass:"d-flex align-center mr-5"},[e("div",{staticClass:"mr-2 font-weight-bold"},[t._v("Collection:")]),e(m["a"],{attrs:{rounded:"xl","offset-y":"","content-class":"mt-1"},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.attrs,i=r.on;return[e(s["a"],{attrs:{close:""},on:{"click:close":function(e){t.$store.state.universalDashboard.filterPlatformGroupCollection=null}}},[e("span",t._g(t._b({staticClass:"pr-3"},"span",n,!1),i),[t._v("\n                  "+t._s(t.$store.state.universalDashboard.filterPlatformGroupCollection.name)+"\n                ")]),e(d["a"],{attrs:{right:""},on:{click:t.editPlatformGroupCollection}},[t._v("\n                  mdi-pencil\n                ")])],1)]}}],null,!1,810516672)},[e(h["a"],t._l(t.$store.state.universalDashboard.platformGroupCollectionOptions.filter((function(e){return e.id!==t.$store.state.universalDashboard.filterPlatformGroupCollection.id})),(function(r,n){return e(f["a"],{key:n,attrs:{link:""},on:{click:function(e){return t.$store.dispatch("universalDashboard/setFilterPlatformGroupCollection",r)}}},[e(p["c"],[t._v(t._s(r.name))])],1)})),1)],1)],1):t._e(),t.filters.length?e("div",{staticClass:"row d-flex align-center"},[e("div",{staticClass:"col-3"},[t._v("\n            "+t._s(t.filteredZoneDevices.length)+" Matched Results\n          ")]),e("div",{staticClass:"col-6 d-flex flex-wrap",staticStyle:{flex:"1 1 auto"}},t._l(t.filters,(function(r){return e(s["a"],{key:r.key,attrs:{close:"",outlined:""},on:{"click:close":function(e){return t.removeStatusFilter(r)}}},["dehumidifier"!==r.icon?e(d["a"],{attrs:{color:r.color}},[t._v(t._s(r.icon))]):e(d["a"],{attrs:{color:r.color}},[t._v("$vuetify.icons.dehumidifier")])],1)})),1)]):t._e()]),t.$store.state.universalDashboard.filterPlatformGroupCollection&&t.platformGroupCollectionSensors(t.$store.state.universalDashboard.filterPlatformGroupCollection.id).length?e("div",{staticClass:"d-flex w-100 pt-1"},t._l(t.platformGroupCollectionSensors(t.$store.state.universalDashboard.filterPlatformGroupCollection.id),(function(r){return e(t.getSensorType(r.designator_id),{key:r.id,tag:"component",attrs:{sensor:r}})})),1):t._e()])]):t._e(),e(o["c"],{staticClass:"flex-grow-auto",staticStyle:{padding:"0"}},[e("locked-column-datatable",{attrs:{items:t.filteredZoneDevices,"max-locked-index":2,sm:"",md:"",lg:"","is-locking-enabled":t.isLockingEnabled},on:{finishedLockingColumns:function(e){t.isLockingColumns=!1}},scopedSlots:t._u([{key:"default",fn:function(r){return[e(c["a"],{key:t.refreshKey,attrs:{id:"unitResultsTable",loading:t.vfusLoading,"no-data-text":t.zone_devices.length>0&&0===t.filteredZoneDevices.length&&(!t.search||0===t.search.length)?"Rendering. Please Wait.":"No data found",headers:t.searchHeaders,items:t.filteredZoneDevices,options:t.pagination,"show-select":"","must-sort":"","fixed-header":"",height:t.filteredZoneDevices.length<250?"100%":"calc(100% - 59px)","mobile-breakpoint":"0","items-per-page":-1,expanded:t.displayUnitsExpanded,"footer-props":t.footerprops,"hide-default-footer":t.filteredZoneDevices.length<250,"group-by":t.tableGroupBy,dense:"","show-expand":""},on:{"dblclick:row":t.onRowDblClick,"contextmenu:row":t.onContextMenu,"update:expanded":function(e){t.displayUnitsExpanded=e},"update:options":r.updated},scopedSlots:t._u([{key:"item.actions",fn:function(r){var n=r.item;return[1===n.dashboardDisplayType_id?e("span",{staticStyle:{"white-space":"nowrap"},attrs:{id:"pg-"+n.platformGroup_id}},[n.exceptionCount>0?[e("span",{attrs:{title:n.exceptionMessage}},[e(d["a"],{attrs:{color:"red"},on:{click:function(e){return t.onShowExceptions(n)}}},[t._v("warning")])],1)]:[e("span",{attrs:{title:"No errors in the last hour"}},[e(d["a"],{attrs:{color:"#d8d8d8"},on:{click:function(e){return t.onShowExceptions(n)}}},[t._v("warning")])],1)],e("span",{attrs:{title:n.title},on:{dblclick:function(e){return t.onRegisterDump(n)}}},[e(i["a"],{attrs:{icon:""},on:{click:function(e){return t.goToDevice(n)}}},[e(d["a"],{attrs:{color:n.infoIconColor}},[t._v(t._s(n.infoIcon))])],1),n.lifecycles?e(d["a"],{staticClass:"hidden-lg-and-up",attrs:{color:"primary"},on:{click:function(e){return t.goFileReport(n)}}},[t._v("camera_alt")]):e(d["a"],{staticClass:"hidden-lg-and-up",attrs:{color:"#c0c0c0"}},[t._v("camera_alt")]),n.lifecycles?e(d["a"],{staticClass:"hidden-lg-and-up",attrs:{color:"primary"},on:{click:function(e){return t.createOperationalTask(n)}}},[t._v("directions_run")]):e(d["a"],{staticClass:"hidden-lg-and-up",attrs:{color:"#c0c0c0"}},[t._v("directions_run")])],1)],2):t._e()]}},{key:"item.platformGroupName",fn:function(r){var n=r.item;return[e("span",{staticClass:"isClickable",staticStyle:{"white-space":"nowrap"},attrs:{title:"Click to view context menu"},on:{click:t.onContextMenu}},["off"===t.userPlatformNamePreference.setting?e("span",{class:{oldvalue:n.isDisconnected},on:{click:function(e){t.clickedRec.item=n}}},[t._v(t._s(n.platformGroupName))]):e("span",{class:{oldvalue:n.isDisconnected},on:{click:function(e){t.clickedRec.item=n}}},[t._v(t._s(n.platformGroupNameFull))])])]}},{key:"item.statusicons",fn:function(r){return[e("device-status-icons",{attrs:{item:r.item,facility:t.getUnitFacility(r.item)},on:{"batch-action":t.triggerContextActionForItem,"intensity-action":t.triggerIntensityActionForItem,"dehumidifier2-action":t.triggerDehumidifier2ActionForItem,"curtains-action":t.triggerCurtainsActionForItem,"ecu-action":t.triggerEcuActionForItem}})]}},{key:"item.hasLifecycles",fn:function(r){return[1===r.item.dashboardDisplayType_id&&r.item.deployed?["VFU"==r.item.platformGroupType||r.item.isRcu?[r.item.lifecycles?[e("span",{staticClass:"iconBtn",on:{click:function(e){return t.onShowDisplayUnitLifecycle(r.item)}}},[r.item.pestDetected?[e("span",{attrs:{title:r.item.lifecyclesTooltip+" -- PEST DETECTED"}},[e(d["a"],{attrs:{color:"red"}},[t._v("local_florist")])],1)]:[e("span",{attrs:{title:r.item.lifecyclesTooltip}},[e(d["a"],{attrs:{color:"green"}},[t._v("local_florist")])],1)]],2)]:["ENVIRONMENT_TESTING"!=r.item.currentState?[e("span",{attrs:{title:"No Lifecycles"},on:{click:function(e){return t.onShowDisplayUnitLifecycle(r.item)}}},[e(d["a"],{attrs:{color:"silver"}},[t._v("local_florist")])],1)]:[e(d["a"],{staticClass:"iconBtn",attrs:{color:"green"},on:{click:function(e){return t.onShowCurrentTest(r.item)}}},[t._v("quiz")])]]]:t._e()]:t._e(),-1!==[2,3,4,5].indexOf(r.item.dashboardDisplayType_id)?[r.item.lifecycles?[e("span",{staticClass:"iconBtn",on:{click:function(e){return t.onShowDisplayUnitLifecycle(r.item)}}},[r.item.pestDetected?[e("span",{attrs:{title:r.item.lifecyclesTooltip+" -- PEST DETECTED"}},[e(d["a"],{attrs:{color:"red"}},[t._v("local_florist")])],1)]:[e("span",{attrs:{title:r.item.lifecyclesTooltip}},[e(d["a"],{attrs:{color:"green"}},[t._v("local_florist")])],1)]],2)]:[e("span",{attrs:{title:"No Lifecycles"},on:{click:function(e){return t.onShowDisplayUnitLifecycle(r.item)}}},[e(d["a"],{attrs:{color:"silver"}},[t._v("local_florist")])],1)]]:t._e()]}},{key:"item.sortableCurrentState",fn:function(r){var n=r.item;return[e("current-state-widget",{ref:"currentStateWidget-".concat(n.platformGroup_id),attrs:{item:n},on:{"clicked-rec":function(e){t.clickedRec.item=n},"show-context-menu":t.onStateContextMenu}})]}},{key:"item.temperature",fn:function(r){return[e("span",{directives:[{name:"show",rawName:"v-show",value:r.item.temperature>0,expression:"props.item.temperature > 0"}],staticClass:"highlightfield",class:{highvalue:r.item.tempHigh,lowvalue:r.item.tempLow,oldvalue:t.minuteDiffUtc(r.item.lastTempUpdate)>=16||r.item.isDisconnected},attrs:{title:"".concat(r.item.tempSensorName,": ")+t.timeDiffUtc(r.item.lastTempUpdate)}},[t._v(t._s(r.item.temperatureFormatted))])]}},{key:"item.humidity",fn:function(r){return[e("span",{directives:[{name:"show",rawName:"v-show",value:r.item.humidity>0,expression:"props.item.humidity > 0"}],staticClass:"highlightfield",class:{highvalue:r.item.humidityHigh,lowvalue:r.item.humidityLow,oldvalue:t.minuteDiffUtc(r.item.lastHumidityUpdate)>=16||r.item.isDisconnected},attrs:{title:"".concat(r.item.humiditySensorName,": ")+t.timeDiffUtc(r.item.lastHumidityUpdate)}},[t._v(t._s(parseFloat(100*r.item.humidity).toFixed(0))+" %")])]}},{key:"item.dewpoint",fn:function(r){return[e("span",{class:{oldvalue:t.minuteDiffUtc(r.item.lastHumidityUpdate)>=16||t.minuteDiffUtc(r.item.lastTempUpdate)>=16||r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v(t._s(r.item.dewpoint))])]}},{key:"item.vpd",fn:function(r){return[e("span",{class:["highlightfield",t.getVpdStyleClass(r.item.temperature,r.item.humidity,t.vpdAdjustment,r.item.lifecyclesRaw)],attrs:{title:t.getVpdRangeText(r.item.temperature,r.item.humidity,t.vpdAdjustment,r.item.lifecyclesRaw)}},[e("span",{staticClass:"vpd",class:{oldvalue:t.minuteDiffUtc(r.item.lastHumidityUpdate)>=16||t.minuteDiffUtc(r.item.lastTempUpdate)>=16||r.item.isDisconnected},on:{click:t.setLeafVpdOffset}},[t._v("\n              "+t._s(t.calcVpd(r.item.temperature,r.item.humidity,t.vpdAdjustment))+"\n            ")])])]}},{key:"item.co2",fn:function(r){return[e("span",{directives:[{name:"show",rawName:"v-show",value:r.item.co2>0,expression:"props.item.co2 > 0"}],staticClass:"highlightfield",class:{highvalue:r.item.co2High,lowvalue:r.item.co2Low,oldvalue:t.minuteDiffUtc(r.item.lastCo2Update)>=16||r.item.isDisconnected},attrs:{title:"".concat(r.item.co2SensorName,": ")+t.timeDiffUtc(r.item.lastCo2Update)}},[t._v(t._s(r.item.co2)+" ppm")])]}},{key:"item.ipAddress",fn:function(r){return[e("span",{staticClass:"ipAddress",class:{oldvalue:r.item.isDisconnected},on:{click:t.onIpAddressClick}},[t._v(t._s(r.item.ipAddress))])]}},{key:"item.xTemp",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap",cursor:"pointer"},attrs:{title:"".concat(r.item.xTempSensorName)},on:{click:function(e){return t.showSoilSensors(r.item)}}},[t._v("\n            "+t._s(r.item.xTemp)+"\n          ")])]}},{key:"item.xFertility",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap",cursor:"pointer"},attrs:{title:"".concat(r.item.xFertilitySensorName)},on:{click:function(e){return t.showSoilSensors(r.item)}}},[t._v("\n            "+t._s(r.item.xFertility)+"\n\n            "),r.item.xFertility?e("span",[t._v("mS/cm")]):t._e()])]}},{key:"item.xMoisture",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap",cursor:"pointer"},attrs:{title:"".concat(r.item.xMoistureSensorName)},on:{click:function(e){return t.showSoilSensors(r.item)}}},[t._v("\n            "+t._s(r.item.xMoisture)+"\n\n            "),r.item.xMoisture?e("span",[t._v("%")]):t._e()])]}},{key:"item.xLux",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap",cursor:"pointer"},attrs:{title:"".concat(r.item.xLuxSensorName)},on:{click:function(e){return t.showSoilSensors(r.item)}}},[t._v("\n            "+t._s(r.item.xLux)+"\n\n            "),null!=r.item.xLux?e("span",[t._v(" lux")]):t._e()])]}},{key:"item.lastIrrigated",fn:function(r){return[e("div",{staticClass:"highlightfield",class:{highvalue:r.item.lateIrrigation,oldvalue:r.item.isDisconnected},staticStyle:{"text-align":"center"}},["on"===r.item.irrigationState.toLowerCase()?e(b["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e("div",t._g({},n),[e("div",[t._v("Irrigating")])])]}}],null,!0)},[r.item.lastIrrigated?e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.item.lastIrrigated,"YYYY-MM-DD h:mm a"))}}):e("span",[t._v("Irrigating")])]):e(b["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(n){var i=n.on;return[e("div",t._g({staticClass:"clickable",on:{click:t.toggleAbsoluteTimes}},i),[t.absoluteTimes?e("div",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.item.lastIrrigated,"YYYY-MM-DD h:mm a"))}}):e("div",[t._v("\n                    "+t._s(r.item.lateIrrigationInMinutes?t.lateTimeDiff(r.item):t.timeDiffUtc(r.item.lastIrrigated))+"\n                  ")])])]}}],null,!0)},[r.item.lastIrrigated?e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.item.lastIrrigated,"YYYY-MM-DD h:mm a"))}}):e("span",[t._v(" - ")])])],1)]}},{key:"item.nextIrrigated",fn:function(r){return[e("div",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"text-align":"center"}},[r.item.cropSteeringPhase?e(b["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(n){var i=n.on;return[e("div",t._g({},i),[t._v("\n                  P"+t._s(r.item.cropSteeringPhase)+": "+t._s(r.item.targetVWC)+"%\n                ")])]}}],null,!0)},[e("span",[t._v("VWC Irrigation Trigger")])]):e(b["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(n){var i=n.on;return[e("div",t._g({staticClass:"clickable",on:{click:t.toggleAbsoluteTimes}},i),[t.absoluteTimes?e("div",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.item.nextIrrigated,"YYYY-MM-DD h:mm a"))}}):e("div",[t._v("\n                    "+t._s(t.timeDiffUtc(r.item.nextIrrigated))+"\n                  ")])])]}}],null,!0)},[r.item.nextIrrigated?e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.item.nextIrrigated,"YYYY-MM-DD h:mm a"))}}):e("span",[t._v(" - ")])])],1)]}},{key:"item.lastCommandFetch",fn:function(r){return[r.item.lastCommandFetch?e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(t.moment(r.item.lastCommandFetch).fromNow())+"\n          ")]):t._e()]}},{key:"item.firmwareVersion",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(r.item.firmwareVersion)+"\n          ")])]}},{key:"item.strainName",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(r.item.strainName)+"\n          ")])]}},{key:"item.ticketCount",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(r.item.ticketCount)+"\n          ")])]}},{key:"item.platformGroupType",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(r.item.platformGroupType)+"\n          ")])]}},{key:"item.area",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(r.item.area)+"\n          ")])]}},{key:"item.softwareVersion",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(r.item.softwareVersion)+"\n          ")])]}},{key:"item.controller_id",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(r.item.controller_id)+"\n          ")])]}},{key:"item.uptime",fn:function(r){return[e("span",{class:{oldvalue:r.item.isDisconnected},staticStyle:{"white-space":"nowrap"}},[t._v("\n            "+t._s(r.item.uptimeFormatted)+"\n          ")])]}},{key:"expanded-item",fn:function(r){var n=r.headers,a=r.item;return[e("td",{attrs:{colspan:n.length}},[a.testPlan?[e("div",{staticStyle:{margin:"10px"}},[a.testPlanLoading?t._e():e(v["a"],{attrs:{indeterminate:""}}),e("div",{staticStyle:{"text-align":"center","font-weight":"bold","margin-bottom":"5px"}},[t._v("\n                  Test Plan: "+t._s(a.testPlan.label)+" "),e("br"),e("span",{staticStyle:{"font-weight":"normal"}},[t._v(t._s(a.testPlan.irrigation))])]),a.testPlan?e(g["a"],{staticStyle:{"max-width":"800px",margin:"auto"},scopedSlots:t._u([{key:"default",fn:function(){return[e("tr",[e("th",[t._v("Seq")]),e("th",[t._v("From")]),e("th",[t._v("To")]),e("th",[t._v("Downlights")]),e("th",[t._v("Interlights")]),e("th",[t._v("Temp")]),e("th",[t._v("RH")]),e("th",[t._v("CO2")])]),e("tbody",t._l(a.testPlan.filteredSchedule,(function(r){return e("tr",{key:"test_"+r.seq},[e("td",{staticStyle:{"text-align":"center"}},[t._v("\n                          "+t._s(r.seq)+" /\n                          "+t._s(a.testPlan.schedule.length)+"\n                        ")]),e("td",{staticStyle:{"text-align":"center"}},[t._v("\n                          "+t._s(r.started)+"\n                        ")]),e("td",{staticStyle:{"text-align":"center"}},[t._v("\n                          "+t._s(r.ending)+"\n                        ")]),e("td",{staticStyle:{"text-align":"center"}},[t._v("\n                          "+t._s(r.downlightIntensity)+"%\n                        ")]),e("td",{staticStyle:{"text-align":"center"}},[t._v("\n                          "+t._s(r.interlightIntensity)+"%\n                        ")]),e("td",{staticStyle:{"text-align":"center"}},[t._v("\n                          "+t._s(r.temperature)+"\n                        ")]),e("td",{staticStyle:{"text-align":"center"}},[t._v("\n                          "+t._s(r.humidity)+"%\n                        ")]),e("td",{staticStyle:{"text-align":"center"}},[t._v(t._s(r.co2)+" ppm")])])})),0)]},proxy:!0}],null,!0)}):t._e()],1)]:[t._l(a.lifecyclesRaw,(function(r,n){return e("div",{key:"lifecycle-".concat(n),staticClass:"text-center",staticStyle:{padding:"10px","max-width":"82vw"}},[e("div",{staticStyle:{display:"inline-block","margin-right":"5px",width:"95%"}},[e(y["a"],{staticClass:"text-left",attrs:{"no-gutters":""}},[e(l["a"],{attrs:{cols:"12"}},[e("div",{staticClass:"d-flex justify-space-between"},[e("div",[e("strong",[t._v("Growplan: ")]),t._v(" "+t._s(r.growplan_id)+" - "),e("a",{attrs:{href:"/#/growplans",onclick:"return false;"},on:{click:function(e){return t.growplanClick(r)}}},[t._v(t._s(r.growplanName))])]),e("div",[e("strong",[t._v("Strain: ")]),e("a",{attrs:{href:"/#/strains",onclick:"return false;"},on:{click:function(e){return t.strainNameClick(r)}}},[t._v(t._s(r.strainName))])]),e("div",{staticStyle:{display:"inline-block","white-space":"nowrap"}},[e("span",{attrs:{title:"Run Plant-Touching Task"}},[e(i["a"],{staticClass:"mr-1",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.createOperationalTask2(r.growplan_id,r.lifecycle_id)}}},[t._v("Run Task")])],1),e("span",{attrs:{title:"Review/Edit Phase Parameters"}},[e(i["a"],{staticClass:"mr-1",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.onEditPhase(r.currentPhase,a.controller_id)}}},[t._v("Edit Phase")])],1),t.isAdmin?e("span",{attrs:{title:"Enable/Disable"}},[e(i["a"],{staticClass:"mr-1",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.onToggleLifecycle(r)}}},[t._v("\n                            "+t._s(r.isSuspended?"Resume":"Suspend")+"\n                            ")])],1):t._e(),1===a.dashboardDisplayType_id?e("span",{attrs:{title:"Re-transmit this lifecycle to the VFU"}},[e(i["a"],{staticClass:"mr-0",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.reloadLifecycle(a)}}},[t._v("Reload")])],1):t._e()])]),e("span",[e("strong",[t._v("Lifecycle:  ")]),e("a",{attrs:{href:"/#/lifecycles",onclick:"return false;"},on:{click:function(e){return t.lifecycleClick(r)}}},[t._v(t._s(r.lifecycle_id))])]),e("div",[e("strong",[t._v("Plants:  ")]),t._v(" "+t._s(r.plants))]),e("div",{staticStyle:{"padding-bottom":"10px"}},[e("strong",[t._v("Schedule:  ")]),e("i",[t._v("\n                          "+t._s(t.moment.utc(r.lifecycleStarttime).format("MM/DD"))+" - "+t._s(t.moment.utc(r.lifecycleScheduledEnd).format("MM/DD"))+"\n                          (day "+t._s(Math.ceil(t.moment.utc(r.starttime).diff(t.moment.utc(r.lifecycleStarttime),"days",!0)))+"\n                          of "+t._s(Math.floor(t.moment.utc(r.lifecycleScheduledEnd).diff(t.moment.utc(r.lifecycleStarttime),"days",!0)))+")\n                        ")])]),e("div",[e("strong",[t._v("Phase: ")]),t._v(' "'+t._s(r.currentPhase.growPhaseName)+'"\n                      ')]),e("div",[e("strong",[t._v("Schedule:  ")]),e("i",[t._v("\n                          "+t._s(t.moment.utc(r.currentPhase.starttime).format("MM/DD"))+" - "+t._s(t.moment.utc(r.currentPhase.scheduledEnd).format("MM/DD"))+"\n                          (day "+t._s(r.daysInPhase)+" of "+t._s(r.totalDaysInPhase)+")\n                        ")])]),r.currentPhase?e("div",[e("strong",[t._v("Photo Period: ")]),t._v(t._s(t.getPhotoPeriodText(r))+"\n                      ")]):e("div",[t._v("\n                        Error - could not get the current growth phase\n                      ")]),e("br")])],1),1===a.dashboardDisplayType_id?e(g["a"],{scopedSlots:t._u([{key:"default",fn:function(){return[e("thead",[e("tr",[e("th",{staticStyle:{"padding-right":"30px"}},[t._v("\n                            Period\n                          ")]),e("th",{staticClass:"text-center"},[t._v("\n                            Temp\n                            "),e("br"),t._v("Min\n                          ")]),e("th",{staticClass:"text-center"},[e("strong",[t._v("\n                              Temp\n                              "),e("br"),t._v("Target\n                            ")])]),e("th",{staticClass:"text-center",staticStyle:{"padding-right":"30px"}},[t._v("\n                            Temp\n                            "),e("br"),t._v("Max\n                          ")]),e("th",{staticClass:"text-center"},[t._v("\n                            RH\n                            "),e("br"),t._v("Min\n                          ")]),e("th",{staticClass:"text-center"},[e("strong",[t._v("\n                              RH\n                              "),e("br"),t._v("Target\n                            ")])]),e("th",{staticClass:"text-center",staticStyle:{"padding-right":"30px"}},[t._v("\n                            RH\n                            "),e("br"),t._v("Max\n                          ")]),e("th",{staticClass:"text-center"},[t._v("\n                            CO2\n                            "),e("br"),t._v("Min\n                          ")]),e("th",{staticClass:"text-center"},[e("strong",[t._v("\n                              CO2\n                              "),e("br"),t._v("Target\n                            ")])]),e("th",{staticClass:"text-center",staticStyle:{"padding-right":"30px"}},[t._v("\n                            CO2\n                            "),e("br"),t._v("Max\n                          ")]),e("th",[e("strong",[t._v("Irrigation Schedule")])])])]),e("tbody",t._l(t.getSortedEnvironments(r.currentPhase.environments),(function(n,i){return e("tr",{key:"lifecycle-phase-".concat(i)},["Lights On"==n.lightState||"Lights Off"==n.lightState&&r.currentPhase.photoperiod<24?[e("td",{staticStyle:{"white-space":"nowrap"}},[t._v("\n                              "+t._s(n.lightState)+"\n                            ")]),e("td",{staticClass:"text-center",staticStyle:{"white-space":"nowrap"}},[t._v("\n                              "+t._s(t.calculateTemperatureDisplay(n.temp.min,1))+"\n                            ")]),e("td",{staticClass:"text-center",staticStyle:{"white-space":"nowrap"}},[e("strong",[t._v(t._s(t.calculateTemperatureDisplay(n.temp.setpoint,1)))])]),e("td",{staticClass:"text-center",staticStyle:{"white-space":"nowrap"}},[t._v("\n                              "+t._s(t.calculateTemperatureDisplay(n.temp.max,1))+"\n                            ")]),e("td",{staticClass:"text-center"},[t._v("\n                              "+t._s(n.humidity.min)+"%\n                            ")]),e("td",{staticClass:"text-center"},[e("strong",[t._v(t._s(n.humidity.setpoint)+"%")])]),e("td",{staticClass:"text-center",staticStyle:{"padding-right":"30px"}},[t._v("\n                              "+t._s(n.humidity.max)+"%\n                            ")]),e("td",{staticClass:"text-center"},[t._v(t._s(n.co2.min)+" ppm")]),e("td",{staticClass:"text-center"},[e("strong",[t._v(t._s(n.co2.setpoint)+" ppm")])]),e("td",{staticClass:"text-center"},[t._v(t._s(n.co2.max)+" ppm")]),e("td",{staticStyle:{"text-align":"left"}},[n.irrigation.customTimes&&n.irrigation.customTimes.length?e("div",{staticClass:"d-flex align-center pt-1"},[e("schedule-chips-custom",{attrs:{blocks:t.getOrderedCustomTimes(r.currentPhase.environments,n.lightState),closeable:!1}})],1):n.irrigation.cropSteering&&n.irrigation.cropSteering.length?[e(b["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e("div",t._g({},n),[e("div",{staticStyle:{cursor:"default"}},[t._v("Crop Steering Irrigation Schedule")])])]}}],null,!0)},[e("span",{domProps:{innerHTML:t._s(t.getCropSteeringTooltip(n.irrigation.cropSteering))}})])]:[n.irrigation.duration>0&&!r.currentPhase.noIrrigation?e("span",[t._v("\n                                  "+t._s(n.irrigation.designator)+"\n                                  every\n                                  "),n.irrigation.frequency>=60?e("span",[t._v(t._s(Math.round(n.irrigation.frequency/60*100)/100)+"\n                                    hours")]):e("span",[t._v(t._s(n.irrigation.frequency)+"\n                                    minutes")]),t._v("\n                                  for\n                                  "),n.irrigation.duration/60>=1?e("span",[t._v(t._s(Math.floor(n.irrigation.duration/60))+"\n                                    min\n                                    "),n.irrigation.duration%60>0?e("span",[t._v("\n                                      "+t._s(n.irrigation.duration%60)+"\n                                      secs\n                                    ")]):t._e()]):e("span",[t._v(t._s(n.irrigation.duration)+" seconds")]),n.irrigation.startTime!=n.irrigation.finishTime?[t._v("\n                                    from\n                                    "+t._s(t.convertTime(n.irrigation.startTime,"HH:mm").format("h:mm a"))+"\n                                    to\n                                    "+t._s(t.convertTime(n.irrigation.finishTime,"HH:mm").format("h:mm a"))+"\n                                  ")]:t._e(),r.currentPhase.customFirstLightIrrigationDuration>0&&"Lights On"==n.lightState?[e("br"),t._v("\n                                    First irrigation runs for\n                                    "+t._s(Math.floor(r.currentPhase.customFirstLightIrrigationDuration/60))+"\n                                    minutes,\n                                    "+t._s(r.currentPhase.customFirstLightIrrigationDuration%60)+"\n                                    seconds.\n                                  ")]:t._e()],2):e("span",[t._v("\n                                  No Irrigation Scheduled\n                                ")])]],2)]:t._e()],2)})),0)]},proxy:!0}],null,!0)}):t._e(),1===a.dashboardDisplayType_id?e("div",{staticClass:"d-flex justify-center",staticStyle:{"padding-top":"10px"}},[a.pestDetected?e(i["a"],{staticClass:"mr-1",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.goToDevice(a,5)}}},[t._v("IPM Scouting")]):t._e(),t.Trimaster.isAdmin(t.getUser)||t.Trimaster.isUserInRole(t.getUser,"Owner")?e("span",{attrs:{title:"Review Microclimate Compliance with Grow Plan"}},[e(i["a"],{staticClass:"mr-1",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.onShowCompliance(a.controller_id,r.lifecycle_id,a.platformGroupName)}}},[t._v("Review Environmental Sensors")])],1):t._e()],1):t._e()],1),t.isExpanded(a)?e("lifecycle-platforms",{attrs:{"lifecycle-id":r.lifecycle_id}}):t._e()],1)})),a.lifecyclesRaw&&a.lifecyclesRaw.length?t._e():e("div",[e("div",{staticStyle:{display:"inline-block","margin-right":"5px",width:"75%"}},[t.isExpanded(a)?e("platform-group-platforms",{attrs:{"platform-group-name":a.platformGroupName,"platform-group-id":a.platformGroup_id}}):t._e()],1)])]],2)]}}],null,!0),model:{value:t.$store.state.universalDashboard.selectedUnits,callback:function(e){t.$set(t.$store.state.universalDashboard,"selectedUnits",e)},expression:"$store.state.universalDashboard.selectedUnits"}},[e(n["a"],{attrs:{slot:"no-results",value:!0,color:"error",icon:"warning"},slot:"no-results"},[t._v('Your search for "'+t._s(t.search)+'" found no results.')])],1)]}}])})],1),e(u["a"],{staticClass:"vfucontrols",attrs:{width:"90%","max-width":"1250"},model:{value:t.showVfuControls,callback:function(e){t.showVfuControls=e},expression:"showVfuControls"}},[t.showVfuControls&&t.selectedContextMenuItem?e("device-controls",{ref:"deviceControl",style:{height:t.deviceControlHeight},attrs:{currentDevice:t.selectedContextMenuItem,device_id:t.deviceId,device:t.selectedDevice,platformGroup_id:t.platformGroupId,isSse:2===t.getFacilityById(t.selectedContextMenuItem.facility_id).commandCommunicationsType,lastEventReceived:t.lastEventReceived,presetTab:t.deviceControlPresetTab},on:{refresh:function(e){t.dataChanged=!0},showlifecyclereport:function(e){t.showLifecycleStatusReport=!0},"batch-action":t.triggerContextActionForItem,"intensity-action":t.triggerIntensityActionForItem,"dehumidifier2-action":t.triggerDehumidifier2ActionForItem,"curtains-action":t.triggerCurtainsActionForItem,"ecu-action":t.triggerEcuActionForItem}}):t._e()],1),e(u["a"],{attrs:{persistent:"",width:"700"},model:{value:t.showLifecycleStatusReport,callback:function(e){t.showLifecycleStatusReport=e},expression:"showLifecycleStatusReport"}},[t.selectedDevice?e("lifecycle-status-report",{staticClass:"vh90",attrs:{platformGroup_id:t.platformGroupId,title:t.selectedDevice.platformGroupName},on:{close:function(e){t.showLifecycleStatusReport=!1}}}):t._e()],1),t.showStateContextMenu?e(m["a"],{attrs:{"position-x":t.stateContextMenuX,"position-y":t.stateContextMenuY,absolute:"","offset-y":"",transition:"scale-transition","min-width":"165px;"},model:{value:t.showStateContextMenu,callback:function(e){t.showStateContextMenu=e},expression:"showStateContextMenu"}},[t.selectedStateItem?e("state-context-options",{attrs:{item:t.selectedStateItem},on:{save:t.onStateSave}}):t._e()],1):t._e(),e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.showStateOptions,callback:function(e){t.showStateOptions=e},expression:"showStateOptions"}},[e("state-options",{attrs:{item:t.selectedStateItem},on:{save:t.onStateSave,cancel:t.onStateCancel}})],1),e(u["a"],{attrs:{persistent:"",width:"700"},model:{value:t.displayAirToLeafVpdAdjuster,callback:function(e){t.displayAirToLeafVpdAdjuster=e},expression:"displayAirToLeafVpdAdjuster"}},[e("air-to-leaf-vpd-adjuster",{on:{close:function(e){t.displayAirToLeafVpdAdjuster=!1},update:t.onVpdAdjustmentUpdate}})],1),e(u["a"],{attrs:{width:"400",persistent:""},model:{value:t.$store.state.universalDashboard.showBatchCo2CalibrationOptions,callback:function(e){t.$set(t.$store.state.universalDashboard,"showBatchCo2CalibrationOptions",e)},expression:"$store.state.universalDashboard.showBatchCo2CalibrationOptions"}},[e("batch-co2-calibration-options")],1),t.$store.state.universalDashboard.showBatchIntensityOptions?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showBatchIntensityOptions,callback:function(e){t.$set(t.$store.state.universalDashboard,"showBatchIntensityOptions",e)},expression:"$store.state.universalDashboard.showBatchIntensityOptions"}},[e("batch-intensity-options")],1):t._e(),t.$store.state.universalDashboard.showBatchImpairedChillerOptions?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showBatchImpairedChillerOptions,callback:function(e){t.$set(t.$store.state.universalDashboard,"showBatchImpairedChillerOptions",e)},expression:"$store.state.universalDashboard.showBatchImpairedChillerOptions"}},[e("batch-impaired-chiller-options")],1):t._e(),t.$store.state.universalDashboard.showSterilizeOptions?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showSterilizeOptions,callback:function(e){t.$set(t.$store.state.universalDashboard,"showSterilizeOptions",e)},expression:"$store.state.universalDashboard.showSterilizeOptions"}},[e("sterilize-confirmation")],1):t._e(),e(u["a"],{attrs:{width:"800",persistent:""},model:{value:t.$store.state.universalDashboard.showBatchControlLoopOptions,callback:function(e){t.$set(t.$store.state.universalDashboard,"showBatchControlLoopOptions",e)},expression:"$store.state.universalDashboard.showBatchControlLoopOptions"}},[t.$store.state.universalDashboard.showBatchControlLoopOptions?e("batch-control-loop-options"):t._e()],1),e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showBatchIrrigationOptions,callback:function(e){t.$set(t.$store.state.universalDashboard,"showBatchIrrigationOptions",e)},expression:"$store.state.universalDashboard.showBatchIrrigationOptions"}},[e("batch-irrigation-options")],1),e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showBashCommands,callback:function(e){t.$set(t.$store.state.universalDashboard,"showBashCommands",e)},expression:"$store.state.universalDashboard.showBashCommands"}},[e("bash-command-execute")],1),e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showDehumidifyOptions,callback:function(e){t.$set(t.$store.state.universalDashboard,"showDehumidifyOptions",e)},expression:"$store.state.universalDashboard.showDehumidifyOptions"}},[e("batch-dehumidifier-options")],1),t.$store.state.universalDashboard.selectedContextMenuItem&&t.$store.state.universalDashboard.selectedCurtainsAction?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showCurtainsConfirm,callback:function(e){t.$set(t.$store.state.universalDashboard,"showCurtainsConfirm",e)},expression:"$store.state.universalDashboard.showCurtainsConfirm"}},[e("batch-curtain-confirm")],1):t._e(),e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showEcuOptions,callback:function(e){t.$set(t.$store.state.universalDashboard,"showEcuOptions",e)},expression:"$store.state.universalDashboard.showEcuOptions"}},[e("batch-ecu-options",{attrs:{actions:t.filteredEcuActions}})],1),t.$store.state.universalDashboard.showDeviceConfigurationViewer?e(u["a"],{attrs:{width:"1000",persistent:""},model:{value:t.$store.state.universalDashboard.showDeviceConfigurationViewer,callback:function(e){t.$set(t.$store.state.universalDashboard,"showDeviceConfigurationViewer",e)},expression:"$store.state.universalDashboard.showDeviceConfigurationViewer"}},[e("device-configuration-viewer")],1):t._e(),t.$store.state.universalDashboard.showDeviceHistory?e(u["a"],{attrs:{width:"90%","max-width":"1250",persistent:""},model:{value:t.$store.state.universalDashboard.showDeviceHistory,callback:function(e){t.$set(t.$store.state.universalDashboard,"showDeviceHistory",e)},expression:"$store.state.universalDashboard.showDeviceHistory"}},[e("device-history-viewer-modal")],1):t._e(),t.$store.state.universalDashboard.showAssemblyTests?e(u["a"],{attrs:{width:"600",persistent:""},model:{value:t.$store.state.universalDashboard.showAssemblyTests,callback:function(e){t.$set(t.$store.state.universalDashboard,"showAssemblyTests",e)},expression:"$store.state.universalDashboard.showAssemblyTests"}},[e("assembly-tests")],1):t._e(),t.$store.state.universalDashboard.isMovingPlatformGroup?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.isMovingPlatformGroup,callback:function(e){t.$set(t.$store.state.universalDashboard,"isMovingPlatformGroup",e)},expression:"$store.state.universalDashboard.isMovingPlatformGroup"}},[e("move-platform-group",{on:{save:t.onMovePlatformGroup,close:function(e){t.$store.state.universalDashboard.isMovingPlatformGroup=!1}}})],1):t._e(),t.$store.state.universalDashboard.isAssigningPlatformGroupCollection?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.isAssigningPlatformGroupCollection,callback:function(e){t.$set(t.$store.state.universalDashboard,"isAssigningPlatformGroupCollection",e)},expression:"$store.state.universalDashboard.isAssigningPlatformGroupCollection"}},[t.$store.state.universalDashboard.isAssigningPlatformGroupCollection?e("assign-platform-group-collection",{on:{save:t.onAssignPlatformGroupCollection,create:t.onCreatePlatformGroupCollection,close:function(e){t.$store.state.universalDashboard.isAssigningPlatformGroupCollection=!1}}}):t._e()],1):t._e(),t.$store.state.universalDashboard.isUnassigningPlatformGroupCollection?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.isUnassigningPlatformGroupCollection,callback:function(e){t.$set(t.$store.state.universalDashboard,"isUnassigningPlatformGroupCollection",e)},expression:"$store.state.universalDashboard.isUnassigningPlatformGroupCollection"}},[t.$store.state.universalDashboard.isUnassigningPlatformGroupCollection?e("unassign-platform-group-collection",{on:{save:t.onUnassignPlatformGroupCollection,close:function(e){t.$store.state.universalDashboard.isUnassigningPlatformGroupCollection=!1}}}):t._e()],1):t._e(),t.$store.state.universalDashboard.isUpdatingHostname?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.isUpdatingHostname,callback:function(e){t.$set(t.$store.state.universalDashboard,"isUpdatingHostname",e)},expression:"$store.state.universalDashboard.isUpdatingHostname"}},[e("edit-hostname")],1):t._e(),t.$store.state.universalDashboard.isUpgradingFirmware?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.isUpgradingFirmware,callback:function(e){t.$set(t.$store.state.universalDashboard,"isUpgradingFirmware",e)},expression:"$store.state.universalDashboard.isUpgradingFirmware"}},[e("edit-firmware",{on:{save:t.onSaveFirmware,close:function(e){t.$store.state.universalDashboard.isUpgradingFirmware=!1}}})],1):t._e(),e(u["a"],{attrs:{persistent:"",width:"770"},model:{value:t.$store.state.universalDashboard.showComplianceDialog,callback:function(e){t.$set(t.$store.state.universalDashboard,"showComplianceDialog",e)},expression:"$store.state.universalDashboard.showComplianceDialog"}},[e("review-microclimate-performance",{staticClass:"vh90"})],1),e(u["a"],{attrs:{width:"80%",persistent:""},model:{value:t.$store.state.universalDashboard.showActiveSoilSensors,callback:function(e){t.$set(t.$store.state.universalDashboard,"showActiveSoilSensors",e)},expression:"$store.state.universalDashboard.showActiveSoilSensors"}},[t.$store.state.universalDashboard.selectedController?e("active-xiaomi-soil-sensors",{staticClass:"vh90"}):t._e()],1),t.$store.state.universalDashboard.showSetDnD?e(u["a"],{attrs:{width:"500",persistent:""},model:{value:t.$store.state.universalDashboard.showSetDnD,callback:function(e){t.$set(t.$store.state.universalDashboard,"showSetDnD",e)},expression:"$store.state.universalDashboard.showSetDnD"}},[e("do-not-disturb")],1):t._e(),e(u["a"],{attrs:{width:"600"},model:{value:t.$store.state.universalDashboard.showAlerts,callback:function(e){t.$set(t.$store.state.universalDashboard,"showAlerts",e)},expression:"$store.state.universalDashboard.showAlerts"}},[t.selectedContextMenuItem?e("alerts",{attrs:{title:t.selectedContextMenuItem.platformGroupName,controller_id:t.selectedContextMenuItem.controller_id}}):t._e()],1),e("edit-phase-modal",{attrs:{"controller-id":t.selectedControllerId},on:{refresh:t.refresh},model:{value:t.growPhase_id,callback:function(e){t.growPhase_id=e},expression:"growPhase_id"}}),e("context-menu"),e("register-dump",{ref:"registerDump"}),e(u["a"],{attrs:{"max-width":"1000",persistent:""},model:{value:t.$store.state.universalDashboard.showStartLifecycle,callback:function(e){t.$set(t.$store.state.universalDashboard,"showStartLifecycle",e)},expression:"$store.state.universalDashboard.showStartLifecycle"}},[t.$store.state.universalDashboard.showStartLifecycle?e("start-lifecycle",{staticStyle:{height:"90vh"},attrs:{fullscreen:!1,"should-navigate-to-lifecycles":!1},on:{close:t.onCreateNewLifecycle,cancel:t.cancelStartLifecycle}}):t._e()],1),e(u["a"],{attrs:{width:"600",persistent:""},model:{value:t.showEditPlatformGroupCollection,callback:function(e){t.showEditPlatformGroupCollection=e},expression:"showEditPlatformGroupCollection"}},[t.showEditPlatformGroupCollection?e("edit-platform-group-collection",{on:{close:function(e){t.showEditPlatformGroupCollection=!1}}}):t._e()],1)],1)},x=[],S=r("a026"),_=r("2f62"),C=r("d67f"),O=r("c1df"),P=r.n(O),D=r("d0eb"),k=r("dd56"),T=(r("6ce0"),r("a9b3")),j=r("b047"),E=r.n(j),I=r("ab66"),L=r("4216"),A=r("81f6"),M=r("2c0d"),U=r("ea10"),N=r("1cf8"),F=r("8d4d"),G=r("300b"),R=r("8ac5"),$=r("488d"),H=r("67b4"),V=r("6b20"),B=r("d84a"),z=r("e0a5"),Y=r("084c"),q=r("9640"),W=r("9cf2"),J=r("ad5a"),Z=r("14c4"),X=r("70d9"),K=r("31e3"),Q=r("d7f2"),tt=r("8537"),et=r("f721"),rt=r("33d8"),nt=r("d054"),it=r("c122"),at=r("1cc5"),ot=r("2ec3"),st=r("e387"),lt=r("06b7"),ct=r("afa9"),ut=r("f749"),dt=r("b3c5"),ht=r("5900"),ft=function(){var t=this,e=t._self._c;return e(a["a"],{attrs:{flat:"",loading:t.isLoading}},[e(o["c"],[t.platforms&&t.platforms.length>0?e("div",{staticClass:"px-3"},[e(y["a"],{staticClass:"row-eq-height",attrs:{justify:"center"}},t._l(t.platforms,(function(r,n){return e(l["a"],{key:n,attrs:{md:t.cols,sm:"12",cols:"12"}},[e("platform",{ref:"platform-".concat(r.platform_id),refInFor:!0,attrs:{name:"".concat(t.platformGroupName&&""!==t.platformGroupName?t.platformGroupName+" - ":"").concat(r.platformName),platform:r,side:"left","selected-platform-positions":[],"selected-empty-positions":[]}})],1)})),1)],1):t._e()])],1)},pt=[];function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function vt(t,e){return xt(t)||wt(t,e)||gt(t,e)||yt()}function yt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gt(t,e){if(t){if("string"==typeof t)return bt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bt(t,e):void 0}}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function wt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function xt(t){if(Array.isArray(t))return t}function St(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */St=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==mt(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(mt(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _t(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Ct(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){_t(a,n,i,o,s,"next",t)}function s(t){_t(a,n,i,o,s,"throw",t)}o(void 0)}))}}function Ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Pt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ot(Object(r),!0).forEach((function(e){Dt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Dt(t,e,r){return(e=kt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kt(t){var e=Tt(t,"string");return"symbol"==mt(e)?e:e+""}function Tt(t,e){if("object"!=mt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var jt={name:"PlatformGroupPlatforms",components:{Platform:ht["a"]},props:{platformGroupId:{type:Number,required:!0},platformGroupName:{type:String,required:!1,default:function(){return""}}},data:function(){return{isLoading:!1,platforms:[]}},computed:Pt(Pt({},Object(_["c"])(["getUser","platformGroups"])),{},{cols:function(){var t;if(null!==(t=this.platforms)&&void 0!==t&&t.length){switch(this.platforms.length){case 4:return 6;case 6:return 6}return 3}return 4}}),mounted:function(){var t=this;return Ct(St().mark((function e(){return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getPlatforms();case 2:case"end":return e.stop()}}),e)})))()},methods:{getPlatforms:function(){var t=this;return Ct(St().mark((function e(){var r,n,i;return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,D["a"].get("infrastructure/getPlatformsByPlatformGroup",t.getUser.apitoken,{platformGroup_id:t.platformGroupId});case 3:r=e.sent,n=vt(r,2),i=n[0],n[1],t.platforms=i,t.isLoading=!1;case 9:case"end":return e.stop()}}),e)})))()}}},Et=jt,It=r("2877"),Lt=Object(It["a"])(Et,ft,pt,!1,null,null,null),At=Lt.exports,Mt=r("69bf"),Ut=r("2fa4"),Nt=function(){var t=this,e=t._self._c;return e(a["a"],[e(o["d"],[e("h2",[t._v("Begin Sterilize State")]),e(Ut["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(d["a"],[t._v("close")])],1)],1),e(o["c"],[e("div",{staticStyle:{width:"calc(100% - 50px)","padding-top":"30px",margin:"auto"}},["CLOSED"===t.selectedContextMenuItem.curtainState?e("span",[t._v("\n        This will turn on all lights at 100% intensity and run the\n        dehumidifiers to generate as much heat as possible to\n        kill pathogens in the unit."),e("br"),e("br"),t._v("\n        Will automatically disengage and raise Curtains after a 3 hour run.\n      ")]):e("span",[t._v("\n        Curtains must be closed to begin Sterilize State."),e("br"),e("br"),t._v("\n        Please close the curtains to continue.\n      ")])])]),e(o["a"],{staticClass:"justify-end"},["CLOSED"!==t.selectedContextMenuItem.curtainState?e(i["a"],{attrs:{outlined:""},on:{click:t.onCancel}},[t._v("Close")]):[e(i["a"],{attrs:{outlined:""},on:{click:t.onCancel}},[t._v("Cancel")]),e(i["a"],{attrs:{color:"primary"},on:{click:t.onConfirm}},[t._v("Begin")])]],2)],1)},Ft=[];function Gt(t){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(t)}function Rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $t(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Rt(Object(r),!0).forEach((function(e){Ht(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ht(t,e,r){return(e=Vt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vt(t){var e=Bt(t,"string");return"symbol"==Gt(e)?e:e+""}function Bt(t,e){if("object"!=Gt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Gt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var zt={name:"SterilizeConfirmation",mixins:[L["a"]],data:function(){return{}},computed:$t({},Object(_["c"])("universalDashboard",["selectedContextMenuItem"])),methods:{onCancel:function(){this.$store.dispatch("universalDashboard/setShowSterilizeOptions",!1),this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1),this.$store.dispatch("universalDashboard/setSelectedBatchAction",null)},onConfirm:function(){this.$store.dispatch("universalDashboard/setShowSterilizeOptions",!1),this.isPerformingContextMenuAction&&this.$store.dispatch("batchActions/runBatchAction")}}},Yt=zt,qt=Object(It["a"])(Yt,Nt,Ft,!1,null,null,null),Wt=qt.exports,Jt=function(){var t=this,e=t._self._c;return e("span",{class:{"animate-flicker":t.isLoading}},[t.item.isDisconnected?t._e():e("span",{staticClass:"isClickable",attrs:{title:"Click to view context menu"},on:{click:t.showStateContextMenu}},[e("span",{on:{click:t.setClickedRec}},[t._v(t._s(t.item.sortableCurrentState))])]),t.item.isDisconnected?e("span",{staticClass:"oldvalue"},[e("span",[t._v(t._s(t.item.sortableCurrentState))])]):t._e()])},Zt=[],Xt={name:"CurrentStateWidget",props:{item:{type:Object,required:!0}},data:function(){return{isLoading:!1}},mounted:function(){A["a"].$on("current-state-loading",this.isLoadingSet)},unmounted:function(){A["a"].$off("current-state-loading",this.isLoadingSet)},methods:{isLoadingSet:function(t){t.platformGroupId===this.item.platformGroup_id&&this.setIsLoading(t.isLoading)},setIsLoading:function(t){var e=this;this.isLoading=t,setTimeout((function(){e.isLoading=!1}),1e4)},setClickedRec:function(){this.$emit("clicked-rec")},showStateContextMenu:function(t){this.$emit("show-context-menu",t)}},watch:{"item.sortableCurrentState":{handler:function(){this.isLoading=!1}}}},Kt=Xt,Qt=(r("9391"),Object(It["a"])(Kt,Jt,Zt,!1,null,"404e609c",null)),te=Qt.exports,ee=r("ba0d"),re=function(){var t=this,e=t._self._c;return e(a["a"],[e(o["d"],[e("h2",[t._v("Select Impaired Chiller Light Intensity")]),e(Ut["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(d["a"],[t._v("close")])],1)],1),e(o["c"],[e("div",{staticStyle:{width:"calc(100% - 50px)","padding-top":"30px",margin:"auto"}},[e(ee["a"],{staticClass:"pt-6",attrs:{max:100,min:0,step:1,color:t.intensitySliderColor,"thumb-size":45,"thumb-label":"always",label:"Intensity"},model:{value:t.currentIntensity,callback:function(e){t.currentIntensity=e},expression:"currentIntensity"}})],1)]),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{text:"",color:"primary"},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},ne=[],ie=r("7ce3"),ae=r("9194");function oe(t){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oe(t)}function se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function le(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?se(Object(r),!0).forEach((function(e){ce(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ce(t,e,r){return(e=ue(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ue(t){var e=de(t,"string");return"symbol"==oe(e)?e:e+""}function de(t,e){if("object"!=oe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var he={name:"BatchImpairedChillerOptions",mixins:[L["a"]],components:{HelpButton:ie["a"]},data:function(){return{currentIntensity:50}},computed:le(le(le({},Object(_["c"])(["getUser"])),Object(_["c"])("universalDashboard",["selectedContextMenuItem","showBatchImpairedChillerOptions"])),{},{intensitySliderColor:function(){var t=parseInt(this.currentIntensity),e=t/100+.1;return"rgba(255,0,255,"+e+")"}}),methods:{onCancel:function(){this.$store.dispatch("universalDashboard/setShowBatchImpairedChillerOptions",!1),this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1),this.$store.dispatch("universalDashboard/setSelectedBatchAction",null)},onConfirm:function(){var t=(parseFloat(this.currentIntensity)/100).toFixed(2);this.$store.dispatch("universalDashboard/setShowBatchImpairedChillerOptions",!1),this.$store.dispatch("batchActions/setBatchActionLabel",{id:ae["o"],label:"Set Impaired Chiller Intensity to "+Math.round(100*t)}),this.$store.dispatch("universalDashboard/setImpairedChillerSettings",parseFloat(t)),this.isPerformingContextMenuAction&&this.$store.dispatch("batchActions/runBatchAction")}}},fe=he,pe=Object(It["a"])(fe,re,ne,!1,null,null,null),me=pe.exports,ve=r("1cc0"),ye=r("38e4"),ge=r("4bd4"),be=r("b974"),we=r("8654"),xe=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:""}},[e(o["d"],[e("h2",[t._v("Assign to Platform Group Collection")]),e(Ut["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(d["a"],[t._v("close")])],1)],1),e(o["c"],[e(ge["a"],{staticClass:"h-100",staticStyle:{"overflow-y":"auto","overflow-x":"hidden"},model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(be["a"],{attrs:{items:t.platformGroupCollections,label:"Platform Group Collection","item-text":"name","item-value":"id",rules:[t.rules.requiredNoBlanks]},model:{value:t.selectedPlatformGroupCollectionId,callback:function(e){t.selectedPlatformGroupCollectionId=e},expression:"selectedPlatformGroupCollectionId"}}),-1===t.selectedPlatformGroupCollectionId?e(we["a"],{attrs:{label:"Platform Group Collection Name",rules:[t.rules.requiredNoBlanks]},model:{value:t.newPlatformGroupCollectionName,callback:function(e){t.newPlatformGroupCollectionName=e},expression:"newPlatformGroupCollectionName"}}):t._e()],1)],1),e(o["a"],[e(Ut["a"]),e(i["a"],{attrs:{color:"primary",disabled:!t.valid||t.isLoading||t.isDuplicate},on:{click:t.onSave}},[t._v("Assign")])],1)],1)},Se=[],_e=r("9c4f");function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Oe(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Oe=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Ce(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Ce(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Pe(t){return Te(t)||ke(t)||Ie(t)||De()}function De(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ke(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Te(t){if(Array.isArray(t))return Le(t)}function je(t,e){return Me(t)||Ae(t,e)||Ie(t,e)||Ee()}function Ee(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ie(t,e){if(t){if("string"==typeof t)return Le(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Le(t,e):void 0}}function Le(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ae(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Me(t){if(Array.isArray(t))return t}function Ue(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Ne(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){Ue(a,n,i,o,s,"next",t)}function s(t){Ue(a,n,i,o,s,"throw",t)}o(void 0)}))}}function Fe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ge(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Fe(Object(r),!0).forEach((function(e){Re(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Re(t,e,r){return(e=$e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $e(t){var e=He(t,"string");return"symbol"==Ce(e)?e:e+""}function He(t,e){if("object"!=Ce(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Ve={name:"AssignPlatformGroupCollection",mixins:[_e["a"]],props:["value"],components:{},mounted:function(){this.loadPlatformGroupCollections()},data:function(){return{valid:!0,platformGroupCollections:[],selectedPlatformGroupCollectionId:null,newPlatformGroupCollectionName:"",isLoading:!1}},computed:Ge(Ge({},Object(_["c"])(["getUser"])),{},{isDuplicate:function(){var t=this;return this.newPlatformGroupCollectionName.length>0&&this.platformGroupCollections.find((function(e){return e.name.toLowerCase()===t.newPlatformGroupCollectionName.toLowerCase().trim()}))}}),methods:{onClose:function(){this.$emit("close")},onSave:function(){this.valid?-1===this.selectedPlatformGroupCollectionId?this.$emit("create",this.newPlatformGroupCollectionName):this.$emit("save",this.selectedPlatformGroupCollectionId):C["a"].error("Form Entries Incomplete or Invalid")},loadPlatformGroupCollections:function(){var t=this;return Ne(Oe().mark((function e(){var r,n,i;return Oe().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,D["a"].get("ag_platformGroupCollections",t.getUser.apitoken,{filter:{where:{facility_id:t.getUser.facility_id}}});case 2:r=e.sent,n=je(r,2),i=n[0],n[1],i.sort((function(t,e){return t.name<e.name?-1:1})),t.platformGroupCollections=[{id:-1,name:"Create New"}].concat(Pe(i));case 8:case"end":return e.stop()}}),e)})))()}},watch:{selectedPlatformGroupCollectionId:function(t){-1===t&&(this.newPlatformGroupCollectionName="")}}},Be=Ve,ze=Object(It["a"])(Be,xe,Se,!1,null,null,null),Ye=ze.exports,qe=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:""}},[e(o["d"],[e("h2",[t._v("Remove From Collection")]),e(Ut["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(d["a"],[t._v("close")])],1)],1),e(o["c"],[e("p",[t._v("Are you sure you want to remove these platform groups from "),e("strong",[t._v(t._s(t.$store.state.universalDashboard.filterPlatformGroupCollection.name))]),t._v("?")]),e("div",{staticClass:"d-flex flex-wrap"},t._l(t.platformGroups,(function(r){return e("div",{staticClass:"px-3 pb-3"},[t._v("\n        "+t._s(r.platformGroupName)+"\n      ")])})),0)]),e(o["a"],[e(Ut["a"]),e(i["a"],{attrs:{color:"primary"},on:{click:t.onSave}},[t._v("Remove")])],1)],1)},We=[];function Je(t){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(t)}function Ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ze(Object(r),!0).forEach((function(e){Ke(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ke(t,e,r){return(e=Qe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qe(t){var e=tr(t,"string");return"symbol"==Je(e)?e:e+""}function tr(t,e){if("object"!=Je(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var er={name:"UnassignPlatformGroupCollection",data:function(){return{valid:!0,platformGroupCollections:[],selectedPlatformGroupCollectionId:null,newPlatformGroupCollectionName:"",isLoading:!1}},computed:Xe(Xe(Xe({},Object(_["c"])(["getUser"])),Object(_["c"])("universalDashboard",["selectedContextMenuItem","selectedUnits"])),{},{platformGroups:function(){return this.selectedUnits.length?this.selectedUnits:[this.selectedContextMenuItem]}}),methods:{onClose:function(){this.$emit("close")},onSave:function(){this.$emit("save",this.selectedPlatformGroupCollectionId)}}},rr=er,nr=Object(It["a"])(rr,qe,We,!1,null,null,null),ir=nr.exports,ar=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"mr-2",attrs:{outlined:"",large:""}},[e("div",{staticClass:"d-flex flex-column align-center"},[e("div",{staticClass:"d-flex"},[e(d["a"],[t._v("mdi-thermometer")]),e("span",[t._v(t._s(t.calculateTemperatureDisplay(t.sensor.reading)))])],1),e("span",{staticClass:"text-caption"},[t._v(t._s(t.sensor.name))])])])},or=[],sr={name:"TemperatureSensorReading",props:{sensor:{type:Object,required:!0}},methods:{calculateTemperatureDisplay:B["c"]}},lr=sr,cr=Object(It["a"])(lr,ar,or,!1,null,null,null),ur=cr.exports,dr=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"mr-2",attrs:{outlined:"",large:""}},[e("div",{staticClass:"d-flex flex-column align-center"},[e("div",{staticClass:"d-flex"},[e(d["a"],[t._v("grain")]),e("span",[t._v(t._s(t.roundTo(100*t.sensor.reading,2).toFixed(0))+" %")])],1),e("span",{staticClass:"text-caption"},[t._v(t._s(t.sensor.name))])])])},hr=[],fr={name:"HumiditySensorReading",props:{sensor:{type:Object,required:!0}},methods:{roundTo:B["h"]}},pr=fr,mr=Object(It["a"])(pr,dr,hr,!1,null,null,null),vr=mr.exports,yr=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"mr-2",attrs:{outlined:"",large:""}},[e("div",{staticClass:"d-flex flex-column align-center"},[e("div",{staticClass:"d-flex"},[e(d["a"],[t._v("cloud_queue")]),e("span",{staticClass:"ml-1"},[t._v(t._s(t.sensor.reading)+" ppm")])],1),e("span",{staticClass:"text-caption"},[t._v(t._s(t.sensor.name))])])])},gr=[],br={name:"Co2SensorReading",props:{sensor:{type:Object,required:!0}}},wr=br,xr=Object(It["a"])(wr,yr,gr,!1,null,null,null),Sr=xr.exports,_r=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"mr-2",attrs:{outlined:"",large:""}},[e("div",{staticClass:"d-flex flex-column align-center"},[e("div",{staticClass:"d-flex"},[e(d["a"],{domProps:{textContent:t._s("$vuetify.icons.epsilon")}}),e("span",[t._v(t._s(t.roundTo(t.sensor.reading,2).toFixed(2))+" Ka")])],1),e("span",{staticClass:"text-caption"},[t._v(t._s(t.sensor.name))])])])},Cr=[],Or={name:"EpsilonSensorReading",props:{sensor:{type:Object,required:!0}},methods:{roundTo:B["h"]}},Pr=Or,Dr=Object(It["a"])(Pr,_r,Cr,!1,null,null,null),kr=Dr.exports,Tr=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"mr-2",attrs:{outlined:"",large:""}},[e("div",{staticClass:"d-flex flex-column align-center"},[e("div",{staticClass:"d-flex"},[e(d["a"],[t._v("wb_incandescent")]),e("span",{staticClass:"ml-1"},[t._v(t._s(t.sensor.reading)+" Lux")])],1),e("span",{staticClass:"text-caption"},[t._v(t._s(t.sensor.name))])])])},jr=[],Er={name:"LightSensorReading",props:{sensor:{type:Object,required:!0}},methods:{roundTo:B["h"]}},Ir=Er,Lr=Object(It["a"])(Ir,Tr,jr,!1,null,null,null),Ar=Lr.exports,Mr=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"mr-2",attrs:{outlined:"",large:""}},[e("div",{staticClass:"d-flex flex-column align-center"},[e("div",{staticClass:"d-flex"},[e(d["a"],{domProps:{textContent:t._s("$vuetify.icons.soilEC")}}),e("span",[t._v(t._s(t.roundTo(t.sensor.reading,2).toFixed(2))+" mS/cm")])],1),e("span",{staticClass:"text-caption"},[t._v(t._s(t.sensor.name))])])])},Ur=[],Nr={name:"SoilECSensorReading",props:{sensor:{type:Object,required:!0}},methods:{roundTo:B["h"]}},Fr=Nr,Gr=Object(It["a"])(Fr,Mr,Ur,!1,null,null,null),Rr=Gr.exports,$r=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"mr-2",attrs:{outlined:"",large:""}},[e("div",{staticClass:"d-flex flex-column align-center"},[e("div",{staticClass:"d-flex"},[e(d["a"],[t._v("water_drop")]),e("span",[t._v(t._s(t.roundTo(t.sensor.reading,2).toFixed(2))+" %")])],1),e("span",{staticClass:"text-caption"},[t._v(t._s(t.sensor.name))])])])},Hr=[],Vr={name:"MoistureSensorReading",props:{sensor:{type:Object,required:!0}},methods:{roundTo:B["h"]}},Br=Vr,zr=Object(It["a"])(Br,$r,Hr,!1,null,null,null),Yr=zr.exports,qr=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"mr-2",attrs:{outlined:"",large:""}},[e("div",{staticClass:"d-flex flex-column align-center"},[e("div",{staticClass:"d-flex"},[e(d["a"],{domProps:{textContent:t._s("$vuetify.icons.soilTemp")}}),e("span",{staticClass:"ml-1"},[t._v(t._s(t.calculateTemperatureDisplay(t.sensor.reading)))])],1),e("span",{staticClass:"text-caption"},[t._v(t._s(t.sensor.name))])])])},Wr=[],Jr={name:"SoilTemperatureSensorReading",props:{sensor:{type:Object,required:!0}},methods:{calculateTemperatureDisplay:B["c"]}},Zr=Jr,Xr=Object(It["a"])(Zr,qr,Wr,!1,null,null,null),Kr=Xr.exports,Qr=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content"},[e(o["d"],[e("h2",[t._v("\n      Edit Collection\n    ")]),e(Ut["a"]),e(i["a"],{attrs:{icon:""},on:{click:function(e){return t.$emit("close")}}},[e(d["a"],[t._v("close")])],1)],1),e(o["c"],[e(we["a"],{model:{value:t.platformGroupCollectionName,callback:function(e){t.platformGroupCollectionName=e},expression:"platformGroupCollectionName"}})],1),e(o["a"],[e(i["a"],{attrs:{color:"error"},on:{click:t.deleteCollection}},[t._v("Delete")]),e(Ut["a"]),e(i["a"],{attrs:{color:"primary",disabled:!t.platformGroupCollectionName.length},on:{click:t.saveCollection}},[t._v("Save")])],1)],1)},tn=[];function en(t){return en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},en(t)}function rn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */rn=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==en(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(en(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function nn(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function an(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){nn(a,n,i,o,s,"next",t)}function s(t){nn(a,n,i,o,s,"throw",t)}o(void 0)}))}}function on(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function sn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?on(Object(r),!0).forEach((function(e){ln(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):on(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ln(t,e,r){return(e=cn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cn(t){var e=un(t,"string");return"symbol"==en(e)?e:e+""}function un(t,e){if("object"!=en(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=en(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var dn={name:"EditPlatformGroupCollection",data:function(){return{platformGroupCollectionName:""}},computed:sn(sn({},Object(_["c"])(["getUser"])),Object(_["c"])("universalDashboard",["filterPlatformGroupCollection"])),mounted:function(){this.platformGroupCollectionName=this.filterPlatformGroupCollection?this.filterPlatformGroupCollection.name:""},methods:{deleteCollection:function(){var t=this;U["a"].confirm("Confirm Delete Collection","Are you sure you want to delete the "+this.filterPlatformGroupCollection.name+" collection?",function(){var e=an(rn().mark((function e(r){return rn().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r&&(D["a"].post("ag_platformGroupCollections/deleteCollection",t.getUser.apitoken,{platformGroupCollectionId:t.filterPlatformGroupCollection.id}),A["a"].$emit("universal-dashboard-refresh"),t.$store.dispatch("universalDashboard/setFilterPlatformGroupCollection",null),t.$emit("close"));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},saveCollection:function(){var t=this;return an(rn().mark((function e(){return rn().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,D["a"].patch("ag_platformGroupCollections",t.getUser.apitoken,{id:t.filterPlatformGroupCollection.id,name:t.platformGroupCollectionName});case 2:t.$store.dispatch("universalDashboard/setFilterPlatformGroupCollection",sn(sn({},t.filterPlatformGroupCollection),{},{name:t.platformGroupCollectionName})),t.$store.dispatch("universalDashboard/setPlatformGroupCollectionOptions",t.$store.state.universalDashboard.platformGroupCollectionOptions.map((function(e){return e.id===t.filterPlatformGroupCollection.id&&(e.name=t.platformGroupCollectionName),e}))),t.$emit("close");case 5:case"end":return e.stop()}}),e)})))()}},watch:{filterPlatformGroupCollection:function(t){this.platformGroupCollectionName=t?t.name:""}}},hn=dn,fn=Object(It["a"])(hn,Qr,tn,!1,null,null,null),pn=fn.exports;function mn(t){return mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mn(t)}function vn(t,e){return bn(t)||gn(t,e)||On(t,e)||yn()}function yn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gn(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function bn(t){if(Array.isArray(t))return t}function wn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */wn=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==mn(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(mn(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function xn(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Sn(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){xn(a,n,i,o,s,"next",t)}function s(t){xn(a,n,i,o,s,"throw",t)}o(void 0)}))}}function _n(t){return Dn(t)||Pn(t)||On(t)||Cn()}function Cn(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function On(t,e){if(t){if("string"==typeof t)return kn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kn(t,e):void 0}}function Pn(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Dn(t){if(Array.isArray(t))return kn(t)}function kn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Tn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function jn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Tn(Object(r),!0).forEach((function(e){En(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function En(t,e,r){return(e=In(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function In(t){var e=Ln(t,"string");return"symbol"==mn(e)?e:e+""}function Ln(t,e){if("object"!=mn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=mn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var An={name:"UnitResults",mixins:[T["a"],L["a"],N["a"]],components:{EditPlatformGroupCollection:pn,UnassignPlatformGroupCollection:ir,AssignPlatformGroupCollection:Ye,ScheduleChipsCustom:ve["a"],BatchImpairedChillerOptions:me,CurrentStateWidget:te,SterilizeConfirmation:Wt,StartLifecycle:Mt["default"],PlatformGroupPlatforms:At,EditPhaseModal:dt["a"],Alerts:ut["default"],DoNotDisturb:ct["a"],ActiveXiaomiSoilSensors:lt["a"],ReviewMicroclimatePerformance:st["a"],EditFirmware:ot["a"],EditHostname:at["a"],MovePlatformGroup:it["a"],AssemblyTests:nt["a"],DeviceConfigurationViewer:rt["a"],DeviceHistoryViewerModal:et["a"],BatchEcuOptions:tt["a"],BatchCurtainConfirm:Q["a"],BatchDehumidifierOptions:K["a"],BashCommandExecute:X["a"],BatchIrrigationOptions:Z["a"],BatchControlLoopOptions:J["a"],BatchIntensityOptions:W["a"],BatchCo2CalibrationOptions:q["a"],AirToLeafVpdAdjuster:Y["a"],LifecycleStatusReport:z["a"],RegisterDump:H["a"],ContextMenu:$["a"],LifecyclePlatforms:R["a"],StateContextOptions:G["a"],StateOptions:F["a"],LockedColumnDatatable:I["a"],DeviceStatusIcons:M["a"],DeviceControls:V["default"],Platform:ht["a"],TemperatureSensorReading:ur,HumiditySensorReading:vr,Co2SensorReading:Sr,EpsilonSensorReading:kr,LightSensorReading:Ar,SoilECSensorReading:Rr,MoistureSensorReading:Yr,SoilTemperatureSensorReading:Kr},props:{searchText:{type:String,required:!1,default:function(){return""}},displayUnits:{type:Array,required:!0},isSearch:{type:Boolean,required:!1,default:function(){return!1}},showGroupBy:{type:Boolean,required:!1,default:function(){return!1}},isLoading:{type:Boolean,required:!1,default:function(){return!1}}},data:function(){return{irrigationDesignators:[],absoluteTimes:!1,showBashCommands:!1,refreshKey:1,setDnD:!1,isAdmin:!1,renameDevice:null,showActiveSoilSensors:!1,refreshLightIntensityQueue:[],openAssemblyTests:!1,openDevices:!1,gridName:"VFU/IGR Dashboard",showComplianceDialog:!1,Trimaster:D["a"],clickedRec:{item:null},showStateMachine:!1,stateMachine:{},growPhase_id:null,selectedControllerId:null,showEditPhaseModal:!1,vpdAdjustment:0,showLifecycleStatusReport:!1,moment:P.a,displayAirToLeafVpdAdjuster:!1,isScrolling:!1,isScrollingHandle:null,flushQueueHandle:null,co2DevicesOpen:0,displayRecQueue:{},deviceControlPresetTab:0,autoRefresh:!0,irrDevices:0,listenerInitialized:!1,vfusLoading:!1,facility:null,showBatchIntensityOptions:!1,intensitySettings:0,selectedControllerIds:[],showBatchControlLoopOptions:!1,controlLoopSettings:[],showBatchIrrigationOptions:!1,showDehumidifyOptions:!1,showCurtainsConfirm:!1,selectedStateItem:null,showStateOptions:!1,co2CalibrationSettings:{ppm:null},irrigationSettings:{designatorName:null,designator_id:null,durationSeconds:null,setAutoWhenComplete:!1},viewType:"standard",autoPlantFilter:!1,currentDevice:null,deviceId:"",platformGroupId:"",showVfuControls:!1,expand:!1,vfusList:[],selectedDevice:null,offlineFilter:!1,warningFilter:!1,irrigatingFilter:!1,co2ActiveValvesFilter:!1,offlineDevices:0,warnDevices:0,zone_devices:[],search:"",displayUnitsExpanded:[],pagination:{itemsPerPage:250},footerprops:{"items-per-page-options":[25,50,75,100,250]},activeHeaders:[],advancedHeaders:["Media EC","Media Temp","Media Moisture","Light","Dew Pt","Strain","Days/Flwr","Tkts","Type","Area","Ctrl Version","FW Version","Uptime","IP Address","ID"],tableHeaders:[{value:"data-table-select",width:35},{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Status",value:"statusicons",sortable:!1,align:"center",width:225},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"State",sortable:!0,align:"center",value:"sortableCurrentState",width:120},{text:"Temp",value:"temperature",align:"center",width:90},{text:"RH",value:"humidity",align:"center",width:70},{text:"Dew Pt",value:"dewpoint",align:"center",width:50},{text:"Air VPD",value:"vpd",align:"center",width:80},{text:"CO2",value:"co2",align:"center",width:80},{text:"Last Irrigated",value:"lastIrrigated",width:100,align:"center"},{text:"Next Irrigation",value:"nextIrrigated",width:110,align:"center"},{text:"Days/Flwr",value:"daysInFlower",align:"center",width:80},{text:"Strain",value:"strainName",align:"left",width:120},{text:"Media EC",value:"xFertility",align:"right",width:100},{text:"Media Temp",value:"xTemp",align:"right",width:120},{text:"Media Moisture",value:"xMoisture",align:"center",width:100},{text:"Light",value:"xLux",align:"right",width:100},{text:"Tkts",value:"ticketCount",align:"center"},{text:"Type",value:"platformGroupType",align:"center"},{text:"IP Address",value:"ipAddress",align:"center"},{text:"Area",value:"area",align:"center",width:200},{text:"Ctrl Version",value:"softwareVersion",align:"center",width:175},{text:"FW Version",value:"firmwareVersion",align:"center",width:100},{text:"ID",value:"controller_id",align:"center",width:100},{text:"Uptime",value:"uptime",align:"center",width:150},{text:"Updated",value:"lastCommandFetch",align:"center",width:120},{text:"",value:"data-table-expand"}],tableGroupBy:null,eventSource:null,platformGroups:{},filteredZoneDevices:[],filteredZoneDevicesIndex:{},filteredZoneControllerIndex:{},showContextMenu:!1,contextMenuX:0,contextMenuY:0,showStateContextMenu:!1,stateContextMenuX:0,stateContextMenuY:0,selectedCurtainsAction:null,showDeviceHistory:!1,isLockingEnabled:!1,isLockingColumns:!1,recMove:null,isMovingPlatformGroup:!1,isUpgradingFirmware:!1,isUpdatingHostname:!1,facilities:{},lateTimeDiff:B["e"],timeDiffUtc:B["i"],minuteDiffUtc:B["f"],calcVpd:B["b"],calcDewpoint:B["a"],calculateTemperatureDisplay:B["c"],showEditPlatformGroupCollection:!1}},computed:jn(jn(jn(jn(jn(jn(jn({},Object(_["c"])(["getUser","zonesList","pgusLoading","userData","timePreference24Hour"])),Object(_["c"])("batchActions",["batchActions"])),Object(_["c"])("universalDashboard",["isPerformingContextMenuAction","isLoadingSearchResults","searchParams","selectedBatchAction","selectedContextMenuItem","selectedUnits"])),Object(_["c"])("socketMessages",["getLastEventReceivedForControllerId"])),Object(_["c"])("statusFilterOptions",["filters","filtersByType","plantsFilters","modeFilters","curtainFilters","lightFilters","irrigationFilters","co2Filters","ecuFilters","humidifierFilters","dehumidifierFilters"])),Object(_["c"])("sensorReadings",["primarySensorReadingForController","primaryPlatformGroupSensorReading","platformGroupCollectionSensors","updatedReading"])),{},{filteredEcuActions:function(){return this.batchActions?this.batchActions.filter((function(t){return t.deviceType&&"ECU"===t.deviceType})):[]},lastEventReceived:function(){return this.selectedContextMenuItem?this.getLastEventReceivedForControllerId(this.selectedContextMenuItem.controller_id):null},deviceControlHeight:function(){return"sm"===this.$vuetify.breakpoint.name?"90vh":"80vh"},userPlatformNamePreference:function(){return this.getUser.preferences.find((function(t){return"full-unit-name"===t.preference}))},userStateMenuPreference:function(){return this.getUser.preferences.find((function(t){return"Preferred VFU State Interaction"===t.preference}))},standardHeaders:function(){var t=this;return t.tableHeaders.filter((function(e){return!t.advancedHeaders.includes(e.text)}))},userIsAdmin:function(){return D["a"].isAdmin(this.getUser)},searchHeaders:function(){var t=_n(this.activeHeaders),e=2;return!this.searchParams.facility_id&&this.isSearch&&t.splice(e++,0,{text:"Facility",value:"facilityName"}),!this.searchParams.area_id&&this.isSearch&&t.splice(e++,0,{text:"Area",value:"area"}),!this.searchParams.dashboardDisplayType_id&&this.isSearch&&t.splice(e++,0,{text:"Unit Type",value:"platformGroupType"}),t}}),watch:{updatedReading:function(t){var e=null;if(t.platformGroup_id&&(e=this.displayRecQueue[t.platformGroup_id]?this.displayRecQueue[t.platformGroup_id]:this.zone_devices.find((function(e){return parseInt(e.platformGroup_id)===parseInt(t.platformGroup_id)})),e=e?jn({},e):null),e){var r=this.primaryPlatformGroupSensorReading(t.platformGroup_id,t.designator_id);if(r){switch(t.designator_id){case 5:e.temperature=parseFloat(r.reading),e.lastTempUpdate=r.dbtime,e.temperatureFormatted=this.calculateTemperatureDisplay(e.temperature),e.dewpoint=this.calcDewpoint(e.temperature,e.humidity),e.tempSensorName=r.name;break;case 6:e.humidity=parseFloat(r.reading),e.dewpoint=this.calcDewpoint(e.temperature,e.humidity),e.lastHumidityUpdate=r.dbtime,e.humiditySensorName=r.name;break;case 7:e.co2=parseFloat(r.reading),e.lastCo2Update=r.dbtime,e.co2SensorName=r.name;break;case 62:e.xFertility=parseFloat(r.reading),e.xFertilitySensorName=r.name;break;case 58:e.xLux=parseFloat(r.reading),e.xLuxSensorName=r.name;break;case 53:e.xMoisture=parseFloat(r.reading),e.xMoistureSensorName=r.name;break;case 57:e.xTemp=this.calculateTemperatureDisplay(r.reading),e.xTempSensorName=r.name;break}this.displayRecQueue[e.platformGroup_id]=e}}},isLoading:function(t){this.vfusLoading=!!t},isLoadingSearchResults:function(t){this.vfusLoading=!!t},displayUnits:{handler:function(t){this.vfusList=t,this.zone_devices=[];for(var e=0;e<this.vfusList.length;e++)this.platformGroups[this.vfusList[e].platformGroup_id]=this.vfusList[e];this.onVfusListChange(this.vfusList),this.setTableGroupBy(),this.vfusLoading=!1},immediate:!0},showContextMenu:function(t){this.isScrolling=t,t||this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1)},showStateContextMenu:function(t){this.isScrolling=t},search:function(t){this.setFilteredZoneDevices()},searchText:function(t){this.search=t},filteredZoneDevices:function(t){""!==this.searchText&&this.$emit("searched-length",this.filteredZoneDevices.length)}},beforeMount:function(){var t=this;t.isAdmin=D["a"].isAdmin(this.getUser)||D["a"].isUserInRole(this.getUser,"Maintenance"),t.activeHeaders=this.standardHeaders,this.getGridColumns(this.gridName,(function(e){t.activeHeaders=e,t.adjustVpdHeader()})),t.adjustVpdHeader(),this.flushQueueHandle=setInterval(this.flushDisplayRecQueue,1500),this.vpdAdjustment=-1*localStorage.getItem("leafVpdOffset"),this.$store.dispatch("batchActions/loadBatchActions")},mounted:function(){A["a"].$on("facility-websocket-message",this.handleSocketMessage);var t=this.$el.querySelector("#unitResultsTable .v-data-table__wrapper");t&&(t.addEventListener("scroll",this.scrollListener),"xs"!=this.$vuetify.breakpoint.name&&"sm"!=this.$vuetify.breakpoint.name||this.enableLocking()),this.$route.query.search&&(this.search=this.$route.query.search)},beforeDestroy:function(){A["a"].$off("facility-websocket-message",this.handleSocketMessage),clearInterval(this.flushQueueHandle);var t=this.$el.querySelector("#unitResultsTable .v-data-table__wrapper");t&&t.removeEventListener("scroll",this.scrollListener)},methods:jn(jn({editPlatformGroupCollection:function(){this.showEditPlatformGroupCollection=!0},getSensorType:function(t){switch(t){case 5:return"TemperatureSensorReading";case 6:return"HumiditySensorReading";case 7:return"Co2SensorReading";case 53:return"MoistureSensorReading";case 57:return"SoilTemperatureSensorReading";case 58:return"LightSensorReading";case 63:return"EpsilonSensorReading";case 54:case 62:return"SoilECSensorReading"}},getCropSteeringTooltip:function(t){try{t=JSON.parse(t)}catch(i){return""}var e=this.irrigationDesignators.find((function(e){return e.id===t.designatorId}));if(!e)return"";var r=14===Number(this.timePreference24Hour)?"HH:mm":"h:mm a",n=this.convertTime(t.finishTime,"HHmm").day(1).format(r);return'\n        <span class="d-flex flex-column">\n          <span>'.concat(e.designatorName,": ").concat(t.irrigationVolume,"ml</span>\n          <span>").concat(t.minimumVWC,"% >>> ").concat(t.maximumVWC,"%</span>\n          <span>Stop @ ").concat(n,"</span>\n        </span>\n      ")},getSortedEnvironments:function(t){return _n(t).sort((function(t,e){return"Lights On"===t.lightState?-1:1}))},getOrderedCustomTimes:function(t,e){var r=this,n=14===Number(this.timePreference24Hour)?"HH:mm":"h:mm a",i=[];t.forEach((function(t){t.irrigation.customTimes.forEach((function(e){var a=r.convertTime(e.customIrrigationStartTime,"HHmm").day(1);i.push({startTime:a.format(n),durationSecs:e.customIrrigationDuration,designatorId:e.customIrrigationDesignatorId,designatorName:e.customIrrigationDesignatorName,timeString:a.format("HHmm"),lightsOn:"Lights On"===t.lightState})}))})),i.sort((function(t,e){return t.timeString<e.timeString?-1:1}));var a=!1,o=[],s=[],l=[];return i.forEach((function(t){t.lightsOn?(a=!0,l.push(t)):a?s.push(t):o.push(t)})),"Lights On"===e?l:[].concat(s,o)},getCustomIrrigationString:function(t){var e="";return t.customIrrigationDuration/60>=1?(e+=Math.floor(t.customIrrigationDuration/60)+"m",t.customIrrigationDuration%60>0&&(e+=t.customIrrigationDuration%60+"s")):e+=t.customIrrigationDuration+"s",e+="@"+t.convertedTime.format("h:mm a"),e},formatCustomTimes:function(t,e){var r=14===Number(this.timePreference24Hour)?"HH:mm":"h:mm a";return t.map((function(t){return{startTime:t.convertedTime.format(r),durationSecs:t.customIrrigationDuration,designatorId:t.customIrrigationDesignatorId,designatorName:t.customIrrigationDesignatorName,timeString:t.convertedTime.format("HHmm"),lightsOn:"Lights On"===e}}))},removeStatusFilter:function(t){this.$store.dispatch("statusFilterOptions/removeFilter",t.key)},onCreateNewLifecycle:function(){this.$store.state.universalDashboard.showStartLifecycle=!1,this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",null),this.refresh(!1,!1)},cancelStartLifecycle:function(){this.$store.state.universalDashboard.showStartLifecycle=!1,this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",null)},toggleAbsoluteTimes:function(){this.absoluteTimes=!this.absoluteTimes},growplanClick:function(t){this.$router.push("/growplans?search="+t.growplan_id)},lifecycleClick:function(t){this.$router.push("/lifecycles?search="+t.lifecycle_id)},strainNameClick:function(t){this.$router.push("/strains?search="+t.strainName)},onSaveFirmware:function(t){var e=this;return Sn(wn().mark((function r(){var n,i,a;return wn().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return n=e.selectedUnits,i=e.selectedUnits.length?n.map((function(t){return t.controller_id})):[e.selectedContextMenuItem.controller_id],a=i.map((function(r){var n={controller_id:r,action_id:136,user_id:e.getUser.id,value:t};return D["a"].post("controllerCommands",e.getUser.apitoken,n)})),r.next=5,e.$store.dispatch("universalDashboard/setSelectedContextMenuItem",null);case 5:return r.next=7,e.$store.dispatch("universalDashboard/setIsUpgradingFirmware",!1);case 7:return r.next=9,Promise.all(a);case 9:return r.next=11,e.$store.dispatch("universalDashboard/setSelectedBatchAction",0);case 11:C["a"].success("Firmware Upgraded."),A["a"].$emit("universal-dashboard-refresh");case 13:case"end":return r.stop()}}),r)})))()},onMovePlatformGroup:function(t){var e=this;return Sn(wn().mark((function r(){var n,i,a;return wn().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,e.$store.dispatch("universalDashboard/setIsMovingPlatformGroup",!1);case 2:return n=e.selectedUnits,i=e.selectedUnits.length?n.map((function(t){return t.platformGroup_id})):[e.selectedContextMenuItem.platformGroup_id],a=i.map((function(r){var n={platformGroup_id:r,area_id:t.area_id};return D["a"].post("infrastructure/movePlatformGroup",e.getUser.apitoken,n)})),r.next=7,Promise.all(a);case 7:return C["a"].success("Platform moved."),r.next=10,e.$store.dispatch("universalDashboard/setSelectedContextMenuItem",null);case 10:return r.next=12,e.$store.dispatch("universalDashboard/setIsMovingPlatformGroup",!1);case 12:return r.next=14,e.$store.dispatch("universalDashboard/setSelectedBatchAction",0);case 14:return r.next=16,e.$store.dispatch("universalDashboard/setSelectedUnits",[]);case 16:A["a"].$emit("universal-dashboard-refresh");case 17:case"end":return r.stop()}}),r)})))()},onAssignPlatformGroupCollection:function(t){var e=this;return Sn(wn().mark((function r(){var n,i;return wn().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return n=e.selectedUnits,i=e.selectedUnits.length?n.map((function(t){return t.platformGroup_id})):[e.selectedContextMenuItem.platformGroup_id],e.$store.dispatch("universalDashboard/setIsAssigningPlatformGroupCollection",!1),e.$store.dispatch("universalDashboard/setSelectedUnits",[]),e.$store.dispatch("universalDashboard/setSelectedBatchAction",null),r.next=7,D["a"].post("ag_platformGroupCollections/addToCollection",e.getUser.apitoken,{platformGroupCollectionId:t,platformGroupIds:i});case 7:A["a"].$emit("universal-dashboard-refresh"),C["a"].success("Platform Groups added to Collection.");case 9:case"end":return r.stop()}}),r)})))()},onUnassignPlatformGroupCollection:function(){var t=this;return Sn(wn().mark((function e(){var r,n;return wn().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.selectedUnits,n=t.selectedUnits.length?r.map((function(t){return t.platformGroup_id})):[t.selectedContextMenuItem.platformGroup_id],t.$store.dispatch("universalDashboard/setIsUnassigningPlatformGroupCollection",!1),t.$store.dispatch("universalDashboard/setSelectedUnits",[]),t.$store.dispatch("universalDashboard/setSelectedBatchAction",null),e.next=7,D["a"].post("ag_platformGroupCollections/removeFromCollection",t.getUser.apitoken,{platformGroupCollectionId:t.$store.state.universalDashboard.filterPlatformGroupCollection.id,platformGroupIds:n});case 7:A["a"].$emit("universal-dashboard-refresh"),C["a"].success("Platform Groups removed from Collection.");case 9:case"end":return e.stop()}}),e)})))()},onCreatePlatformGroupCollection:function(t){var e=this;return Sn(wn().mark((function r(){var n,i;return wn().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return n=e.selectedUnits,i=e.selectedUnits.length?n.map((function(t){return t.platformGroup_id})):[e.selectedContextMenuItem.platformGroup_id],e.$store.dispatch("universalDashboard/setIsAssigningPlatformGroupCollection",!1),e.$store.dispatch("universalDashboard/setSelectedUnits",[]),e.$store.dispatch("universalDashboard/setSelectedBatchAction",null),r.next=7,D["a"].post("ag_platformGroupCollections/createCollection",e.getUser.apitoken,{name:t,platformGroupIds:i});case 7:A["a"].$emit("universal-dashboard-refresh"),C["a"].success("Platform Group Collection created.");case 9:case"end":return r.stop()}}),r)})))()},setTableGroupBy:function(){this.showGroupBy?this.searchParams.area_id?this.searchParams.dashboardDisplayType_id||(this.tableGroupBy="platformGroupType"):this.tableGroupBy="area":this.tableGroupBy=null},getUnitFacility:function(t){return{co2Enabled:t.facilityCo2Enabled,commandCommunicationsType:t.commandCommunicationsType}},isExpanded:function(t){var e=this.displayUnitsExpanded.find((function(e){return e.id===t.id}));return!!e},onToggleLifecycle:function(t){var e=this,r="";r=t.isSuspended?"Resume Lifecycle  "+t.lifecycle_id+"?":"Suspend Lifecycle  "+t.lifecycle_id+"?",U["a"].confirm("Please Confirm",r,(function(r){r&&D["a"].post("ag_lifecycles/toggleSuspend",e.getUser.apitoken,{lifecycle_id:t.lifecycle_id}).then((function(e){var r=vn(e,2),n=r[0];r[1];n?(C["a"].success("Function Complete"),t.isSuspended=!t.isSuspended):C["a"].error("An error occurred. Please try again later")}))}))},triggerContextActionForItem:function(t){var e={id:t.actionId};this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",t.item),this.onSelectContextAction(e)},triggerIntensityActionForItem:function(t){this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!0),this.$store.dispatch("universalDashboard/setSelectedBatchAction",90),this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",t),this.$store.dispatch("universalDashboard/setShowBatchIntensityOptions",!0)},triggerDehumidifier2ActionForItem:function(t){this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",t),this.$store.dispatch("universalDashboard/setShowDehumidifyOptions",!0)},triggerCurtainsActionForItem:function(t){this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",t.item),this.$store.dispatch("universalDashboard/setSelectedCurtainsAction",t.action),this.$store.dispatch("universalDashboard/setShowCurtainsConfirm",!0)},triggerEcuActionForItem:function(t){this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",t),this.$store.dispatch("universalDashboard/setShowEcuOptions",!0)},showSoilSensors:function(t){this.$store.dispatch("universalDashboard/setSelectedController",t),this.$store.dispatch("universalDashboard/setShowActiveSoilSensors",!0)},onGridColumnChange:function(t){this.activeHeaders=t},changeGridLayout:function(){this.$refs.GridColumnSelector.show()},createOperationalTask:function(t){1==t.lifecyclesRaw.length&&this.$router.push({name:"operational-task",params:{growplanId:t.lifecyclesRaw[0].growplan_id,lifecycleId:t.lifecyclesRaw[0].lifecycle_id}})},createOperationalTask2:function(t,e){this.$router.push({name:"operational-task",params:{growplanId:t,lifecycleId:e}})},enableLocking:function(){var t=this;this.isLockingColumns=!0,setTimeout((function(){t.isLockingEnabled=!0}),250)},getPhotoPeriodText:function(t){var e=t.currentPhase.photoperiod+" hours at ";return t.currentPhase.photoPeriodIntensity!==t.currentPhase.photoPeriodInterlightIntensity?(e+=Math.round(100*t.currentPhase.photoPeriodIntensity)+"% Downlight, ",e+=Math.round(100*t.currentPhase.photoPeriodInterlightIntensity)+"% Interlight intensity, "):e+=Math.round(100*t.currentPhase.photoPeriodIntensity)+"% intensity, ",e+="starting at "+this.convertTime(t.currentPhase.photoperiodStartTime).format("h:mm a")+".",e},onRegisterDump:function(t){(D["a"].isAdmin(this.getUser)||D["a"].isUserInRole(this.getUser,"MAINTENANCE"))&&this.$refs.registerDump.show(t.controller_id,t.platformGroupName)},onStateSave:function(t){var e={controller_id:this.selectedStateItem.controller_id,action_id:t,virtualDevice_id:this.selectedStateItem.id,user_id:this.getUser.id};A["a"].$emit("mode-of-operation-loading",{platformGroupId:this.selectedStateItem.platformGroup_id,isLoading:!0}),A["a"].$emit("current-state-loading",{platformGroupId:this.selectedStateItem.platformGroup_id,isLoading:!0}),this.storeControllerCommand({payload:e,apitoken:this.getUser.apitoken}),this.selectedStateItem=null,this.showStateOptions=!1,this.showStateContextMenu=!1},onStateCancel:function(){this.selectedStateItem=null,this.showStateOptions=!1},onStateContextMenu:function(t,e){var r=this;t.preventDefault(),e||(e=this.clickedRec),e.item||(e.item=e);var n=291,i=window.innerHeight;this.showStateContextMenu=!1,t.clientY+n>i?this.stateContextMenuY=i-n-20:this.stateContextMenuY=t.clientY,this.stateContextMenuX=t.clientX,this.$nextTick((function(){r.selectedStateItem=e.item,"Pop-up"===r.userStateMenuPreference.setting?r.showStateOptions=!0:r.showStateContextMenu=!0}))},onContextMenu:function(t,e){e||(e=this.clickedRec),e.item||(e.item=e),this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",e),A["a"].$emit("show-context-menu",t,e)},onSelectContextAction:function(t){var e=this;this.$nextTick((function(){e.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!0),e.onChangeBatchAction(t.id)}))},onEditPhase:function(t,e){this.growPhase_id=t.id,this.selectedControllerId=e},getVpdRangeText:function(t,e,r,n){this.calcVpd(t,e,r);if(!n)return"";var i=P()().diff(P()(n[0].lifecycleStarttime),"days");return i<=33?"Optimal VPD should be 0.4 to 0.8 for propagation / early veg stage":i>33&&i<=51?"Optimal VPD should be 0.8 to 1.2 for late veg / early flower stage":i>51?"Optimal VPD should be 1.2 to 1.6 for mid to late flower stage":void 0},adjustVpdHeader:function(){null==!localStorage.getItem("leafVpdOffset")&&localStorage.setItem("leafVpdOffset",0);var t=this.tableHeaders.find((function(t){return"vpd"==t.value})),e=this.activeHeaders.find((function(t){return"vpd"==t.value})),r=parseInt(localStorage.getItem("leafVpdOffset"));t.text=r?"Est Leaf VPD":"Air VPD",e&&(e.text=t.text)},getVpdStyleClass:function(t,e,r,n){var i=this.calcVpd(t,e,r);if(!n)return"vpdBlack";var a=P()().diff(P()(n[0].lifecycleStarttime),"days");return a<=33?i>=.4&&i<=.8?"vpdGreen":i>.8&&i<=1.2?"vpdYellow":"vpdRed":a>33&&a<=51?i>=.8&&i<=1.2?"vpdGreen":i>1.2&&i<1.6?"vpdYellow":"vpdRed":a>51?i>=1.2&&i<=1.6?"vpdGreen":i>=.8&&i<1.2?"vpdYellow":"vpdRed":void 0},onVpdAdjustmentUpdate:function(t){var e=this.tableHeaders.find((function(t){return"vpd"==t.value})),r=this.activeHeaders.find((function(t){return"vpd"==t.value}));e&&(e.text=0==t?"Air VPD":"Est Leaf VPD",r&&(r.text=e.text)),this.vpdAdjustment=-1*localStorage.getItem("leafVpdOffset")},setLeafVpdOffset:function(){this.displayAirToLeafVpdAdjuster=!0},onIpAddressClick:function(t){D["a"].isAdmin(this.getUser)&&navigator.clipboard.writeText("ssh agrinamics@"+t.currentTarget.innerText).then((function(){C["a"].success("Ip address copied to clipboard")}),(function(){C["a"].error("Could not write data to clipboard")}))},convertTime:ye["a"]},Object(_["b"])(["getZones","storeControllerCommand"])),{},{onShowCurrentTest:function(t){var e=this;t.testPlanLoading=!1,e.$nextTick((function(){D["a"].get("ecuTests",this.getUser.apitoken,{filter:{where:{controller_id:t.controller_id,starttime:{neq:null},finishtime:null}}}).then((function(r){var n=vn(r,2),i=n[0];n[1];if(1==i.length){var a=JSON.parse(i[0].testDetails);a.sort((function(t,e){return t.seq>e.seq?1:-1}));for(var o=D["a"].displayMetric(e.getUser),s=P()(i[0].starttime),l=0;l<a.length;l++)a[l].started=s.format("YYYY-MM-DD h:mm a"),s.add(a[l].transitionTime+a[l].onTargetTime,"minutes"),a[l].ending=s.format("YYYY-MM-DD h:mm a"),o||(a[l].temperature=Math.round(Object(k["a"])(a[l].temperature)));for(var c=[],u=0;u<a.length;u++){var d=P()(a[u].started),h=d.clone().add(a[u].transitionTime+a[u].onTargetTime,"minutes");P()().isBetween(d,h)&&c.push(a[u])}t.testPlan={irrigation:"Irrigate for "+i[0].irrigationDuration+" minutes every "+i[0].irrigationFrequency+" hours",label:i[0].testLabel,slopCo2:i[0].slopCo2,slopRh:i[0].slopRh,slopTemp:o?i[0].slopTemp:Object(k["a"])(i[0].slopTemp),schedule:a,filteredSchedule:c},t.testPlanLoading=!0}}))})),this.onShowDisplayUnitLifecycle(t)},onShowDisplayUnitLifecycle:function(t){this.loadDeviceDesignators();var e=this.displayUnitsExpanded.findIndex((function(e){return e.id===t.id}));-1===e?this.displayUnitsExpanded.push(t):this.displayUnitsExpanded.splice(e,1)},loadDeviceDesignators:function(){var t=this;return Sn(wn().mark((function e(){var r,n,i;return wn().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.irrigationDesignators.length){e.next=8;break}return e.next=3,D["a"].get("ag_deviceDesignators",t.getUser.apitoken,{filter:{fields:["id","designatorName"],where:{designatorType_id:1}}});case 3:r=e.sent,n=vn(r,2),i=n[0],n[1],t.irrigationDesignators=i;case 8:case"end":return e.stop()}}),e)})))()},onRowDblClick:function(t,e){this.goToDevice(e.item)},scrollListener:function(){var t=this;t.isScrolling=!0,window.clearTimeout(t.isScrollingHandle),t.isScrollingHandle=setTimeout((function(){t.isScrolling=!1}),100)},startListening:function(){if(!this.listenerInitialized){Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"}),this.highlightRow.bind(this);this.listenerInitialized=!0}},flushDisplayRecQueue:function(){var t=this;if(this.isScrolling)return!1;this.pagination.disabled=!0;var e=function(e){t.highlightRow(e);var r=t.zone_devices.find((function(t){return parseInt(t.platformGroup_id)===parseInt(e)}));if(r){for(var n in delete t.displayRecQueue[e].changedProps,t.displayRecQueue[e])r[n]=t.displayRecQueue[e][n];r=Object(B["g"])(r),t.zone_devices=t.zone_devices.map((function(t){return parseInt(t.platformGroup_id)===parseInt(e)?r:t}))}else console.warn("displayRecRef not found for ",e)};for(var r in this.displayRecQueue)e(r);this.displayRecQueue={},this.pagination.disabled=!1,this.filters.length&&this.setFilteredZoneDevices(),this.refreshLights()},refreshLights:E()((function(){var t=this,e=_n(this.refreshLightIntensityQueue);this.refreshLightIntensityQueue=[],e.length>0&&D["a"].get("platformGroupLightsViews",this.getUser.apitoken,{filter:{where:{controller_id:{inq:e}}}}).then((function(e){for(var r=vn(e,2),n=r[0],i=(r[1],0);i<n.length;i++){var a=t.filteredZoneDevicesIndex[n[i].platformGroup_id];a.lightIntensityAverage=Math.round(100*n[i].lightIntensityAverage)}}))}),250),handleControllerDisconnect:function(t){var e=null;e=this.zone_devices.find((function(e){return e.macAddress===t.payload.macAddress})),e&&(this.displayRecQueue[e.platformGroup_id]&&(e=this.displayRecQueue[e.platformGroup_id]),e=jn({},e),e.isDisconnected=!0,this.displayRecQueue[e.platformGroup_id]=e)},handleControllerReconnect:function(t){var e=null;e=this.zone_devices.find((function(e){return e.macAddress===t.payload.macAddress})),e&&(this.displayRecQueue[e.platformGroup_id]&&(e=this.displayRecQueue[e.platformGroup_id]),e=jn({},e),e.isDisconnected=!1,e.sortableCurrentState=e.currentState,this.displayRecQueue[e.platformGroup_id]=e)},handleSocketMessage:function(t){var e=!1;switch(t.type){case"reportState":break;case"reportReading":case"reportSensorReading":case"reportBatteryLevel":case"sensorPriorityChanged":return;case"setDeviceParameter":break;case"setLogLevel":break;case"reportSoilSensorReading":break;case"photocapture":break;case"nextIrrigated":break;case"reportIrrigationTimes":break;case"targetVWC":break;case"cropSteeringPhase":break;case"controllerDisconnect":return void this.handleControllerDisconnect(t);case"controllerReconnect":return void this.handleControllerReconnect(t);case"unpublishedDeviceMessage":return;default:return void console.log("got foreign message : "+t.type,t)}var r=t.payload,n=null;if("reportState"===t.type?n=r.data.deviceMessage:"setDeviceParameter"===t.type&&(n=r.data.reason),this.autoRefresh){var i=null;if(r.platformGroupId?(i=this.displayRecQueue[r.platformGroupId]?this.displayRecQueue[r.platformGroupId]:this.zone_devices.find((function(t){return parseInt(t.platformGroup_id)===parseInt(r.platformGroupId)})),i=i?jn({},i):null):(i=this.zone_devices.find((function(t){return r.controllerId&&parseInt(t.controller_id)===parseInt(r.controllerId)})),i=i?jn({},i):null),i&&(i.lastCommandFetch=P()().utc().format(),i.formattedLastCommandFetch=P()(i.lastCommandFetch).fromNow(),i.controller_id&&i.isDisconnected&&(D["a"].patch("controllers",this.getUser.apitoken,{id:i.controller_id,isDisconnected:!1}),i.isDisconnected=!1),i.changedProps=[],!("CortexVFU"!==r.deviceType&&"RackControlUnit"!==r.deviceType&&"LGU"!==r.deviceType&&"VFU"!==r.deviceType&&"PGU"!==r.deviceType&&n&&(n.indexOf("from AUTOMATIC to MANUAL")>0||n.indexOf("from MANUAL to AUTOMATIC")>0)||"heartbeat"===n))){switch(i.changedProps.push({type:r.deviceType,value:r.state}),"reportIrrigationTimes"===t.type&&(r.nextIrrigated&&(i.nextIrrigated=r.nextIrrigated,i.nextIrrigatedFormatted=Object(B["i"])(r.nextIrrigated)),r.lastIrrigated&&(i.lastIrrigated=r.lastIrrigated,i.lastIrrigatedFormatted=Object(B["i"])(r.lastIrrigated))),r.deviceType){case"CortexVFU":"setDeviceParameter"===t.type?(n&&n.indexOf("from AUTOMATIC to MANUAL")>0&&(i.mode="MANUAL"),n&&n.indexOf("from MANUAL to AUTOMATIC")>0&&(i.mode="AUTOMATIC")):(r.state&&(i.currentState=r.state,i.sortableCurrentState=r.isDisconnected?"DISCONNECTED":r.state),n&&n.indexOf("from AUTOMATIC to MANUAL")>0&&(i.mode="MANUAL"),n&&n.indexOf("from MANUAL to AUTOMATIC")>0&&(i.mode="AUTOMATIC"));break;case"LGU":case"PGU":"setDeviceParameter"===t.type&&(n&&n.indexOf("from AUTOMATIC to MANUAL")>0&&(i.mode="MANUAL"),n&&n.indexOf("from MANUAL to AUTOMATIC")>0&&(i.mode="AUTOMATIC"));break;case"RackControlUnit":r.state&&(i.currentState=r.state,i.sortableCurrentState=r.isDisconnected?"DISCONNECTED":r.state),n&&n.indexOf("from AUTOMATIC to MANUAL")>0&&(i.mode="MANUAL"),n&&n.indexOf("from MANUAL to AUTOMATIC")>0&&(i.mode="AUTOMATIC");break;case"VFU":i.currentState=r.state,i.sortableCurrentState=r.isDisconnected?"DISCONNECTED":r.state,n&&n.indexOf("from AUTOMATIC to MANUAL")>0&&(i.mode="MANUAL"),n&&n.indexOf("from MANUAL to AUTOMATIC")>0&&(i.mode="AUTOMATIC");break;case"Sensor":break;case"Valve":"reportState"===t.type&&n&&(n.indexOf("PAA")>=0||n.indexOf("Irrigation")>=0||n.indexOf("Mix")>=0)&&(i.irrigationState=r.state,"ON"===r.state&&(i.lastIrrigated=P()().format(),i.nextIrrigated=null),"OFF"===r.state&&-1===n.indexOf("from WAITING to OFF")?this.irrDevices--:"ON"===r.state&&this.irrDevices++,this.irrDevices<0&&(this.irrDevices=0)),"nextIrrigated"===t.type&&r.nextIrrigated&&(i.nextIrrigated=r.nextIrrigated,i.nextIrrigatedFormatted=Object(B["i"])(r.nextIrrigated)),"targetVWC"===t.type&&r.targetVWC&&(i.targetVWC=r.targetVWC),"cropSteeringPhase"===t.type&&(i.cropSteeringPhase=r.cropSteeringPhase);break;case"ECU":if(r.state&&n&&-1===n.indexOf("CO2Enabled"))i.ECUState=r.state;else if(n&&-1!==n.indexOf("CO2Enabled")){var a=n.split("=");2===a.length&&(i.co2Enabled="true"===a[1].trim())}break;case"CO2Valve":switch(r.state){case"ON":i.co2ValveState="ON";break;case"OFF":case"WAITING":i.co2ValveState="OFF";break}break;case"Curtain":i.curtainState=r.state;break;case"HeaterStrip":"HIGH"===r.state?(r.state="HeatStripOn",i.heaterstripState="On"):(r.state="HeatStripOff",i.heaterstripState="Off");break;case"Light":r.state&&"NULL"!==r.state&&(i.lightState=r.state),e=!0;break;case"SpectrumAdjustableLight":r.state&&"NULL"!==r.state&&(i.lightState=r.state),e=!0;break;case"Bard":if(n&&n.indexOf("CO2Enabled")>0){var o=n.split("=");i.co2Enabled=2===o.length&&"true"===o[1].trim(),2===o.length&&(i.co2Enabled="true"===o[1].trim())}else i.BardState=r.state;break;case"VFUHumidifier":i.vfuHumidifierState=r.state;break;case"VFUDehumidifier":i.vfuDehumidifierState=r.state;break;case"TwoStageDehumidifier":i.vfu2StageDehumidifierState=r.state;break;case"Debug":i.logLevel=r.state,"DEBUG"===r.state?i.infoIcon="bug_report":i.infoIcon="info";break}"reportSoilSensorReading"===t.type&&(i.xFertility=r.fertility,i.xTemp=r.temperature,i.xMoisture=r.moisture,i.xLux=r.lux),this.co2DevicesOpen=this.zone_devices.filter((function(t){return"ON"===t.co2ValveState&&"OFFLINE"!==t.state})).length,i&&"ON"===i.co2ValveState&&this.co2DevicesOpen++,this.displayRecQueue[i.platformGroup_id]=i,e&&r.controllerId&&this.refreshLightIntensityQueue.push(r.controllerId)}}},setFilteredZoneDevices:function(){var t=this,e=this.zone_devices;if(this.warningFilter&&(e=e.filter((function(t){return"WARN"==t.state}))),this.offlineFilter&&(e=e.filter((function(t){return"OFFLINE"==t.state}))),this.irrigatingFilter&&(e=e.filter((function(t){return"ON"==t.irrigationState}))),this.co2ActiveValvesFilter&&(e=e.filter((function(t){return"ON"==t.co2ValveState}))),this.filters.length){var r=function(){var r=[];t.filtersByType[n].forEach((function(t){var n=e.filter(t.filterFunction);r=_n(new Set(r.concat(n)))})),e=t.filtersByType[n].length?r:e};for(var n in this.filtersByType)r()}for(var i=0;i<e.length;i++)this.filteredZoneDevicesIndex[e[i].platformGroup_id]=e[i],this.filteredZoneControllerIndex[e[i].controller_id]||(this.filteredZoneControllerIndex[e[i].controller_id]=[]),this.filteredZoneControllerIndex[e[i].controller_id].push(e[i]),e[i].updated=P()(e[i].lastCommandFetch).fromNow();e.sortableCurrentState=e.isDisconnected?"DISCONNECTED":e.currentState,this.filteredZoneDevices=e},highlightRow:function(t){var e=document.getElementById("pg-"+t);e&&(e=e.parentElement.parentElement,e.classList.add("highlight"),setTimeout((function(){e.classList.remove("highlight")}),750))},reloadLifecycle:function(t){var e=this,r={controller_id:t.controller_id,action_id:51,virtualDevice_id:t.id,user_id:this.getUser.id};D["a"].get("controllerCommands",e.getUser.apitoken,{filter:{where:{controller_id:t.controller_id}}}).then((function(t){for(var n=vn(t,2),i=n[0],a=(n[1],!1),o=0;o<i.length;o++)51==i[o].action_id&&(a=!0);a?C["a"].info("This command is already queued for this controller."):D["a"].post("controllerCommands",e.getUser.apitoken,r).then((function(t){t.length&&t[0].id?C["a"].success("Action Submitted."):C["a"].error("Error sending command. Please try again later.")}))}))},onVfusListChange:function(t){var e=[],r=0,n=0,i=0,a=0;t&&t.length&&t.forEach((function(t){"ON"===t.co2ValveState&&a++,"ON"==t.irrigationState&&i++,t.deployed&&("WARN"===t.state?n++:"OFFLINE"===t.state&&r++),e.push(t)}));for(var o=0;o<e.length;o++)S["default"].set(this.zone_devices,this.zone_devices.length,e[o]);this.offlineDevices=r,this.warnDevices=n,this.irrDevices=i,this.co2DevicesOpen=a,this.setFilteredZoneDevices(),this.startListening()},goFileReport:function(t){this.platformGroupId=t.platformGroup_id,this.selectedDevice=t,this.showLifecycleStatusReport=!0},goToDevice:function(t,e){var r=this;return Sn(wn().mark((function n(){return wn().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,r.$store.dispatch("universalDashboard/setSelectedContextMenuItem",t);case 2:return n.next=4,r.doFacilityRefresh(t.facility_id);case 4:r.deviceControlPresetTab=e||0,t.platformGroupType.indexOf("DD Rack")>=0||t.platformGroupType.indexOf("VFU")>=0||t.platformGroupType.indexOf("PGU")>=0||t.platformGroupType.indexOf("LGU")>=0||t.platformGroupType.indexOf("IGR")>=0?(r.platformGroupId=t.platformGroup_id,r.deviceId=t.id,r.selectedDevice=t,r.showVfuControls=!0):t.id?(r.deviceId=t.id,t.platformGroupType="RCU",r.platformGroupId=t.platformGroup_id,r.selectedDevice=t,r.showVfuControls=!0):C["a"].error("A platform group type was not assigned to this record.");case 6:case"end":return n.stop()}}),n)})))()},onChangeBatchAction:function(t){this.$store.dispatch("batchActions/changeBatchAction",t)},onShowExceptions:function(t){this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",t),this.$store.dispatch("universalDashboard/setShowAlerts",!0)},getFacilityById:function(t){return this.facilities[t]},doFacilityRefresh:function(t){var e=this;return Sn(wn().mark((function r(){var n,i,a;return wn().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(e.facilities[t]){r.next=8;break}return r.next=3,D["a"].get("facilities/"+t,e.getUser.apitoken,{filter:{fields:["co2Enabled","commandCommunicationsType"]}});case 3:n=r.sent,i=vn(n,2),a=i[0],i[1],e.$set(e.facilities,t,a);case 8:case"end":return r.stop()}}),r)})))()},refresh:function(t){Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"});A["a"].$emit("universal-dashboard-refresh")},onShowCompliance:function(t,e,r){this.$store.dispatch("universalDashboard/setMicroclimateParams",{controller_id:t,lifecycle_id:e,facility_id:this.getUser.facility_id,platformGroupName:r}),this.$store.dispatch("universalDashboard/setShowComplianceDialog",!0)}})},Mn=An,Un=(r("1d2b9"),Object(It["a"])(Mn,w,x,!1,null,null,null));e["a"]=Un.exports},"144e":function(t,e,r){var n,i;(function(a){t.exports?(a["default"]=a,t.exports=a):(n=[r("ea7f")],i=function(t){return a(t),a.Highcharts=t,a}.apply(e,n),void 0===i||(t.exports=i))})((function(t){function e(t,e,r,n){t.hasOwnProperty(e)||(t[e]=n.apply(null,r),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}t=t?t._modules:{},e(t,"Extensions/PatternFill.js",[t["Core/Animation/AnimationUtilities.js"],t["Core/Chart/Chart.js"],t["Core/Globals.js"],t["Core/DefaultOptions.js"],t["Core/Series/Point.js"],t["Core/Series/Series.js"],t["Core/Renderer/SVG/SVGRenderer.js"],t["Core/Utilities.js"]],(function(t,e,r,n,i,a,o,s){function l(t,e){t=JSON.stringify(t);var r=t.length||0,n=0,i=0;if(e){e=Math.max(Math.floor(r/500),1);for(var a=0;a<r;a+=e)n+=t.charCodeAt(a);n&=n}for(;i<r;++i)e=t.charCodeAt(i),n=(n<<5)-n+e,n&=n;return n.toString(16).replace("-","1")}var c=t.animObject,u=n.getOptions;t=s.addEvent;var d=s.erase,h=s.merge,f=s.pick,p=s.removeEvent;n=s.wrap;var m=r.patterns=function(){var t=[],e=u().colors;return["M 0 0 L 5 5 M 4.5 -0.5 L 5.5 0.5 M -0.5 4.5 L 0.5 5.5","M 0 5 L 5 0 M -0.5 0.5 L 0.5 -0.5 M 4.5 5.5 L 5.5 4.5","M 2 0 L 2 5 M 4 0 L 4 5","M 0 2 L 5 2 M 0 4 L 5 4","M 0 1.5 L 2.5 1.5 L 2.5 0 M 2.5 5 L 2.5 3.5 L 5 3.5"].forEach((function(r,n){t.push({path:r,color:e[n],width:5,height:5,patternTransform:"scale(1.4 1.4)"})})),["M 0 0 L 5 10 L 10 0","M 3 3 L 8 3 L 8 8 L 3 8 Z","M 5 5 m -4 0 a 4 4 0 1 1 8 0 a 4 4 0 1 1 -8 0","M 0 0 L 10 10 M 9 -1 L 11 1 M -1 9 L 1 11","M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9"].forEach((function(r,n){t.push({path:r,color:e[n+5],width:10,height:10})})),t}();i.prototype.calculatePatternDimensions=function(t){if(!t.width||!t.height){var e=this.graphic&&(this.graphic.getBBox&&this.graphic.getBBox(!0)||this.graphic.element&&this.graphic.element.getBBox())||{},r=this.shapeArgs;if(r&&(e.width=r.width||e.width,e.height=r.height||e.height,e.x=r.x||e.x,e.y=r.y||e.y),t.image){if(!e.width||!e.height)return t._width="defer",void(t._height="defer");t.aspectRatio&&(e.aspectRatio=e.width/e.height,t.aspectRatio>e.aspectRatio?e.aspectWidth=e.height*t.aspectRatio:e.aspectHeight=e.width/t.aspectRatio),t._width=t.width||Math.ceil(e.aspectWidth||e.width),t._height=t.height||Math.ceil(e.aspectHeight||e.height)}t.width||(t._x=t.x||0,t._x+=e.x-Math.round(e.aspectWidth?Math.abs(e.aspectWidth-e.width)/2:0)),t.height||(t._y=t.y||0,t._y+=e.y-Math.round(e.aspectHeight?Math.abs(e.aspectHeight-e.height)/2:0))}},o.prototype.addPattern=function(t,e){e=f(e,!0);var r=c(e),n=t.width||t._width||32,i=t.height||t._height||32,a=t.color||"#343434",o=t.id,l=this,u=function(t){l.rect(0,0,n,i).attr({fill:t}).add(h)};if(o||(this.idCounter=this.idCounter||0,o="highcharts-pattern-"+this.idCounter+"-"+(this.chartIndex||0),++this.idCounter),this.forExport&&(o+="-export"),this.defIds=this.defIds||[],!(-1<this.defIds.indexOf(o))){this.defIds.push(o);var d={id:o,patternUnits:"userSpaceOnUse",patternContentUnits:t.patternContentUnits||"userSpaceOnUse",width:n,height:i,x:t._x||t.x||0,y:t._y||t.y||0};t.patternTransform&&(d.patternTransform=t.patternTransform);var h=this.createElement("pattern").attr(d).add(this.defs);return h.id=o,t.path?(d=s.isObject(t.path)?t.path:{d:t.path},t.backgroundColor&&u(t.backgroundColor),u={d:d.d},this.styledMode||(u.stroke=d.stroke||a,u["stroke-width"]=f(d.strokeWidth,2),u.fill=d.fill||"none"),d.transform&&(u.transform=d.transform),this.createElement("path").attr(u).add(h),h.color=a):t.image&&(e?this.image(t.image,0,0,n,i,(function(){this.animate({opacity:f(t.opacity,1)},r),p(this.element,"load")})).attr({opacity:0}).add(h):this.image(t.image,0,0,n,i).add(h)),t.image&&e||"undefined"===typeof t.opacity||[].forEach.call(h.element.childNodes,(function(e){e.setAttribute("opacity",t.opacity)})),this.patternElements=this.patternElements||{},this.patternElements[o]=h}},n(a.prototype,"getColor",(function(t){var e=this.options.color;e&&e.pattern&&!e.pattern.color?(delete this.options.color,t.apply(this,Array.prototype.slice.call(arguments,1)),e.pattern.color=this.color,this.color=this.options.color=e):t.apply(this,Array.prototype.slice.call(arguments,1))})),t(a,"render",(function(){var t=this.chart.isResizing;(this.isDirtyData||t||!this.chart.hasRendered)&&(this.points||[]).forEach((function(e){var r=e.options&&e.options.color;r&&r.pattern&&(!t||e.shapeArgs&&e.shapeArgs.width&&e.shapeArgs.height?e.calculatePatternDimensions(r.pattern):(r.pattern._width="defer",r.pattern._height="defer"))}))})),t(i,"afterInit",(function(){var t=this.options.color;t&&t.pattern&&("string"===typeof t.pattern.path&&(t.pattern.path={d:t.pattern.path}),this.color=this.options.color=h(this.series.options.color,t))})),t(o,"complexColor",(function(t){var e=t.args[0],r=t.args[1];t=t.args[2];var n=this.chartIndex||0,a=e.pattern,o="#343434";if("undefined"!==typeof e.patternIndex&&m&&(a=m[e.patternIndex]),!a)return!0;if(a.image||"string"===typeof a.path||a.path&&a.path.d){var s=t.parentNode&&t.parentNode.getAttribute("class");s=s&&-1<s.indexOf("highcharts-legend"),"defer"!==a._width&&"defer"!==a._height||i.prototype.calculatePatternDimensions.call({graphic:{element:t}},a),!s&&a.id||(a=h({},a),a.id="highcharts-pattern-"+n+"-"+l(a)+l(a,!0)),this.addPattern(a,!this.forExport&&f(a.animation,this.globalAnimation,{duration:100})),o="url("+this.url+"#"+a.id+(this.forExport?"-export":"")+")"}else o=a.color||o;return t.setAttribute(r,o),e.toString=function(){return o},!1})),t(e,"endResize",(function(){(this.renderer&&this.renderer.defIds||[]).filter((function(t){return t&&t.indexOf&&0===t.indexOf("highcharts-pattern-")})).length&&(this.series.forEach((function(t){t.points.forEach((function(t){(t=t.options&&t.options.color)&&t.pattern&&(t.pattern._width="defer",t.pattern._height="defer")}))})),this.redraw(!1))})),t(e,"redraw",(function(){var t={},e=this.renderer,r=(e.defIds||[]).filter((function(t){return t.indexOf&&0===t.indexOf("highcharts-pattern-")}));r.length&&([].forEach.call(this.renderTo.querySelectorAll('[color^="url("], [fill^="url("], [stroke^="url("]'),(function(r){(r=r.getAttribute("fill")||r.getAttribute("color")||r.getAttribute("stroke"))&&(r=r.replace(e.url,"").replace("url(#","").replace(")",""),t[r]=!0)})),r.forEach((function(r){t[r]||(d(e.defIds,r),e.patternElements[r]&&(e.patternElements[r].destroy(),delete e.patternElements[r]))})))}))})),e(t,"masters/modules/pattern-fill.src.js",[],(function(){}))}))},"14c4":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("ac7c"),s=r("62ad"),l=r("4bd4"),c=r("132d"),u=r("0fd9"),d=r("b974"),h=r("2fa4"),f=r("8654"),p=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v("Select Irrigation Type and Duration")]),e(h["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(c["a"],[t._v("close")])],1)],1),e(a["c"],[e(l["a"],{model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(u["a"],[e(s["a"],{staticClass:"pr-1",attrs:{cols:"8"}},[e(d["a"],{attrs:{items:t.designators,"item-value":"id","item-text":"designatorName",label:"Select Irrigation Type","return-object":"",rules:[function(){return!!t.selectedDesignator||"This field is required"}]},model:{value:t.selectedDesignator,callback:function(e){t.selectedDesignator=e},expression:"selectedDesignator"}})],1),e(s["a"],{attrs:{cols:"4"}},[e(f["a"],{attrs:{type:"number",label:"Duration",suffix:"second(s)",rules:[function(){return t.durationSecs>=0&&t.durationSecs<=1440||"Permitted range: 0 - 1440"}]},model:{value:t.durationSecs,callback:function(e){t.durationSecs=e},expression:"durationSecs"}})],1)],1),e(u["a"],[e(s["a"],[e(o["a"],{attrs:{label:"Set to AUTO when complete"},model:{value:t.setAutoWhenComplete,callback:function(e){t.setAutoWhenComplete=e},expression:"setAutoWhenComplete"}})],1)],1)],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.valid},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},m=[],v=r("2f62"),y=r("d0eb");r("c1df"),r("d67f");function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function b(t,e){return C(t)||_(t,e)||x(t,e)||w()}function w(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){if(t){if("string"==typeof t)return S(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function C(t){if(Array.isArray(t))return t}function O(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */O=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function b(){}function w(){}var x={};c(x,o,(function(){return this}));var S=Object.getPrototypeOf,_=S&&S(S(L([])));_&&_!==r&&n.call(_,o)&&(x=_);var C=w.prototype=y.prototype=Object.create(x);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==g(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(g(e)+" is not iterable")}return b.prototype=w,i(C,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=c(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c(t,l,"GeneratorFunction")),t.prototype=Object.create(C),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(C),c(C,l,"Generator"),c(C,o,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function P(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function D(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){P(a,n,i,o,s,"next",t)}function s(t){P(a,n,i,o,s,"throw",t)}o(void 0)}))}}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){j(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function j(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t){var e=I(t,"string");return"symbol"==g(e)?e:e+""}function I(t,e){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var L={name:"BatchIrrigationOptions",components:{},beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{valid:!1,designators:[],durationSecs:60,selectedDesignator:null,setAutoWhenComplete:!1}},computed:T(T({},Object(v["c"])(["getUser"])),Object(v["c"])("universalDashboard",["isPerformingContextMenuAction"])),watch:{},methods:{onCancel:function(){this.$store.dispatch("universalDashboard/setShowBatchIrrigationOptions",!1),this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1),this.$store.dispatch("universalDashboard/setSelectedBatchAction",null)},onConfirm:function(){var t=this;return D(O().mark((function e(){var r;return O().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r={designatorName:t.selectedDesignator.designatorName,designator_id:t.selectedDesignator.id,durationSeconds:t.durationSecs,setAutoWhenComplete:t.setAutoWhenComplete},e.next=3,t.$store.dispatch("universalDashboard/setIrrigationSettings",r);case 3:return e.next=5,t.$store.dispatch("universalDashboard/setShowBatchIrrigationOptions",!1);case 5:return e.next=7,t.$store.dispatch("batchActions/setBatchActionLabel",{id:16,label:"Irrigate "+r.designatorName+" for "+r.durationSeconds+" seconds"});case 7:if(!t.isPerformingContextMenuAction){e.next=10;break}return e.next=10,t.$store.dispatch("batchActions/runBatchAction");case 10:case"end":return e.stop()}}),e)})))()},refresh:function(){var t=this;return D(O().mark((function e(){var r,n,i;return O().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,y["a"].get("ag_deviceDesignators",t.getUser.apitoken,{filter:{fields:["id","designatorName"],where:{designatorType_id:1},order:"designatorName"}});case 2:r=e.sent,n=b(r,2),i=n[0],n[1],t.designators=i;case 7:case"end":return e.stop()}}),e)})))()}}},A=L,M=r("2877"),U=Object(M["a"])(A,p,m,!1,null,null,null);e["a"]=U.exports},"14fc":function(t,e,r){"use strict";r("d93d")},"15e6":function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"h-100 w-100"},[e("div",{attrs:{id:t.canvasId}})])},i=[],a=r("c1df"),o=r.n(a),s=r("2f62"),l=r("ea7f"),c=r.n(l),u=r("ee40"),d=r.n(u),h=r("a9b3"),f=r("d0eb"),p=(r("12a1"),r("dd56"));function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t){return w(t)||b(t)||g(t)||y()}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function b(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function w(t){if(Array.isArray(t))return x(t)}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){C(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function C(t,e,r){return(e=O(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function O(t){var e=P(t,"string");return"symbol"==m(e)?e:e+""}function P(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}d()(c.a);var D={name:"xiaomi-chart",props:["value","lights","valves"],mixins:[h["a"]],beforeDestroy:function(){this.destroyCharts()},beforeMount:function(){this.displayMetric=f["a"].displayMetric(this.getUser),window.moment=o.a,c.a.setOptions({time:{timezone:this.tzPref()}})},mounted:function(){this.drawCharts()},data:function(){return{canvasId:"SoilSensorsChart",charts:[],chartColors:{Temperature:"red",Lux:"magenta",Moisture:"blue",EC:"silver"},chart:null}},computed:_({},Object(s["c"])(["getUser"])),watch:{value:function(){this.drawCharts()}},methods:{adjustChartSize:function(t){var e=this.$refs["container"].getBoundingClientRect().height,r=this.$refs["container"].getBoundingClientRect().width;t.chartHeight!==e&&t.setSize(r,e)},drawCharts:function(){var t=this;this.destroyCharts();var e={57:{id:57,color:"rgba(255,0,0,1)",type:"line",name:"Media Temp",data:[],yAxis:0,tooltip:{pointFormatter:function(){var t=a.displayMetric?"°C":"°F";return"<span>Temp ".concat(this.y.toFixed(1)," ").concat(t,"</span>")}},marker:{enabled:void 0,radius:3}},53:{id:53,color:"rgba(0,0,255,1)",type:"line",name:"Media WC",data:[],yAxis:1,tooltip:{pointFormatter:function(){return"<span>WC ".concat(this.y.toFixed(1)," %</span>")}},marker:{enabled:void 0,radius:3}},62:{id:62,color:"rgba(0,255,0,1)",type:"line",name:"Media Pore EC",data:[],yAxis:2,tooltip:{pointFormatter:function(){return"<span>Pore EC ".concat(this.y.toFixed(2)," (mS/cm)</span>")}},marker:{enabled:void 0,radius:3}},54:{id:54,color:"rgb(0,255,166)",type:"line",name:"Media Bulk EC",data:[],yAxis:3,visible:!1,tooltip:{pointFormatter:function(){return"<span>Bulk EC ".concat(this.y.toFixed(2)," (mS/cm)</span>")}},marker:{enabled:void 0,radius:3}},63:{id:63,color:"rgb(255,200,128)",type:"line",name:"Epsilon",data:[],yAxis:4,visible:!1,tooltip:{pointFormatter:function(){return"<span>Epsilon ".concat(this.y.toFixed(2),"</span>")}},marker:{enabled:void 0,radius:3}}};this.value.forEach((function(r){Object.keys(r).forEach((function(n){var i;"dateTime"!==n&&(null===(i=e[n])||void 0===i||i.data.push({x:o.a.utc(r.dateTime).valueOf(),y:"57"===n?t.formatTemperature(r[n].reading):r[n].reading}))}))})),e=Object.keys(e).map((function(t){return e[t].data.sort((function(t,e){return t.x<e.x?-1:1})),e[t]})).filter((function(t){return t.data.length>0}));var r=[],n=this.lights.map((function(t){return 1===t.stateId?(r.push({point:{xAxis:0,yAxis:1,x:o.a.utc(t.dateTime).valueOf(),y:97.5},text:"Lights On",backgroundColor:"rgb(255,0,255)"}),{color:"rgb(255,0,255)",width:2,value:o.a.utc(t.dateTime).valueOf()}):(r.push({point:{xAxis:0,yAxis:1,x:o.a.utc(t.dateTime).valueOf(),y:97.5},text:"Lights Off"}),{color:"black",width:2,value:o.a.utc(t.dateTime).valueOf()})})),i=[];this.valves.forEach((function(t){1===t.stateId&&(r.push({point:{xAxis:0,yAxis:1,x:o.a.utc(t.dateTime).valueOf(),y:10},text:"Valve On",backgroundColor:"rgb(87,168,239)",shape:"rect"}),i.push({color:"rgb(87,168,239)",width:2,value:o.a.utc(t.dateTime).valueOf()}))})),n=[].concat(v(n),i);var a=this;this.chart=c.a.chart(this.canvasId,{credits:{enabled:!1},chart:{alignTicks:!1,backgroundColor:null,zoomType:"x"},title:void 0,tooltip:{formatter:function(){var t="";return t+="<b>".concat(a.formatDateWithTZPref(o()(this.x).format()),"</b><br />"),this.points.map((function(e){t+=e.point.series.userOptions.tooltip.pointFormatter?"<span>\n                ".concat(e.point.series.userOptions.tooltip.pointFormatter.apply(e),"\n              </span><br />"):""})),t},shared:!0},plotOptions:{line:{turboThreshold:0}},xAxis:{type:"datetime",crosshair:!0,plotLines:n,plotBands:[],dateTimeLabelFormats:{minute:"%I:%M %P",hour:"%I:%M %P"}},yAxis:[{type:"linear",title:{text:"Temperature ".concat(this.displayMetric?"(°C)":"(°F)")},min:this.displayMetric?10:Object(p["a"])(10),max:this.displayMetric?35:Object(p["a"])(35),gridLineWidth:0},{title:{text:"WC (%)"},type:"linear",min:10,max:99,gridLineWidth:0,opposite:!0},{title:{text:"Pore EC (mS/cm)"},type:"linear",gridLineWidth:0,opposite:!0},{title:{text:"Bulk EC (mS/cm)"},type:"linear",gridLineWidth:0,opposite:!0},{title:{text:"Epsilon"},type:"linear",gridLineWidth:0,opposite:!0}],series:e,annotations:[{labels:r}]}),this.adjustChartSize(this.chart)},formatTemperature:function(t){return this.displayMetric?t:Object(p["a"])(t)},destroyCharts:function(){this.chart&&this.chart.destroy()}}},k=D,T=(r("bcf9"),r("2877")),j=Object(T["a"])(k,n,i,!1,null,null,null);e["a"]=j.exports},"169aa":function(t,e,r){"use strict";r("0802")},"196c":function(t,e,r){},"196d":function(t,e,r){},"19b5":function(t,e,r){},"1cc0":function(t,e,r){"use strict";var n=r("cc20"),i=function(){var t=this,e=t._self._c;return e("div",[t._l(t.customTimes,(function(r,i){return[e(n["a"],{key:i,staticClass:"mr-1 mb-1",staticStyle:{height:"50px"},attrs:{color:r.lightsOn?t.COLORS["on"]:t.COLORS["off"],small:"","text-color":"#FFFFFF",close:t.closeable},on:{"click:close":function(e){return t.deleteTime(r)}}},[e("div",{staticClass:"d-flex flex-column"},[e("span",[t._v("\n          "+t._s(r.designatorName)+"\n        ")]),e("span",[t._v("\n          "+t._s(t.getCustomIrrigationString(r))+"\n        ")])])])]}))],2)},a=[];function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var s={name:"ScheduleChipsCustom",props:["blocks","duration","closeable"],data:function(){return{COLORS:{on:"#ff00ff",off:"#383838"}}},computed:{customTimes:function(){return this.blocks.map((function(t){return"object"!==o(t)?{startTime:t,durationSecs:null,designatorId:null,designatorName:null}:t}))}},methods:{deleteTime:function(t){this.closeable&&(t.lightsOn?(delete t.lightsOn,this.$emit("remove-day",t)):(delete t.lightsOn,this.$emit("remove-night",t)))},getCustomIrrigationString:function(t){var e="";return t.durationSecs/60>=1?(e+=Math.floor(t.durationSecs/60)+"m",t.durationSecs%60>0&&(e+=t.durationSecs%60+"s")):e+=t.durationSecs+"s",e+="@"+t.startTime,e}}},l=s,c=r("2877"),u=Object(c["a"])(l,i,a,!1,null,null,null);e["a"]=u.exports},"1cc5":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("4bd4"),s=r("132d"),l=r("2fa4"),c=r("8654"),u=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[t.rec?e("h2",[t._v("Update Name of "+t._s(t.rec.controller.name))]):t._e(),e(l["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(s["a"],[t._v("close")])],1)],1),e(a["c"],[e(o["a"],{nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSave.apply(null,arguments)}},model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(c["a"],{attrs:{label:"Hostname",rules:[t.rules.required],autofocus:""},model:{value:t.hostname,callback:function(e){t.hostname=e},expression:"hostname"}})],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.valid},on:{click:t.onSave}},[t._v("Update")])],1)],1)},d=[],h=r("d67f"),f=r("9c4f"),p=r("2f62"),m=r("d0eb"),v=r("81f6");function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */g=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function b(){}function w(){}function x(){}var S={};c(S,o,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,o)&&(S=C);var O=x.prototype=b.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==y(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(y(e)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function b(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function w(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){b(a,n,i,o,s,"next",t)}function s(t){b(a,n,i,o,s,"throw",t)}o(void 0)}))}}function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){_(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _(t,e,r){return(e=C(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t){var e=O(t,"string");return"symbol"==y(e)?e:e+""}function O(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var P={name:"EditHostname",mixins:[f["a"]],components:{},mounted:function(){},data:function(){return{valid:!1,hostname:null,isLoading:!1}},computed:S(S(S({},Object(p["c"])(["getUser"])),Object(p["c"])("universalDashboard",["selectedContextMenuItem"])),{},{rec:function(){return{controller:{name:this.selectedContextMenuItem.platformGroupName,id:this.selectedContextMenuItem.controller_id}}}}),watch:{},methods:{onClose:function(){this.$store.dispatch("universalDashboard/setIsUpdatingHostname",!1)},onSave:function(){var t=this;return w(g().mark((function e(){var r,n,i,a;return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.valid){e.next=3;break}return h["a"].error("Form Entries Incomplete or Invalid"),e.abrupt("return");case 3:return r={controller_id:t.selectedContextMenuItem.controller_id,action_id:139,user_id:t.getUser.id,value:t.hostname.toLowerCase()},e.next=6,t.$store.dispatch("universalDashboard/setIsUpdatingHostname",!0);case 6:return e.next=8,t.$store.dispatch("universalDashboard/setIsChangingController",!0);case 8:return e.next=10,Promise.all([m["a"].post("controllerCommands",t.getUser.apitoken,r),m["a"].patch("controllers",t.getUser.apitoken,{id:t.selectedContextMenuItem.controller_id,name:t.hostname.toLowerCase()}),m["a"].patch("ag_platformGroups",t.getUser.apitoken,{id:t.selectedContextMenuItem.platformGroup_id,platformGroupName:t.hostname}),m["a"].patch("hardware_items",t.getUser.apitoken,{id:t.selectedContextMenuItem.hardware_item_id,label:t.hostname})]);case 10:return n=e.sent,e.next=13,t.$store.dispatch("universalDashboard/setSelectedContextMenuItem",null);case 13:return e.next=15,t.$store.dispatch("universalDashboard/isUpdatingHostname",!1);case 15:i=!1,a=0;case 17:if(!(a<n.length)){e.next=24;break}if(!(n[a].length>1)){e.next=21;break}return i=!0,e.abrupt("break",24);case 21:a++,e.next=17;break;case 24:i?h["a"].error("Error updating hostname."):(h["a"].success("Hostname Updated. Unit restarting."),v["a"].$emit("universal-dashboard-refresh"));case 25:case"end":return e.stop()}}),e)})))()}}},D=P,k=r("2877"),T=Object(k["a"])(D,u,d,!1,null,null,null);e["a"]=T.exports},"1cf8":function(t,e,r){"use strict";var n=r("d0eb"),i=r("2f62");function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function o(t,e){return d(t)||u(t,e)||l(t,e)||s()}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function d(t){if(Array.isArray(t))return t}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function p(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m(t){var e=v(t,"string");return"symbol"==a(e)?e:e+""}function v(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}e["a"]={computed:f({},Object(i["c"])(["getUser"])),methods:{initFloorplans:function(t){var e=this;t&&!t.getFacility||n["a"].get("Facilities/"+this.getUser.facility_id,this.getUser.apitoken).then((function(t){var r=o(t,2),n=r[0];r[1];e.facility=n})),n["a"].get("ag_facilityMaps",this.getUser.apitoken,{filter:{order:"label",include:[{relation:"agFacilitymaphotspots",scope:{include:["camera"]}}],where:{facility_id:this.getUser.facility_id}}}).then((function(t){var r=o(t,2),n=r[0];r[1];e.facilityMaps=n;for(var i=0;i<e.facilityMaps.length;i++)for(var a=0;a<e.facilityMaps[i].agFacilitymaphotspots.length;a++){var s=e.facilityMaps[i].agFacilitymaphotspots[a],l=s.label.split("-");3==l.length&&(s.label=l[1]+"-"+l[2])}e.facilityMaps.length>0&&(e.selectedFacilityMap=e.facilityMaps[0])}))}}}},"1d2b9":function(t,e,r){"use strict";r("2357")},"1d4d":function(t,e,r){"use strict";r("696f");var n=r("9d26"),i=r("a9ad"),a=r("16b7"),o=r("af2b"),s=r("5311"),l=r("7560"),c=r("80d2"),u=r("58df");e["a"]=Object(u["a"])(i["a"],a["a"],s["a"],o["a"],l["a"]).extend({name:"v-rating",props:{backgroundColor:{type:String,default:"accent"},color:{type:String,default:"primary"},clearable:Boolean,dense:Boolean,emptyIcon:{type:String,default:"$ratingEmpty"},fullIcon:{type:String,default:"$ratingFull"},halfIcon:{type:String,default:"$ratingHalf"},halfIncrements:Boolean,hover:Boolean,length:{type:[Number,String],default:5},readonly:Boolean,size:[Number,String],value:{type:Number,default:0},iconLabel:{type:String,default:"$vuetify.rating.ariaLabel.icon"}},data(){return{hoverIndex:-1,internalValue:this.value}},computed:{directives(){return this.readonly||!this.ripple?[]:[{name:"ripple",value:{circle:!0}}]},iconProps(){const{dark:t,large:e,light:r,medium:n,small:i,size:a,xLarge:o,xSmall:s}=this.$props;return{dark:t,large:e,light:r,medium:n,size:a,small:i,xLarge:o,xSmall:s}},isHovering(){return this.hover&&this.hoverIndex>=0}},watch:{internalValue(t){t!==this.value&&this.$emit("input",t)},value(t){this.internalValue=t}},methods:{createClickFn(t){return e=>{if(this.readonly)return;const r=this.genHoverIndex(e,t);this.clearable&&this.internalValue===r?this.internalValue=0:this.internalValue=r}},createProps(t){const e={index:t,value:this.internalValue,click:this.createClickFn(t),isFilled:Math.floor(this.internalValue)>t,isHovered:Math.floor(this.hoverIndex)>t};return this.halfIncrements&&(e.isHalfHovered=!e.isHovered&&(this.hoverIndex-t)%1>0,e.isHalfFilled=!e.isFilled&&(this.internalValue-t)%1>0),e},genHoverIndex(t,e){let r=this.isHalfEvent(t);return this.halfIncrements&&this.$vuetify.rtl&&(r=!r),e+(r?.5:1)},getIconName(t){const e=this.isHovering?t.isHovered:t.isFilled,r=this.isHovering?t.isHalfHovered:t.isHalfFilled;return e?this.fullIcon:r?this.halfIcon:this.emptyIcon},getColor(t){if(this.isHovering){if(t.isHovered||t.isHalfHovered)return this.color}else if(t.isFilled||t.isHalfFilled)return this.color;return this.backgroundColor},isHalfEvent(t){if(this.halfIncrements){const e=t.target&&t.target.getBoundingClientRect();if(e&&t.pageX-e.left<e.width/2)return!0}return!1},onMouseEnter(t,e){this.runDelay("open",()=>{this.hoverIndex=this.genHoverIndex(t,e)})},onMouseLeave(){this.runDelay("close",()=>this.hoverIndex=-1)},genItem(t){const e=this.createProps(t);if(this.$scopedSlots.item)return this.$scopedSlots.item(e);const r={click:e.click};return this.hover&&(r.mouseenter=e=>this.onMouseEnter(e,t),r.mouseleave=this.onMouseLeave,this.halfIncrements&&(r.mousemove=e=>this.onMouseEnter(e,t))),this.$createElement(n["a"],this.setTextColor(this.getColor(e),{attrs:{"aria-label":this.$vuetify.lang.t(this.iconLabel,t+1,Number(this.length))},directives:this.directives,props:this.iconProps,on:r}),[this.getIconName(e)])}},render(t){const e=Object(c["j"])(Number(this.length)).map(t=>this.genItem(t));return t("div",{staticClass:"v-rating",class:{"v-rating--readonly":this.readonly,"v-rating--dense":this.dense}},e)}})},"1d93":function(t,e,r){"use strict";var n=r("d0eb"),i=r("2f62");function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function o(t,e){return d(t)||u(t,e)||l(t,e)||s()}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function d(t){if(Array.isArray(t))return t}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function p(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m(t){var e=v(t,"string");return"symbol"==a(e)?e:e+""}function v(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}e["a"]={computed:f({},Object(i["c"])(["getUser"])),methods:{onJsonChange:function(t,e,r){var i="",a=null,s=[];for(var l in a="string"==typeof t?JSON.parse(t):t,i+=e?"".concat(e,' [color="#1876D1" active];')+String.fromCharCode(10)+String.fromCharCode(13):"".concat(a.startAt,' [color="#1876D1" active];')+String.fromCharCode(10)+String.fromCharCode(13),a.states){var c=a.states[l];for(var u in c.transitions){for(var d=[],h=0;h<c.transitions[u].length;h++)d.push("Rule "+c.transitions[u][h].ruleNumber),s.push({id:c.transitions[u][h].ruleNumber,transition:l+"->"+u,text:c.transitions[u][h].expression,isActive:!1});i+=l+" => "+u+" : "+d.join(" or ")+";"}}i+='initial => "'+a.startAt+'";'+String.fromCharCode(10)+String.fromCharCode(13);var f=this;n["a"].post("VirtualDeviceTypeFsas/render",this.getUser.apitoken,{statemachine:i,direction:"left-right"}).then((function(t){var e=o(t,2),n=e[0],i=(e[1],n.substring(n.indexOf("<svg")));f.$vuetify.theme.isDark&&(i=i.replace(/#ffffff/gi,"#1C1E1D"),i=i.replace(/#000000/gi,"#B0B0AF")),r&&r(i,s)}))}}}},"1e7b":function(t,e,r){},"1f09":function(t,e,r){},"1f26":function(t,e,r){},"207d":function(t,e,r){},"210b":function(t,e,r){},2282:function(t,e,r){},2357:function(t,e,r){},2366:function(t,e){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);function i(t,e){var n=e||0,i=r;return[i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]]].join("")}t.exports=i},"25cd":function(t,e,r){"use strict";var n=r("4ca6"),i=r("8336"),a=r("b0af"),o=r("99d9"),s=r("62ad"),l=r("169a"),c=r("132d"),u=r("490a"),d=r("0fd9"),h=r("ba0d"),f=r("3a2f"),p=function(){var t=this,e=t._self._c;return e("div",{staticClass:"intensitySwitch",class:{disabled:t.disabled},style:t.customStyle},[e(d["a"],{attrs:{"no-gutters":"",align:"center"}},[e(s["a"],{attrs:{cols:"1",sm:"2"}},[e(n["a"],{staticClass:"smallBadgeText",attrs:{left:"",overlap:"",content:Math.floor(t.displayValue)+"%",value:t.displayValue}},[e(c["a"],{staticStyle:{"user-select":"none"},attrs:{color:t.color,large:"",disabled:t.disabled},on:{click:t.onDblClick}},[t._v("wb_incandescent")])],1)],1),t.hideLabel?t._e():e(s["a"],{staticClass:"pl-3",attrs:{cols:"8"}},[e("span",{staticClass:"v-label",class:{disabled:t.disabled},staticStyle:{"user-select":"none"},on:{click:t.onClick}},[t._v(t._s(t.label))])]),e(s["a"],{staticClass:"text-right",staticStyle:{"padding-top":"20px"},attrs:{cols:"2"}},[t.transitionClass?[t.isSse?[e(u["a"],{attrs:{color:"primary",indeterminate:""}})]:e(f["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(u["a"],t._g({attrs:{color:"primary",value:t.pctComplete,rotate:-90}},n))]}}],null,!1,887808457)},[e("span",[t._v(t._s(t.nextFetch))])])]:t._e()],2)],1),e(l["a"],{attrs:{width:"600"},model:{value:t.displaySlider,callback:function(e){t.displaySlider=e},expression:"displaySlider"}},[e(a["a"],[e(o["d"],[e("h2",[t._v("Set Light Intensity for "+t._s(t.label))])]),e(o["c"],{staticStyle:{"padding-top":"20px"}},[e(d["a"],{attrs:{justify:"center"}},[e(s["a"],{attrs:{cols:"10"}},[e(h["a"],{attrs:{"thumb-color":t.sliderColor,"thumb-label":"always"},model:{value:t.sliderValue,callback:function(e){t.sliderValue=e},expression:"sliderValue"}})],1)],1)],1),e(o["a"],{staticClass:"justify-center pt-0"},[e(i["a"],{attrs:{color:"primary",text:""},on:{click:t.onConfirmIntensity}},[t._v("Confirm")])],1)],1)],1)],1)},m=[],v=r("d67f"),y={name:"zone-devices-devices-dimmercontrol",props:{isSse:{type:Boolean,default:!1},isCortex:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{type:[String],default:""},state:{type:[String,Number],default:0},id:{type:[Number],default:0},type:{type:String,default:""},options:{type:Array,default:function(){return[]}},readonly:{type:Boolean,default:!0},isPolling:{type:Boolean,default:!1},nextFetchTime:{type:String,default:""},pctComplete:{type:[Number],default:0},suspendEvent:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},parameters:{type:Array,default:function(){return[]}},customStyle:{type:Object,default:function(){return{"margin-top":"30px","margin-left":"5px"}}}},data:function(){return{displaySlider:!1,sliderValue:0,val:!1,inTransition:!1,displayValue:0,delay:250,clicks:0,timer:null}},watch:{state:function(t){this.setCurrentState(t)},isPolling:function(t){t||(this.inTransition=!1)},parameters:{deep:!0,immediate:!0,handler:function(t){var e=this.parameters.filter((function(t){return"intensity"==t.description}));1==e.length&&(this.displayValue=100*e[0].numericValue)}}},computed:{color:function(){if(0==this.displayValue)return"rgb(190,190,190)";var t=.01*this.displayValue+.15;return"rgba(255,0,255,"+t+")"},sliderColor:function(){var t=.01*this.sliderValue+.15;return"rgba(255,0,255,"+t+")"},transitionClass:function(){return this.inTransition&&this.isPolling},nextFetch:function(){return this.inTransition?""==this.nextFetchTime?"Next update within 2 minutes":this.nextFetchTime:""}},methods:{onClick:function(t){if(!this.disabled){var e=this;this.clicks++,1===this.clicks?this.timer=setTimeout((function(){e.onSingleClick(),e.clicks=0}),this.delay):(clearTimeout(this.timer),e.onDblClick(),e.clicks=0)}},onSingleClick:function(){this.disabled||(this.readonly?v["a"].error("You cannot change settings when AUTOMATIC mode is ON."):(this.val>0?this.val=0:this.val=100,this.change(this.val)))},onDblClick:function(){this.disabled||(this.readonly?v["a"].error("You cannot change settings when AUTOMATIC mode is ON."):(this.sliderValue=this.displayValue,this.displaySlider=!0))},onConfirmIntensity:function(){this.change(this.sliderValue),this.displaySlider=!1},setCurrentState:function(t){t&&(t=t.toLowerCase(),this.val="on"==t||"closed"==t)},value:function(t,e){this.suspendEvent=!0},change:function(t){if(!this.suspendEvent){this.inTransition=!0;this.displayValue=t;var e=this.isCortex?96:90;this.$emit("changed",{id:this.id,action_id:e,intensity:t/100})}}},mounted:function(){this.setCurrentState(this.state)}},g=y,b=(r("7deb"),r("2877")),w=Object(b["a"])(g,p,m,!1,null,null,null);e["a"]=w.exports},"277e":function(t,e,r){"use strict";var n=r("f977"),i=r("d9bd"),a=r("a026");e["a"]=a["default"].extend({name:"scrollable",directives:{Scroll:n["a"]},props:{scrollTarget:String,scrollThreshold:[String,Number]},data:()=>({currentScroll:0,currentThreshold:0,isActive:!1,isScrollingUp:!1,previousScroll:0,savedScroll:0,target:null}),computed:{canScroll(){return"undefined"!==typeof window},computedScrollThreshold(){return this.scrollThreshold?Number(this.scrollThreshold):300}},watch:{isScrollingUp(){this.savedScroll=this.savedScroll||this.currentScroll},isActive(){this.savedScroll=0}},mounted(){this.scrollTarget&&(this.target=document.querySelector(this.scrollTarget),this.target||Object(i["c"])("Unable to locate element with identifier "+this.scrollTarget,this))},methods:{onScroll(){this.canScroll&&(this.previousScroll=this.currentScroll,this.currentScroll=this.target?this.target.scrollTop:window.pageYOffset,this.isScrollingUp=this.currentScroll<this.previousScroll,this.currentThreshold=Math.abs(this.currentScroll-this.computedScrollThreshold),this.$nextTick(()=>{Math.abs(this.currentScroll-this.savedScroll)>this.computedScrollThreshold&&this.thresholdMet()}))},thresholdMet(){}}})},2896:function(t,e,r){},2911:function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=r("62ad"),o=r("169a"),s=r("0fd9"),l=r("b974"),c=r("8dd9"),u=r("2fa4"),d=r("8654"),h=function(){var t=this,e=t._self._c;return e(o["a"],{attrs:{width:"620"},model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[e(n["a"],{attrs:{loading:t.isLoading}},[e(i["d"],{staticClass:"pb-0"},[e("h2",{staticStyle:{"min-width":"250px"}},[t._v("Find Plant By Tag")]),e(u["a"]),e(d["a"],{staticClass:"pr-2",attrs:{label:"Tag Number",clearable:"","single-line":""},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.search.apply(null,arguments)}},model:{value:t.searchtext,callback:function(e){t.searchtext=e},expression:"searchtext"}})],1),e(i["c"],{staticClass:"pt-0"},[e(c["a"],{staticClass:"overflow-auto overflow-x-hidden",attrs:{height:"330"}},[t.foundPlants&&!t.foundPlants.length?e("div",{staticClass:"d-flex flex-column align-center"},[e("div",[t._v("\n            No results found for these tags.\n          ")]),e("div",[t._v("\n            "+t._s(t.searchTags.join(", "))+"\n          ")])]):t._e(),t.foundPlants&&t.foundPlants.length?[e(s["a"],{attrs:{justify:"center"}},[t.multipleFound?e(a["a"],{attrs:{md:"4"}},[e(l["a"],{attrs:{items:t.foundPlants,"return-object":"","item-text":"tag","item-value":"id",label:"Select a Plant"},model:{value:t.plantInfo,callback:function(e){t.plantInfo=e},expression:"plantInfo"}})],1):t._e()],1),t.plantInfo&&t.plantInfo.tag?e(s["a"],[e(a["a"],{staticClass:"pr-2",attrs:{md:"6"}},[e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Tag")]),t._v("\n                "+t._s(t.plantInfo.tag)+"\n              ")]),e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Lifecycle")]),t._v("\n                "+t._s(t.plantInfo.lifecycle_id)+"\n              ")]),e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Strain")]),t._v("\n                "+t._s(t.plantInfo.strainName)+"\n              ")]),e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Cloned")]),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.plantInfo.starttime))}})]),e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Harvested")]),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.plantInfo.actualHarvestDate))}})]),""!=t.plantInfo.areaname?[e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Area")]),e("span",[t._v(t._s(t.plantInfo.areaname))])]),e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Grow Chamber")]),e("span",[t._v(t._s(t.plantInfo.platformGroupName))])]),e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Basin")]),e("span",[t._v(t._s(t.plantInfo.platformName))])]),e("div",{staticClass:"plantInfoRow"},[e("label",[t._v("Position")]),e("span",[t._v("Row "+t._s(t.plantInfo.row)+", Col "+t._s(t.plantInfo.col))])])]:t._e()],2),t.growPlatform?e(a["a"],{staticClass:"pl-2",attrs:{md:"6"}},[e("platform",{attrs:{platform:t.growPlatform,"lifecycle-id":t.plantInfo.lifecycle_id,platformGroup:{id:t.plantInfo.ag_platforms_id,platformGroupName:t.plantInfo.platformGroupName},positions:t.growPlatform.ag_platformPositions,highlightPosition:t.highlightPosition}})],1):t._e()],1):t._e()]:t._e()],2)],1)],1)],1)},f=[],p=r("d0eb"),m=(r("c1df"),r("d67f"),r("2f62")),v=r("a9b3"),y=r("d89d");function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach((function(e){x(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function x(t,e,r){return(e=S(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(t){var e=_(t,"string");return"symbol"==g(e)?e:e+""}function _(t,e){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function C(t,e){return T(t)||k(t,e)||P(t,e)||O()}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function k(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function T(t){if(Array.isArray(t))return t}var j={name:"",props:["value"],mixins:[v["a"]],components:{Platform:y["a"]},beforeMount:function(){var t=this;p["a"].get("ag_licenses",this.getUser.apitoken,{filter:{fields:["tagPrefix","tagLength"],where:{facility_id:this.getUser.facility_id}}}).then((function(e){var r=C(e,2),n=r[0];r[1];t.licenses=n}))},mounted:function(){},data:function(){return{showDialog:!1,selectedPlant:null,searchtext:"",searchTags:[],foundPlants:null,platformName:"",licenses:[],plantInfo:{},growPlatform:null,selectedEmptyPositions:[],selectedPlatformPositions:[],highlightPosition:[-1,-1],isLoading:!1}},computed:w(w({},Object(m["c"])(["getUser"])),{},{multipleFound:function(){return this.foundPlants&&this.foundPlants.length>1}}),watch:{plantInfo:function(t,e){t&&this.loadPlant()}},methods:{show:function(){this.showDialog=!0},hide:function(){this.showDialog=!1},loadPlant:function(){var t=this;t.platformName=t.plantInfo.platformGroupName+" : "+t.plantInfo.platformName,!t.plantInfo.harvestDate&&t.plantInfo.ag_platforms_id?p["a"].get("platformGroups/getLifecyclePlatformGroups",t.getUser.apitoken,{lifecycle_id:t.plantInfo.lifecycle_id}).then((function(e){var r=C(e,2),n=r[0];r[1];for(var i in n)if(n[i].platforms[t.plantInfo.ag_platforms_id]){var a=n[i].platforms[t.plantInfo.ag_platforms_id];a.platformPositions=a.ag_platformPositions,t.highlightPosition=[t.plantInfo.row,t.plantInfo.col],t.growPlatform=a}})):t.growPlatform=null},search:function(){var t=this;this.foundPlants=null;var e=[],r=0,n="";this.isLoading=!0;for(var i=0;i<this.licenses.length;i++)this.searchtext.length==this.licenses[i].tagLength?n=this.searchtext:(r=this.licenses[i].tagLength-this.licenses[i].tagPrefix.length,n=this.licenses[i].tagPrefix+this.searchtext.padStart(r,"0")),e.push(n);this.searchTags=e,t.growPlatform=null,p["a"].get("ag_plants/getPlantPosition",this.getUser.apitoken,{tags:e,facility_id:this.getUser.facility_id}).then((function(e){var r=C(e,2),n=r[0];r[1];t.isLoading=!1,n.sort((function(t,e){return t.tag>e.tag?1:-1})),t.foundPlants=n,n.length?(t.plantInfo=n[0],t.loadPlant()):t.plantInfo=null}))}}},E=j,I=(r("3f55"),r("2877")),L=Object(I["a"])(E,h,f,!1,null,"389f149c",null);e["a"]=L.exports},"29ad":function(t,e,r){},"29fd":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("169a"),s=r("cd55"),l=r("49e2"),c=r("c865"),u=r("0393"),d=r("132d"),h=r("8654"),f=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"panel-no-padding"},[e(c["a"],{staticClass:"d-flex justify-between align-center"},[t.facilityMap?e("div",{staticClass:"flex-grow-auto d-flex justify-start"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.onShowFacilityMap}},[t._v(t._s(t.area.areaname))])],1):e("div",{staticClass:"flex-grow-auto d-flex justify-start"},[e(n["a"],{attrs:{text:"",color:"default"}},[t._v(t._s(t.area.areaname))])],1),e(h["a"],{directives:[{name:"show",rawName:"v-show",value:"area"===t.activeSearch.activeSearchLevel&&t.activeSearch.activeSearchId===t.area.id,expression:"activeSearch.activeSearchLevel === 'area' && activeSearch.activeSearchId === area.id"}],ref:"areaSearch",staticClass:"col-6 col-sm-4",staticStyle:{"padding-bottom":"3px"},attrs:{"append-icon":"search","single-line":"","hide-details":"",clearable:"",dense:""},on:{click:function(t){t.stopPropagation()},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.stopPropagation(),e.preventDefault(),t.onPreventSpace.apply(null,arguments))}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),e(n["a"],{directives:[{name:"show",rawName:"v-show",value:"area"!==t.activeSearch.activeSearchLevel||t.activeSearch.activeSearchId!==t.area.id,expression:"activeSearch.activeSearchLevel !== 'area' || activeSearch.activeSearchId !== area.id"}],staticClass:"flex-shrink-1 flex-grow-0",attrs:{icon:""},on:{click:function(e){return e.stopPropagation(),t.showAreaSearch.apply(null,arguments)}}},[e(d["a"],[t._v("search")])],1)],1),e(l["a"],{staticClass:"flex-grow-auto"},[e("unit-search-results",{directives:[{name:"show",rawName:"v-show",value:t.search&&""!==t.search,expression:"search && search !== ''"}],attrs:{"display-units":t.searchResultUnits,"search-text":t.search}}),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:!t.search||""===t.search,expression:"!search || search === ''"}],staticClass:"h-100 flex-content",attrs:{loading:t.isLoading}},[t.isLoading?e(a["d"]):t._e(),e(a["c"],{staticStyle:{padding:"0"}},[e(u["a"],{staticClass:"h-100 d-flex flex-column flex-nowrap justify-start dashboard-panels",attrs:{accordion:"",multiple:t.isMultiple},model:{value:t.openPanel,callback:function(e){t.openPanel=e},expression:"openPanel"}},[e("grow-unit-expansion-panel",{ref:"growUnitExpansionPanel",attrs:{"facility-id":t.facilityId,area:t.area,"is-active-panel":t.isActivePanel,"search-text":t.search,"display-units":t.displayUnits[1]},on:{"searched-length":t.onGrowUnitSearch,"do-refresh":t.getDashboardDisplayUnitsStatus}}),e("plant-platform-expansion-panel",{class:[t.panelClass],attrs:{"selected-display-types":t.selectedDisplayTypes,"display-units":t.displayUnits[2],"maximized-display-type":t.maximizedDisplayType,"display-units-loading":t.displayUnitsLoading[2],"is-locking-columns":t.isLockingColumns,"is-locking-enabled":t.isLockingEnabled,"search-text":t.search},on:{"fullscreen-panel":t.fullscreenPanel,"minimize-panel":t.minimizePanel,"searched-length":t.onPlantPlatformSearch}}),e("bucking-unit-expansion-panel",{class:[t.panelClass],attrs:{"selected-display-types":t.selectedDisplayTypes,"display-units":t.displayUnits[3],"maximized-display-type":t.maximizedDisplayType,"display-units-loading":t.displayUnitsLoading[3],"is-locking-columns":t.isLockingColumns,"is-locking-enabled":t.isLockingEnabled,"search-text":t.search},on:{"fullscreen-panel":t.fullscreenPanel,"minimize-panel":t.minimizePanel,"searched-length":t.onBuckingSearch}}),e("drying-unit-expansion-panel",{class:[t.panelClass],attrs:{"selected-display-types":t.selectedDisplayTypes,"display-units":t.displayUnits[4],"maximized-display-type":t.maximizedDisplayType,"display-units-loading":t.displayUnitsLoading[4],"is-locking-columns":t.isLockingColumns,"is-locking-enabled":t.isLockingEnabled,"search-text":t.search},on:{"fullscreen-panel":t.fullscreenPanel,"minimize-panel":t.minimizePanel,"searched-length":t.onDryingSearch}}),e("curing-unit-expansion-panel",{class:[t.panelClass],attrs:{"selected-display-types":t.selectedDisplayTypes,"display-units":t.displayUnits[5],"maximized-display-type":t.maximizedDisplayType,"display-units-loading":t.displayUnitsLoading[5],"is-locking-columns":t.isLockingColumns,"is-locking-enabled":t.isLockingEnabled,"search-text":t.search},on:{"fullscreen-panel":t.fullscreenPanel,"minimize-panel":t.minimizePanel,"searched-length":t.onCuringSearch}})],1)],1)],1)],1),e(o["a"],{attrs:{width:"90%"},model:{value:t.showFacilityMap,callback:function(e){t.showFacilityMap=e},expression:"showFacilityMap"}},[e("display-facility-map",{attrs:{"facility-map":t.facilityMap,facility:t.facility}})],1)],1)},p=[],m=r("2f62"),v=r("c1df"),y=r.n(v),g=r("d0eb"),b=r("6ce0"),w=r("a9b3"),x=r("b047"),S=r.n(x),_=r("4216"),C=r("1cf8"),O=r("6841"),P=r("f675"),D=r("b09b"),k=r("9c9c"),T=r("62ad"),j=r("0fd9"),E=r("b974"),I=function(){var t=this,e=t._self._c;return e(s["a"],{directives:[{name:"show",rawName:"v-show",value:t.isVisibleDisplayUnitType(1),expression:"isVisibleDisplayUnitType(1)"}],staticClass:"flex-grow-auto flex-column",class:[t.isVisibleDisplayUnitType(1)?"d-flex":"",t.panelClass]},[e(c["a"],[e("div",{staticClass:"d-flex flex-column flex-sm-row justify-between align-center"},[e("span",{staticClass:"flex-grow-auto"},[t._v(t._s(t.zone_devices.length)+" Grow Units")]),e(j["a"],{staticClass:"py-2 py-sm-0",attrs:{align:"center",justify:"center","no-gutters":""}},[e(T["a"],{attrs:{cols:"10"}},[e(E["a"],{ref:"batchActionSelect",staticStyle:{margin:"0px"},attrs:{dense:"",label:"Batch Actions - "+t.selectedUnits.length+" target"+(t.selectedUnits.length>1?"s":""),items:t.batchActions,"item-text":"label","item-value":"id",clearable:"","hide-details":""},on:{change:t.onChangeBatchAction,click:function(e){return e.stopPropagation(),t.openBatchActionSelect.apply(null,arguments)}},model:{value:t.$store.state.universalDashboard.selectedBatchAction,callback:function(e){t.$set(t.$store.state.universalDashboard,"selectedBatchAction",e)},expression:"$store.state.universalDashboard.selectedBatchAction"}})],1),e(T["a"],{staticClass:"text-lg-right text-center pl-1",attrs:{cols:"2"}},[e(n["a"],{attrs:{small:"",disabled:!t.selectedBatchAction,color:"primary",loading:t.isBatchActionRunning},on:{click:function(e){return e.stopPropagation(),t.$store.dispatch("batchActions/runBatchAction")}}},[t._v("Run")])],1)],1),e("div",{staticClass:"flex-grow-1 d-flex justify-center justify-md-end"},[e("zone-devices-control-button",{staticClass:"mr-1",attrs:{icon:"notification_important",color:"error",badgeCount:t.issueCount,tooltip:"# of open grow system alert tickets - click to view"},on:{onclick:function(e){e.stopPropagation(),t.showAlerts=!0}}}),t.offlineDevices>0?e("zone-devices-control-button",{staticClass:"mr-1",attrs:{icon:"error",color:"error",badgeCount:t.offlineDevices,tooltip:"# of grow units that are offline - click to view"},on:{onclick:function(e){return e.stopPropagation(),t.toggleErrorView.apply(null,arguments)}}}):t._e(),t.warnDevices>0?e("zone-devices-control-button",{staticClass:"mr-1",attrs:{icon:"warning",color:"warning",badgeCount:t.warnDevices,tooltip:"# of grow units with warnings - click to view"},on:{onclick:function(e){return e.stopPropagation(),t.toggleWarningView.apply(null,arguments)}}}):t._e(),e("zone-devices-control-button",{attrs:{icon:"opacity",color:"primary",badgeCount:t.irrDevices,tooltip:"# of open irrigation valves - click to view"},on:{onclick:function(e){e.stopPropagation(),t.showIrrigationSummary=!0}}}),e("span",{staticClass:"hidden-sm-and-down"},[e("zone-devices-control-button",{staticClass:"mr-1",attrs:{icon:"local_florist",color:t.autoPlantFilter?"default":"primary",badgeCount:-1,tooltip:t.autoPlantFilter?"View all units":"View units in automatic with plants"},on:{onclick:function(e){return e.stopPropagation(),t.automaticPlantFilter.apply(null,arguments)}}})],1),e("zone-devices-control-button",{staticClass:"mr-1",attrs:{icon:"search",color:"primary",badgeCount:"-1",tooltip:"Locate a plant by tag number"},on:{onclick:function(e){return e.stopPropagation(),t.showPlantFinder.apply(null,arguments)}}}),e("span",{staticClass:"hidden-sm-and-down"},[e("zone-devices-control-button",{staticClass:"mr-1",attrs:{icon:"pie_chart",color:"primary",badgeCount:"-1",disabled:0==t.selectedUnits.length,tooltip:"Plot telemetry from multiple grow platforms"},on:{onclick:function(e){e.stopPropagation(),t.chartMultipleVFUs=!0}}})],1),e("span",{staticClass:"hidden-sm-and-down"},[e("zone-devices-control-button",{staticClass:"mr-1",attrs:{icon:"view_column",color:"primary",badgeCount:"-1",tooltip:"Change Grid Layout"},on:{onclick:function(e){return e.stopPropagation(),t.changeGridLayout.apply(null,arguments)}}})],1),e("span",{directives:[{name:"show",rawName:"v-show",value:!t.isLockingEnabled,expression:"!isLockingEnabled"}],staticClass:"hidden-sm-and-down"},[e("zone-devices-control-button",{staticClass:"mr-1 hidden-sm-and-down",attrs:{icon:"mdi-lock-open",color:"primary",badgeCount:"-1",tooltip:"Click to lock columns",loading:t.isLockingColumns},on:{onclick:function(e){return e.stopPropagation(),t.enableLocking.apply(null,arguments)}}})],1),e("span",{directives:[{name:"show",rawName:"v-show",value:t.isLockingEnabled,expression:"isLockingEnabled"}],staticClass:"hidden-sm-and-down"},[e("zone-devices-control-button",{staticClass:"mr-1 hidden-sm-and-down",attrs:{icon:"mdi-lock",color:"primary",disabled:!0,badgeCount:"-1",tooltip:"Columns are locked"}})],1),e("span",{directives:[{name:"show",rawName:"v-show",value:!t.autoRefresh,expression:"!autoRefresh"}],staticClass:"hidden-sm-and-down"},[e("zone-devices-control-button",{staticClass:"mr-1 hidden-sm-and-down",attrs:{icon:"autorenew",color:"black",badgeCount:"-1",tooltip:"Click to turn auto-refresh on"},on:{onclick:function(e){e.stopPropagation(),t.autoRefresh=!0}}})],1),e("span",{directives:[{name:"show",rawName:"v-show",value:t.autoRefresh,expression:"autoRefresh"}],staticClass:"rotateanimation hidden-sm-and-down"},[e("zone-devices-control-button",{staticClass:"mr-1",attrs:{icon:"autorenew",color:"primary",badgeCount:"-1",tooltip:"Click to turn auto-refresh off"},on:{onclick:function(e){e.stopPropagation(),t.autoRefresh=!1}}})],1),e("zone-devices-control-button",{attrs:{icon:"refresh",color:"primary",badgeCount:"-1",tooltip:"Reload data from the cloud",disabled:t.vfusLoading||t.pgusLoading},on:{onclick:function(e){return e.stopPropagation(),t.refresh(!0)}}})],1)],1)]),e(l["a"],{staticClass:"flex-grow-auto"},[e("unit-results",{attrs:{"display-units":t.displayUnits}})],1),e(o["a"],{attrs:{width:"90%"},model:{value:t.chartMultipleVFUs,callback:function(e){t.chartMultipleVFUs=e},expression:"chartMultipleVFUs"}},[t.chartMultipleVFUs?e("chart-multiple",{staticClass:"vh90",attrs:{platformGroups:t.selectedUnits,user:t.getUser}}):t._e()],1),t.showIrrigationSummary?e(o["a"],{attrs:{width:"700",persistent:""},model:{value:t.showIrrigationSummary,callback:function(e){t.showIrrigationSummary=e},expression:"showIrrigationSummary"}},[e("irrigation-summary",{staticClass:"vh80",attrs:{"zone-devices":t.zone_devices},on:{closed:function(e){t.showIrrigationSummary=!1}}})],1):t._e(),e("grid-display-selector",{ref:"GridColumnSelector",attrs:{defaultColumns:t.standardHeaders,gridName:t.gridName,"default-display-units":t.dashboardDisplayTypes,"selected-display-units":t.selectedDisplayTypes},on:{change:t.onGridColumnChange,"display-selection":t.onDisplaySelectionChange},model:{value:t.table_headers,callback:function(e){t.table_headers=e},expression:"table_headers"}}),e("plant-finder",{ref:"plantfinder"}),e("edit-phase-modal",{on:{refresh:t.refresh},model:{value:t.growPhase_id,callback:function(e){t.growPhase_id=e},expression:"growPhase_id"}}),e(o["a"],{attrs:{width:"1024"},model:{value:t.showStateMachine,callback:function(e){t.showStateMachine=e},expression:"showStateMachine"}},[t.stateMachine.ag_controlLoopDiagram_version||t.stateMachine.id?e("display-fsa-decision-details",{attrs:{ag_controlLoopDiagramType_id:t.stateMachine.ag_controlLoopDiagramType_id,message:t.stateMachine.message,ag_controlLoopDiagram_version:t.stateMachine.ag_controlLoopDiagram_version,ruleNumber:t.stateMachine.ruleNumber,timestamp:t.stateMachine.timestamp,platformGroupName:t.stateMachine.platformGroupName},on:{close:function(e){t.showStateMachine=!1}},model:{value:t.stateMachine.details,callback:function(e){t.$set(t.stateMachine,"details",e)},expression:"stateMachine.details"}}):t._e()],1),e(o["a"],{attrs:{width:"600",persistent:""},model:{value:t.showAlerts,callback:function(e){t.showAlerts=e},expression:"showAlerts"}},[t.showAlerts?e("alert-viewer",{staticStyle:{height:"90vh"},attrs:{facility_id:t.facilityId,maximized:!0,modal:!0,compact:!0},on:{close:function(e){t.showAlerts=!1}}}):t._e()],1)],1)},L=[],A=r("a026"),M=r("54a5"),U=r("d67f"),N=r("0276"),F=r("f590"),G=(r("dd56"),r("6b20")),R=r("31e3"),$=r("14c4"),H=r("9640"),V=r("2911"),B=r("fec3"),z=r("f749"),Y=r("0aa3"),q=r("ab66"),W=r("b3c5"),J=r("9cf2"),Z=r("b4e3"),X=(r("8e07"),r("e387")),K=r("4504"),Q=r("e620"),tt=r("81f6"),et=r("ad5a"),rt=r("2c0d"),nt=r("c122"),it=r("2ec3"),at=r("1cc5"),ot=r("856a"),st=r("aec4"),lt=r("616f"),ct=r("06b7"),ut=r("d7f2"),dt=r("8537"),ht=r("afa9"),ft=r("ea10"),pt=r("a2fb"),mt=r("70d9"),vt=r("8d4d"),yt=r("300b"),gt=r("567b"),bt=r("3c1b"),wt=r("8ac5"),xt=r("488d"),St=r("12ad");function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function Ct(t){return Dt(t)||Pt(t)||jt(t)||Ot()}function Ot(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Dt(t){if(Array.isArray(t))return Et(t)}function kt(t,e){return Lt(t)||It(t,e)||jt(t,e)||Tt()}function Tt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jt(t,e){if(t){if("string"==typeof t)return Et(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Et(t,e):void 0}}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function It(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Lt(t){if(Array.isArray(t))return t}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?At(Object(r),!0).forEach((function(e){Ut(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ut(t,e,r){return(e=Nt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nt(t){var e=Ft(t,"string");return"symbol"==_t(e)?e:e+""}function Ft(t,e){if("object"!=_t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Gt=Object(lt["longClickDirective"])({delay:500,interval:1e4});A["default"].directive("longclick",Gt);var Rt={name:"GrowUnitExpansionPanel",mixins:[w["a"],b["a"],_["a"],C["a"]],components:{UnitResults:St["a"],ContextMenu:xt["a"],LifecyclePlatforms:wt["a"],GridDisplaySelector:bt["a"],IrrigationSummary:gt["a"],StateContextOptions:yt["a"],StateOptions:vt["a"],BatchEcuOptions:dt["a"],BatchCurtainConfirm:ut["a"],BatchDehumidifierOptions:R["a"],BatchControlLoopOptions:et["a"],GridColumnSelector:Q["a"],ReviewMicroclimatePerformance:X["a"],BatchIntensityOptions:J["a"],Lgu:N["a"],ChartMultiple:M["a"],GenericController:F["a"],DeviceControls:G["default"],BatchIrrigationOptions:$["a"],PlantFinder:V["a"],Co2CalibrationOptions:H["a"],LifecycleStatusReport:B["a"],AlertViewer:z["default"],ZoneDevicesControlButton:Y["a"],LockedColumnDatatable:q["a"],EditPhaseModal:W["a"],DisplayFsaDecisionDetails:Z["a"],ControllerDevices:K["a"],DeviceStatusIcons:rt["a"],MovePlatformGroup:nt["a"],EditFirmware:it["a"],EditHostname:at["a"],ControllerCameras:ot["a"],XiaomiSoilSensor:st["a"],activeXiaomiSoilSensors:ct["a"],DoNotDisturb:ht["a"],DisplayFacilityMap:pt["a"],BashCommandExecute:mt["a"]},props:{facilityId:{type:Number,required:!0},area:{type:Object,required:!0},isActivePanel:{type:Boolean,required:!1,default:function(){return!1}},searchText:{type:String,required:!1,default:function(){return""}},displayUnits:{type:Array,required:!0}},data:function(){return{toggleSelect:!1,filterLetter:null,showBashCommands:!1,refreshKey:1,facilityMaps:[],selectedSlide:0,setDnD:!1,isAdmin:!1,renameDevice:null,showActiveSoilSensors:!1,deviceTabs:0,refreshLightIntensityQueue:[],mobileFilters:[],showMobileFilters:!1,openDevices:!1,gridName:"VFU/IGR Dashboard",microclimateparams:{lifecycle_id:null,facility_id:null,controller_id:null},showComplianceDialog:!1,Trimaster:g["a"],clickedRec:{item:null},showStateMachine:!1,stateMachine:{},growPhase_id:null,showEditPhaseModal:!1,expanded:[],pagination:{itemsPerPage:250},vpdAdjustment:0,footerprops:{"items-per-page-options":[25,50,75,100,250]},showLifecycleStatusReport:!1,moment:y.a,displayAirToLeafVpdAdjuster:!1,isScrolling:!1,isScrollingHandle:null,refreshGridCounter:1,flushQueueHandle:null,refreshTable:0,co2DevicesOpen:0,displayRecQueue:{},lastUpdateRecieved:null,isDemo:!1,deviceControlPresetTab:0,autoRefresh:!0,irrDevices:0,readyToDisplay:!1,listenerInitialized:!1,recentControllerChange:{},vfusLoading:!1,facility:null,showBatchIntensityOptions:!1,intensitySettings:0,selectedControllerIds:[],showBatchControlLoopOptions:!1,controlLoopSettings:[],showBatchIrrigationOptions:!1,showBatchCo2CalibrationOptions:!1,showDehumidifyOptions:!1,showCurtainsConfirm:!1,showEcuOptions:!1,co2CalibrationSettings:{ppm:null},viewType:"standard",dataChanged:!1,autoPlantFilter:!1,showDeviceTickets:!1,showNonVfuController:!1,showAlerts:!1,issueCount:0,deviceId:"",platformGroupId:"",showVfuControls:!1,expand:!1,vfusList:[],controllersList:[],showOtherDeviceDetail:!1,chartMultipleVFUs:!1,customSort:g["a"].vuetifyGridSort,selectedDevice:null,selectedLguId:null,offlineFilter:!1,warningFilter:!1,irrigatingFilter:!1,co2ActiveValvesFilter:!1,showLguDetail:!1,zone_id:0,offlineDevices:0,warnDevices:0,zone_type_id:0,zones:[],zone_types:[],zone_devices:[],search:"",activeHeaders:[],advancedHeaders:["Soil EC","Soil Temp","Soil Moisture","Light","Dew Pt","Strain","Days/Flwr","Tkts","Type","Area","Ctrl Version","FW Version","Uptime","IP Address","ID"],table_headers:[{value:"data-table-select",width:35},{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Status",value:"statusicons",sortable:!1,align:"center",width:225},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"State",sortable:!0,align:"center",value:"currentState",width:120},{text:"Temp",value:"temperature",align:"center",width:90},{text:"RH",value:"humidity",align:"center",width:70},{text:"Dew Pt",value:"dewpoint",align:"center",width:50},{text:"Air VPD",value:"vpd",align:"center",width:80},{text:"CO2",value:"co2",align:"center",width:80},{text:"Last Irrigated",value:"lastIrrigated",width:100,align:"center"},{text:"Days/Flwr",value:"daysInFlower",align:"center",width:80},{text:"Strain",value:"strainName",align:"left",width:120},{text:"Soil EC",value:"xFertility",align:"right",width:100},{text:"Soil Temp",value:"xTemp",align:"right",width:100},{text:"Soil Moisture",value:"xMoisture",align:"center",width:100},{text:"Light",value:"xLux",align:"right",width:100},{text:"Tkts",value:"ticketCount",align:"center"},{text:"Type",value:"platformGroupType",align:"center"},{text:"IP Address",value:"ipAddress",align:"center"},{text:"Area",value:"area",align:"center",width:200},{text:"Ctrl Version",value:"softwareVersion",align:"center",width:175},{text:"FW Version",value:"firmwareVersion",align:"center",width:100},{text:"ID",value:"controller_id",align:"center",width:100},{text:"Uptime",value:"uptime",align:"center",width:150},{text:"Updated",value:"lastCommandFetch",align:"center",width:120},{text:"",value:"data-table-expand"}],displayUnitsHeaders:{2:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],3:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],4:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],5:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}]},eventSource:null,platformGroups:{},platformGroupDisplayRecords:{},filteredZoneDevices:[],filteredZoneDevicesIndex:{},filteredZoneControllerIndex:{},isLoaded:!1,showContextMenu:!1,contextMenuX:0,contextMenuY:0,selectedCurtainsAction:null,isLockingEnabled:!1,isLockingColumns:!1,recMove:null,isMovingPlatformGroup:!1,isUpgradingFirmware:!1,isUpdatingHostname:!1,alphabet:[],showIrrigationSummary:!1,dashboardDisplayTypes:[],selectedDisplayTypes:[],openPanel:null,maximizedDisplayType:null}},computed:Mt(Mt(Mt(Mt(Mt({},Object(m["c"])(["getUser","zonesList","pgusLoading","pgusList","userData"])),Object(m["c"])("universalDashboard",["selectedBatchAction","isPerformingContextMenuAction","selectedContextMenuItem","selectedUnits"])),Object(m["c"])("socketMessages",["getLastEventReceivedForControllerId"])),Object(m["c"])("batchActions",["isBatchActionRunning"])),{},{lastEventReceived:function(){return this.selectedContextMenuItem?this.getLastEventReceivedForControllerId(this.selectedContextMenuItem.controller_id):null},panelClass:function(){return this.maximizedDisplayType?"panel-height-1":"panel-height-"+this.selectedDisplayTypes.length},deviceControlHeight:function(){return"sm"==this.$vuetify.breakpoint.name?"90vh":"80vh"},nonContextBatchActions:function(){return this.batchActions.filter((function(t){return!t.contextOnly}))},filteredEcuActions:function(){return this.batchActions?this.batchActions.filter((function(t){return t.deviceType&&"ECU"===t.deviceType})):[]},userPlatformNamePreference:function(){return this.getUser.preferences.find((function(t){return"full-unit-name"===t.preference}))},userUnitPreference:function(){return this.getUser.preferences.find((function(t){return"units"===t.preference}))},userStateMenuPreference:function(){return this.getUser.preferences.find((function(t){return"Preferred VFU State Interaction"===t.preference}))},standardHeaders:function(){var t=this;return t.table_headers.filter((function(e){return!t.advancedHeaders.includes(e.text)}))},filteredHeaders:function(){var t=this;return"standard"===t.viewType?t.table_headers.filter((function(e){return!t.advancedHeaders.includes(e.text)})):t.table_headers},statusWarningMessage:function(){return this.warningFilter?"Show All":this.warnDevices+" warning"},statusErrorMessage:function(){return this.offlineFilter?"Show All":this.offlineDevices+" off-line"},vfuParams:function(){return{facility_id:this.facilityId,access_token:this.getUser.apitoken}},pguParams:function(){var t=this,e={where:{deviceType_id:16,facility_id:this.facilityId}};if(this.zone_id&&this.zone_id>0&&(e.where.zone_id=this.zone_id),this.zone_type_id){var r=this.zone_types.find((function(e){return e.zoneTypeName==t.zone_type_id}));r&&r.id&&(e.where.zoneType_id=r.id)}return"access_token=".concat(this.getUser.apitoken,"&filter=").concat(encodeURI(JSON.stringify(e)))},userIsAdmin:function(){return g["a"].isAdmin(this.getUser)}}),watch:{displayUnits:function(t){this.vfusList=t;for(var e=0;e<this.vfusList.length;e++)this.platformGroups[this.vfusList[e].platformGroup_id]=this.vfusList[e];this.onVfusListChange(this.vfusList);for(var r={},n=0;n<this.vfusList.length;n++){var i=this.vfusList[n].platformGroupName.split("-");3==i.length?r[i[1].charAt(0)]=i[1].charAt(0):2==i.length&&(r[i[0].charAt(0)]=i[0].charAt(0))}this.alphabet=r,this.readyToDisplay=!0,this.vfusLoading=!1},isActivePanel:function(t,e){t&&t!==e&&this.refresh()},facilityMaps:function(t){var e=this;t.length>0&&g["a"].get("vUserPreferences",this.getUser.apitoken,{filter:{where:{users_id:this.getUser.id,ag_preferences_id:4}}}).then((function(t){var r=kt(t,2),n=r[0],i=(r[1],n[0].setting||n[0].defaultSetting);"Floorplan"==i&&(e.selectedSlide=1)}))},showContextMenu:function(t){this.isScrolling=t,t||(this.isPerformingContextMenuAction=!1)},search:function(t){this.setFilteredZoneDevices()},searchText:function(t){this.search=t},filteredZoneDevices:function(){""!==this.searchText&&this.$emit("searched-length",this.filteredZoneDevices.length)},pgusList:function(t){var e=[];t&&t.length&&(t.forEach((function(t){t.type="pgu",e.push(t)})),this.zone_devices=this.zone_devices.concat(e))},zonesList:function(t){this.zones=[{id:0,zonename:"-- None --"}],t&&t.length&&(this.zones=this.zones.concat(t))},zone_id:function(t){this.zone_devices=[],this.getControllerData()},zone_type_id:function(t){this.zone_devices=[];var e=this.zone_types.find((function(e){return e.zoneTypeName==t}));this.getControllerData(),this.getZones({apitoken:this.getUser.apitoken,facility_id:this.facilityId,zone_type_id:e.id})}},beforeMount:function(){var t=Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"}),e=this;"dev"===t.VUE_APP_env&&(this.isDemo=!0),e.isAdmin=g["a"].isAdmin(this.getUser)||g["a"].isUserInRole(this.getUser,"Maintenance"),e.activeHeaders=this.standardHeaders,this.getGridColumns(this.gridName,(function(t){e.activeHeaders=t})),this.flushQueueHandle=setInterval(this.flushDisplayRecQueue,1500),this.vpdAdjustment=-1*localStorage.getItem("leafVpdOffset"),this.doFacilityRefresh(),this.initFloorplans({getFacility:!1}),this.$store.dispatch("batchActions/loadBatchActions")},mounted:function(){tt["a"].$on("facility-websocket-restart",this.refresh),"present"==this.$route.params.mode&&tt["a"].$emit("present"),this.$route.query.search&&(this.search=this.$route.query.search)},beforeDestroy:function(){clearInterval(this.flushQueueHandle)},methods:Mt(Mt({isExpanded:function(t){var e=this.expanded.find((function(e){return e.id===t.id}));return!!e},automaticPlantFilter:function(){this.autoPlantFilter=!this.autoPlantFilter,this.autoPlantFilter?this.filteredZoneDevices=this.zone_devices.filter((function(t){return"AUTOMATIC"===t.mode&&t.hasLifecycles})).sort((function(t,e){return t.lastIrrigated>e.lastIrrigated?-1:1})):this.filteredZoneDevices=this.zone_devices},onGridColumnChange:function(t){this.activeHeaders=t},onDisplaySelectionChange:function(t){this.selectedDisplayTypes=t},changeGridLayout:function(){this.$refs.GridColumnSelector.show()},enableLocking:function(){var t=this;this.isLockingColumns=!0,setTimeout((function(){t.isLockingEnabled=!0}),250)}},Object(m["b"])(["getZones","storeControllerCommand"])),{},{showPlantFinder:function(){this.$refs.plantfinder.show()},flushDisplayRecQueue:function(){if(this.isScrolling)return!1;for(var t in this.pagination.disabled=!0,this.displayRecQueue){var e=this.filteredZoneDevicesIndex[t];if(e){for(var r in delete this.displayRecQueue[t].changedProps,this.displayRecQueue[t])e[r]=this.displayRecQueue[t][r];e=this.onVfuDataChange(e)}else console.warn("displayRecRef not found for ",t)}this.displayRecQueue={},this.pagination.disabled=!1,this.refreshLights()},refreshLights:S()((function(){var t=this,e=Ct(this.refreshLightIntensityQueue);this.refreshLightIntensityQueue=[],e.length>0&&g["a"].get("platformGroupLightsViews",this.getUser.apitoken,{filter:{where:{controller_id:{inq:e}}}}).then((function(e){for(var r=kt(e,2),n=r[0],i=(r[1],0);i<n.length;i++){var a=t.filteredZoneDevicesIndex[n[i].platformGroup_id];a.lightIntensityAverage=Math.round(100*n[i].lightIntensityAverage)}}))}),250),setFilteredZoneDevices:S()((function(){for(var t=this.zone_devices,e=new Set,r=0;r<t.length;r++)e.add(t[r].platformGroupName.substring(0,2));if(this.mobileFilters=Array.from(e),this.mobileFilters.push("*"),this.warningFilter&&(t=t.filter((function(t){return"WARN"==t.state}))),this.offlineFilter&&(t=t.filter((function(t){return"OFFLINE"==t.state}))),this.irrigatingFilter&&(t=t.filter((function(t){return"ON"==t.irrigationState}))),this.co2ActiveValvesFilter&&(t=t.filter((function(t){return"ON"==t.co2ValveState}))),this.search){var n=this.search.toUpperCase();t=t.filter((function(t){return t.platformGroupName.toUpperCase().indexOf(n)>=0||t.currentState&&t.currentState.toUpperCase().indexOf(n)>=0}))}for(var i=0;i<t.length;i++)this.filteredZoneDevicesIndex[t[i].platformGroup_id]=t[i],this.filteredZoneControllerIndex[t[i].controller_id]||(this.filteredZoneControllerIndex[t[i].controller_id]=[]),this.filteredZoneControllerIndex[t[i].controller_id].push(t[i]),t[i].updated=y()(t[i].lastCommandFetch).fromNow();this.filteredZoneDevices=t}),300),onVfusListChange:function(t){var e=this,r=[],n=0,i=0,a=0,o=0;t&&t.length&&t.forEach((function(t){"ON"===t.co2ValveState&&o++,"ON"==t.irrigationState&&a++,t.deployed&&("WARN"===t.state?i++:"OFFLINE"===t.state&&n++),e.platformGroupDisplayRecords[t.platformGroup_id]=t,r.push(t)}));for(var s=0;s<r.length;s++)A["default"].set(this.zone_devices,this.zone_devices.length,r[s]);this.offlineDevices=n,this.warnDevices=i,this.irrDevices=a,this.co2DevicesOpen=o,this.setFilteredZoneDevices()},getVfus:function(){this.vfusLoading=!0,this.$emit("do-refresh")},getControllerData:function(){this.getVfus()},isVisibleDisplayUnitType:function(t){return 1===t?this.selectedDisplayTypes.find((function(e){return e.id===t}))&&this.zone_devices&&this.zone_devices.length&&(!this.maximizedDisplayType||this.maximizedDisplayType===t):this.selectedDisplayTypes.find((function(e){return e.id===t}))&&this.displayUnits[t]&&this.displayUnits[t].length&&(!this.maximizedDisplayType||this.maximizedDisplayType===t)},openBatchActionSelect:function(){this.$refs["batchActionSelect"].focus(),this.$refs["batchActionSelect"].activateMenu()},onChangeBatchAction:function(t){this.$store.dispatch("batchActions/changeBatchAction",t)},refreshExceptionCount:function(){var t=this;g["a"].get("ExceptionLists/count",t.getUser.apitoken,{where:{facility_id:t.facilityId,resolvedOn:null,escalationLevel:1}}).then((function(e){t.issueCount=e[0].count}))},onShowExceptions:function(t){this.selectedDevice=t,this.displayAlerts=!0},doFacilityRefresh:function(){var t=this,e=this;g["a"].get("facilities/"+this.facilityId,this.getUser.apitoken,{filter:{fields:["co2Enabled","commandCommunicationsType"]}}).then((function(t){var r=kt(t,2),n=r[0];r[1];e.facility=n})),this.refreshExceptionCount(),this.lastUpdateRecieved=y()(),g["a"].get("ag_dashboardDisplayTypes",this.getUser.apitoken).then((function(e){var r=kt(e,2),n=r[0];r[1];t.dashboardDisplayTypes=n,t.selectedDisplayTypes=Ct(n)}))},refresh:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.isActivePanel&&(!this.isLoaded||e)){var r=this;Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"});r.dataChanged=!1,r.zone_devices=[],r.vfusLoading=!0,this.isLoaded=!0,r.getControllerData()}},toggleErrorView:function(){this.irrigatingFilter=!1,this.warningFilter=!1,this.co2ActiveValvesFilter=!1,this.offlineFilter=!this.offlineFilter,this.setFilteredZoneDevices()},toggleWarningView:function(){this.irrigatingFilter=!1,this.offlineFilter=!1,this.co2ActiveValvesFilter=!1,this.warningFilter=!this.warningFilter,this.setFilteredZoneDevices()},toggleIrrigatingView:function(){this.irrigatingFilter=!this.irrigatingFilter,this.offlineFilter=!1,this.warningFilter=!1,this.co2ActiveValvesFilter=!1,this.setFilteredZoneDevices()},toggleCo2ValvesView:function(){this.co2ActiveValvesFilter=!this.co2ActiveValvesFilter,this.irrigatingFilter=!1,this.offlineFilter=!1,this.warningFilter=!1,this.setFilteredZoneDevices()}})},$t=Rt,Ht=(r("14fc"),r("2877")),Vt=Object(Ht["a"])($t,I,L,!1,null,null,null),Bt=Vt.exports,zt=r("faef"),Yt=r("d84a"),qt=r("8fea"),Wt=function(){var t=this,e=t._self._c;return e(s["a"],{directives:[{name:"show",rawName:"v-show",value:t.isVisibleDisplayUnitType,expression:"isVisibleDisplayUnitType"}],staticClass:"flex-grow-auto flex-column",class:{"d-flex":t.isVisibleDisplayUnitType}},[e(c["a"],{staticClass:"d-flex justify-between"},[e("span",{staticClass:"flex-grow-auto"},[t._v(t._s(t.displayUnits.length)+" Plant Platforms")])]),e(l["a"],{staticClass:"flex-grow-auto"},[e("locked-column-datatable",{attrs:{items:t.filteredDisplayUnits,"max-locked-index":2,sm:"",md:"",lg:"","is-locking-enabled":t.isLockingEnabled},scopedSlots:t._u([{key:"default",fn:function(r){return[e(qt["a"],{attrs:{loading:t.displayUnitsLoading,headers:t.displayUnitsHeaders,items:t.filteredDisplayUnits,options:t.pagination,"must-sort":"","fixed-header":"",height:t.filteredDisplayUnits.length<250?"100%":"calc(100% - 59px)","mobile-breakpoint":"0","items-per-page":-1,expanded:t.displayUnitsExpanded,"item-key":"platformGroup_id","footer-props":t.footerprops,"hide-default-footer":t.filteredDisplayUnits.length<250,dense:"","show-expand":""},on:{"update:expanded":function(e){t.displayUnitsExpanded=e},"update:options":r.updated},scopedSlots:t._u([{key:"item.actions",fn:function(r){var i=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},attrs:{id:"pg-"+i.platformGroup_id}},[e("span",{attrs:{title:i.title}},[e(n["a"],{attrs:{icon:""},on:{click:function(e){return t.goToDevice(i)}}},[e(d["a"],{attrs:{color:i.infoIconColor}},[t._v("info")])],1)],1)])]}},{key:"item.hasLifecycles",fn:function(r){return[r.item.lifecycles?[e("span",{staticClass:"iconBtn",on:{click:function(e){return t.onShowDisplayUnitLifecycle(r.item,2)}}},[r.item.pestDetected?[e("span",{attrs:{title:r.item.lifecyclesTooltip+" -- PEST DETECTED"}},[e(d["a"],{attrs:{color:"red"}},[t._v("local_florist")])],1)]:[e("span",{attrs:{title:r.item.lifecyclesTooltip}},[e(d["a"],{attrs:{color:"green"}},[t._v("local_florist")])],1)]],2)]:[e("span",{attrs:{title:"No Lifecycles"}},[e(d["a"],{attrs:{color:"silver"}},[t._v("local_florist")])],1)]]}},{key:"expanded-item",fn:function(r){r.headers;var i=r.item;return[e("td",{attrs:{colspan:t.displayUnitsHeaders.length}},[t._l(i.lifecycles,(function(r,a){return e("div",{key:"lifecycle-".concat(a),staticClass:"text-center",staticStyle:{padding:"10px"}},[e("div",{staticStyle:{display:"inline-block","margin-right":"5px",width:"95%"}},[e(j["a"],{staticClass:"text-left",attrs:{"no-gutters":""}},[e(T["a"],{attrs:{cols:"12"}},[e("div",{staticClass:"d-flex justify-space-between"},[e("strong",[t._v("Lifecycle "+t._s(r.lifecycle_id)+" :\n                          "+t._s(r.growplanName)+", started on\n                          "+t._s(t.moment(r.lifecycleStarttime).format("MM/DD/YYYY"))+"\n                          - Day\n                          "+t._s(t.moment().diff(t.moment(r.lifecycleStarttime),"days")))]),e("div",{staticStyle:{display:"inline-block","white-space":"nowrap"}},[e("span",{attrs:{title:"Run Plant-Touching Task"}},[e(n["a"],{staticClass:"mr-1",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.createOperationalTask2(r.growplan_id,r.lifecycle_id)}}},[t._v("Run Task")])],1),e("span",{attrs:{title:"Review/Edit Phase Parameters"}},[e(n["a"],{staticClass:"mr-1",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.onEditPhase(r.currentPhase)}}},[t._v("Edit Phase")])],1),t.isAdmin?e("span",{attrs:{title:"Enable/Disable"}},[e(n["a"],{staticClass:"mr-1",attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.onToggleLifecycle(r)}}},[t._v(t._s(r.isSuspended?"Resume":"Suspend"))])],1):t._e()])]),t.isExpanded(i)?e("lifecycle-platforms",{attrs:{"lifecycle-id":r.lifecycle_id}}):t._e(),e("div",[t._v("Strain: "+t._s(r.strainName))]),r.currentPhase?e("div",{staticClass:"isClickable",on:{click:function(e){return t.onEditPhase(r.currentPhase)}}},[t._v("\n                        Phase:\n                        "+t._s(r.currentPhase.growPhaseName)+"\n                        "),e("br"),t._v("Started on\n                        "),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.currentPhase.starttime))}}),t._v(". Ending on\n                        "),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.currentPhase.scheduledEnd))}}),t._v("\n                        . (Day "+t._s(r.daysInPhase)+" of\n                        "+t._s(r.totalDaysInPhase)+")\n                      ")]):t._e(),t._v("\n                      Plants: "+t._s(r.plants)+"\n                      "),e("br"),r.currentPhase?e("div",[t._v("\n                        "+t._s(t.getPhotoPeriodText(r))+"\n                      ")]):e("div",[t._v("\n                        Error - could not get the current growth\n                        phase\n                      ")]),e("br")],1)],1)],1)])}))],2)]}}],null,!0)})]}}])})],1),e("edit-phase-modal",{on:{refresh:t.refresh},model:{value:t.growPhase_id,callback:function(e){t.growPhase_id=e},expression:"growPhase_id"}})],1)},Jt=[];function Zt(t){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(t)}function Xt(t,e){return re(t)||ee(t,e)||Qt(t,e)||Kt()}function Kt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Qt(t,e){if(t){if("string"==typeof t)return te(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?te(t,e):void 0}}function te(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ee(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function re(t){if(Array.isArray(t))return t}function ne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ie(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ne(Object(r),!0).forEach((function(e){ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ae(t,e,r){return(e=oe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oe(t){var e=se(t,"string");return"symbol"==Zt(e)?e:e+""}function se(t,e){if("object"!=Zt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var le={name:"PlantPlatformExpansionPanelOld",mixins:[w["a"]],components:{UnitResults:St["a"],LifecyclePlatforms:wt["a"],LockedColumnDatatable:q["a"],EditPhaseModal:W["a"]},props:{selectedDisplayTypes:{type:Array,required:!1,default:function(){return[]}},displayUnits:{type:Array,required:!1,default:function(){return[]}},maximizedDisplayType:{type:Number,required:!1,default:function(){return null}},isLockingEnabled:{type:Boolean,required:!1,default:function(){return!1}},isLockingColumns:{type:Boolean,required:!1,default:function(){return!1}},displayUnitsLoading:{type:Boolean,required:!1,default:function(){return!1}},searchText:{type:String,required:!1,default:function(){return""}}},data:function(){return{moment:y.a,pagination:{itemsPerPage:250},footerprops:{"items-per-page-options":[25,50,75,100,250]},displayUnitsHeaders:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],displayUnitsExpanded:[],growPhase_id:null,isAdmin:!1}},computed:ie(ie({},Object(m["c"])(["getUser"])),{},{isVisibleDisplayUnitType:function(){return this.selectedDisplayTypes.find((function(t){return 2===t.id}))&&this.displayUnits&&this.displayUnits.length&&(!this.maximizedDisplayType||2===this.maximizedDisplayType)},filteredDisplayUnits:function(){var t=this;return""!==this.searchText&&this.searchText?this.displayUnits.filter((function(e){return e.platformGroupName.toLowerCase().includes(t.searchText.toLowerCase())})):this.displayUnits}}),beforeMount:function(){this.isAdmin=g["a"].isAdmin(this.getUser)||g["a"].isUserInRole(this.getUser,"Maintenance")},watch:{filteredDisplayUnits:function(){""!==this.searchText&&this.$emit("searched-length",this.filteredDisplayUnits.length)}},methods:{isExpanded:function(t){var e=this.displayUnitsExpanded.find((function(e){return e.id===t.id}));return!!e},fullscreenPanel:function(){this.$emit("fullscreen-panel",2)},minimizePanel:function(){this.$emit("minimize-panel")},refresh:function(){this.$emit("refresh")},goToDevice:function(){},onShowDisplayUnitLifecycle:function(t){var e=this.displayUnitsExpanded.findIndex((function(e){return e.platformGroup_id===t.platformGroup_id}));-1===e?this.displayUnitsExpanded.push(t):this.displayUnitsExpanded.splice(e,1)},createOperationalTask2:function(t,e){this.$router.push({name:"operational-task",params:{growplanId:t,lifecycleId:e}})},onEditPhase:function(t){this.growPhase_id=t.id},onToggleLifecycle:function(t){var e=this,r="";r=t.isSuspended?"Resume Lifecycle  "+t.lifecycle_id+"?":"Suspend Lifecycle  "+t.lifecycle_id+"?",ft["a"].confirm("Please Confirm",r,(function(r){r&&g["a"].post("ag_lifecycles/toggleSuspend",e.getUser.apitoken,{lifecycle_id:t.lifecycle_id}).then((function(e){var r=Xt(e,2),n=r[0];r[1];n?(U["a"].success("Function Complete"),t.isSuspended=!t.isSuspended):U["a"].error("An error occurred. Please try again later")}))}))},getPhotoPeriodText:function(t){var e="Photo period: "+t.currentPhase.photoperiod+" hours at ";return t.currentPhase.photoPeriodIntensity!==t.currentPhase.photoPeriodInterlightIntensity?(e+=100*t.currentPhase.photoPeriodIntensity+"% Downlight, ",e+=Math.round(100*t.currentPhase.photoPeriodInterlightIntensity)+"% Interlight intensity, "):e+=Math.round(100*t.currentPhase.photoPeriodIntensity)+"% intensity, ",e+="starting at "+this.convertTime(t.currentPhase.photoperiodStartTime)+".",e},convertTime:function(t){return 12===+this.$root.timePreference?y.a.utc(t,"HH:mm").add(this.getUser.facility_UTCOffset,"hours").format("h:mm a"):y.a.utc(t,"HH:mm").local().format("h:mm a")}}},ce=le,ue=Object(Ht["a"])(ce,Wt,Jt,!1,null,null,null),de=ue.exports;function he(t){return me(t)||pe(t)||we(t)||fe()}function fe(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pe(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function me(t){if(Array.isArray(t))return xe(t)}function ve(t){return ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(t)}function ye(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ye=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==ve(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(ve(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ge(t,e){return _e(t)||Se(t,e)||we(t,e)||be()}function be(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(t,e){if(t){if("string"==typeof t)return xe(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xe(t,e):void 0}}function xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Se(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function _e(t){if(Array.isArray(t))return t}function Ce(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Oe(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){Ce(a,n,i,o,s,"next",t)}function s(t){Ce(a,n,i,o,s,"throw",t)}o(void 0)}))}}function Pe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function De(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Pe(Object(r),!0).forEach((function(e){ke(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ke(t,e,r){return(e=Te(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Te(t){var e=je(t,"string");return"symbol"==ve(e)?e:e+""}function je(t,e){if("object"!=ve(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Ee={name:"AreaExpansionPanel",mixins:[w["a"],b["a"],_["a"],C["a"]],components:{PlantPlatformExpansionPanelOld:de,UnitSearchResults:zt["a"],DisplayFacilityMap:pt["a"],GrowUnitExpansionPanel:Bt,CuringUnitExpansionPanel:k["a"],DryingUnitExpansionPanel:D["a"],BuckingUnitExpansionPanel:P["a"],PlantPlatformExpansionPanel:O["a"]},props:{facilityId:{type:Number,required:!0},area:{type:Object,required:!0},isActivePanel:{type:Boolean,required:!1,default:function(){return!1}}},data:function(){return{showFacilityMap:!1,facilityMap:null,isAdmin:!1,Trimaster:g["a"],expanded:[],pagination:{itemsPerPage:250},vpdAdjustment:0,footerprops:{"items-per-page-options":[25,50,75,100,250]},moment:y.a,isScrolling:!1,isDemo:!1,facility:null,expand:!1,showLguDetail:!1,selected:[],search:"",activeHeaders:[],advancedHeaders:["Soil EC","Soil Temp","Soil Moisture","Light","Dew Pt","Strain","Days/Flwr","Tkts","Type","Area","Ctrl Version","FW Version","Uptime","IP Address","ID"],table_headers:[{value:"data-table-select",width:35},{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Status",value:"statusicons",sortable:!1,align:"center",width:225},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"State",sortable:!0,align:"center",value:"currentState",width:120},{text:"Temp",value:"temperature",align:"center",width:90},{text:"RH",value:"humidity",align:"center",width:70},{text:"Dew Pt",value:"dewpoint",align:"center",width:50},{text:"Air VPD",value:"vpd",align:"center",width:80},{text:"CO2",value:"co2",align:"center",width:80},{text:"Last Irrigated",value:"lastIrrigated",width:100,align:"center"},{text:"Days/Flwr",value:"daysInFlower",align:"center",width:80},{text:"Strain",value:"strainName",align:"left",width:120},{text:"Soil EC",value:"xFertility",align:"right",width:100},{text:"Soil Temp",value:"xTemp",align:"right",width:100},{text:"Soil Moisture",value:"xMoisture",align:"center",width:100},{text:"Light",value:"xLux",align:"right",width:100},{text:"Tkts",value:"ticketCount",align:"center"},{text:"Type",value:"platformGroupType",align:"center"},{text:"IP Address",value:"ipAddress",align:"center"},{text:"Area",value:"area",align:"center",width:200},{text:"Ctrl Version",value:"softwareVersion",align:"center",width:175},{text:"FW Version",value:"firmwareVersion",align:"center",width:100},{text:"ID",value:"controller_id",align:"center",width:100},{text:"Uptime",value:"uptime",align:"center",width:150},{text:"Updated",value:"lastCommandFetch",align:"center",width:120},{text:"",value:"data-table-expand"}],displayUnitsHeaders:{2:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],3:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],4:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],5:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}]},displayUnitsExpanded:{2:[],3:[],4:[],5:[]},eventSource:null,platformGroups:{},platformGroupDisplayRecords:{},filteredZoneDevices:[],filteredZoneDevicesIndex:{},filteredZoneControllerIndex:{},lastEventReceived:null,isLoading:!1,isLoaded:!1,showContextMenu:!1,contextMenuX:0,contextMenuY:0,selectedContextMenuItem:null,showStateContextMenu:!1,stateContextMenuX:0,stateContextMenuY:0,selectedCurtainsAction:null,showDeviceHistory:!1,isLockingEnabled:!1,isLockingColumns:!1,recMove:null,isMovingPlatformGroup:!1,isUpgradingFirmware:!1,isUpdatingHostname:!1,alphabet:[],showIrrigationSummary:!1,dashboardDisplayTypes:[],selectedDisplayTypes:[],openPanel:0,displayUnitsLoading:{1:!1,2:!1,3:!1,4:!1,5:!1},displayUnits:{1:[],2:[],3:[],4:[],5:[]},maximizedDisplayType:null,growUnitResultsCount:0,plantPlatformResultsCount:0,buckingUnitResultsCount:0,dryingUnitResultsCount:0,curingUnitResultsCount:0}},computed:De(De(De({},Object(m["c"])(["getUser","zonesList","pgusLoading","pgusList","userData"])),Object(m["c"])("universalDashboard",["searchResultUnits","activeSearch"])),{},{panelClass:function(){return this.maximizedDisplayType?"panel-height-1":"panel-height-"+this.selectedDisplayTypes.length},userIsAdmin:function(){return g["a"].isAdmin(this.getUser)},isMultiple:function(){return!!this.search&&""!==this.search},totalResultsCount:function(){return this.growUnitResultsCount+this.plantPlatformResultsCount+this.buckingUnitResultsCount+this.dryingUnitResultsCount+this.curingUnitResultsCount}}),watch:{isActivePanel:function(t,e){t&&t!==e&&this.refresh()},search:S()((function(t){t&&""!==t||(this.openPanel=0,this.$store.dispatch("universalDashboard/setActiveSearch",{activeSearchLevel:null,activeSearchId:null})),this.$store.dispatch("universalDashboard/searchUnits",{facility_id:this.facilityId,area_id:this.area.id,page:1,search:"%".concat(t,"%")})}),500),totalResultsCount:S()((function(t){if(this.search&&this.search.length>0&&0===t)this.openPanel=[];else if(this.search&&0!==this.search.length){if(this.search&&this.search.length>0&&0!==t){var e=[];this.growUnitResultsCount&&e.push(0),this.plantPlatformResultsCount&&e.push(1),this.buckingUnitResultsCount&&e.push(2),this.dryingUnitResultsCount&&e.push(3),this.curingUnitResultsCount&&e.push(4),this.openPanel=e}}else this.openPanel=0}),250),activeSearch:{handler:function(t){var e=this;"area"===t.activeSearchLevel&&t.activeSearchId===this.area.id&&this.$nextTick((function(){e.$refs.areaSearch.focus()}))},deep:!0}},beforeMount:function(){var t=Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"}),e=this;"dev"===t.VUE_APP_env&&(this.isDemo=!0),e.isAdmin=g["a"].isAdmin(this.getUser)||g["a"].isUserInRole(this.getUser,"Maintenance"),tt["a"].$on("universal-dashboard-refresh",this.dashboardRefresh),this.refresh()},unmounted:function(){tt["a"].$off("universal-dashboard-refresh",this.dashboardRefresh)},methods:{dashboardRefresh:function(){this.search&&""!==this.search?this.$store.dispatch("universalDashboard/searchUnits",{facility_id:this.facilityId,area_id:this.area.id,page:1,search:"%".concat(this.search,"%")}):this.refresh()},showAreaSearch:function(){this.$store.dispatch("universalDashboard/setActiveSearch",{activeSearchLevel:"area",activeSearchId:this.area.id})},loadFacilityMap:function(){var t=this;return Oe(ye().mark((function e(){var r,n;return ye().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,g["a"].get("ag_facilityMaps",t.getUser.apitoken,{filter:{order:"label",include:[{relation:"agFacilitymaphotspots",scope:{include:["camera"]}}],where:{facility_id:t.getUser.facility_id,ag_areas_id:t.area.id}}});case 2:r=e.sent,n=ge(r,2),n[0],n[1],t.facilityMap=null;case 7:case"end":return e.stop()}}),e)})))()},onShowFacilityMap:function(){this.showFacilityMap=!0},onPreventSpace:function(){this.search+=" "},getDashboardDisplayUnitsStatus:function(){var t=this;return Oe(ye().mark((function e(){var r,n,i,a;return ye().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.displayUnitsLoading[1]=!0,t.displayUnitsLoading[2]=!0,t.displayUnitsLoading[3]=!0,t.displayUnitsLoading[4]=!0,t.displayUnitsLoading[5]=!0,e.next=7,g["a"].get("ag_platformGroups/getStatusByDisplayType",t.getUser.apitoken,{facility_id:t.facilityId,area_id:t.area.id});case 7:r=e.sent,n=ge(r,2),i=n[0],n[1],a={1:[],2:[],3:[],4:[],5:[]},i.forEach((function(e){var r=Object(Yt["d"])(e,"VFU");t.platformGroupDisplayRecords[r.platformGroup_id]=r,a[r.dashboardDisplayType_id].push(r)})),t.displayUnits=De({},a),t.displayUnitsLoading[1]=!1,t.displayUnitsLoading[2]=!1,t.displayUnitsLoading[3]=!1,t.displayUnitsLoading[4]=!1,t.displayUnitsLoading[5]=!1;case 19:case"end":return e.stop()}}),e)})))()},getDashboardDisplayUnitStatus:function(t){var e=this;return Oe(ye().mark((function r(){var n,i,a;return ye().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.displayUnitsLoading[t]=!0,r.next=3,g["a"].get("ag_platformGroups/getStatusByDisplayType",e.getUser.apitoken,{facility_id:e.facilityId,dashboardDisplayType_id:t,area_id:e.area.id});case 3:n=r.sent,i=ge(n,2),a=i[0],i[1],e.displayUnits[t]=a.map((function(t){if(t.lifecycles)for(var e=0;e<t.lifecycles.length;e++)if("object"==ve(t.lifecycles[e].currentPhase)){t.lifecycles[e].daysInPhase=y()().diff(y()(t.lifecycles[e].currentPhase.starttime),"days")+1;var r=t.lifecycles[e].currentPhase.scheduledEnd;t.lifecycles[e].totalDaysInPhase=y()(r).diff(y()(t.lifecycles[e].currentPhase.starttime),"days")+1}return t})),e.displayUnitsLoading[t]=!1;case 9:case"end":return r.stop()}}),r)})))()},fullscreenPanel:function(t){this.openPanel=t-1,this.maximizedDisplayType=t},minimizePanel:function(){this.openPanel=this.maximizedDisplayType-1,this.maximizedDisplayType=null},onGrowUnitSearch:function(t){this.growUnitResultsCount=t},onPlantPlatformSearch:function(t){this.plantPlatformResultsCount=t},onBuckingSearch:function(t){this.buckingUnitResultsCount=t},onDryingSearch:function(t){this.dryingUnitResultsCount=t},onCuringSearch:function(t){this.curingUnitResultsCount=t},doRefresh:function(){var t=this;this.isLoading=!0,g["a"].get("facilities/"+this.facilityId,this.getUser.apitoken,{filter:{fields:["co2Enabled","commandCommunicationsType"]}}).then((function(e){var r=ge(e,2),n=r[0];r[1];t.facility=n,t.loadFacilityMap(),Promise.all([t.getDashboardDisplayUnitsStatus()]).then((function(){t.isLoading=!1}))})),g["a"].get("ag_dashboardDisplayTypes",this.getUser.apitoken).then((function(e){var r=ge(e,2),n=r[0];r[1];t.dashboardDisplayTypes=n,t.selectedDisplayTypes=he(n)}))},refresh:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!this.isActivePanel||this.isLoaded&&!e||(this.isLoaded=!0,this.doRefresh())}}},Ie=Ee,Le=(r("9697"),Object(Ht["a"])(Ie,f,p,!1,null,null,null));e["a"]=Le.exports},"2a7f":function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r("71d9"),i=r("80d2");const a=Object(i["k"])("v-toolbar__title"),o=Object(i["k"])("v-toolbar__items");n["a"]},"2bdd":function(t,e,r){},"2be8":function(t,e,r){},"2c0d":function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return e("span",{staticStyle:{"white-space":"nowrap"}},[t.item.deployed?[e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected&&!t.getUser.facility.lockLights},staticStyle:{"padding-left":"5px"},on:{click:t.onIntensityClick}},[t.item.lightState?e("light-intensity",{attrs:{iconSize:t.iconSize,lightState:t.item.lightState,lightIntensityAverage:t.item.lightIntensityAverage,disabled:t.item.isDisconnected||t.getUser.facility.lockLights}}):t._e()],1),e("span",{class:{clickable:!t.item.isDisconnected},on:{click:t.onCurtainsClick}},[t.item.curtainState?e("curtain-state",{attrs:{iconSize:t.iconSize,device:t.item,disabled:t.item.isDisconnected},model:{value:t.item.curtainState,callback:function(e){t.$set(t.item,"curtainState",e)},expression:"item.curtainState"}}):t._e()],1),e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected},on:{click:t.onIrrigateClick}},[t.item.irrigationState?e("irrigation-state",{attrs:{iconSize:t.iconSize,disabled:t.item.isDisconnected},model:{value:t.item.irrigationState,callback:function(e){t.$set(t.item,"irrigationState",e)},expression:"item.irrigationState"}}):t._e()],1),e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected},on:{click:t.onCo2Click}},[e("co2-state",{attrs:{iconSize:t.iconSize,facility_co2Enabled:t.facility.co2Enabled,co2Enabled:t.item.co2Enabled,debug:"bug_report"==t.item.infoIcon,disabled:t.item.isDisconnected},model:{value:t.item.co2ValveState,callback:function(e){t.$set(t.item,"co2ValveState",e)},expression:"item.co2ValveState"}})],1),t.item.ECUState?e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected&&t.filteredEcuActions.length},on:{click:t.onEcuClick}},[e("ecu-state",{attrs:{iconSize:t.iconSize,disabled:t.item.isDisconnected},model:{value:t.item.ECUState,callback:function(e){t.$set(t.item,"ECUState",e)},expression:"item.ECUState"}})],1):t._e(),t.item.BardState?e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected},on:{click:function(e){return t.showEcuTransitions(t.item)}}},[e("ecu-state",{attrs:{iconSize:t.iconSize,disabled:t.item.isDisconnected},model:{value:t.item.BardState,callback:function(e){t.$set(t.item,"BardState",e)},expression:"item.BardState"}})],1):t._e(),e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected},on:{click:t.onHumidifierClick}},[e("humidifier-state",{attrs:{disabled:!t.item.vfuHumidifierState||t.item.isDisconnected,iconSize:t.iconSize},model:{value:t.item.vfuHumidifierState,callback:function(e){t.$set(t.item,"vfuHumidifierState",e)},expression:"item.vfuHumidifierState"}})],1),t.item.heaterstripState?e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected},on:{click:function(e){return t.showHeaterStripTransitions(t.item)}}},[e("heaterstrip-state",{attrs:{iconSize:t.iconSize,disabled:t.item.isDisconnected},model:{value:t.item.heaterstripState,callback:function(e){t.$set(t.item,"heaterstripState",e)},expression:"item.heaterstripState"}})],1):t._e(),t.item.vfuDehumidifierState?e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected}},[e("dehumidifier-state",{attrs:{iconSize:t.iconSize,disabled:t.item.isDisconnected},model:{value:t.item.vfuDehumidifierState,callback:function(e){t.$set(t.item,"vfuDehumidifierState",e)},expression:"item.vfuDehumidifierState"}})],1):t._e(),e("span",{class:{clickable:t.isManual&&!t.item.isDisconnected},on:{click:t.onDehumidifierClick}},[e("dehumidifier2-state",{attrs:{iconSize:t.iconSize,disabled:!t.item.vfu2StageDehumidifierState||t.item.isDisconnected},model:{value:t.item.vfu2StageDehumidifierState,callback:function(e){t.$set(t.item,"vfu2StageDehumidifierState",e)},expression:"item.vfu2StageDehumidifierState"}})],1),e("span",{class:{clickable:!t.item.isDisconnected},on:{click:t.onModeClick}},[e("mode-of-operation",{ref:"modeOfOperationWidget",attrs:{iconSize:t.iconSize,disabled:t.item.isDisconnected,item:t.item},model:{value:t.item.mode,callback:function(e){t.$set(t.item,"mode",e)},expression:"item.mode"}})],1)]:[e("span",{staticClass:"oldvalue"},[t._v("NOT DEPLOYED")])]],2)},i=[],a=r("79f8"),o=r("6606"),s=r("60e0"),l=r("2882"),c=r("5961"),u=r("2c14"),d=r("883c"),h=r("5915"),f=r("4fe0"),p=r("0f1f"),m=r("2f62"),v=r("81f6");function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){w(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function w(t,e,r){return(e=x(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x(t){var e=S(t,"string");return"symbol"==y(e)?e:e+""}function S(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var _={name:"DeviceStatusIcons",props:["item","facility","iconSize"],components:{LightIntensity:a["a"],CurtainState:o["a"],IrrigationState:s["a"],Co2State:l["a"],EcuState:c["a"],ModeOfOperation:d["a"],HeaterstripState:u["a"],HumidifierState:h["a"],DehumidifierState:f["a"],Dehumidifier2State:p["a"]},beforeMount:function(){},mounted:function(){},data:function(){return{}},computed:b(b(b({},Object(m["c"])(["getUser"])),Object(m["c"])("batchActions",["batchActions"])),{},{filteredEcuActions:function(){return this.batchActions?this.batchActions.filter((function(t){return t.deviceType&&"ECU"===t.deviceType})):[]},isManual:function(){return"MANUAL"===this.item.mode}}),watch:{},methods:{onIrrigateClick:function(){this.isManual&&this.$emit("batch-action",{item:b({},this.item),actionId:16})},onIntensityClick:function(){this.isManual&&!this.getUser.facility.lockLights&&this.$emit("intensity-action",b({},this.item))},onModeClick:function(){this.$refs.modeOfOperationWidget.isLoading?console.log("blocking mode click"):(this.$emit("batch-action",{item:b({},this.item),actionId:"AUTOMATIC"===this.item.mode?84:83}),v["a"].$emit("mode-of-operation-loading",{platformGroupId:this.item.platformGroup_id,isLoading:!0}),v["a"].$emit("current-state-loading",{platformGroupId:this.item.platformGroup_id,isLoading:!0}))},onCo2Click:function(){this.isManual&&this.$emit("batch-action",{item:b({},this.item),actionId:this.item.co2Enabled?86:85})},onHumidifierClick:function(){if(this.isManual){if(!this.item.vfuHumidifierState)return;this.$emit("batch-action",{item:b({},this.item),actionId:"ON"===this.item.vfuHumidifierState?28:27})}},onDehumidifierClick:function(){if(this.isManual){if(!this.item.vfu2StageDehumidifierState)return;this.$emit("dehumidifier2-action",b({},this.item))}},onCurtainsClick:function(){if(this.item.curtainState){var t=null;if("open"===this.item.curtainState.toLowerCase()||"off"===this.item.curtainState.toLowerCase())t={id:53,label:"Curtains Down"};else{if("closed"!==this.item.curtainState.toLowerCase())return;t={id:52,label:"Curtains Up"}}this.$emit("curtains-action",{action:t,item:b({},this.item)})}},onEcuClick:function(){if(this.isManual){if(!this.item.ECUState)return;this.$emit("ecu-action",b({},this.item))}}}},C=_,O=(r("bba9"),r("2877")),P=Object(O["a"])(C,n,i,!1,null,"48071abe",null);e["a"]=P.exports},"2ec3":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("4bd4"),s=r("132d"),l=r("b974"),c=r("2fa4"),u=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v("Upgrade Firmware"),t.rec?e("span",[t._v(" - "),t.rec.controllerName?e("span",[t._v(t._s(t.rec.controllerName))]):e("span",[t._v(t._s(t.rec.macAddress))])]):t._e()]),e(c["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(s["a"],[t._v("close")])],1)],1),e(a["c"],[e(o["a"],{model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(l["a"],{attrs:{items:t.hardwareProducts,label:"Select Firmware Binary","item-text":"label","item-value":"firmwareBinary",rules:[t.rules.required]},model:{value:t.firmwareBinary,callback:function(e){t.firmwareBinary=e},expression:"firmwareBinary"}})],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.valid},on:{click:t.onSave}},[t._v("Upgrade")])],1)],1)},d=[],h=r("d0eb"),f=r("d67f"),p=r("9c4f"),m=r("2f62");function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function y(t,e){return S(t)||x(t,e)||b(t,e)||g()}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function x(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function S(t){if(Array.isArray(t))return t}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=P(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(t){var e=D(t,"string");return"symbol"==v(e)?e:e+""}function D(t,e){if("object"!=v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var k={name:"EditFirmware",mixins:[p["a"]],props:["value"],components:{},beforeMount:function(){this.value&&(this.rec=C({},this.value)),this.refresh()},mounted:function(){},data:function(){return{valid:!1,rec:null,isLoading:!1,firmwareBinary:null,hardwareProducts:[]}},computed:C({},Object(m["c"])(["getUser"])),watch:{},methods:{refresh:function(){var t=this;h["a"].get("hardware_products",this.getUser.apitoken,{filter:{where:{firmwareBinary:{neq:null}}}}).then((function(e){var r=y(e,2),n=r[0];r[1];t.hardwareProducts=n,t.firmwareBinary=n[n.length-1].firmwareBinary}))},onClose:function(){this.$emit("close")},onSave:function(){this.valid?this.$emit("save",this.firmwareBinary):f["a"].error("Form Entries Incomplete or Invalid")}}},T=k,j=r("2877"),E=Object(j["a"])(T,u,d,!1,null,null,null);e["a"]=E.exports},"2ed8":function(t,e,r){},"2fa3":function(t,e,r){"use strict";var n=r("8fea"),i=r("132d"),a=r("3a2f"),o=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ipmscoutingreportviewer h-100"},[e(n["a"],{staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,items:t.items,"hide-default-footer":"",loading:t.isLoading,"fixed-header":"",height:"100%",options:t.pagination},scopedSlots:t._u([{key:"item.begintime",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.begintime))}})]}},{key:"item.pestDetected",fn:function(e){var r=e.item;return[t._v(t._s(r.pestDetected?"Yes":"No"))]}},{key:"item.fileUploadUrl1",fn:function(r){var n=r.item;return[n.fileUploadUrl1||n.fileUploadUrl2||n.fileUploadUrl3?e(a["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(i["a"],t._g({on:{click:function(e){return t.onDisplayImages(n)}}},a),[t._v("collections")])]}}],null,!0)},[e("span",[t._v("Click to view images")])]):t._e()]}}])}),e("loading",{attrs:{show:t.isLoading}}),t.showViewer?e("viewer",{ref:"viewer",staticClass:"images clearfix",attrs:{images:t.images,options:t.imageViewerOptions},on:{inited:t.inited},scopedSlots:t._u([{key:"default",fn:function(r){return t._l(r.images,(function(n,i){return e("img",{key:n,staticClass:"image",attrs:{alt:i+1+" of "+r.images.length,src:n},on:{load:t.onImageLoad}})}))}}],null,!1,3010154228)}):t._e()],1)},s=[],l=r("d0eb"),c=(r("c1df"),r("d67f"),r("2f62")),u=r("a9b3"),d=(r("0808"),r("172a")),h=r("9908"),f=r("a026");function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function m(t,e){return w(t)||b(t,e)||y(t,e)||v()}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(t,e){if(t){if("string"==typeof t)return g(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function b(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function w(t){if(Array.isArray(t))return t}function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){_(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _(t,e,r){return(e=C(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t){var e=O(t,"string");return"symbol"==p(e)?e:e+""}function O(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var P={name:"ipmScoutingReports",props:["facility_id","platformGroup_id","isBuggy"],mixins:[u["a"]],components:{Viewer:d["a"],Loading:h["a"]},beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{showImages:!1,items:[],images:[],isLoading:!1,showViewer:!1,imageViewerOptions:{inline:!1,button:!1,navbar:!1,title:[1,function(t,e){return"".concat(t.alt," (").concat(e.naturalWidth," × ").concat(e.naturalHeight,")")}],toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!1,keyboard:!1},pagination:{sortBy:["begintime"],sortDesc:[!0],itemsPerPage:-1},headers:[{text:"Date",value:"begintime",align:"left",sortable:!0,width:150},{text:"Pests?",value:"pestDetected",align:"center",sortable:!0},{text:"Pest Type",value:"pestType.label",align:"left",sortable:!0},{text:"# Plants Affected",value:"numberOfPlantsAffected",align:"center",sortable:!0},{text:"Comments",value:"comments",align:"left",sortable:!1},{text:"Photos",value:"fileUploadUrl1",align:"left",sortable:!1,width:50}]}},computed:S({},Object(c["c"])(["getUser"])),watch:{platformGroup_id:function(t,e){this.refresh()}},methods:{onImageLoad:function(t){this.$viewer.view(0),this.isLoading=!1},inited:function(t){this.$viewer=t},onDisplayImages:function(t){var e=this;e.showViewer=!1,e.isLoading=!0,f["default"].nextTick().then((function(){for(var r=[],n=1;n<=4;n++)t["fileUploadUrl"+n]&&r.push(t["fileUploadUrl"+n]);e.images=r,e.showViewer=!0}))},refresh:function(){var t=this;t.isLoading=!0,this.platformGroup_id&&l["a"].get("IpmScoutingReports",this.getUser.apitoken,{filter:{sort:"begintime desc",include:[{relation:"pestType",scope:{filter:{fields:"label"}}}],where:{platformGroupId:this.platformGroup_id}}}).then((function(e){var r=m(e,2),n=r[0];r[1];t.items=n,t.isLoading=!1}))}}},D=P,k=(r("7168"),r("2877")),T=Object(k["a"])(D,o,s,!1,null,null,null);e["a"]=T.exports},"300b":function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=r("8860"),o=r("da13"),s=r("5d23"),l=r("8e36"),c=function(){var t=this,e=t._self._c;return e(n["a"],{staticStyle:{"min-width":"165px",position:"relative"},attrs:{loading:t.isLoading}},[e(i["d"],{staticClass:"py-2 d-flex justify-center",staticStyle:{"background-color":"#1876d2",color:"white"}},[e("span",[t._v(t._s(t.item.platformGroupName)+" States")])]),t.isLoading?e(l["a"],{staticStyle:{position:"absolute",top:"48px"},attrs:{indeterminate:""}}):t._e(),e(i["c"],{staticClass:"pt-0",staticStyle:{"max-height":"250px","min-height":"150px","overflow-y":"auto"}},[e(a["a"],{ref:"state-menu",attrs:{dense:""}},t._l(t.options,(function(r,n){return e(o["a"],{key:n,staticClass:"context-action",on:{click:function(e){return e.stopPropagation(),t.onSelectState(r)}}},[e(s["c"],[t._v(t._s(r.action))])],1)})),1)],1)],1)},u=[],d=r("2f62"),h=r("d0eb"),f=(r("d67f"),r("c0d6")),p=r("9194");function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t){return b(t)||g(t)||S(t)||y()}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function b(t){if(Array.isArray(t))return _(t)}function w(t,e){return O(t)||C(t,e)||S(t,e)||x()}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function O(t){if(Array.isArray(t))return t}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=j(t,"string");return"symbol"==m(e)?e:e+""}function j(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var E={name:"StateContextOptions",props:["item"],data:function(){return{options:[],isLoading:!1}},computed:D({},Object(d["c"])(["getUser"])),mounted:function(){this.loadStates()},methods:{loadStates:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.isLoading=!0,h["a"].get("devices/getPlatformGroupDevices",this.getUser.apitoken,{platformGroup_id:this.item.platformGroup_id}).then((function(r){var n=w(r,2),i=n[0];n[1];t.isLoading=!1;var a=i.filter((function(e){return e.device_id===t.item.id}));if(a[0].actions){var o=[];e===p["n"]||e!==p["m"]&&t.getUser.facility.dashboardUIVersion>1?(h["a"].isAdmin(f["a"].getters["getUser"])&&o.push({action_id:p["m"],action:"Show Full List"}),"AUTOMATIC"===t.item.mode?(o.push({action_id:p["v"],action:"Manual"}),o=[].concat(v(o),v(a[0].actions.filter((function(t){return t.action_id===p["o"]}))))):(o.push({action_id:p["e"],action:"Automatic"}),o.push({action_id:p["A"],action:"Service"}),o=[].concat(v(o),v(a[0].actions.filter((function(t){return t.action_id===p["D"]})))))):(h["a"].isAdmin(f["a"].getters["getUser"])&&o.push({action_id:p["n"],action:"Hide Full List"}),o=[].concat(v(o),v(a[0].actions))),t.options=o}else t.options=[]}))},onSelectState:function(t){t.action_id===p["m"]||t.action_id===p["n"]?this.loadStates(t.action_id):this.$emit("save",t.action_id)}},watch:{item:function(t,e){t&&t!==e&&this.loadStates()}}},I=E,L=r("2877"),A=Object(L["a"])(I,c,u,!1,null,null,null);e["a"]=A.exports},"304d":function(t,e,r){"use strict";r("4545")},3129:function(t,e,r){"use strict";r("1f09");var n=r("c995"),i=r("24b2"),a=r("7560"),o=r("58df"),s=r("80d2");e["a"]=Object(o["a"])(n["a"],i["a"],a["a"]).extend({name:"VSkeletonLoader",props:{boilerplate:Boolean,loading:Boolean,tile:Boolean,transition:String,type:String,types:{type:Object,default:()=>({})}},computed:{attrs(){return this.isLoading?this.boilerplate?{}:{"aria-busy":!0,"aria-live":"polite",role:"alert",...this.$attrs}:this.$attrs},classes(){return{"v-skeleton-loader--boilerplate":this.boilerplate,"v-skeleton-loader--is-loading":this.isLoading,"v-skeleton-loader--tile":this.tile,...this.themeClasses,...this.elevationClasses}},isLoading(){return!("default"in this.$scopedSlots)||this.loading},rootTypes(){return{actions:"button@2",article:"heading, paragraph",avatar:"avatar",button:"button",card:"image, card-heading","card-avatar":"image, list-item-avatar","card-heading":"heading",chip:"chip","date-picker":"list-item, card-heading, divider, date-picker-options, date-picker-days, actions","date-picker-options":"text, avatar@2","date-picker-days":"avatar@28",heading:"heading",image:"image","list-item":"text","list-item-avatar":"avatar, text","list-item-two-line":"sentences","list-item-avatar-two-line":"avatar, sentences","list-item-three-line":"paragraph","list-item-avatar-three-line":"avatar, paragraph",paragraph:"text@3",sentences:"text@2",table:"table-heading, table-thead, table-tbody, table-tfoot","table-heading":"heading, text","table-thead":"heading@6","table-tbody":"table-row-divider@6","table-row-divider":"table-row, divider","table-row":"table-cell@6","table-cell":"text","table-tfoot":"text@2, avatar@2",text:"text",...this.types}}},methods:{genBone(t,e){return this.$createElement("div",{staticClass:`v-skeleton-loader__${t} v-skeleton-loader__bone`},e)},genBones(t){const[e,r]=t.split("@"),n=()=>this.genStructure(e);return Array.from({length:r}).map(n)},genStructure(t){let e=[];t=t||this.type||"";const r=this.rootTypes[t]||"";if(t===r);else{if(t.indexOf(",")>-1)return this.mapBones(t);if(t.indexOf("@")>-1)return this.genBones(t);r.indexOf(",")>-1?e=this.mapBones(r):r.indexOf("@")>-1?e=this.genBones(r):r&&e.push(this.genStructure(r))}return[this.genBone(t,e)]},genSkeleton(){const t=[];return this.isLoading?t.push(this.genStructure()):t.push(Object(s["u"])(this)),this.transition?this.$createElement("transition",{props:{name:this.transition},on:{afterEnter:this.resetStyles,beforeEnter:this.onBeforeEnter,beforeLeave:this.onBeforeLeave,leaveCancelled:this.resetStyles}},t):t},mapBones(t){return t.replace(/\s/g,"").split(",").map(this.genStructure)},onBeforeEnter(t){this.resetStyles(t),this.isLoading&&(t._initialStyle={display:t.style.display,transition:t.style.transition},t.style.setProperty("transition","none","important"))},onBeforeLeave(t){t.style.setProperty("display","none","important")},resetStyles(t){t._initialStyle&&(t.style.display=t._initialStyle.display||"",t.style.transition=t._initialStyle.transition,delete t._initialStyle)}},render(t){return t("div",{staticClass:"v-skeleton-loader",attrs:this.attrs,on:this.$listeners,class:this.classes,style:this.isLoading?this.measurableStyles:void 0},[this.genSkeleton()])}})},"31e3":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("4bd4"),l=r("132d"),c=r("0fd9"),u=r("b974"),d=r("2fa4"),h=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v("Select Dehumidifier State")]),e(d["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],[e(s["a"],{ref:"form",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(c["a"],[e(o["a"],{staticClass:"pr-1",attrs:{cols:"12"}},[e(u["a"],{attrs:{items:t.options,"item-value":"id","item-text":"label",label:"Select Dehumidifier State","return-object":"",rules:[function(){return!!t.selectedOption||"This field is required"}]},model:{value:t.selectedOption,callback:function(e){t.selectedOption=e},expression:"selectedOption"}})],1)],1)],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.valid},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},f=[],p={data:function(){return{valid:!1,options:[{id:125,label:"Dehumidifier 1 ON"},{id:126,label:"Dehumidifier 2 ON"},{id:127,label:"Both Dehumidifiers ON"},{id:124,label:"Both Dehumidifiers OFF"}],selectedOption:null}},methods:{onCancel:function(){this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",null),this.$store.dispatch("universalDashboard/setShowDehumidifyOptions",!1),this.selectedOption=null,this.$refs.form.resetValidation()},onConfirm:function(){this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!0),this.$store.dispatch("batchActions/changeBatchAction",this.selectedOption.id),this.$store.dispatch("universalDashboard/setShowDehumidifyOptions",!1),this.selectedOption=null,this.$refs.form.resetValidation()}}},m=p,v=r("2877"),y=Object(v["a"])(m,h,f,!1,null,null,null);e["a"]=y.exports},"32bf":function(t,e,r){"use strict";var n=r("62ad"),i=r("490a"),a=r("0fd9"),o=r("b974"),s=r("3a2f"),l=function(){var t=this,e=t._self._c;return e("div",{staticClass:"deviceToggleSelectField"},[e(a["a"],{attrs:{"no-gutters":""}},[e(n["a"],{staticClass:"pl-1",attrs:{cols:"10"}},[e(o["a"],{attrs:{label:t.label,items:t.options,"item-value":"action","item-text":"displayName",readonly:t.readonly,disabled:t.disabled},on:{focus:t.onClick},model:{value:t.val,callback:function(e){t.val=e},expression:"val"}})],1),e(n["a"],{staticClass:"text-right",staticStyle:{"padding-top":"20px"},attrs:{cols:"2"}},[t.transitionClass?[t.isSse?e(i["a"],{attrs:{color:"primary",indeterminate:""}}):e(s["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(i["a"],t._g({attrs:{value:t.pctComplete,color:"primary",rotate:-90}},n))]}}],null,!1,2386431241)},[e("span",[t._v(t._s(t.nextFetch))])])]:t._e()],2)],1)],1)},c=[],u=r("d67f"),d={name:"zone-devices-devices-sensor",props:{isSse:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{type:[String],default:""},state:{type:[String,Number],default:0},id:{type:[Number],default:0},options:{type:Array,default:function(){return[]}},readonly:{type:Boolean,default:!1},isPolling:{type:Boolean,default:!1},nextFetchTime:{type:String,default:""},pctComplete:{type:[Number],default:0},suspendEvent:{type:Boolean,default:!1}},data:function(){return{val:0,inTransition:!1}},mounted:function(){this.setVal(this.state)},computed:{optionSet:function(){return this.options.map((function(t){return t.action}))},transitionClass:function(){return this.inTransition},nextFetch:function(){return this.inTransition?""==this.nextFetchTime?"Next update within 2 minutes":this.nextFetchTime:""}},watch:{isPolling:function(t){t||(this.inTransition=!1)},suspendEvent:function(t,e){e&&!t&&(this.inTransition=!1)},state:function(t,e){this.setVal(t)},val:function(t,e){0==e||this.suspendEvent||this.change(t)}},methods:{setVal:function(t){if("DEHUMHEATING"!=t){if("HeaterStrip"==this.label)this.val="HIGH"==t||"HeatStripOn"==t||"ON"==t?"HeatStripOn":"HeatStripOff";else for(var e=t.toLowerCase(),r=0;r<this.options.length;r++)if(this.options[r].action.toLowerCase().indexOf(e.substring(0,3))>=0){this.val=this.options[r].action;break}}else this.val="BardDehumHeating"},change:function(t){if(!this.suspendEvent){var e=this.options.findIndex((function(e){return e.action.toLowerCase()==t.toLowerCase()}));this.$emit("changed",{id:this.id,action_id:this.options[e].action_id}),this.inTransition=!0}},onClick:function(){this.readonly&&u["a"].error("You cannot change settings when AUTOMATIC mode is ON.")}}},h=d,f=r("2877"),p=Object(f["a"])(h,l,c,!1,null,null,null);e["a"]=p.exports},"33d8":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("132d"),s=r("2fa4"),l=r("71a3"),c=r("c671"),u=r("fe57"),d=r("aac8"),h=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"vh90 screen-height-container flex-content"},[e(a["d"],[t.selectedController?e("h2",[t._v("\n      Configure "+t._s(t.selectedController.name)+" Devices\n    ")]):t._e(),e(s["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.closeModal}},[e(o["a"],[t._v("close")])],1)],1),e(a["c"],{staticClass:"flex-tabs-container pb-0"},[e(u["a"],{attrs:{centered:""},model:{value:t.deviceTabs,callback:function(e){t.deviceTabs=e},expression:"deviceTabs"}},[e(l["a"],[t._v("VFU Devices")]),e(l["a"],[t._v("Cameras")]),e(l["a"],[t._v("Soil Sensors")])],1),e(d["a"],{model:{value:t.deviceTabs,callback:function(e){t.deviceTabs=e},expression:"deviceTabs"}},[e(c["a"],{staticStyle:{height:"98%"}},[e("controller-devices",{attrs:{hideHeader:!0,controller:t.selectedController,user:t.getUser},on:{close:t.closeModal}})],1),e(c["a"],[e("controller-cameras",{attrs:{controller:t.selectedController,user:t.getUser}})],1),e(c["a"],[e("xiaomi-soil-sensor",{attrs:{controller:t.selectedController,user:t.getUser}})],1)],1)],1)],1)},f=[],p=r("2f62"),m=r("4504"),v=r("856a"),y=r("aec4");function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach((function(e){x(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function x(t,e,r){return(e=S(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(t){var e=_(t,"string");return"symbol"==g(e)?e:e+""}function _(t,e){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var C={name:"DeviceConfigurationViewer",components:{ControllerDevices:m["a"],ControllerCameras:v["a"],XiaomiSoilSensor:y["a"]},computed:w(w({},Object(p["c"])(["getUser"])),Object(p["c"])("universalDashboard",["showDeviceConfigurationViewer","selectedController"])),data:function(){return{deviceTabs:0}},methods:{closeModal:function(){this.$store.dispatch("universalDashboard/setShowDeviceConfigurationViewer",!1)}}},O=C,P=r("2877"),D=Object(P["a"])(O,h,f,!1,null,null,null);e["a"]=D.exports},3488:function(t,e,r){"use strict";var n=r("c1df"),i=r.n(n),a=r("d0eb"),o=r("dd56");function s(t){return d(t)||u(t)||c(t)||l()}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){if(t){if("string"==typeof t)return h(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function d(t){if(Array.isArray(t))return h(t)}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}e["a"]={data:function(){return{temperatureDevices:[],humidityDevices:[],co2Devices:[],temperatureSensors:[],co2Sensors:[],humiditySensors:[],humidityChartData:[],temperatureChartData:[],co2ChartData:[],ecuChartData:[],cortexVfuChartData:[],annotationData:[],showAnnotations:{co2:!1,humidifier:!1,dehumidifier:!1,heater:!1,other:!0},chartData:{type:"line",title:"Unit Status",dataset:[],plotBands:[],plotLines:[],xAxes:[],yAxes:[],showPlotBands:!0,showPlotLines:!0,tempSeries:null,humiditySeries:null,co2Series:null,vpdSeries:null,annotations:[]},chartDevice:{humidity:0,co2:0,temperature:0,heaterStrip:0,ecu:"",bard:null,irr:[],dehumidifier:0,humidifier:0,cortexVfu:null},ecuStateColors:{HEAT:"rgba(255, 138, 128)",HEATING2:"rgba(179, 0, 0)",HEATING3:"rgba(102, 0, 0)",DEHUMIDIFYING:"rgba(159, 90, 253, 1)",COOLING:"rgba(82, 179, 217, 1)",COOLING2:"rgba(0, 0, 255, 1)",CIRCULATING:"rgba(255, 167, 38, 1)",OFF:"white",FAN:"rgba(217, 217, 217, 1)",LOW_CIRCULATE:"rgba(255, 204, 128, 1)",DEHUMHEATING:"rgba(255, 0, 255, 1)"},ecuStateColorsLight:{HEAT:"rgba(255, 138, 128, 0.5)",HEATING2:"rgba(179, 0, 0, 0.5)",HEATING3:"rgba(102, 0, 0, 0.5)",DEHUMIDIFYING:"rgba(159, 90, 253, 0.5)",COOLING:"rgba(82, 179, 217, 0.5)",COOLING2:"rgba(0, 0, 255, 0.5)",CIRCULATING:"rgba(255, 167, 38, 0.5)",OFF:"white",FAN:"rgba(217, 217, 217, 0.5)",LOW_CIRCULATE:"rgba(255, 204, 128, 0.5)",DEHUMHEATING:"rgba(255, 0, 255, 0.5)"}}},computed:{startDateStr:function(){return this.startDate.utc().format()},endDateStr:function(){return this.endDate.utc().format()},userUnitPreference:function(){return this.getUser.preferences.find((function(t){return"units"===t.preference}))}},methods:{processTemperatureData:function(t){var e=this,r=this;if(t&&t.length){var n=this.temperatureDevices.filter((function(e){return e.device_id==t[0].device_id}));t.length===this.maxRecordsLimit&&(this.maxRecordsHit=!0),this.sortValsByTime(t,"date");var a=t.filter((function(t){return i.a.utc(t.date).isBefore(e.endDate.utc())})),s=a.map((function(t){if(t[r.datasetTypeProperty]&&t[r.datasetTypeProperty]>0)return{x:i.a.utc(t.date).valueOf(),y:"metric"===e.userUnitPreference.setting?t[r.datasetTypeProperty]:Object(o["a"])(t[r.datasetTypeProperty])}})).reduce((function(t,e){return e&&t.push(e),t}),[]),l=this.temperatureSensors.length?n[0].device:"Temp";this.chartData.tempSeries={id:l+Date.now(),type:"line",label:l,yAxisID:1,data:s,tooltip:{pointFormatter:function(){var t="metric"===r.userUnitPreference.setting?"°C":"°F";return"<span>Temp ".concat(this.y.toFixed(1)," ").concat(t,"</span><br />")}}}}},processVpdData:function(t){var e="VPD",r={id:e+Date.now(),type:"line",name:"VPD",label:e,yAxisID:3,data:[],tooltip:{pointFormatter:function(){return"<span>VPD ".concat(this.y.toFixed(1),"</span><br />")}}};this.sortValsByTime(t,"date"),t.length===this.maxRecordsLimit&&(this.maxRecordsHit=!0);for(var n=0;n<t.length;n++){var a=t[n];a.vpd&&r.data.push({x:i.a.utc(a.datetime).valueOf(),y:parseFloat(a.vpd)})}this.chartData.vpdSeries=r,this.redrawChart()},processHumidityData:function(t){var e=this,r=this;if(t&&t.length){var n=this.humidityDevices.filter((function(e){return e.device_id==t[0].device_id}));this.sortValsByTime(t,"date"),t.length===this.maxRecordsLimit&&(this.maxRecordsHit=!0);var a=t.filter((function(t){return i.a.utc(t.date).isBefore(e.endDate.utc())})),o=a.map((function(t){if(t[r.datasetTypeProperty]&&t[r.datasetTypeProperty]>0)return{x:i.a.utc(t.date).valueOf(),y:t[r.datasetTypeProperty]?100*t[r.datasetTypeProperty]:0}})).reduce((function(t,e){return e&&t.push(e),t}),[]),s=this.humiditySensors.length?n[0].device:"Humidity";this.chartData.humiditySeries={id:s+Date.now(),type:"line",name:"Humidity",label:s,yAxisID:2,data:o,tooltip:{pointFormatter:function(){return"<span>RH ".concat(this.y.toFixed(1)," %</span><br />")}}}}},processCO2Data:function(t){var e=this,r=this;if(t&&t.length){var n=this.co2Devices.filter((function(e){return e.device_id==t[0].device_id}));t.length===this.maxRecordsLimit&&(this.maxRecordsHit=!0),this.sortValsByTime(t,"date");var a=t.filter((function(t){return i.a.utc(t.date).isBefore(e.endDate.utc())})),o=a.map((function(t){if(t[r.datasetTypeProperty]&&t[r.datasetTypeProperty]>0)return{x:i.a.utc(t.date).valueOf(),y:t[r.datasetTypeProperty]?t[r.datasetTypeProperty]:0}})).reduce((function(t,e){return e&&t.push(e),t}),[]),s=this.co2Sensors.length?n[0].device:"CO₂";this.chartData.co2Series={id:s+Date.now(),type:"line",name:"CO₂",label:s,yAxisID:0,data:o,tooltip:{pointFormatter:function(){return"<span>CO₂ ".concat(this.y.toFixed(1)," ppm</span><br />")}}}}},getTemperatureChartData:function(t){if(!(t.device_id instanceof Array)&&t.device_id||t.device_id instanceof Array&&t.device_id.length>0)return a["a"].get("temperatureSensorHistories/getChartData",this.getUser.apitoken,t)},getCo2ValveHistory:function(t){if(t)return a["a"].get("CO2ValveHistories",this.getUser.apitoken,t)},getHumidityChartData:function(t){if(!(t.device_id instanceof Array)&&t.device_id||t.device_id instanceof Array&&t.device_id.length>0)return a["a"].get("humiditySensorHistories/getChartData",this.getUser.apitoken,t)},getCo2ChartData:function(t){if(!(t.device_id instanceof Array)&&t.device_id||t.device_id instanceof Array&&t.device_id.length>0)return a["a"].get("co2SensorHistories/getChartData",this.getUser.apitoken,t)},getECUData:function(t){if(!(t.device_ids instanceof Array)&&t.device_ids||t.device_ids instanceof Array&&t.device_ids.length>0)return a["a"].get("virtualDevices/history",this.getUser.apitoken,t)},getModesData:function(t){if(t.deviceId)return a["a"].get("virtualDevices/modeHistory",this.getUser.apitoken,t)},getHeaterStripData:function(t){if(!(t.device_ids instanceof Array)&&t.device_ids||t.device_ids instanceof Array&&t.device_ids.length>0)return a["a"].get("virtualDevices/history",this.getUser.apitoken,t)},getDehumidifierData:function(t){if(!(t.device_ids instanceof Array)&&t.device_ids||t.device_ids instanceof Array&&t.device_ids.length>0)return a["a"].get("virtualDevices/history",this.getUser.apitoken,t)},getHumidifierData:function(t){if(!(t.device_ids instanceof Array)&&t.device_ids||t.device_ids instanceof Array&&t.device_ids.length>0)return a["a"].get("virtualDevices/history",this.getUser.apitoken,t)},getIrrData:function(t){if(!(t.device_ids instanceof Array)&&t.device_ids||t.device_ids instanceof Array&&t.device_ids.length>0)return a["a"].get("virtualDevices/history",this.getUser.apitoken,t)},processECUData:function(t,e){var r=this;if(t&&t.length){var n=e&&e.success?e.data:[],a=[].concat(s(t),s(n));this.sortValsByTime(t,"dbtime"),this.sortValsByTime(n,"dbtime"),this.sortValsByTime(a,"dbtime");var o=e&&e.success?e.firstPriorModeEvent:null,l=null,c=null,u="black",d=[];a.forEach((function(t,e){var s=r.endDate.utc(),h=i.a.utc(t.dbtime);if(t.mode)c&&(o=t,l=n.find((function(t){var e=i.a.utc(t.dbtime);return e.isAfter(h)})),void 0!==a[e+1]&&(s=i.a.utc(a[e+1].dbtime)),u="MANUAL"===t.mode.toUpperCase()?{pattern:{path:{d:"M 0 0 H 10 V 10 H 0 Z",strokeWidth:6,fill:r.ecuStateColorsLight[c.stateName]||"black",stroke:r.ecuStateColors[c.stateName]||"black"},width:10,height:10,color:r.ecuStateColors[c.stateName]||"black"}}:r.ecuStateColors[c.stateName]||"black",d.push({x:i.a.utc(t.dbtime).valueOf(),xForm:i.a.utc(t.dbtime).format(),y:s.valueOf(),yForm:s.format(),state:c.stateName,color:u}));else{var f;if(c=t,!l||i.a.utc(l.dbtime).isBefore(i.a.utc(h)))o=null!==(f=l)&&void 0!==f?f:o,l=n.find((function(t){var e=i.a.utc(t.dbtime);return e.isAfter(h)}));o||(o=n.find((function(t){var e=i.a.utc(t.dbtime);return e.isSameOrBefore(h)}))),void 0!==a[e+1]&&(s=i.a.utc(a[e+1].dbtime)),u=r.ecuStateColors[t.stateName]||"black",o?"MANUAL"===o.mode.toUpperCase()&&(u={pattern:{path:{d:"M 0 0 H 10 V 10 H 0 Z",strokeWidth:6,fill:r.ecuStateColorsLight[t.stateName]||"black",stroke:r.ecuStateColors[t.stateName]||"black"},width:10,height:10,color:r.ecuStateColors[t.stateName]||"black",test:t.stateName}}):l?"AUTOMATIC"===l.mode.toUpperCase()&&(u={pattern:{path:{d:"M 0 0 H 10 V 10 H 0 Z",strokeWidth:6,fill:r.ecuStateColorsLight[t.stateName]||"black",stroke:r.ecuStateColors[t.stateName]||"black"},width:10,height:10,color:r.ecuStateColors[t.stateName]||"black"}}):u=r.ecuStateColors[t.stateName]||"black",d.push({x:i.a.utc(t.dbtime).valueOf(),xForm:i.a.utc(t.dbtime).format(),y:s.valueOf(),yForm:s.format(),state:c.stateName,color:u})}})),this.chartData.plotBands.push({label:"ECU",type:"line",yAxisID:"irr-ecu",showLine:!1,data:d})}},processAnnotationData:function(t){var e=[];if(this.showAnnotations.co2){var r=t.filter((function(t){return"CO2Valve"==t.dtLabel}));r.length&&this.showAnnotations.co2&&(e=this.processCo2ValveAnnotations(r))}if(this.showAnnotations.other){var n=t.filter((function(t){return"Curtain"==t.dtLabel}));n.length&&(e=[].concat(s(e),[{labels:this.processOtherAnnotations(n,"CURT ",36),labelOptions:{backgroundColor:"rgba(0,0,0,0.4)",verticalAlign:"top",y:36}}]));var i=t.filter((function(t){return"Light"==t.dtLabel}));i.length&&(e=[].concat(s(e),[{labels:this.processOtherAnnotations(i,"Light ",92),labelOptions:{backgroundColor:"rgba(255,255,0,0.4)"}}]))}if(this.showAnnotations.heater){var a=t.filter((function(t){return"HeaterStrip"==t.dtLabel}));if(a.length&&(e=[].concat(s(e),[this.processHeaterAnnotations(a)])),this.showAnnotations.humidifier){var o=t.filter((function(t){return"VFUHumidifier"==t.dtLabel}));o.length&&(e=[].concat(s(e),[this.processDehumidifierAnnotations(o,"Hum")]))}}if(this.showAnnotations.dehumidifier){var l=t.filter((function(t){return"VFUDehumidifier"==t.dtLabel||"TwoStageDehumidifier"==t.dtLabel}));l.length&&(e=[].concat(s(e),[this.processDehumidifierAnnotations(l,"Dehum")]))}this.chartData.annotations=e},sortValsByTime:function(t,e){if(Array.isArray(t))return t.sort((function(t,r){var n=i.a.utc(t[e]).valueOf(),a=i.a.utc(r[e]).valueOf();return n<a?-1:n>a?1:0}))},fetchChartData:function(t,e){var r=this;if(this.canFetch){var n=this;this.maxRecordsHit=!1;var o=[],l=[];this.chartDevice.temperature&&(this.chartDevice.temperature.length?(this.temperatureSensors=s(new Set(this.chartDevice.temperature.map((function(t){return t})))),this.temperatureSensors.forEach((function(e){o.push(r.getTemperatureChartData({apitoken:r.getUser.apitoken,startDate:r.startDateStr,endDate:r.endDateStr,interval:r.selectedUnit,device_id:e,start:0,limit:t,type:"temperature"}))}))):(this.temperatureSensors=this.chartDevice.temperature,o.push(this.getTemperatureChartData({apitoken:this.getUser.apitoken,startDate:this.startDateStr,endDate:this.endDateStr,interval:this.selectedUnit,device_id:this.temperatureSensors,start:0,limit:t,type:"temperature"}))),l.push("temperature")),this.chartDevice.humidity&&(this.chartDevice.humidity.length?(this.humiditySensors=s(new Set(this.chartDevice.humidity.map((function(t){return t})))),this.humiditySensors.forEach((function(e){o.push(r.getHumidityChartData({apitoken:r.getUser.apitoken,startDate:r.startDateStr,endDate:r.endDateStr,interval:r.selectedUnit,device_id:e,start:0,limit:t,type:"humidity"}))}))):(this.humiditySensors=this.chartDevice.humidity,o.push(this.getHumidityChartData({apitoken:this.getUser.apitoken,startDate:this.startDateStr,endDate:this.endDateStr,interval:this.selectedUnit,device_id:this.humiditySensors,start:0,limit:t,type:"humidity"}))),l.push("humidity")),this.chartDevice.co2&&(this.chartDevice.co2.length?(this.co2Sensors=s(new Set(this.chartDevice.co2.map((function(t){return t})))),this.co2Sensors.forEach((function(e){o.push(r.getCo2ChartData({apitoken:r.getUser.apitoken,startDate:r.startDateStr,endDate:r.endDateStr,interval:r.selectedUnit,device_id:e,start:0,limit:t,type:"co2"}))}))):(this.co2Sensors=this.chartDevice.co2,o.push(this.getCo2ChartData({apitoken:this.getUser.apitoken,startDate:this.startDateStr,endDate:this.endDateStr,interval:this.selectedUnit,device_id:this.co2Sensors,start:0,limit:t,type:"co2"}))),l.push("co2"));var c=[];if("day"!=this.selectedUnit&&"month"!=this.selectedUnit){this.chartDevice.ecu&&(c.push(this.chartDevice.ecu),o.push(this.getECUData({device_ids:[this.chartDevice.ecu].join(","),filter:{order:"timestamp DESC",limit:t,startDate:this.startDateStr,endDate:this.endDateStr,interval:this.selectedUnit}})),l.push("ecu")),this.chartDevice.cortexVfu&&(o.push(this.getModesData({deviceId:this.chartDevice.cortexVfu,filter:{order:"timestamp DESC",limit:t,startDate:this.startDateStr,endDate:this.endDateStr,interval:this.selectedUnit}})),l.push("cortexVfu")),this.chartDevice.dehumidifier&&(c.push(this.chartDevice.dehumidifier),o.push(this.getDehumidifierData({device_ids:[this.chartDevice.dehumidifier],filter:{order:"timestamp DESC",limit:250,startDate:this.startDateStr,endDate:this.endDateStr,interval:this.selectedUnit}})),l.push("dehumidifier")),this.chartDevice.irr.length>0&&(c=c.concat(this.chartDevice.irr),o.push(this.getIrrData({device_ids:this.chartDevice.irr.join(","),filter:{order:"timestamp DESC",limit:250,startDate:this.startDateStr,endDate:this.endDateStr,interval:this.selectedUnit}})),l.push("irr"));var u=i()(this.endDateStr).diff(i()(this.startDateStr),"hours");u<2.01&&this.chartDevice.co2Valve&&c.push(this.chartDevice.co2Valve),this.chartDevice.humidifier&&c.push(this.chartDevice.humidifier),this.chartDevice.lights&&(c=[].concat(s(c),s(this.chartDevice.lights))),this.chartDevice.curtains&&(c=[].concat(s(c),s(this.chartDevice.curtains))),this.annotationDevices=c,c.length&&(o.push(a["a"].get("virtualDevices/history",this.getUser.apitoken,{device_ids:c.join(","),filter:{startDate:this.startDateStr,endDate:this.endDateStr,limit:300,order:"timestamp desc"}})),l.push("annotations"))}else console.log(this.chartData),this.chartData.plotBands=[],this.chartData.annotations=[],this.keyIndex++;c.length>0&&o.push(a["a"].get("virtualDevices/getPriorStates",this.getUser.apitoken,{device_ids:c,date:this.startDateStr})),Promise.all(o).then((function(t){n.temperatureChartData=[],n.humidityChartData=[],n.co2ChartData=[],n.chartData.annotations=[],c.length>0&&(n.priorStates=t[t.length-1][0]);for(var r=0;r<l.length;r++)switch(l[r]){case"temperature":n.temperatureChartData=t[r][0],n.processTemperatureData(t[r][0]);break;case"humidity":n.humidityChartData=t[r][0],n.processHumidityData(t[r][0]);break;case"co2":n.co2ChartData=t[r][0],n.processCO2Data(t[r][0]);break;case"ecu":n.ecuChartData=t[r][0];var i=l.indexOf("cortexVfu");-1!==i&&(n.cortexVfuChartData=t[i][0]);var a=n.priorStates.find((function(t){return"ECU"==t.typename}));a&&n.ecuChartData.unshift({dbtime:n.startDateStr,stateName:a.stateName,timestamp:n.startDateStr}),n.ecuChartData[n.ecuChartData.length-1]&&n.ecuChartData.push({dbtime:n.endDateStr,stateName:n.ecuChartData[n.ecuChartData.length-1].stateName,timestamp:n.endDateStr}),n.chartData.plotBands=[],n.processECUData(n.ecuChartData,n.cortexVfuChartData);break;case"irr":n.showAnnotations.other&&(n.irrChartData=t[r][0],n.processIrrData(t[r][0]));break;case"annotations":n.annotationData=t[r][0],n.processAnnotationData(n.annotationData);break}e&&e()}))}}}}},"35d5":function(t,e,r){"use strict";var n=r("8212"),i=r("8336"),a=r("b0af"),o=r("99d9"),s=r("ac7c"),l=r("8fea"),c=r("169a"),u=r("132d"),d=r("adda"),h=r("0fd9"),f=r("3a2f"),p=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:"",id:"vfuDeviceServiceHistory"}},[e(o["c"],{staticClass:"pt-0 d-flex flex-column"},[e(h["a"],{attrs:{justify:"center"}},[e(s["a"],{staticClass:"pr-4 hidden-sm-and-down",staticStyle:{"max-width":"170px"},attrs:{label:"Deployed"},on:{change:t.onUnitDeployedChange},model:{value:t.device.controller.deployed,callback:function(e){t.$set(t.device.controller,"deployed",e)},expression:"device.controller.deployed"}}),e(s["a"],{staticClass:"pr-4",staticStyle:{"max-width":"150px"},attrs:{label:"Disabled"},on:{change:t.onUnitDisableChange},model:{value:t.outOfService,callback:function(e){t.outOfService=e},expression:"outOfService"}}),e(s["a"],{staticClass:"pr-4",staticStyle:{"max-width":"180px"},attrs:{label:"CO2 Disabled"},on:{change:t.onUnitCo2DisableChange},model:{value:t.co2Disabled,callback:function(e){t.co2Disabled=e},expression:"co2Disabled"}}),t.isMaintenanceUser?e(s["a"],{staticClass:"hidden-sm-and-down",staticStyle:{"max-width":"150px"},attrs:{label:"Test Mode"},on:{change:t.onUnitTestingChange},model:{value:t.isTesting,callback:function(e){t.isTesting=e},expression:"isTesting"}}):t._e()],1),e(l["a"],{staticClass:"flex-grow-auto",staticStyle:{border:"1px solid silver"},attrs:{"hide-default-footer":"",headers:t.headers,items:t.filteredTickets,"item-key":"id","fixed-header":"",options:t.pagination,"must-sort":"",height:"100%",loading:t.isLoading||t.ticketsLoading,"show-expand":""},scopedSlots:t._u([{key:"item.actions",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},[e(f["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(i["a"],t._g({attrs:{icon:""},on:{click:function(e){t.ticketDetailsDialog=!0,t.currentTicket=n}}},a),[e(u["a"],[t._v("add")])],1)]}}],null,!0)},[e("span",[t._v("Update Ticket Status")])]),e(f["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(i["a"],t._g({attrs:{icon:""},on:{click:function(e){t.selectedTicket=n,t.createTicketDialog=!0}}},a),[e(u["a"],[t._v("edit")])],1)]}}],null,!0)},[e("span",[t._v("Edit Ticket")])]),e(f["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(i["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.confirmDelete(n)}}},a),[e(u["a"],[t._v("delete")])],1)]}}],null,!0)},[e("span",[t._v("Delete")])])],1)]}},{key:"item.failureDate",fn:function(r){var n=r.item;return[e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(n.failureDate,"MM/DD/YYYY"))}})]}},{key:"item.estimatedCompletionDate",fn:function(r){var n=r.item;return[e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(n.estimatedCompletionDate,"MM/DD/YYYY"))}})]}},{key:"item.assignedUsers",fn:function(r){var i=r.item;return[e("div",{staticClass:"d-flex"},t._l(i.assignedUsers,(function(r){return e(f["a"],{key:r.lastname,attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(i){var a=i.on;return[e("div",t._g({},a),[r.profileImg?e(n["a"],{attrs:{size:"30px"}},[e(d["a"],{attrs:{src:r.profileImg}})],1):e(n["a"],{attrs:{color:"primary",size:"30px"}},[e("span",{staticClass:"white--text",staticStyle:{"font-size":"12px"}},[t._v(t._s(r.firstname.charAt(0))+t._s(r.lastname.charAt(0)))])])],1)]}}],null,!0)},[e("span",[t._v(t._s(r.firstname)+" "+t._s(r.lastname))])])})),1)]}},{key:"item.isResolved",fn:function(e){var r=e.item;return[t._v(t._s(r.isResolved?"Yes":"No"))]}},{key:"item.updatedate",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.updatedate))}})]}},{key:"expanded-item",fn:function(r){var n=r.headers,i=r.item;return[e("td",{attrs:{colspan:n.length}},[e("div",{staticStyle:{margin:"10px"}},[t._v(t._s(i.description))])])]}}])})],1),e(o["a"],{staticClass:"d-flex flex-wrap justify-space-around justify-sm-center"},[e(i["a"],{staticClass:"mb-2 mb-sm-0",attrs:{color:"primary",outlined:t.outlineButtons},on:{click:t.onNewTicket}},[e("span",{staticClass:"hidden-sm-and-down"},[t._v("Log ")]),t._v("New\n      "),e("span",{staticClass:"hidden-sm-and-down"},[t._v(" Problem")])]),e(i["a"],{staticClass:"hidden-sm-and-down",attrs:{color:"primary",outlined:t.outlineButtons},on:{click:t.hideResolvedTickets}},[t._v(t._s(t.hideResolved?"Show":"Hide")+" Resolved Tickets")]),e(i["a"],{staticClass:"mb-2 mb-sm-0",attrs:{color:"primary",outlined:t.outlineButtons},on:{click:function(e){return t.showAlerts()}}},[t._v("Alerts")]),e(i["a"],{staticClass:"mb-2 mb-sm-0",attrs:{color:"primary",outlined:t.outlineButtons},on:{click:function(e){t.displayOperationalNotes=!0}}},[e("span",{staticClass:"hidden-sm-and-down"},[t._v("Operational ")]),t._v("Notes\n      "),t.currentHardwareItem&&t.currentHardwareItem.notes&&t.currentHardwareItem.notes.length>10?e(u["a"],{attrs:{right:"",dark:""}},[t._v("assignment")]):t._e()],1),t.isMaintenanceUser?e(i["a"],{staticClass:"mb-2 mb-sm-0",attrs:{outlined:t.outlineButtons,color:"primary"},on:{click:function(e){t.showEcuValidationTests=!0}}},[t._v("ECU Validation Tests")]):t._e(),e(i["a"],{staticClass:"hidden-sm-and-down",attrs:{outlined:t.outlineButtons,color:"primary"},on:{click:t.refresh}},[t._v("Refresh")])],1),e(c["a"],{attrs:{width:"600",persistent:""},model:{value:t.createTicketDialog,callback:function(e){t.createTicketDialog=e},expression:"createTicketDialog"}},[t.createTicketDialog?e("create-new-ticket",{attrs:{device:t.device,hardwareItem:t.currentHardwareItem,"ticket-id":t.selectedTicket.id},on:{onSave:t.onTicketCreated,close:function(e){t.createTicketDialog=!1}}}):t._e()],1),e(c["a"],{attrs:{width:"80%",persistent:""},model:{value:t.ticketDetailsDialog,callback:function(e){t.ticketDetailsDialog=e},expression:"ticketDetailsDialog"}},[t.ticketDetailsDialog?e("ticket-details",{staticClass:"vh90",attrs:{ticketStatuses:t.ticketStatuses,ticket:t.currentTicket,user:t.getUser,hardwareItem:t.currentHardwareItem.label,"job-tickets":t.jobTickets},on:{saved:t.ticketUpdated,close:function(e){t.ticketDetailsDialog=!1}}}):t._e()],1),t.selectedRec?e(c["a"],{attrs:{width:"300"},model:{value:t.showConfirmDelete,callback:function(e){t.showConfirmDelete=e},expression:"showConfirmDelete"}},[e(a["a"],[e(o["d"],[e("h2",[t._v("Delete "+t._s(t.selectedRec.name))])]),e(o["c"],[t._v("Are you sure?")]),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{text:"",color:"error"},on:{click:t.onConfirmDelete}},[t._v("Confirm Delete")])],1)],1)],1):t._e(),e(c["a"],{attrs:{width:"850",persistent:""},model:{value:t.displayOperationalNotes,callback:function(e){t.displayOperationalNotes=e},expression:"displayOperationalNotes"}},[e("operational-notes",{on:{close:function(e){t.displayOperationalNotes=!1}},model:{value:t.currentHardwareItem,callback:function(e){t.currentHardwareItem=e},expression:"currentHardwareItem"}})],1),e(c["a"],{attrs:{width:"1000",persistent:""},model:{value:t.showEcuValidationTests,callback:function(e){t.showEcuValidationTests=e},expression:"showEcuValidationTests"}},[e("ecu-validation-tests",{staticClass:"vh90",on:{close:function(e){t.showEcuValidationTests=!1}},model:{value:t.device,callback:function(e){t.device=e},expression:"device"}})],1)],1)},m=[],v=r("d0eb"),y=r("2f62"),g=r("d67f"),b=r("92f1"),w=r("310b"),x=r("2fa4"),S=function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"operationalNotesEditor"}},[e(a["a"],[e(o["d"],[e("h2",[t._v("Operational Notes for "+t._s(t.value.label))]),e(x["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(u["a"],[t._v("close")])],1)],1),e(o["c"],[e("RichTextEditor",{attrs:{placeholder:"Enter operational notes about this item."},model:{value:t.value.notes,callback:function(e){t.$set(t.value,"notes",e)},expression:"value.notes"}})],1),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{color:"primary",text:"",loading:t.isLoading},on:{click:t.onSave}},[t._v("Save")])],1)],1)],1)},_=[],C=r("c1df"),O=r.n(C),P=r("743e");function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function k(t,e){return L(t)||I(t,e)||j(t,e)||T()}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function I(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function L(t){if(Array.isArray(t))return t}function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){U(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function U(t,e,r){return(e=N(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t){var e=F(t,"string");return"symbol"==D(e)?e:e+""}function F(t,e){if("object"!=D(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var G={name:"",props:["value"],components:{RichTextEditor:P["a"]},beforeMount:function(){},mounted:function(){},data:function(){return{isLoading:!1}},computed:M({},Object(y["c"])(["getUser"])),watch:{},methods:{onClose:function(){this.$emit("close")},onSave:function(){var t=this;t.isLoading=!0,v["a"].patch("hardware_items",this.getUser.apitoken,{id:this.value.id,notes:this.value.notes}).then((function(e){var r=k(e,2),n=r[0];r[1];t.isLoading=!1,n?(g["a"].success("Record saved."),t.$emit("input",t.value),t.onClose()):g["a"].error("An error occurred. Please try again later")}))}}},R=G,$=r("2877"),H=Object($["a"])(R,S,_,!1,null,null,null),V=H.exports,B=r("a9b3"),z=r("62ad"),Y=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content"},[e(o["d"],[e("h2",[t._v(t._s(t.abbrevPlatformGroupName)+" ECU Validation Tests")]),e(x["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.refresh}},[e(u["a"],[t._v("refresh")])],1),e(i["a"],{attrs:{icon:""},on:{click:t.onclose}},[e(u["a"],[t._v("close")])],1)],1),e(o["c"],{staticClass:"flex-grow-auto"},[e(l["a"],{staticStyle:{border:"1px solid silver",height:"100%"},attrs:{headers:t.headers,items:t.data,"hide-default-footer":"",loading:t.isLoading,"must-sort":"",options:t.pagination,"fixed-header":"",height:"100%","single-expand":"","show-expand":"",expanded:t.expandedRecord},on:{"update:expanded":function(e){t.expandedRecord=e}},scopedSlots:t._u([{key:"item.actions",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},[e(f["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(i["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onEdit(n)}}},a),[e(u["a"],[t._v("edit")])],1)]}}],null,!0)},[e("span",[t._v("Edit Notes/View Results")])]),e(f["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(i["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onDuplicate(n)}}},a),[e(u["a"],[t._v("update")])],1)]}}],null,!0)},[e("span",[t._v("Duplicate and Reschedule")])]),n.finishtime||!n.starttime?e(f["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(i["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onDelete(n)}}},a),[e(u["a"],[t._v("delete")])],1)]}}],null,!0)},[e("span",[t._v("Delete this record")])]):t._e(),!n.finishtime&&n.starttime?e(f["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(i["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onStop(n)}}},a),[e(u["a"],{attrs:{color:"red"}},[t._v("stop")])],1)]}}],null,!0)},[e("span",[t._v("Stop this test")])]):t._e()],1)]}},{key:"item.scheduledStarttime",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.scheduledStarttime))}})]}},{key:"item.starttime",fn:function(r){var n=r.item;return[n.starttime?e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.starttime))}}):e("span",[t._v("---")])]}},{key:"item.finishtime",fn:function(r){var n=r.item;return[n.finishtime?e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.finishtime))}}):e("span",[t._v("---")])]}},{key:"item.passed",fn:function(r){var n=r.item;return[e("div",{staticClass:"clickable",attrs:{title:"Click to re-evaluate results"},on:{click:function(e){return t.recomputeResults(n)}}},[null!=n.passed?e("span",{staticStyle:{"white-space":"nowrap"}},[n.passed?e("span",{staticStyle:{color:"green"}},[t._v("Yes")]):e("span",{staticStyle:{color:"red","font-weight":"bold"}},[t._v("No")])]):e("span",[t._v("---")])])]}},{key:"expanded-item",fn:function(r){var n=r.headers,i=r.item;return[e("td",{attrs:{colspan:n.length}},[t.failedReasons.length>0?[i.id==t.expandedRecordId?e(l["a"],{staticStyle:{margin:"10px"},attrs:{headers:t.headers2,items:t.failedReasons,height:"300px","hide-default-footer":"",options:t.pagination2,"fixed-header":"","show-group-by":""},scopedSlots:t._u([{key:"item.timestamp",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.timestamp))}})]}},{key:"item.rangeLow",fn:function(e){var r=e.item;return[t._v("\n                "+t._s(r.rangeLow)+" "+t._s(t.rangeSuffix[r.type])+"\n              ")]}},{key:"item.rangeHigh",fn:function(e){var r=e.item;return[t._v("\n                "+t._s(r.rangeHigh)+" "+t._s(t.rangeSuffix[r.type])+"\n              ")]}},{key:"item.reading",fn:function(e){var r=e.item;return[t._v("\n                "+t._s(r.reading)+" "+t._s(t.rangeSuffix[r.type])+"\n              ")]}},{key:"item.diff",fn:function(r){var n=r.item;return[e("span",{class:n.class},[t._v(t._s(n.diff)+" "+t._s(t.rangeSuffix[n.type]))])]}}],null,!0)}):t._e()]:t._e(),i.isCanceled?[e("div",{staticStyle:{"text-align":"center","font-weight":"bold"}},[t._v("\n              Note: Test was interrupted\n            ")])]:[null==i.passed?[t._v("No results")]:t._e(),1==i.passed?[t._v("All tests passed")]:t._e()]],2)]}}])})],1),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{text:"",color:"primary"},on:{click:function(e){t.showAddNew=!0}}},[t._v("Schedule New Test")])],1),e(c["a"],{attrs:{persistent:"",width:"300"},model:{value:t.showDuplicate,callback:function(e){t.showDuplicate=e},expression:"showDuplicate"}},[e(a["a"],[e(o["d"],[t._v("\n        Reschedule Test\n        "),e(x["a"]),e(i["a"],{attrs:{icon:""},on:{click:function(e){t.showDuplicate=!1}}},[e(u["a"],[t._v("close")])],1)],1),e(o["c"],[e(h["a"],[e(z["a"],{attrs:{cols:"6"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate"),"auto-close":!0},model:{value:t.rescheduleStartDate,callback:function(e){t.rescheduleStartDate=e},expression:"rescheduleStartDate"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"6"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime")},model:{value:t.rescheduleStartTime,callback:function(e){t.rescheduleStartTime=e},expression:"rescheduleStartTime"}})],1)],1)],1),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{color:"primary",plain:""},on:{click:t.onConfirmDuplicate}},[t._v("Schedule")])],1)],1)],1),e(c["a"],{attrs:{persistent:"",width:"1000"},model:{value:t.showAddNew,callback:function(e){t.showAddNew=e},expression:"showAddNew"}},[e("schedule-new-test",{staticClass:"vh80",attrs:{platformGroupName:t.abbrevPlatformGroupName,controller_id:t.value.controller_id},on:{close:function(e){t.showAddNew=!1},save:t.refresh}})],1),e(c["a"],{attrs:{persistent:"",width:"900"},model:{value:t.showResults,callback:function(e){t.showResults=e},expression:"showResults"}},[e("review-results",{key:"reviewResults"+t.refreshCounter,staticClass:"vh90",attrs:{platformGroupName:t.abbrevPlatformGroupName},on:{close:function(e){t.showResults=!1}},model:{value:t.selectedRec,callback:function(e){t.selectedRec=e},expression:"selectedRec"}})],1)],1)},q=[],W=r("ea10"),J=r("4bd4"),Z=r("b974"),X=r("8654"),K=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{loading:t.isLoading}},[e(o["d"],[e("h2",[t._v("Schedule New Test for "+t._s(t.platformGroupName))]),e(x["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onclose}},[e(u["a"],[t._v("close")])],1)],1),e(o["c"],{staticClass:"flex-grow-auto d-flex flex-column"},[e(J["a"],{ref:"form",model:{value:t.isValid,callback:function(e){t.isValid=e},expression:"isValid"}},[e(h["a"],{attrs:{"no-gutters":""}},[e(z["a"],{staticClass:"pr-2",attrs:{cols:"6"}},[e(Z["a"],{attrs:{items:t.ecuTestPlans,"item-value":"id","item-text":"label",label:"Test Plan","return-object":"",rules:[t.rules.required]},model:{value:t.selectedTestPlan,callback:function(e){t.selectedTestPlan=e},expression:"selectedTestPlan"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"6"}},[e(X["a"],{attrs:{counter:"45",label:"Label",rules:[t.rules.required]},model:{value:t.rec.testLabel,callback:function(e){t.$set(t.rec,"testLabel",e)},expression:"rec.testLabel"}})],1)],1),e(h["a"],{staticClass:"mt-0",attrs:{"no-gutters":""}},[e(z["a"],{attrs:{cols:"4",md:"2"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.required,t.rules.nonNegativeNumber],label:"Temperature +/-",suffix:t.tempSuffix},model:{value:t.slopTempInput,callback:function(e){t.slopTempInput=e},expression:"slopTempInput"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"4",md:"2"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.required,t.rules.nonNegativeNumber],label:"Humidity +/-",suffix:"%"},model:{value:t.rec.slopRh,callback:function(e){t.$set(t.rec,"slopRh",e)},expression:"rec.slopRh"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"4",md:"2"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.required,t.rules.nonNegativeNumber],label:"CO2  +/-",suffix:"ppm"},model:{value:t.rec.slopCo2,callback:function(e){t.$set(t.rec,"slopCo2",e)},expression:"rec.slopCo2"}})],1),e(z["a"],{staticClass:"pl-0 pl-md-2",attrs:{cols:"6",md:"4"}},[e(Z["a"],{attrs:{label:"Irrigate With",items:t.designators,"item-value":"id","item-text":"designatorName"},model:{value:t.rec.irrigationDesignatorId,callback:function(e){t.$set(t.rec,"irrigationDesignatorId",e)},expression:"rec.irrigationDesignatorId"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"3",md:"1"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.required,t.rules.nonNegativeNumber],label:"Every",suffix:"hrs"},model:{value:t.rec.irrigationFrequency,callback:function(e){t.$set(t.rec,"irrigationFrequency",e)},expression:"rec.irrigationFrequency"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"3",md:"1"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.nonNegativeNumber],label:"For",suffix:"mins"},model:{value:t.rec.irrigationDuration,callback:function(e){t.$set(t.rec,"irrigationDuration",e)},expression:"rec.irrigationDuration"}})],1)],1),e(h["a"],{staticClass:"mt-0",attrs:{"no-gutters":""}},[e(z["a"],{attrs:{cols:"6",md:"2"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate"),"auto-close":!0},model:{value:t.startDate,callback:function(e){t.startDate=e},expression:"startDate"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"6",md:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime")},model:{value:t.startTime,callback:function(e){t.startTime=e},expression:"startTime"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"3",md:"1"}},[e(X["a"],{attrs:{label:"Ext. Temp",type:"number",suffix:t.tempSuffix,rules:[t.rules.required,t.rules.nonNegativeNumber]},model:{value:t.externalTemp,callback:function(e){t.externalTemp=e},expression:"externalTemp"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"3",md:"1"}},[e(X["a"],{attrs:{label:"External RH",type:"number",suffix:"%",rules:[t.rules.required,t.rules.nonNegativeNumber]},model:{value:t.rec.externalRh,callback:function(e){t.$set(t.rec,"externalRh",e)},expression:"rec.externalRh"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"6"}},[e(Z["a"],{attrs:{items:t.plantSizes,"item-value":"id","item-text":"text",label:"Plant Size"},model:{value:t.rec.plantAge,callback:function(e){t.$set(t.rec,"plantAge",e)},expression:"rec.plantAge"}})],1)],1)],1),e("data-table",{ref:"datatable",staticClass:"flex-grow-auto",attrs:{tempSuffix:t.tempSuffix,displayMetric:t.displayMetric},model:{value:t.rec.testDetails,callback:function(e){t.$set(t.rec,"testDetails",e)},expression:"rec.testDetails"}})],1),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{text:"",color:"primary",disabled:!t.isValid,loading:t.isLoading},on:{click:t.save}},[t._v("Save")])],1)],1)},Q=[],tt=r("9c4f"),et=r("4458"),rt=r("dd20"),nt=r("06b1"),it=r("12a1");function at(t){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(t)}function ot(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ot=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==at(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(at(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function st(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function lt(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){st(a,n,i,o,s,"next",t)}function s(t){st(a,n,i,o,s,"throw",t)}o(void 0)}))}}function ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(r),!0).forEach((function(e){yt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function dt(t,e){return vt(t)||mt(t,e)||ft(t,e)||ht()}function ht(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ft(t,e){if(t){if("string"==typeof t)return pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(t,e):void 0}}function pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function mt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function vt(t){if(Array.isArray(t))return t}function yt(t,e,r){return(e=gt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gt(t){var e=bt(t,"string");return"symbol"==at(e)?e:e+""}function bt(t,e){if("object"!=at(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=at(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var wt={name:"",props:["platformGroupName","controller_id"],mixins:[tt["a"]],components:{VuetifyDatepicker:et["a"],VuetifyTimepicker:rt["a"],DataTable:nt["a"]},data:function(){return{designators:[],slopTempInput:null,isLoading:!1,isValid:!1,tempSuffix:"C",displayMetric:!0,ecuTestPlans:[],selectedTestPlan:null,startDate:O()().format("YYYY-MM-DD"),startTime:O()().format("HH:mm"),externalTemp:null,plantSizes:[{id:0,text:"No Plants"},{id:1,text:"Small"},{id:2,text:"Medium"},{id:3,text:"Large"}],rec:yt(yt(yt(yt(yt({controller_id:this.controller_id,testLabel:null,testDetails:[],plantAge:0,notes:null,scheduledStarttime:null,starttime:null,finishtime:null,passed:null},"plantAge",3),"externalRh",50),"externalTemp",null),"irrigationDuration",0),"irrigationDesignatorId",9)}},beforeMount:function(){var t=this;v["a"].get("ecuTestPlans",this.getUser.apitoken,{filter:{sort:"label",include:["ecuTestPlanDetails"]}}).then((function(e){var r=dt(e,2),n=r[0];r[1];t.ecuTestPlans=n})),v["a"].get("vAgDesignators",this.getUser.apitoken,{filter:{order:"designatorName",where:{designatorType:"irrigation"}}}).then((function(e){var r=dt(e,2),n=r[0];r[1];t.designators=n}))},mounted:function(){v["a"].displayMetric(this.getUser)?(this.tempSuffix="C",this.displayMetric=!0,this.externalTemp=22.22):(this.tempSuffix="F",this.displayMetric=!1,this.externalTemp="72"),this.reset()},computed:ut({},Object(y["c"])(["getUser"])),methods:{reset:function(){this.rec={controller_id:this.controller_id,testLabel:null,testDetails:[],notes:null,scheduledStarttime:null,starttime:null,finishtime:null,passed:null,externalRh:50,externalTemp:null,slopRh:5,slopCo2:100,irrigationFrequency:12,irrigationDuration:0,plantAge:0,irrigationDesignatorId:9},this.slopTempInput=1,this.$refs.form.resetValidation()},onclose:function(){this.reset(),this.$emit("close")},save:function(){var t=lt(ot().mark((function t(){var e,r,n,i,a;return ot().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(this.isLoading=!0,e=JSON.parse(JSON.stringify(this.rec)),this.displayMetric)e.externalTempC=this.externalTemp;else{for(r=0;r<e.testDetails.length;r++)e.testDetails[r].temperature=Object(it["toCelsius"])(e.testDetails[r].temperature,2);e.externalTempC=Object(it["toCelsius"])(this.externalTemp,2),e.slopTemp=5*this.slopTempInput/9}return e.testDetails=JSON.stringify(e.testDetails),e.scheduledStarttime=O()(this.startDate+" "+this.startTime).utc().format(),t.next=7,v["a"].post("ecuTests",this.getUser.apitoken,e);case 7:n=t.sent,i=dt(n,2),a=i[0],i[1],this.isLoading=!1,a?(g["a"].success("Test Scheduled"),this.$emit("save"),this.$emit("close"),this.reset()):g["a"].error("An error occurred. Please try again later.");case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},watch:{selectedTestPlan:function(t,e){var r=this;if(this.rec.testLabel=t.label,this.rec.testDetails=JSON.parse(JSON.stringify(t.ecuTestPlanDetails)),!this.displayMetric)for(var n=0;n<this.rec.testDetails.length;n++)this.rec.testDetails[n].temperature=Object(it["toFahrenheit"])(this.rec.testDetails[n].temperature,1);this.$nextTick().then((function(){r.$refs.datatable.gridDraggable()})),this.$refs.form.validate()}}},xt=wt,St=Object($["a"])(xt,K,Q,!1,null,null,null),_t=St.exports,Ct=r("71a3"),Ot=r("c671"),Pt=r("fe57"),Dt=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{id:"reviewEcuTestPlanResults"}},[e(o["d"],[e("h2",[t._v("\n      "+t._s(t.platformGroupName)+" : "+t._s(t.value.testLabel)+"\n      "),t.value.starttime?e("span",[t._v(", started "),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.value.starttime))}})]):t._e()]),e(x["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.close}},[e(u["a"],[t._v("close")])],1)],1),e(o["c"],{staticStyle:{height:"100%"}},[e(Pt["a"],{staticStyle:{height:"calc(100% - 30px)"},attrs:{centered:""},model:{value:t.tabmodel,callback:function(e){t.tabmodel=e},expression:"tabmodel"}},[e(Ct["a"],[t._v("Details")]),e(Ct["a"],[t._v("Targets")]),e(Ct["a"],{attrs:{disabled:!t.value.starttime}},[t._v("Results")]),e(Ot["a"],{staticStyle:{height:"100%"}},[e(J["a"],{staticStyle:{"padding-top":"10px",height:"100%"},model:{value:t.isValid,callback:function(e){t.isValid=e},expression:"isValid"}},[e(X["a"],{attrs:{counter:"45",label:"Test Plan Name",rules:[t.rules.required]},model:{value:t.rec.testLabel,callback:function(e){t.$set(t.rec,"testLabel",e)},expression:"rec.testLabel"}}),e(h["a"],{staticClass:"mt-0",attrs:{"no-gutters":""}},[e(z["a"],{staticClass:"pr-2",attrs:{cols:"2"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.required,t.rules.nonNegativeNumber],label:"Temp +/-",suffix:t.tempSuffix,disabled:t.isDisabled},model:{value:t.slopTempInput,callback:function(e){t.slopTempInput=e},expression:"slopTempInput"}})],1),e(z["a"],{staticClass:"pl-2 pr-2",attrs:{cols:"2"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.required,t.rules.nonNegativeNumber],label:"Humidity +/-",suffix:"%",disabled:t.isDisabled},model:{value:t.rec.slopRh,callback:function(e){t.$set(t.rec,"slopRh",e)},expression:"rec.slopRh"}})],1),e(z["a"],{staticClass:"pl-2 pr-4",attrs:{cols:"2"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.required,t.rules.nonNegativeNumber],label:"CO2  +/-",suffix:"ppm",disabled:t.isDisabled},model:{value:t.rec.slopCo2,callback:function(e){t.$set(t.rec,"slopCo2",e)},expression:"rec.slopCo2"}})],1),e(z["a"],{staticClass:"pl-4",attrs:{cols:"4"}},[e(Z["a"],{attrs:{label:"Irrigate With",items:t.designators,"item-value":"id","item-text":"designatorName",disabled:t.isDisabled},model:{value:t.rec.irrigationDesignatorId,callback:function(e){t.$set(t.rec,"irrigationDesignatorId",e)},expression:"rec.irrigationDesignatorId"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"1"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.required,t.rules.nonNegativeNumber],label:"Every",suffix:"hours",disabled:t.isDisabled},model:{value:t.rec.irrigationFrequency,callback:function(e){t.$set(t.rec,"irrigationFrequency",e)},expression:"rec.irrigationFrequency"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"1"}},[e(X["a"],{attrs:{type:"number",rules:[t.rules.nonNegativeNumber],label:"For",suffix:"min",disabled:t.isDisabled},model:{value:t.rec.irrigationDuration,callback:function(e){t.$set(t.rec,"irrigationDuration",e)},expression:"rec.irrigationDuration"}})],1)],1),e(h["a"],{staticClass:"mt-0",attrs:{"no-gutters":""}},[e(z["a"],{attrs:{cols:"2"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate"),"auto-close":!0,disabled:t.isDisabled},model:{value:t.startDate,callback:function(e){t.startDate=e},expression:"startDate"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime"),readonly:t.isDisabled},model:{value:t.startTime,callback:function(e){t.startTime=e},expression:"startTime"}})],1),e(z["a"],{staticClass:"pl-2",attrs:{cols:"1"}},[e(X["a"],{attrs:{label:"Ext. Temp",disabled:t.isDisabled,type:"number",suffix:t.tempSuffix,rules:[t.rules.required,t.rules.nonNegativeNumber]},model:{value:t.externalTemp,callback:function(e){t.externalTemp=e},expression:"externalTemp"}})],1),e(z["a"],{staticClass:"pl-2 pr-2",attrs:{cols:"1"}},[e(X["a"],{attrs:{label:"Ext. RH",type:"number",disabled:t.isDisabled,suffix:"%",rules:[t.rules.required,t.rules.nonNegativeNumber]},model:{value:t.rec.externalRh,callback:function(e){t.$set(t.rec,"externalRh",e)},expression:"rec.externalRh"}})],1),e(z["a"],{staticClass:"pl-4",attrs:{cols:"6"}},[e(Z["a"],{attrs:{items:t.plantSizes,disabled:t.isDisabled,"item-value":"id","item-text":"text",label:"Plant Size"},model:{value:t.rec.plantAge,callback:function(e){t.$set(t.rec,"plantAge",e)},expression:"rec.plantAge"}})],1)],1),t._v("\n\n          Notes\n          "),e("rich-text-editor",{attrs:{height:"250"},model:{value:t.rec.notes,callback:function(e){t.$set(t.rec,"notes",e)},expression:"rec.notes"}})],1)],1),e(Ot["a"],{staticStyle:{height:"100%","padding-top":"10px"}},[e("data-table",{ref:"datatable",staticStyle:{height:"100%"},attrs:{tempSuffix:t.tempSuffix,displayMetric:t.displayMetric,disabled:!0},model:{value:t.rec.testDetails,callback:function(e){t.$set(t.rec,"testDetails",e)},expression:"rec.testDetails"}})],1),e(Ot["a"],{staticStyle:{height:"100%"}},[e("chart-results",{staticStyle:{height:"100%"},attrs:{controller_id:t.value.controller_id,testPlan:t.value.testDetails,starttime:t.value.starttime,finishtime:t.theFinishTime,slopTemp:t.rec.slopTemp,slopRh:t.rec.slopRh,slopCo2:t.rec.slopCo2}})],1)],1)],1),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{color:"primary",text:"",loading:t.isLoading,disabled:!t.isValid&&!t.isDisabled},on:{click:t.save}},[t._v("Save")])],1)],1)},kt=[],Tt=r("490a"),jt=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{height:"100%","padding-left":"5px","padding-right":"5px","padding-top":"10px"}},[e(h["a"],[e(z["a"],{staticClass:"pr-2",attrs:{cols:"12",md:"9"}},[e(Z["a"],{staticClass:"chartTypeSelector",attrs:{items:t.chartTypes,"item-text":"text","item-value":"id","single-line":"",label:"Charts",multiple:"",chips:"","deletable-chips":"",dense:""},model:{value:t.chartsToDisplay,callback:function(e){t.chartsToDisplay=e},expression:"chartsToDisplay"}})],1),e(z["a"],{attrs:{cols:"12",md:"3"}},[e(Z["a"],{staticStyle:{"padding-top":"8px"},attrs:{items:t.dataTypes,"item-text":"label","item-value":"id"},model:{value:t.datasetTypeProperty,callback:function(e){t.datasetTypeProperty=e},expression:"datasetTypeProperty"}})],1)],1),t.isLoading?e("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center",height:"calc(100% - 80px)"}},[e(Tt["a"],{attrs:{indeterminate:"",color:"primary"}})],1):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.isLoading,expression:"!isLoading"}],attrs:{id:"FullScreenMultiChart2"}})],1)},Et=[],It=r("3488"),Lt=r("ea7f"),At=r.n(Lt),Mt=r("ee40"),Ut=r.n(Mt),Nt=r("12dc"),Ft=r("b047"),Gt=r.n(Ft);r("aa47");function Rt(t){return Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rt(t)}function $t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */$t=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Rt(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Rt(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Ht(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Vt(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){Ht(a,n,i,o,s,"next",t)}function s(t){Ht(a,n,i,o,s,"throw",t)}o(void 0)}))}}function Bt(t,e){return Jt(t)||Wt(t,e)||Yt(t,e)||zt()}function zt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Yt(t,e){if(t){if("string"==typeof t)return qt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qt(t,e):void 0}}function qt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Wt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Jt(t){if(Array.isArray(t))return t}function Zt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Zt(Object(r),!0).forEach((function(e){Kt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Kt(t,e,r){return(e=Qt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qt(t){var e=te(t,"string");return"symbol"==Rt(e)?e:e+""}function te(t,e){if("object"!=Rt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Ut()(At.a);var ee={name:"",props:["controller_id","testPlan","starttime","finishtime","slopTemp","slopRh","slopCo2"],mixins:[B["a"],It["a"],Nt["a"]],components:{},beforeMount:function(){window.moment=O.a,At.a.setOptions({time:{timezone:this.tzPref()}}),At.a.Pointer.prototype.reset=function(){},At.a.Point.prototype.highlight=function(t){t=this.series.chart.pointer.normalize(t),this.onMouseOver(),this.series.chart.tooltip.refresh(this),this.series.chart.xAxis[0].drawCrosshair(t,this)}},mounted:function(){},data:function(){return{sortableObj:null,dataTypes:[{id:"avgReading",label:"3 Min. Averages"},{id:"reading",label:"Actuals"}],isLoading:!1,canFetch:!0,datasetTypeProperty:"avgReading",selectedUnit:"minute",testplan:{},startDate:null,endDate:null,keyIndex:100,lightSeries:[],charts:[],chartsToDisplay:[1,8,2,3],priorStates:null,devices:[],dehumidifierType:"",booleanYAxis:{title:{text:"Status"}},temperatureDevices:[],co2Devices:[],humidityDevices:[],chartTypes:[{id:1,text:"Temperature"},{id:2,text:"Humidity"},{id:3,text:"CO2"},{id:4,text:"Lights"},{id:5,text:"Curtains"},{id:6,text:"Heater"},{id:7,text:"CO2 Valve"},{id:8,text:"ECU"},{id:9,text:"Dehumidifier"},{id:10,text:"Humidifier"}]}},computed:Xt({},Object(y["c"])(["getUser","userData"])),watch:{datasetTypeProperty:function(t,e){this.refresh()},testPlan:{immediate:!0,handler:function(t,e){this.testplan=JSON.parse(t),this.testplan.sort((function(t,e){return t.seq>e.seq?1:-1})),this.refresh()}},chartsToDisplay:function(t,e){this.removeEventListeners(),this.destroyCharts(),this.generateChart()}},beforeDestroy:function(){this.removeEventListeners(),this.destroyCharts()},methods:{onClose:function(){this.$emit("close")},getBooleanSeries:function(t,e,r){var n=this.annotationData.filter((function(e){return e.dtLabel==t})),i=[];n.sort((function(t,e){return t.timestamp>e.timestamp?1:-1}));for(var a=0;a<n.length;a++){var o=n[a].stateName.indexOf(e)>=0;r?i.push({x:O.a.utc(n[a].timestamp).valueOf(),y:o?0:1,datestring:n[a].timestamp}):i.push({x:O.a.utc(n[a].timestamp).valueOf(),y:o?1:0,datestring:n[a].timestamp})}var s=this.priorStates.find((function(e){return e.typename==t})),l=i[0];return l&&i.unshift({x:l.x-1,y:l.y,datestring:l.datestring}),s&&(r?i.unshift({x:O.a.utc(this.startDate).valueOf(),y:s.stateName.indexOf(e)>=0?0:1,datestring:this.startDate}):i.unshift({x:O.a.utc(this.startDate).valueOf(),y:s.stateName.indexOf(e)>=0?1:0,datestring:this.startDate})),i.push({x:O.a.utc(this.endDate).valueOf(),y:i[i.length-1].y,datestring:this.endDate}),i},get2StageSeries:function(t,e){var r=Bt(e,2),n=r[0],i=r[1],a=this.annotationData.filter((function(e){return e.dtLabel==t})),o=[];console.log(a),a.sort((function(t,e){return t.timestamp>e.timestamp?1:-1}));for(var s=0;s<a.length;s++){var l=a[s].stateName.indexOf(n)>=0,c=a[s].stateName.indexOf(i)>=0;l?o.push({x:O.a.utc(a[s].timestamp).valueOf(),y:0,datestring:a[s].timestamp}):c?o.push({x:O.a.utc(a[s].timestamp).valueOf(),y:2,datestring:a[s].timestamp}):o.push({x:O.a.utc(a[s].timestamp).valueOf(),y:1,datestring:a[s].timestamp})}var u=this.priorStates.find((function(e){return e.typename==t})),d=o[0];if(d&&o.unshift({x:d.x-1,y:d.y,datestring:d.datestring}),u){var h=u.stateName.indexOf(n)>=0,f=u.stateName.indexOf(i)>=0;h?o.push({x:O.a.utc(this.startDate).valueOf(),y:0,datestring:this.startDate}):f?o.push({x:O.a.utc(this.startDate).valueOf(),y:2,datestring:this.startDate}):o.push({x:O.a.utc(this.startDate).valueOf(),y:1,datestring:this.startDate})}return o.push({x:O.a.utc(this.endDate).valueOf(),y:o[o.length-1].y,datestring:this.endDate}),o},getCo2ValveSeries:function(){for(var t=this.annotationData.filter((function(t){return"CO2Valve"==t.dtLabel})),e=[],r=0;r<t.length;r++)e.push({x:O.a.utc(t[r].timestamp).valueOf(),y:t[r].stateName.indexOf("ON")>=0?1:0});var n=this.priorStates.find((function(t){return"CO2Valve"==t.typename}));return n&&e.push({x:O.a.utc(this.startDate).valueOf(),y:"OFF"==n.stateName?0:1}),1==e.length&&e.push({x:O.a.utc(this.endDate).valueOf(),y:"OFF"==n.stateName?0:1}),e},syncExtremes:function(t){var e=this.chart;"syncExtremes"!==t.trigger&&At.a.each(At.a.charts,(function(r){r!==e&&r.xAxis[0].setExtremes&&r.xAxis[0].setExtremes(t.min,t.max,void 0,!1,{trigger:"syncExtremes"})}))},syncChartHandler:function(t){var e,r,n,i,a=this,o=a.charts.length;for(n=0;n<o;n+=1)e=a.charts[n],i=e.pointer.normalize(t),r=e.series[0].searchPoint(i,!0),r&&r.highlight(t)},destroyCharts:function(){for(var t=this.charts.length,e=0;e<t;e++)this.charts[e].destroy();var r=document.getElementById("FullScreenMultiChart2");r&&(r.innerHTML=""),this.charts=[]},removeEventListeners:function(){var t=this,e=document.getElementById("FullScreenMultiChart2");e&&["mousemove","touchmove","touchstart"].forEach((function(r){e.removeEventListener(r,t.syncChartHandler)}))},attachEventListeners:function(){var t=this;["mousemove","touchmove","touchstart"].forEach((function(e){document.getElementById("FullScreenMultiChart2").addEventListener(e,t.syncChartHandler)}))},syncData:function(){for(var t=this,e=this,r=[],n=function(n){var i=e.chartTypes.find((function(t){return t.id==e.chartsToDisplay[n]}));if(!i)return 1;switch(i.id){case 1:r.push(e.chartData.tempSeries.data);break;case 2:r.push(e.chartData.humiditySeries.data);break;case 3:r.push(e.chartData.co2Series.data);break;case 4:break;case 5:r.push(e.getBooleanSeries("Curtain","CLOSED",!0));break;case 6:r.push(e.getBooleanSeries("HeaterStrip","OFF",!0));break;case 7:r.push(e.getCo2ValveSeries());break;case 8:r.push(e.ecuChartData);break;case 9:if("TwoStageDehumidifier"==e.dehumidifierType){var a=t.get2StageSeries(t.dehumidifierType,["OFF","ON"]);r.push(a)}else r.push(e.getBooleanSeries("VFUDehumidifier","OFF",!0));break;case 10:r.push(e.getBooleanSeries("VFUHumidifier","OFF",!0));break}},i=0;i<this.chartsToDisplay.length;i++)n(i);return r},generateChart:Gt()((function(){var t=this,e=this,r=this.syncData(),n=[];this.removeEventListeners(),this.destroyCharts();for(var i=function(i){var a=e.chartTypes.find((function(t){return t.id==e.chartsToDisplay[i]})),o=null;n=r[i];var s="",l="",c=!1,u="";switch(a.id){case 1:u="line",s="red",l="F";break;case 2:u="line",s="blue",l="%";break;case 3:u="line",s="green",l="ppm";break;case 4:u="line",s="magenta",l="",c=!1;break;case 5:u="line",s="silver",l="",c=!0;break;case 6:u="line",s="brown",l="",c=!0;break;case 7:u="line",s="lightGreen",l="",c=!0;break;case 8:u="xrange",s="purple",l="";break;case 9:u="line",s="orange",l="",c=!0;break;case 10:u="line",s="cyan",l="",c=!0;break}var d=document.createElement("div");if(d.className=c?"multichartBoolean":"multichart",document.getElementById("FullScreenMultiChart2").appendChild(d),"line"==u){o={exporting:t.highchartsExporting,plotOptions:{series:{turboThreshold:2e3}},chart:{marginLeft:40,spacingTop:20,spacingBottom:20,backgroundColor:null,zoomType:"x"},title:{text:a.text,align:"left",margin:0,x:30},credits:{enabled:!1},legend:{enabled:!1},xAxis:{crosshair:!0,type:"datetime",min:O.a.utc(t.startDate).valueOf(),max:O.a.utc(t.endDate).valueOf(),dateTimeLabelFormats:{minute:"%I:%M %P",hour:"%I:%M %P"},events:{setExtremes:t.syncExtremes}},yAxis:{title:{text:null}},tooltip:{positioner:function(){return{x:this.chart.chartWidth-this.label.width-40,y:10}},borderWidth:0,backgroundColor:"none",pointFormat:"{point.y}",headerFormat:"",shadow:!1,style:{fontSize:"18px"},valueDecimals:1==a.id?2:0},series:[{data:n,name:a.text,type:"line",color:s,fillOpacity:.3,tooltip:{valueSuffix:" "+l}}]};var h=[],f=O()(t.starttime).utc(),p=v["a"].displayMetric(e.getUser);switch(a.id){case 1:o.xAxis.plotLines=[];var m=e.slopTemp,y=e.testplan[0].temperature-m,g=e.testplan[0].temperature+m;h.push([f.valueOf(),p?y:Object(it["toFahrenheit"])(y),p?g:Object(it["toFahrenheit"])(g)]);for(var b=0;b<e.testplan.length;b++){var w=e.testplan[b].temperature-m,x=e.testplan[b].temperature+m;o.xAxis.plotLines.push({color:"silver",width:1,value:f.valueOf()}),f.add(e.testplan[b].transitionTime,"minutes"),h.push([f.valueOf(),p?w:Object(it["toFahrenheit"])(w),p?x:Object(it["toFahrenheit"])(x)]),f.add(e.testplan[b].onTargetTime,"minutes"),h.push([f.valueOf(),p?w:Object(it["toFahrenheit"])(w),p?x:Object(it["toFahrenheit"])(x)])}o.series.push({data:h,name:"Test Plan",type:"arearange",color:At.a.getOptions().colors[0],fillOpacity:.3,zIndex:0,linkedTo:":previous",marker:{enabled:!1},tooltip:{valueSuffix:" "+l}});break;case 2:var S=parseInt(t.slopRh),_=e.testplan[0].humidity-S,C=e.testplan[0].humidity+S;o.xAxis.plotLines=[],h.push([f.valueOf(),_,C]);for(var P=0;P<e.testplan.length;P++)o.xAxis.plotLines.push({color:"silver",width:1,value:f.valueOf()}),f.add(e.testplan[P].transitionTime,"minutes"),h.push([f.valueOf(),e.testplan[P].humidity-S,e.testplan[P].humidity+S]),f.add(e.testplan[P].onTargetTime,"minutes"),h.push([f.valueOf(),e.testplan[P].humidity-S,e.testplan[P].humidity+S]);o.series.push({data:h,name:"Test Plan",type:"arearange",color:At.a.getOptions().colors[0],fillOpacity:.3,zIndex:0,linkedTo:":previous",marker:{enabled:!1}});break;case 3:var D=parseInt(t.slopCo2),k=e.testplan[0].co2-D,T=e.testplan[0].co2+D;o.xAxis.plotLines=[],h.push([f.valueOf(),k,T]);for(var j=0;j<e.testplan.length;j++){var E=e.testplan[j].co2-D,I=e.testplan[j].co2+D;o.xAxis.plotLines.push({color:"silver",width:1,value:f.valueOf()}),f.add(e.testplan[j].transitionTime,"minutes"),h.push([f.valueOf(),E,I]),f.add(e.testplan[j].onTargetTime,"minutes"),h.push([f.valueOf(),E,I])}o.series.push({data:h,name:"Test Plan",type:"arearange",color:At.a.getOptions().colors[0],fillOpacity:.3,zIndex:0,linkedTo:":previous",marker:{enabled:!1}});break;case 4:o.xAxis.plotLines=[];var L=Math.round((e.testplan[0].downlightIntensity+e.testplan[0].interlightIntensity)/2);h.push({x:f.valueOf(),y:L});for(var A=0;A<e.testplan.length;A++){o.xAxis.plotLines.push({color:"silver",width:1,value:f.valueOf()}),f.add(e.testplan[A].transitionTime,"minutes");var M=Math.round((e.testplan[A].downlightIntensity+e.testplan[A].interlightIntensity)/2);h.push({x:f.valueOf(),y:M}),f.add(e.testplan[A].onTargetTime,"minutes"),h.push({x:f.valueOf(),y:M})}o.series.push({data:h,name:"Test Plan",type:"line"}),o.yAxis.max=100;break}c&&(o.yAxis.tickInterval=1,o.yAxis.ceiling=1,o.plotOptions={series:{step:"left"}})}else if("xrange"==u){for(var U=[],N={CO:"lightblue",CI:"silver",DE:"purple"},F=[],G={},R=0;R<n.length;R++){var $=n[R].stateName.substring(0,2),H=n[R].stateName;if($ in G||(F.push($),G[$]=F.length-1),R+1<n.length){var V=O.a.utc(n[R].timestamp),B=O.a.utc(n[R+1].timestamp);U.push({y:G[$],x:V.valueOf(),x2:B.valueOf(),label:H,timeDiff:V.diff(B,"minutes")})}}o={credits:{enabled:!1},exporting:t.highchartsExporting,chart:{type:"xrange",backgroundColor:null},colors:z,title:{text:a.text,align:"left",margin:0,x:30},tooltip:{positioner:function(){return{x:this.chart.chartWidth-this.label.width,y:10}},borderWidth:0,backgroundColor:"none",pointFormat:"",headerFormat:"",shadow:!1,style:{fontSize:"18px"},valueDecimals:!1},xAxis:{crosshair:!0,type:"datetime",min:O.a.utc(t.startDate).valueOf(),max:O.a.utc(t.endDate).valueOf(),dateTimeLabelFormats:{minute:"%I:%M %P",hour:"%I:%M %P"},events:{setExtremes:t.syncExtremes}},yAxis:{title:{text:""},categories:F,reversed:!0},series:[{borderColor:"gray",pointWidth:20,data:U}],dataLabels:{enabled:!0}};for(var z=[],Y=0;Y<F.length;Y++)N[F[Y]]&&z.push(N[F[Y]]);z.length>0&&(o.colors=z)}e.charts.push(At.a.chart(d,o))},a=0;a<this.chartsToDisplay.length;a++)i(a);this.attachEventListeners()}),250),refresh:function(){var t=Vt($t().mark((function t(){var e,r,n,i,a,o,s;return $t().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=this,this.destroyCharts(),this.startDate=O.a.utc(this.starttime),this.endDate=O.a.utc(this.finishtime),e.isLoading=!0,e.chartTypes=[{id:1,text:"Temperature"},{id:2,text:"Humidity"},{id:3,text:"CO2"}],t.next=8,v["a"].get("virtualDevices",this.getUser.apitoken,{filter:{include:[{relation:"virtualDeviceType",scope:{fields:["typename"]}}],where:{controller_id:this.controller_id}}});case 8:r=t.sent,n=Bt(r,2),i=n[0],n[1],a=0;case 13:if(!(a<i.length)){t.next=28;break}o=i[a],o.device_id=o.id,t.t0=o.designator_id,t.next=5===t.t0?19:6===t.t0?21:7===t.t0?23:25;break;case 19:return this.temperatureDevices.push(o),t.abrupt("break",25);case 21:return this.humidityDevices.push(o),t.abrupt("break",25);case 23:return this.co2Devices.push(o),t.abrupt("break",25);case 25:a++,t.next=13;break;case 28:e.chartDevice.temperature=this.temperatureDevices.map((function(t){return t.id})),e.chartDevice.humidity=this.humidityDevices.map((function(t){return t.id})),e.chartDevice.co2=this.co2Devices.map((function(t){return t.id})),i=i.filter((function(t){return[1,11,13,17,18,28,37,39,41,42,43].includes(t.virtualDeviceType_id)})),e.devices=i,s=O.a.utc(this.starttime).format("YYYY-MM-DD HH:mm"),v["a"].get("virtualDevices/getPriorStates",this.getUser.apitoken,{device_ids:i.map((function(t){return t.id})),date:s}).then((function(t){var r=Bt(t,2),n=r[0];r[1];e.priorStates=n;var i=n.find((function(t){return"Light"==t.typename}));i&&e.chartTypes.push({id:4,text:"Lights"});var a=n.find((function(t){return"Curtain"==t.typename}));a&&e.chartTypes.push({id:5,text:"Curtains"});var o=n.find((function(t){return"HeaterStrip"==t.typename}));o&&e.chartTypes.push({id:6,text:"Heater"}),e.chartTypes.push({id:7,text:"CO2 Valve"});var s=n.find((function(t){return"ECU"==t.typename}));s&&(e.chartDevice.ecu=s.device_id,e.chartTypes.push({id:8,text:"ECU"}));var l=n.find((function(t){return"VFUHumidifier"==t.typename}));l&&(e.chartDevice.humidifier=l.device_id,e.chartTypes.push({id:10,text:"Humidifier"}));var c=n.find((function(t){return"VFUDehumidifier"==t.typename}));c&&(e.chartDevice.dehumidifier=c.device_id,e.dehumidifierType="VFUDehumidifier",e.chartTypes.push({id:9,text:"Dehumidifier"}));var u=n.find((function(t){return"TwoStageDehumidifier"==t.typename}));u&&(e.chartDevice.dehumidifier=u.device_id,e.dehumidifierType="TwoStageDehumidifier",e.chartTypes.push({id:9,text:"Two-Stage Dehumidifier"})),e.chartTypes.sort((function(t,e){return t.text>e.text?1:-1})),e.fetchChartData(2e3,(function(){e.isLoading=!1,e.$nextTick((function(){e.generateChart()}))}))}));case 35:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()}},re=ee,ne=(r("bc3c"),Object($["a"])(re,jt,Et,!1,null,"2661f6f1",null)),ie=ne.exports;function ae(t){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(t)}function oe(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */oe=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==ae(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(ae(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function se(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function le(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){se(a,n,i,o,s,"next",t)}function s(t){se(a,n,i,o,s,"throw",t)}o(void 0)}))}}function ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ue(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ce(Object(r),!0).forEach((function(e){de(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function de(t,e,r){return(e=he(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function he(t){var e=fe(t,"string");return"symbol"==ae(e)?e:e+""}function fe(t,e){if("object"!=ae(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function pe(t,e){return be(t)||ge(t,e)||ve(t,e)||me()}function me(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ve(t,e){if(t){if("string"==typeof t)return ye(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ye(t,e):void 0}}function ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ge(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function be(t){if(Array.isArray(t))return t}var we={name:"",props:["value","platformGroupName"],mixins:[tt["a"],B["a"]],components:{RichTextEditor:P["a"],ChartResults:ie,DataTable:nt["a"],VuetifyDatepicker:et["a"],VuetifyTimepicker:rt["a"]},data:function(){return{tabmodel:0,startDate:O()().format("YYYY-MM-DD"),startTime:O()().format("HH:mm"),slopTempInput:null,isLoading:!1,isValid:!0,tempSuffix:"C",designators:[],displayMetric:!0,externalTemp:null,showTable:!0,rec:{label:"",notes:null,id:null,ecuTestPlanDetails:[]},plantSizes:[{id:0,text:"No Plants"},{id:1,text:"Small"},{id:2,text:"Medium"},{id:3,text:"Large"}]}},beforeMount:function(){var t=this;t.value.starttime&&(this.tabmodel=2),v["a"].displayMetric(this.getUser)?(this.tempSuffix="C",this.displayMetric=!0):(this.tempSuffix="F",this.displayMetric=!1),v["a"].get("vAgDesignators",this.getUser.apitoken,{filter:{order:"designatorName",where:{designatorType:"irrigation"}}}).then((function(e){var r=pe(e,2),n=r[0];r[1];t.designators=n}))},mounted:function(){},computed:ue(ue({},Object(y["c"])(["getUser"])),{},{isDisabled:function(){return null!=this.value.starttime},theFinishTime:function(){return this.value.finishtime?this.value.finishtime:O.a.utc()}}),methods:{close:function(){this.$emit("close")},save:function(){var t=le(oe().mark((function t(){var e,r,n,i;return oe().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.isLoading=!0,e=this.rec,this.displayMetric?this.rec.slopTemp=this.slopTempInput:this.rec.slopTemp=5*this.slopTempInput/9,e.scheduledStarttime=O()(this.startDate+" "+this.startTime).utc().format(),e.testDetails&&delete e.testDetails,t.next=7,v["a"].patch("ecuTests",this.getUser.apitoken,e);case 7:r=t.sent,n=pe(r,2),i=n[0],n[1],this.isLoading=!1,i?(g["a"].success("Record Saved"),this.rec.id=i.id,this.$emit("refresh"),this.close()):g["a"].error("An error occurred. Please try again later.");case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},watch:{value:{handler:function(t,e){if(this.rec=JSON.parse(JSON.stringify(t)),this.rec.testDetails=JSON.parse(this.rec.testDetails),this.rec.testDetails.sort((function(t,e){return t.seq>e.seq?1:-1})),!v["a"].displayMetric(this.getUser))for(var r=0;r<this.rec.testDetails.length;r++)this.rec.testDetails[r].temperature=Object(it["toFahrenheit"])(this.rec.testDetails[r].temperature,1);if(t.starttime)for(var n=O()(t.starttime),i=0;i<this.rec.testDetails.length;i++)this.rec.testDetails[i].startTime=n.format("YYYY-MM-DD HH:mm"),n.add(this.rec.testDetails[i].transitionTime+this.rec.testDetails[i].onTargetTime,"minutes");this.startDate=O.a.utc(this.rec.scheduledStarttime).format("YYYY-MM-DD"),this.startTime=O.a.utc(this.rec.scheduledStarttime).format("HH:mm"),v["a"].displayMetric(this.getUser)?(this.slopTempInput=this.rec.slopTemp,this.externalTemp=this.rec.externalTempC):(this.slopTempInput=parseFloat((9*this.rec.slopTemp/5).toFixed(1)),this.externalTemp=Object(it["toFahrenheit"])(this.rec.externalTempC))},immediate:!0}}},xe=we,Se=(r("54f5"),Object($["a"])(xe,Dt,kt,!1,null,null,null)),_e=Se.exports;function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Oe(t,e){return je(t)||Te(t,e)||De(t,e)||Pe()}function Pe(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function De(t,e){if(t){if("string"==typeof t)return ke(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ke(t,e):void 0}}function ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Te(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function je(t){if(Array.isArray(t))return t}function Ee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ie(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ee(Object(r),!0).forEach((function(e){Le(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ee(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Le(t,e,r){return(e=Ae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ae(t){var e=Me(t,"string");return"symbol"==Ce(e)?e:e+""}function Me(t,e){if("object"!=Ce(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Ue={name:"",props:["value"],mixins:[B["a"]],components:{ScheduleNewTest:_t,ReviewResults:_e,VuetifyTimepicker:rt["a"],VuetifyDatepicker:et["a"]},data:function(){return{isLoading:!1,refreshCounter:0,rescheduleStartDate:O()().format("YYYY-MM-DD"),rescheduleStartTime:O()().format("HH:mm"),showDuplicate:!1,showResults:!1,showAddNew:!1,failedReasons:[],selectedRec:null,expandedRecord:[],data:[],rangeSuffix:{Temperature:"C",Humidity:"%",CO2:"ppm"},expandedRecordId:null,pagination:{itemsPerPage:-1,sortBy:["scheduledStarttime"],sortDesc:[!0]},pagination2:{itemsPerPage:-1},headers:[{value:"actions",text:"Actions",sortable:!1,align:"center",width:100},{text:"Test",sortable:!0,value:"testLabel"},{text:"Scheduled Start",sortable:!0,value:"scheduledStarttime",align:"center"},{text:"Started",sortable:!0,value:"starttime",align:"center"},{text:"Finished",sortable:!0,value:"finishtime",align:"center"},{text:"Passed",sortable:!0,value:"passed",align:"center"},{text:"",value:"data-table-expand"}],headers2:[{text:"Time",value:"timestamp"},{text:"Type",value:"type"},{text:"Low Bound",value:"rangeLow",align:"center"},{text:"High Bound",value:"rangeHigh",align:"center"},{text:"Actual",value:"reading",align:"center",groupable:!1},{text:"Diff",value:"diff",align:"center",groupable:!1}]}},beforeMount:function(){},computed:Ie(Ie({},Object(y["c"])(["getUser"])),{},{abbrevPlatformGroupName:function(){var t=this.value.platformGroupName.split("-");return 3===t.length?t[1]+"-"+t[2]:this.value.platformGroupName}}),methods:{onConfirmDuplicate:function(){this.showDuplicate=!1,this.selectedRec.starttime=null,this.selectedRec.finishtime=null,this.selectedRec.passed=null,this.selectedRec.failReasons=null,this.selectedRec.isCanceled=!1,this.selectedRec.scheduledStarttime=O()(this.rescheduleStartDate+" "+this.rescheduleStartTime).utc().format(),delete this.selectedRec.id;var t=this;t.isLoading=!0,v["a"].post("ecuTests",this.getUser.apitoken,this.selectedRec).then((function(e){var r=Oe(e,2),n=r[0];r[1];t.isLoading=!1,t.refresh(),n?g["a"].success("Test Scheduled"):g["a"].error("An error occurred. Please try again later.")}))},onDuplicate:function(t){this.selectedRec=JSON.parse(JSON.stringify(t)),this.rescheduleStartTime=O()().add(5,"minutes").format("HH:mm"),this.showDuplicate=!0},recomputeResults:function(t){var e=this;v["a"].get("ecuTests/validateResults",this.getUser.apitoken,{id:t.id}).then((function(t){var r=Oe(t,2),n=r[0];r[1];n?(g["a"].success("Tests "+(n.passed?"Passed":"Failed")),e.refresh()):g["a"].error("An error occurred. Please try again later.")}))},onclose:function(){this.$emit("close")},onEdit:function(t){this.refreshCounter++,this.selectedRec=t,this.showResults=!0},onStop:function(t){var e=this;W["a"].confirm("Confirm","Are you sure that you want to stop the current test - "+t.testLabel+"?",(function(r){r&&(e.isLoading=!0,v["a"].post("ecuTests/stop",e.getUser.apitoken,{id:t.id}).then((function(t){var r=Oe(t,2),n=r[0];r[1];e.isLoading=!1,e.refresh(),n?g["a"].success("Test Stopped"):g["a"].error("An error occurred. Please try again later.")})))}))},onDelete:function(t){var e=this;W["a"].confirm("Confirm Delete","Are you sure that you want to delete "+t.testLabel+"?",(function(r){r&&(e.isLoading=!0,v["a"].destroy("ecuTests",t.id,e.getUser.apitoken).then((function(t){var r=Oe(t,2),n=r[0];r[1];e.isLoading=!1,e.refresh(),n?g["a"].success("Record deleted"):g["a"].error("An error occurred. Please try again later.")})))}))},refresh:function(){var t=this;this.isLoading=!0,v["a"].get("ecuTests",this.getUser.apitoken,{filter:{limit:100,order:"scheduledStarttime",where:{controller_id:this.value.controller_id}}}).then((function(e){var r=Oe(e,2),n=r[0];r[1];t.isLoading=!1,t.data=n}))}},watch:{value:{handler:function(t){this.refresh()},immediate:!0},expandedRecord:function(t,e){var r=this;if(1==t.length&&t[0].failReasons){this.failedReasons=JSON.parse(t[0].failReasons);var n=v["a"].displayMetric(this.getUser);n||(this.rangeSuffix.Temperature="F");for(var i=0;i<r.failedReasons.length;i++){var a=r.failedReasons[i];"Temperature"!=a.type||n||(a.reading=Object(it["toFahrenheit"])(a.reading,2),a.rangeLow=Object(it["toFahrenheit"])(a.rangeLow,1),a.rangeHigh=Object(it["toFahrenheit"])(a.rangeHigh,1)),"CO2"==a.type&&(a.reading=Math.round(a.reading)),r.failedReasons[i].reading>r.failedReasons[i].rangeHigh?(r.failedReasons[i].class="high",r.failedReasons[i].diff=parseFloat((r.failedReasons[i].reading-r.failedReasons[i].rangeHigh).toFixed(1))):r.failedReasons[i].reading<r.failedReasons[i].rangeLow&&(r.failedReasons[i].diff=parseFloat((r.failedReasons[i].rangeLow-r.failedReasons[i].reading).toFixed(1)),r.failedReasons[i].class="low")}this.expandedRecordId=t[0].id}else this.expandedRecordId=null,this.failedReasons=[]}}},Ne=Ue,Fe=(r("c1f1"),Object($["a"])(Ne,Y,q,!1,null,"750e0e4a",null)),Ge=Fe.exports;function Re(t){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(t)}function $e(t,e){return Ye(t)||ze(t,e)||Ve(t,e)||He()}function He(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ve(t,e){if(t){if("string"==typeof t)return Be(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Be(t,e):void 0}}function Be(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ze(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Ye(t){if(Array.isArray(t))return t}function qe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function We(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qe(Object(r),!0).forEach((function(e){Je(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Je(t,e,r){return(e=Ze(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ze(t){var e=Xe(t,"string");return"symbol"==Re(e)?e:e+""}function Xe(t,e){if("object"!=Re(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Ke={name:"",props:["device","co2Enabled","temperatureDevices","humidityDevices","co2Devices"],mixins:[B["a"]],components:{CreateNewTicket:w["a"],TicketDetails:b["a"],OperationalNotes:V,EcuValidationTests:Ge},beforeMount:function(){this.refresh(),this.checkTestMode(),this.isMaintenanceUser=v["a"].isAdmin(this.getUser)||v["a"].isUserInRole(this.getUser,"Maintenance")},mounted:function(){},data:function(){return{outlineButtons:!0,isMaintenanceUser:!1,showEcuValidationTests:!1,pagination:{itemsPerPage:-1,sortBy:["failureDate"]},CMD_DEPLOY:81,CMD_UNDEPLOY:82,displayAlerts:!1,displayOperationalNotes:!1,co2Disabled:!1,selectedTicket:null,disableServiceHistory:!1,deployed:!1,selectedRec:null,outOfService:!1,isTesting:!1,showConfirmDelete:!1,tickets:[],ticketStatuses:[],jobTickets:[],currentTicket:{},hideResolved:!0,currentHardwareItem:null,createTicketDialog:!1,ticketDetailsDialog:!1,Trimaster:v["a"],isLoading:!1,ticketsLoading:!1,headers:[{text:"Actions",sortable:!1,value:"actions",align:"center"},{text:"ID",align:"center",value:"id"},{text:"Date Failed",align:"center",value:"failureDate"},{text:"Type",align:"left",value:"hardwareItemTicketProblemTypeLabel"},{text:"Subcomponent",align:"left",value:"hardwareTypeCategoryLabel"},{text:"Status",value:"hardwareItemTicketStatusLabel",align:"center"},{text:"Estimated Completion",value:"estimatedCompletionDate",align:"center"},{text:"Assigned User(s)",value:"assignedUsers",align:"center"},{text:"Resolved",value:"isResolved",align:"center"},{text:"Updated",value:"updatedate",align:"center"},{value:"data-table-select",width:35}]}},computed:We(We({},Object(y["c"])(["getUser"])),{},{filteredTickets:function(){if(this.hideResolved){var t=this.tickets.filter((function(t){return!t.isResolved}));return t}return this.tickets}}),watch:{co2Enabled:{immediate:!0,handler:function(t,e){this.co2Disabled=!t}}},methods:{showAlerts:function(){this.$emit("showalerts")},onNewTicket:function(){this.selectedTicket={id:null},this.createTicketDialog=!0},onUnitCo2DisableChange:function(){var t=this,e="CO2Enable";this.co2Disabled&&(e="CO2Disable"),v["a"].get("devicesAndPlatforms",this.getUser.apitoken,{filter:{where:{controller_id:this.device.controller.id,deviceType_id:{inq:[18,39]}}}}).then((function(r){var n=$e(r,2),i=n[0];n[1];return v["a"].post("controllerCommands/executeComplexBatchCommand",t.getUser.apitoken,{command:e,controller_ids:[t.device.controller.id],platformGroup_ids:[t.device.platformGroup_id],virtualDeviceType_id:i[0].deviceType_id})})).then((function(t){var e=$e(t,2),r=e[0];e[1];r?g["a"].success("Command sent"):g["a"].error("An error occurred. Please try again later.")}))},onConfirmDelete:function(){var t=this;v["a"].destroy("hardware_item_tickets",this.selectedRec.id,this.getUser.apitoken).then((function(e){1==e.length?(g["a"].success("Record deleted."),t.showConfirmDelete=!1,t.refresh(),t.$emit("refresh")):g["a"].error("Error - "+e[1].message)}))},confirmDelete:function(t){this.selectedRec=t,this.showConfirmDelete=!0},checkTestMode:function(){var t=this;t.isLoading=!0,v["a"].get("controllers/"+t.device.controller.id,t.getUser.apitoken,{}).then((function(e){var r=$e(e,2),n=r[0];r[1];n&&(t.isTesting=n.isTesting)}))},onUnitTestingChange:function(){var t=this;t.isLoading=!0,v["a"].patch("controllers",t.getUser.apitoken,{id:t.device.controller.id,isTesting:t.isTesting}).then((function(e){var r=$e(e,2),n=r[0],i=r[1];t.isLoading=!1,i?g["a"].error("Unable to switch test mode for controller"):n&&g["a"].success("Test mode toggled succesfully")}))},onUnitDisableChange:function(){var t=this;t.isLoading=!0,t.outOfService&&v["a"].post("controllerCommands/clear",t.getUser.apitoken,{controller_id:t.device.controller_id}).then((function(t){var e=$e(t,2),r=(e[0],e[1]);r&&g["a"].error("Unable to clear controller commands")})),v["a"].patch("hardware_items",t.getUser.apitoken,{id:t.currentHardwareItem.id,isDisabled:t.outOfService}).then((function(e){var r=$e(e,1),n=r[0];n.error&&g["a"].error("Something went wrong, please try again"),t.isLoading=!1}))},onUnitDeployedChange:function(t){var e=this;e.isLoading=!0;var r=[];r.push(v["a"].post("controllerCommands",this.getUser.apitoken,{user_id:this.getUser.id,controller_id:this.device.controller_id,action_id:t?this.CMD_DEPLOY:this.CMD_UNDEPLOY,virtualDevice_id:this.device.id})),r.push(v["a"].patch("controllers",e.getUser.apitoken,e.device.controller)),Promise.all(r).then((function(t){t[0][0]?g["a"].success("Command transmitted"):g["a"].error("Something went wrong, please try again"),e.isLoading=!1}))},onTicketCreated:function(){this.createTicketDialog=!1,this.refresh(),this.$emit("refresh")},refresh:function(){this.tickets=[],this.ticketStatuses=[],this.getTickets(),this.getTicketStatuses(),this.getJobTickets()},getJobTickets:function(){var t=this;v["a"].get("jobTickets",this.getUser.apitoken,{filter:{where:{jobTicketStatus_id:1},limit:1e3}}).then((function(e){var r=$e(e,2),n=r[0];r[1];t.jobTickets=n}))},hideResolvedTickets:function(){this.hideResolved=!this.hideResolved},getTickets:function(){var t=this;t.device&&(t.isLoading=!0,t.ticketsLoading=!0,v["a"].get("hardware_items",t.getUser.apitoken,{filter:{where:{or:[{and:[{label:t.device.platformGroupName},{facilities_id:this.getUser.facility_id}]},{id:t.device.hardware_item_id}]}}}).then((function(e){var r=$e(e,2),n=r[0],i=r[1];n&&n.length>0?(t.currentHardwareItem=n[0],t.disableServiceHistory=!1,t.$emit("disableservicehistory",!1),t.outOfService=t.currentHardwareItem.isDisabled,v["a"].get("vHardwareItemTickets",t.getUser.apitoken,{filter:{where:{hardware_item_id:t.currentHardwareItem.id,facility_id:t.getUser.facility_id,endtime:null},order:"updatedate DESC",include:["jobTicket",{relation:"assignedUsers"}]}}).then((function(e){var r=$e(e,2),n=r[0],i=void 0===n?[]:n,a=r[1];i&&i[0]&&(t.tickets=i,t.hideResolved=!!t.hideResolved),a&&g["a"].error("Something went wrong, please try again."),t.ticketsLoading=!1,t.isLoading=!1}))):i?g["a"].error("Something went wrong, please try again."):0==n.length&&(t.isLoading=!1,g["a"].error("Corresponding record not found in hardware database. Service History unavailable."),t.disableServiceHistory=!0,t.$emit("disableservicehistory",!0))})))},getTicketStatuses:function(){var t=this;v["a"].get("hardware_item_ticket_statuses",t.getUser.apitoken,{filter:{order:"seq ASC"}}).then((function(e){var r=$e(e,2),n=r[0];r[1];t.ticketStatuses=n,t.isLoading=!1}))},ticketUpdated:function(){this.refresh(),this.$emit("refresh")}}},Qe=Ke,tr=Object($["a"])(Qe,p,m,!1,null,null,null);e["a"]=tr.exports},"36a5":function(t,e,r){"use strict";r("afda")},3860:function(t,e,r){"use strict";var n=r("604c");e["a"]=n["a"].extend({name:"button-group",provide(){return{btnToggle:this}},computed:{classes(){return n["a"].options.computed.classes.call(this)}},methods:{genData:n["a"].options.methods.genData}})},"38b0":function(t,e,r){},"3a72":function(t,e,r){},"3aac":function(t,e,r){},"3c10":function(t,e,r){"use strict";r("0f1d")},"3c1b":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("8fea"),s=r("169a"),l=r("132d"),c=r("2fa4"),u=r("71a3"),d=r("c671"),h=r("fe57"),f=r("aac8"),p=function(){var t=this,e=t._self._c;return e(s["a"],{attrs:{persistent:"",width:"600"},model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[e(i["a"],{staticClass:"vh70 d-flex flex-column"},[e(a["d"],[e("h2",[t._v("Grid Display Selector")]),e(c["a"]),e(n["a"],{attrs:{icon:""},on:{click:function(e){t.showDialog=!1}}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],{staticClass:"d-flex flex-column flex-tabs-container flex-grow-auto",attrs:{id:"gridcolumns"}},[e(h["a"],{staticClass:"flex-shrink-1 flex-grow-0",attrs:{centered:""},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e(u["a"],[t._v("Grid Columns")]),e(u["a"],[t._v("Display Units")])],1),e(f["a"],{model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e(d["a"],{staticClass:"h-100 overflow-auto"},[t.renderComponent?e(o["a"],{attrs:{headers:t.headers,items:t.items,loading:t.isLoading,"item-key":"value","hide-default-footer":"","fixed-header":"",height:"100%","must-sort":"","show-select":"",options:t.pagination},scopedSlots:t._u([{key:"item.handle",fn:function(r){r.item;return[e("div",{staticClass:"handle",staticStyle:{"max-width":"28px"}},[e(l["a"],[t._v("drag_indicator")])],1)]}},{key:"item.text",fn:function(e){var r=e.item;return[t._v("\n              "+t._s(r.text?r.text:r.value)+"\n            ")]}}],null,!1,3273250730),model:{value:t.selectedColumns,callback:function(e){t.selectedColumns=e},expression:"selectedColumns"}}):t._e()],1),e(d["a"],{staticClass:"h-100"},[t.renderComponent?e(o["a"],{attrs:{headers:t.unitHeaders,items:t.unitItems,loading:t.isLoading,"item-key":"id","hide-default-footer":"","fixed-header":"",height:"100%","must-sort":"","show-select":"",options:t.pagination},model:{value:t.selectedUnits,callback:function(e){t.selectedUnits=e},expression:"selectedUnits"}}):t._e()],1)],1)],1),e(a["a"],{staticClass:"justify-center flex-shrink-1 flex-grow-0"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.save}},[t._v("Save")]),e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.reset}},[t._v("Reset to Defaults")])],1)],1)],1)},m=[],v=r("2f62"),y=r("d67f"),g=r("d0eb"),b=r("aa47");function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function x(t){return C(t)||_(t)||k(t)||S()}function S(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function C(t){if(Array.isArray(t))return T(t)}function O(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */O=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var x={};c(x,o,(function(){return this}));var S=Object.getPrototypeOf,_=S&&S(S(L([])));_&&_!==r&&n.call(_,o)&&(x=_);var C=b.prototype=y.prototype=Object.create(x);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==w(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(w(e)+" is not iterable")}return g.prototype=b,i(C,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(C),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(C),c(C,l,"Generator"),c(C,o,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function P(t,e){return E(t)||j(t,e)||k(t,e)||D()}function D(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function E(t){if(Array.isArray(t))return t}function I(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function L(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){I(a,n,i,o,s,"next",t)}function s(t){I(a,n,i,o,s,"throw",t)}o(void 0)}))}}function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){U(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function U(t,e,r){return(e=N(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t){var e=F(t,"string");return"symbol"==w(e)?e:e+""}function F(t,e){if("object"!=w(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var G={name:"GridDisplaySelector",props:["value","gridName","defaultColumns","selectedDisplayUnits","defaultDisplayUnits"],components:{},mounted:function(){},data:function(){return{activeTab:0,showDialog:!1,selectedColumns:[],gridCustomizationId:null,pagination:{itemsPerPage:-1,sortBy:["seq"]},isLoading:!1,renderComponent:!0,items:[],headers:[{text:"",align:"left",value:"handle",sortable:!1,width:20},{text:"Seq",value:"seq",align:"center",sortable:!1,width:50},{text:"Column",value:"text",align:"left",sortable:!1},{value:"data-table-select",width:50,groupable:!1}],unitItems:[],unitHeaders:[{text:"Unit Type",value:"dashboardDisplayType",align:"left",sortable:!1},{value:"data-table-select",width:50,groupable:!1}],selectedUnits:[]}},beforeMount:function(){this.refresh()},computed:M({},Object(v["c"])(["getUser"])),watch:{showDialog:function(t,e){t&&this.refresh()}},methods:{refresh:function(){var t=L(O().mark((function t(){var e,r,n,i,a,o,s,l=this;return O().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.isLoading=!0,t.next=3,g["a"].get("ag_gridCustomizations",this.getUser.apitoken,{filter:{where:{user_id:this.getUser.id,grid_id:this.gridName}}});case 3:if(e=t.sent,r=P(e,2),n=r[0],r[1],0!=n.length){t.next=12;break}this.useDefaults(),this.gridCustomizationId=null,t.next=24;break;case 12:this.useDefaults(!0),this.gridCustomizationId=n[0].id,this.selectedColumns=[],i=O().mark((function t(e){var r;return O().wrap((function(t){while(1)switch(t.prev=t.next){case 0:r=l.items.find((function(t){return t.value==n[0].columnsJson[e].value})),void 0!=r&&(r.seq=e+1,l.selectedColumns.push(r));case 2:case"end":return t.stop()}}),t)})),a=0;case 17:if(!(a<n[0].columnsJson.length)){t.next=22;break}return t.delegateYield(i(a),"t0",19);case 19:a++,t.next=17;break;case 22:for(o=n[0].columnsJson.length+1,s=0;s<this.items.length;s++)this.items[s].seq||(this.items[s].seq=o++);case 24:this.isLoading=!1,setTimeout(this.gridDraggable,250),this.unitItems=this.defaultDisplayUnits.map((function(t){return t})),this.selectedUnits=this.selectedDisplayUnits.map((function(t){return t}));case 28:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),show:function(){this.showDialog=!0},hide:function(){this.showDialog=!1},gridDraggable:function(){var t=this,e=document.querySelector("#gridcolumns tbody");e&&b["a"].create(e,{handle:".handle",onEnd:function(e){var r=e.newIndex,n=e.oldIndex,i=t.items.splice(n,1)[0];t.items.splice(r,0,i);for(var a=t.items.length-1;a>=0;a--)t.items[a].seq=a+1}})},reRenderComponent:function(){var t=this;this.renderComponent=!1,this.$nextTick().then((function(){t.renderComponent=!0,setTimeout(t.gridDraggable,250)}))},save:function(){var t=L(O().mark((function t(){var e,r,n,i,a,o;return O().wrap((function(t){while(1)switch(t.prev=t.next){case 0:for(e=JSON.parse(JSON.stringify(this.selectedColumns)),e.sort((function(t,e){return t.seq>e.seq?1:-1})),r=0;r<e.length;r++)delete e[r].seq;return this.isLoading=!0,n={user_id:this.getUser.id,grid_id:this.gridName,columnsJson:e},this.gridCustomizationId&&(n.id=this.gridCustomizationId),t.next=8,g["a"].patch("ag_gridCustomizations",this.getUser.apitoken,n);case 8:i=t.sent,a=P(i,2),o=a[0],a[1],o?(y["a"].success("Grid customization profile saved."),this.$emit("change",e),this.$emit("display-selection",x(this.selectedUnits)),this.showDialog=!1):y["a"].error("An error occurred. Please try again later.");case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),reset:function(){this.useDefaults()},useDefaults:function(t){var e=this,r=this;this.selectedColumns=[],this.items=JSON.parse(JSON.stringify(this.value));for(var n=function(n){t||(e.items[n].seq=n+1),e.defaultColumns?e.defaultColumns.find((function(t){return t.value==r.items[n].value}))&&e.selectedColumns.push(e.items[n]):e.selectedColumns.push(e.items[n])},i=0;i<this.items.length;i++)n(i);this.unitItems=this.defaultDisplayUnits.map((function(t){return t})),this.selectedUnits=this.defaultDisplayUnits.map((function(t){return t}))}}},R=G,$=(r("aa82"),r("2877")),H=Object($["a"])(R,p,m,!1,null,null,null);e["a"]=H.exports},"3d69":function(t,e,r){},"3e35":function(t,e,r){"use strict";var n=r("1e6c"),i=r("adda"),a=r("58df"),o=r("80d2"),s=r("1c87");const l=Object(a["a"])(n["a"],s["a"]);e["a"]=l.extend().extend({name:"v-carousel-item",inject:{parentTheme:{default:{isDark:!1}}},provide(){return{theme:this.parentTheme}},inheritAttrs:!1,methods:{genDefaultSlot(){return[this.$createElement(i["a"],{staticClass:"v-carousel__item",props:{...this.$attrs,height:this.windowGroup.internalHeight},on:this.$listeners,scopedSlots:{placeholder:this.$scopedSlots.placeholder}},Object(o["u"])(this))]},genWindowItem(){const{tag:t,data:e}=this.generateRouteLink();return e.staticClass="v-window-item",e.directives.push({name:"show",value:this.isActive}),this.$createElement(t,e,this.genDefaultSlot())}}})},"3f55":function(t,e,r){"use strict";r("3a72")},"40dc":function(t,e,r){"use strict";r("8b0d");var n=r("71d9"),i=r("f977"),a=r("3a66"),o=r("277e"),s=r("d10f"),l=r("f2e7"),c=r("80d2"),u=r("58df");const d=Object(u["a"])(n["a"],o["a"],s["a"],l["a"],Object(a["a"])("top",["clippedLeft","clippedRight","computedHeight","invertedScroll","isExtended","isProminent","value"]));e["a"]=d.extend({name:"v-app-bar",directives:{Scroll:i["b"]},provide(){return{VAppBar:this}},props:{clippedLeft:Boolean,clippedRight:Boolean,collapseOnScroll:Boolean,elevateOnScroll:Boolean,fadeImgOnScroll:Boolean,hideOnScroll:Boolean,invertedScroll:Boolean,scrollOffScreen:Boolean,shrinkOnScroll:Boolean,value:{type:Boolean,default:!0}},data(){return{isActive:this.value}},computed:{applicationProperty(){return this.bottom?"bottom":"top"},canScroll(){return o["a"].options.computed.canScroll.call(this)&&(this.invertedScroll||this.elevateOnScroll||this.hideOnScroll||this.collapseOnScroll||this.isBooted||!this.value)},classes(){return{...n["a"].options.computed.classes.call(this),"v-toolbar--collapse":this.collapse||this.collapseOnScroll,"v-app-bar":!0,"v-app-bar--clipped":this.clippedLeft||this.clippedRight,"v-app-bar--fade-img-on-scroll":this.fadeImgOnScroll,"v-app-bar--elevate-on-scroll":this.elevateOnScroll,"v-app-bar--fixed":!this.absolute&&(this.app||this.fixed),"v-app-bar--hide-shadow":this.hideShadow,"v-app-bar--is-scrolled":this.currentScroll>0,"v-app-bar--shrink-on-scroll":this.shrinkOnScroll}},scrollRatio(){const t=this.computedScrollThreshold;return Math.max((t-this.currentScroll)/t,0)},computedContentHeight(){if(!this.shrinkOnScroll)return n["a"].options.computed.computedContentHeight.call(this);const t=this.dense?48:56,e=this.computedOriginalHeight;return t+(e-t)*this.scrollRatio},computedFontSize(){if(!this.isProminent)return;const t=1.25,e=1.5;return t+(e-t)*this.scrollRatio},computedLeft(){return!this.app||this.clippedLeft?0:this.$vuetify.application.left},computedMarginTop(){return this.app?this.$vuetify.application.bar:0},computedOpacity(){if(this.fadeImgOnScroll)return this.scrollRatio},computedOriginalHeight(){let t=n["a"].options.computed.computedContentHeight.call(this);return this.isExtended&&(t+=parseInt(this.extensionHeight)),t},computedRight(){return!this.app||this.clippedRight?0:this.$vuetify.application.right},computedScrollThreshold(){return this.scrollThreshold?Number(this.scrollThreshold):this.computedOriginalHeight-(this.dense?48:56)},computedTransform(){if(!this.canScroll||this.elevateOnScroll&&0===this.currentScroll&&this.isActive)return 0;if(this.isActive)return 0;const t=this.scrollOffScreen?this.computedHeight:this.computedContentHeight;return this.bottom?t:-t},hideShadow(){return this.elevateOnScroll&&this.isExtended?this.currentScroll<this.computedScrollThreshold:this.elevateOnScroll?0===this.currentScroll||this.computedTransform<0:(!this.isExtended||this.scrollOffScreen)&&0!==this.computedTransform},isCollapsed(){return this.collapseOnScroll?this.currentScroll>0:n["a"].options.computed.isCollapsed.call(this)},isProminent(){return n["a"].options.computed.isProminent.call(this)||this.shrinkOnScroll},styles(){return{...n["a"].options.computed.styles.call(this),fontSize:Object(c["i"])(this.computedFontSize,"rem"),marginTop:Object(c["i"])(this.computedMarginTop),transform:`translateY(${Object(c["i"])(this.computedTransform)})`,left:Object(c["i"])(this.computedLeft),right:Object(c["i"])(this.computedRight)}}},watch:{canScroll:"onScroll",computedTransform(){this.canScroll&&(this.clippedLeft||this.clippedRight)&&this.callUpdate()},invertedScroll(t){this.isActive=!t||0!==this.currentScroll},hideOnScroll(t){this.isActive=!t||this.currentScroll<this.computedScrollThreshold}},created(){this.invertedScroll&&(this.isActive=!1)},methods:{genBackground(){const t=n["a"].options.methods.genBackground.call(this);return t.data=this._b(t.data||{},t.tag,{style:{opacity:this.computedOpacity}}),t},updateApplication(){return this.invertedScroll?0:this.computedHeight+this.computedTransform},thresholdMet(){this.invertedScroll?this.isActive=this.currentScroll>this.computedScrollThreshold:(this.hideOnScroll&&(this.isActive=this.isScrollingUp||this.currentScroll<this.computedScrollThreshold),this.currentThreshold<this.computedScrollThreshold||(this.savedScroll=this.currentScroll))}},render(t){const e=n["a"].options.render.call(this,t);return e.data=e.data||{},this.canScroll&&(e.data.directives=e.data.directives||[],e.data.directives.push({arg:this.scrollTarget,name:"scroll",value:this.onScroll})),e}})},4216:function(t,e,r){"use strict";var n=r("d0eb"),i=r("2f62"),a=r("d67f");function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var p="suspendedStart",m="suspendedYield",v="executing",y="completed",g={};function b(){}function w(){}function x(){}var S={};d(S,l,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,l)&&(S=C);var O=x.prototype=b.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,s,l){var c=f(t[i],t,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,s,l)}),(function(t){r("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,l)}))}l(c.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=p;return function(a,o){if(i===v)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var c=f(e,r,n);if("normal"===c.type){if(i=n.done?y:m,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=y,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=f(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(o(e)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),d(D.prototype,c,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(h(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),d(O,u,"Generator"),d(O,l,(function(){return this})),d(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function l(t,e){return f(t)||h(t,e)||u(t,e)||c()}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){if(t){if("string"==typeof t)return d(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function h(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function f(t){if(Array.isArray(t))return t}function p(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function m(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){p(a,n,i,o,s,"next",t)}function s(t){p(a,n,i,o,s,"throw",t)}o(void 0)}))}}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){g(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t){var e=w(t,"string");return"symbol"==o(e)?e:e+""}function w(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}e["a"]={computed:y(y(y({},Object(i["c"])(["getUser"])),Object(i["c"])("universalDashboard",["selectedBatchAction","isPerformingContextMenuAction","selectedUnits"])),Object(i["c"])("batchActions",["batchActions"])),data:function(){return{}},methods:{runBatchActionDepricated:function(){var t=this;return m(s().mark((function e(){var r,i,o,c,u,d,h,f,p,m;return s().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=t,!t.isLoading){e.next=4;break}return a["a"].error("Please wait for the current request to complete."),e.abrupt("return");case 4:if(i=[],t.isLoading=!0,i=t.isPerformingContextMenuAction?[t.selectedContextMenuItem]:t.selectedUnits,o=i.map((function(t){return t.controller_id})),i.map((function(t){return t.platformGroup_id})),c=t.batchActions.filter((function(e){return e.id===t.selectedBatchAction}))[0],92===c.id)t.doBatchCo2Calibration(i);else if(16===c.id)t.doBatchIrrigation(i);else if(145===c.id)t.doBatchBashCommand(i);else if(17===c.id)t.doBatchIrrigationStop(i);else if(90===c.id)t.doBatchSetIntensity(i);else if(87===c.id)t.doBatchSetControlLoops(i);else if(104===c.id||105===c.id)t.doBatchSetDebug(i,c.value);else if(141===c.id)t.doRefreshSoilSensors(i,c.value);else if(100===c.id||101===c.id)t.doBatchSetHeatStrip(i,c.id);else if(138===c.id)t.onUpgradeClient();else if(137===c.id)t.onUpgradeOS();else if(146===c.id)t.forceSync();else if(u=[83,84,59,60,58,61,62,51,103,89,115,147],u.includes(c.id)){for(p=[],m=0;m<i.length;m++)p.push({controller_id:i[m].controller_id,virtualDevice_id:i[m].id,action_id:c.id,user_id:t.getUser.id,platformGroup_id:i[m].platformGroup_id});n["a"].post("controllerCommands",t.getUser.apitoken,p).then((function(t){var e=l(t,2),n=(e[0],e[1]);n?a["a"].error("An error occurred. Please try again later."):a["a"].success("Commands were successfully added to the queue"),r.isLoading=!1}))}else d=[],18===c.deviceTypeId?(h=i.filter((function(t){return""!=t.BardState})).map((function(t){return t.controller_id})),f=i.filter((function(t){return""!=t.ECUState})).map((function(t){return t.controller_id})),h.length>0&&d.push(n["a"].post("controllerCommands/executeComplexBatchCommand",t.getUser.apitoken,{controller_ids:h,command:c.value,virtualDeviceType_id:39})),f.length>0&&d.push(n["a"].post("controllerCommands/executeComplexBatchCommand",t.getUser.apitoken,{controller_ids:f,command:c.value,virtualDeviceType_id:18}))):d.push(n["a"].post("controllerCommands/executeComplexBatchCommand",t.getUser.apitoken,{controller_ids:o,command:c.value,virtualDeviceType_id:c.deviceTypeId})),Promise.all(d).then((function(t){var e=l(t,2),n=(e[0],e[1]);n?a["a"].error("Request Failed. Please try again later."):(a["a"].success("Batch process completed!"),r.$store.dispatch("universalDashboard/setSelectedBatchAction",0)),r.isLoading=!1}));t.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1);case 12:case"end":return e.stop()}}),e)})))()},doBatchCo2Calibration:function(t){var e=this;e.isLoading=!0;for(var r=[],i=0;i<t.length;i++)r.push({controller_id:t[i].controller_id,action_id:92,value:this.co2CalibrationSettings.ppm,user_id:this.getUser.id});n["a"].post("controllerCommands",this.getUser.apitoken,r).then((function(t){var r=l(t,2),n=(r[0],r[1]);e.isLoading=!1,n?a["a"].error("An error occurred. Please try again later."):a["a"].success("Commands were successfully added to the queue")}))},doRefreshSoilSensors:function(t){var e=this;e.isLoading=!0;for(var r=[],i=0;i<t.length;i++)r.push({controller_id:t[i].controller_id,action_id:141});n["a"].post("controllerCommands",e.getUser.apitoken,r).then((function(t){var r=l(t,2),n=(r[0],r[1]);e.isLoading=!1,n?a["a"].error("An error occurred. Please try again later."):(e.$store.dispatch("universalDashboard/setSelectedBatchAction",0),a["a"].success("Commands were successfully added to the queue"))}))},doBatchIrrigation:function(t){var e=this;e.isLoading=!0;for(var r=[],i=0;i<t.length;i++)r.push({controller_id:t[i].controller_id,platformGroup_id:t[i].platformGroup_id,device_id:t[i].id});n["a"].post("controllerCommands/batchIrrigate",this.getUser.apitoken,{platformGroups:r,designator_id:this.irrigationSettings.designator_id,durationSeconds:parseInt(this.irrigationSettings.durationSeconds),setAutoWhenComplete:this.irrigationSettings.setAutoWhenComplete}).then((function(t){var r=l(t,2),n=(r[0],r[1]);e.isLoading=!1,n?a["a"].error("An error occurred. Please try again later."):a["a"].success("Irrigation command successfully transmitted")}))},doBatchBashCommand:function(t){var e=this;e.isLoading=!0;for(var r=[],i=0;i<t.length;i++)r.push({controller_id:t[i].controller_id,platformGroup_id:t[i].platformGroup_id,virtualDevice_id:t[i].id});n["a"].post("controllerCommands/doBashCommand",this.getUser.apitoken,{platformGroups:r,id:this.bashSettings.id}).then((function(t){var r=l(t,2),n=(r[0],r[1]);e.isLoading=!1,n?a["a"].error("An error occurred. Please try again later."):a["a"].success("Bash command successfully transmitted")}))},doBatchIrrigationStop:function(t){var e=this;e.isLoading=!0;for(var r=[],i=0;i<t.length;i++)r.push({controller_id:t[i].controller_id,platformGroup_id:t[i].platformGroup_id,device_id:t[i].id});n["a"].post("controllerCommands/batchIrrigateStop",this.getUser.apitoken,{platformGroups:r}).then((function(t){var r=l(t,2),n=(r[0],r[1]);e.isLoading=!1,n?a["a"].error("An error occurred. Please try again later."):a["a"].success("Stop irrigation command successfully transmitted")}))},doBatchSetIntensity:function(t){var e=this;e.isLoading=!0;var r=t.map((function(t){return t.controller_id}));t.map((function(t){return t.platformGroup_id}));n["a"].post("controllerCommands/executeComplexBatchCommand",this.getUser.apitoken,{controller_ids:r,command:"LightOn",virtualDeviceType_id:13,intensity:this.intensitySettings}).then((function(t){var r=l(t,2),n=(r[0],r[1]);n?a["a"].error("Request Failed. Please try again later."):(a["a"].success("Batch process completed!"),e.$store.dispatch("universalDashboard/setSelectedBatchAction",0),e.$store.dispatch("batchActions/setBatchActionLabel",{id:90,label:"Set Intensity"})),e.isLoading=!1}))},doBatchSetControlLoops:function(t){var e=this,r=this;r.isLoading=!0;var i=t.map((function(t){n["a"].post("ControllerFsaOverrides/batchSet",e.getUser.apitoken,{controller_id:t.controller_id,virtualDeviceTypeFsa_id:e.controlLoopSettings.map((function(t){return t.id}))})}));Promise.all(i).then((function(t){a["a"].success("Batch process completed!"),e.$store.dispatch("universalDashboard/setSelectedBatchAction",0),e.isLoading=!1}))},doBatchSetDebug:function(t,e){var r=this;r.isLoading=!0;for(var i=[],o=0;o<t.length;o++)i.push({controller_id:t[o].controller_id,action_id:50,loglevel:e});n["a"].post("controllerCommands",r.getUser.apitoken,i).then((function(t){var e=l(t,2),n=(e[0],e[1]);r.isLoading=!1,n?a["a"].error("An error occurred. Please try again later."):(r.$store.dispatch("universalDashboard/setSelectedBatchAction",0),a["a"].success("Commands were successfully added to the queue"))}))},doBatchSetHeatStrip:function(t,e){var r=this;this.isLoading=!0;var i=t.map((function(t){return t.controller_id}));n["a"].get("virtualDevices",this.getUser.apitoken,{filter:{where:{controller_id:{inq:i},virtualDeviceType_id:37}}}).then((function(t){var i=l(t,2),o=i[0],s=(i[1],o.map((function(t){return{controller_id:t.controller_id,virtualDevice_id:t.id,action_id:e,user_id:r.getUser.id}})));n["a"].post("controllerCommands",r.getUser.apitoken,s).then((function(t){var e=l(t,2),n=(e[0],e[1]);n?a["a"].error("An error occurred. Please try again later."):a["a"].success("Commands Sent"),r.isLoading=!1}))}))},onUpgradeClient:function(){var t=this;return m(s().mark((function e(){var r,i,o;return s().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=t.selectedUnits,i=t.selectedUnits.length?r.map((function(t){return t.controller_id})):[t.selectedContextMenuItem.controller_id],o=i.map((function(e){var r={controller_id:e,action_id:138,user_id:t.getUser.id};return n["a"].post("controllerCommands",t.getUser.apitoken,r)})),Promise.all(o).then((function(e){t.selectedContextMenuItem=null,a["a"].success("Client Upgraded."),t.$store.dispatch("universalDashboard/setSelectedBatchAction",0),t.isLoading=!1,t.refresh(!1,!0)}));case 4:case"end":return e.stop()}}),e)})))()},onUpgradeOS:function(){var t=this;return m(s().mark((function e(){var r,i,o;return s().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=t.selectedUnits,i=t.selectedUnits.length?r.map((function(t){return t.controller_id})):[t.selectedContextMenuItem.controller_id],o=i.map((function(e){var r={controller_id:e,action_id:137,user_id:t.getUser.id};return n["a"].post("controllerCommands",t.getUser.apitoken,r)})),Promise.all(o).then((function(e){t.selectedContextMenuItem=null,a["a"].success("OS Upgraded."),t.$store.dispatch("universalDashboard/setSelectedBatchAction",0),t.isLoading=!1,t.refresh(!1,!0)}));case 4:case"end":return e.stop()}}),e)})))()},forceSync:function(){var t=this;return m(s().mark((function e(){var r,i,o;return s().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.selectedUnits,i=t.selectedUnits.length?r.map((function(t){return t.controller_id})):[t.selectedContextMenuItem.controller_id],o=i.map((function(e){return n["a"].post("controllerCommands",t.getUser.apitoken,{controller_id:e,user_id:t.getUser.id,action_id:146})})),e.next=5,Promise.all(o);case 5:t.selectedContextMenuItem=null,a["a"].success("Sync command sent."),t.$store.dispatch("universalDashboard/setSelectedBatchAction",0),t.isLoading=!1,t.refresh(!1,!0);case 10:case"end":return e.stop()}}),e)})))()}}}},4472:function(t,e,r){},4504:function(t,e,r){"use strict";var n=r("8336"),i=r("ac7c"),a=r("62ad"),o=r("8fea"),s=r("0fd9"),l=r("b974"),c=r("71a3"),u=r("c671"),d=r("fe57"),h=r("aac8"),f=r("8654"),p=function(){var t=this,e=t._self._c;return e(o["a"],{attrs:{items:t.devices,headers:t.headers,"item-key":"id","single-expand":t.singleExpand,expanded:t.expanded,"hide-default-footer":"","show-expand":"","show-group-by":"",loading:t.isLoading,options:t.pagination,"fixed-header":"",height:"100%"},on:{"update:expanded":function(e){t.expanded=e},"item-expanded":t.expandRow},scopedSlots:t._u([{key:"expanded-item",fn:function(r){var o=r.headers,p=r.item;return[e("td",{staticStyle:{padding:"40px"},attrs:{colspan:o.length}},[e(d["a"],{attrs:{centered:""},model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},[e(c["a"],{key:0},[t._v("Properties")]),e(c["a"],{key:1},[t._v("Parameters")]),e(c["a"],{key:2},[t._v("Platforms")])],1),e(h["a"],{model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},[e(u["a"],{key:0,staticStyle:{"padding-top":"10px"}},[e("device-props",{attrs:{deviceTypes:t.deviceTypesArray,virtualDeviceTypeDesignators:t.virtualDeviceTypeDesignators,virtualDeviceActions:t.virtualDeviceActions},on:{save:t.onRefresh},model:{value:t.selectedVirtualDevice,callback:function(e){t.selectedVirtualDevice=e},expression:"selectedVirtualDevice"}})],1),e(u["a"],{key:1,staticStyle:{"padding-top":"10px"}},[e(s["a"],{attrs:{"no-gutters":""}},t._l(p.deviceParameters,(function(r,n){return e(a["a"],{key:n,staticClass:"pl-3 pr-3",attrs:{cols:"12",sm:r.parameter.indexOf("digOut")>=0?12:6,md:r.parameter.indexOf("digOut")>=0?12:4}},["TEXT"!==r.fieldtype||r.posibleValuesList.length?t._e():e(f["a"],{attrs:{label:r.parameter,placeholder:"".concat(r.defaultTextValue)||"NOT SET",counter:"20"},model:{value:r.textValue,callback:function(e){t.$set(r,"textValue",e)},expression:"parameter.textValue"}}),"NUMERIC"!==r.fieldtype||r.posibleValuesList.length?t._e():e(f["a"],{attrs:{label:r.parameter,placeholder:"".concat(r.defaultNumericValue)||"NOT SET",type:"number",counter:"20",rules:[t.rules.requiredNumber]},model:{value:r.numericValue,callback:function(e){t.$set(r,"numericValue",e)},expression:"parameter.numericValue"}}),"NUMERIC"===r.fieldtype&&r.posibleValuesList.length?e(l["a"],{attrs:{items:r.posibleValuesList,label:r.parameter,placeholder:"".concat(r.defaultNumericValue),"item-text":"name","item-value":"id",clearable:""},model:{value:r.numericValue,callback:function(e){t.$set(r,"numericValue",e)},expression:"parameter.numericValue"}}):t._e(),"TEXT"===r.fieldtype&&r.posibleValuesList.length?e(l["a"],{attrs:{items:r.posibleValuesList,label:r.parameter,placeholder:"".concat(r.defaultTextValue),"item-text":"name","item-value":"id",clearable:""},model:{value:r.textValue,callback:function(e){t.$set(r,"textValue",e)},expression:"parameter.textValue"}}):t._e()],1)})),1),p.deviceParameters&&p.deviceParameters.length?e(s["a"],{staticClass:"justify-center",attrs:{"no-gutters":""}},[e(a["a"],{attrs:{cols:"1"}},[e(n["a"],{attrs:{color:"primary"},on:{click:function(e){return t.saveParameters(p)}}},[t._v("Save")])],1)],1):t._e()],1),e(u["a"],{key:2},[t._l(p.platforms,(function(r){return e(s["a"],{key:r.id,staticClass:"justify-center",attrs:{"no-gutters":""}},[e(a["a"],{attrs:{cols:"4"}},[e(i["a"],{attrs:{label:r.name,"hide-default-footer":"","hide-details":""},model:{value:r.selected,callback:function(e){t.$set(r,"selected",e)},expression:"platform.selected"}})],1)],1)})),e(s["a"],{staticClass:"justify-center"},[e(a["a"],{attrs:{cols:"1"}},[e(n["a"],{attrs:{color:"primary"},on:{click:function(e){return t.savePlatformGroup(p)}}},[t._v("Save")])],1)],1)],2)],1)],1)]}}])})},m=[],v=r("d0eb"),y=r("d67f"),g=r("c6a6"),b=r("b0af"),w=r("99d9"),x=r("4bd4"),S=function(){var t=this,e=t._self._c;return e(b["a"],{attrs:{flat:""}},[t.rec?e(w["c"],[e(x["a"],{model:{value:t.isValid,callback:function(e){t.isValid=e},expression:"isValid"}},[e(s["a"],{attrs:{"no-gutters":""}},[e(a["a"],{staticClass:"pr-2",attrs:{cols:"8"}},[e(f["a"],{attrs:{rules:[t.rules.required],label:"Title",counter:"",maxlength:"255"},model:{value:t.rec.name,callback:function(e){t.$set(t.rec,"name",e)},expression:"rec.name"}})],1),e(a["a"],{staticClass:"pl-2"},[e(g["a"],{attrs:{label:"Default State",items:t.states,"item-text":"stateName","item-value":"state_id",disabled:0==t.states.length},model:{value:t.rec.defaultState_id,callback:function(e){t.$set(t.rec,"defaultState_id",e)},expression:"rec.defaultState_id"}})],1)],1),e(s["a"],{attrs:{"no-gutters":""}},[e(a["a"],{staticClass:"pr-2",attrs:{cols:"4"}},[e(g["a"],{attrs:{label:"Device Type",items:t.deviceTypes,"item-text":"typename","item-value":"id",rules:[t.rules.required]},on:{change:t.onDeviceTypeChange},model:{value:t.rec.virtualDeviceType_id,callback:function(e){t.$set(t.rec,"virtualDeviceType_id",e)},expression:"rec.virtualDeviceType_id"}})],1),e(a["a"],{staticClass:"pl-2 pr-2",attrs:{cols:"4"}},[e(g["a"],{attrs:{label:"Designator",items:t.availableVirtualDeviceTypeDesignators,"item-text":"designatorName","item-value":"ag_deviceDesignators_id",rules:[t.rules.required]},model:{value:t.rec.designator_id,callback:function(e){t.$set(t.rec,"designator_id",e)},expression:"rec.designator_id"}})],1),e(a["a"],{staticClass:"pl-2 pr-2",attrs:{cols:"4"}},[e(g["a"],{attrs:{label:"Current State",items:t.states,"item-text":"stateName","item-value":"state_id",disabled:0==t.states.length},model:{value:t.rec.state_id,callback:function(e){t.$set(t.rec,"state_id",e)},expression:"rec.state_id"}})],1)],1)],1)],1):t._e(),e(w["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{color:"primary",disabled:!t.isValid},on:{click:t.onSave}},[t._v("Save")])],1)],1)},_=[],C=r("2f62"),O=r("9c4f"),P=r("c1df"),D=r.n(P);function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}function T(t,e){return A(t)||L(t,e)||E(t,e)||j()}function j(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(t,e){if(t){if("string"==typeof t)return I(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(t,e):void 0}}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function L(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function A(t){if(Array.isArray(t))return t}function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function U(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach((function(e){N(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function N(t,e,r){return(e=F(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function F(t){var e=G(t,"string");return"symbol"==k(e)?e:e+""}function G(t,e){if("object"!=k(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var R={name:"",props:["value","deviceTypes","virtualDeviceTypeDesignators","virtualDeviceActions"],mixins:[O["a"]],components:{},data:function(){return{rec:null,isValid:!1}},beforeMount:function(){},computed:U(U({},Object(C["c"])(["getUser"])),{},{states:function(){var t=this;return this.virtualDeviceActions.filter((function(e){return e.virtualDeviceType_id==t.rec.virtualDeviceType_id}))},availableVirtualDeviceTypeDesignators:function(){var t=this;return this.virtualDeviceTypeDesignators.filter((function(e){return e.virtualDeviceTypes_id===t.rec.virtualDeviceType_id}))}}),watch:{value:{handler:function(t,e){this.rec=JSON.parse(JSON.stringify(t))},immediate:!0}},methods:{onSave:function(){var t=this;t.isLoading=!0,this.rec.virtualDeviceType_id&&this.rec.virtualDeviceType_id!=this.value.virtualDeviceType_id&&v["a"].post("virtualDeviceParameterValues/deleteByDeviceId",this.getUser.apitoken,{device_id:this.rec.id}),v["a"].patch("virtualDevices",this.getUser.apitoken,{id:this.rec.id,name:this.rec.name,virtualDeviceType_id:this.rec.virtualDeviceType_id,designator_id:this.rec.designator_id,defaultState_id:this.rec.defaultState_id,state_id:this.rec.state_id,stateReason:"Manual edit",lastUpdated:D.a.utc().format()}).then((function(e){var r=T(e,2),n=r[0];r[1];t.isLoading=!1,n?(y["a"].success("Record updated."),t.$emit("save",t.rec)):y["a"].error("An error occurred. Please try again later.")}))},onDeviceTypeChange:function(t){this.availableVirtualDeviceTypeDesignators.length>0?this.rec.designator_id=this.availableVirtualDeviceTypeDesignators[0].ag_deviceDesignators_id:this.rec.designator_id=null}}},$=R,H=r("2877"),V=Object(H["a"])($,S,_,!1,null,null,null),B=V.exports;function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function Y(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Y=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==z(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(z(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function q(t,e){return K(t)||X(t,e)||J(t,e)||W()}function W(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(t,e){if(t){if("string"==typeof t)return Z(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(t,e):void 0}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function X(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function K(t){if(Array.isArray(t))return t}function Q(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function tt(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){Q(a,n,i,o,s,"next",t)}function s(t){Q(a,n,i,o,s,"throw",t)}o(void 0)}))}}var et={name:"devices",props:["controller","user","hideHeader"],components:{DeviceProps:B},data:function(){return{tab:0,virtualDeviceTypeDesignators:[],virtualDeviceActions:[],expanded:[],deviceTypesArray:[],isLoading:!1,singleExpand:!0,selectedVirtualDevice:null,pagination:{itemsPerPage:-1,sortBy:["name"]},headers:[{text:"Name",value:"name",sortable:!0,groupable:!1},{text:"ID",value:"id",sortable:!0,groupable:!1},{text:"Device Type",value:"deviceTypeName",sortable:!0},{text:"Designator",value:"designator.designatorName",sortable:!0},{text:"State",value:"stateName",sortable:!0},{text:"",value:"data-table-expand",groupable:!1}],devices:[],deviceTypes:{},states:{},platformGroup:{},platforms:[],boardComponents:[],zones:[],rules:{requiredNoblanks:function(t){return!!t&&null!=t.match(/^(?!\s*$).+/g)||"Required."},requiredNumber:function(t){return!isNaN(parseInt(t))&&parseInt(t)>=0||"Required."}}}},beforeMount:function(){this.onInitialize(),this.onRefresh()},watch:{controller:function(t,e){this.onRefresh()}},methods:{onCancel:function(){this.$emit("close")},onInitialize:function(){var t=this;return tt(Y().mark((function e(){var r,n,i,a,o,s,l,c;return Y().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,v["a"].get("virtualDeviceTypes",t.user.apitoken,{filter:{limit:500,order:"typename"}});case 2:return r=e.sent,r&&r.length&&(t.deviceTypesArray=r[0],t.deviceTypes=r[0].reduce((function(t,e){return t[e.id]=e,t}),{})),e.next=6,v["a"].get("states",t.user.apitoken,{filter:{limit:500}});case 6:return n=e.sent,n&&n.length&&(t.states=n[0].reduce((function(t,e){return t[e.id]=e,t}),{})),e.next=10,v["a"].get("vVirtualDeviceTypeDesignators",t.user.apitoken,{filter:{order:"designatorName"}});case 10:return i=e.sent,a=q(i,2),o=a[0],a[1],t.virtualDeviceTypeDesignators=o,e.next=17,v["a"].get("virtualDeviceActionsViews",t.user.apitoken,{filter:{order:"stateName",fields:["virtualDeviceType_id","state_id","stateName"]}});case 17:s=e.sent,l=q(s,2),c=l[0],l[1],t.virtualDeviceActions=c;case 22:case"end":return e.stop()}}),e)})))()},onRefresh:function(){var t=this;return tt(Y().mark((function e(){var r,n,i,a;return Y().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.controller||!t.controller.id){e.next=20;break}return t.isLoading=!0,e.next=4,v["a"].get("ag_platformGroups",t.user.apitoken,{filter:{where:{controller_id:t.controller.id},limit:500}});case 4:if(r=e.sent,!(r&&r.length&&r[0].length)){e.next=11;break}return t.platformGroup=r[0][0],e.next=9,v["a"].get("ag_platforms",t.user.apitoken,{filter:{where:{platformGroup_id:t.platformGroup.id},limit:500}});case 9:n=e.sent,n&&n.length&&(t.platforms=n[0]);case 11:return e.next=13,v["a"].get("boardComponents",t.user.apitoken,{filter:{where:{controller_id:t.controller.id},limit:500}});case 13:return i=e.sent,i&&i.length&&(t.boardComponents=i[0]),e.next=17,v["a"].get("zones",t.user.apitoken,{filter:{where:{facility_id:t.controller.facility_id},limit:500}});case 17:a=e.sent,a&&a.length&&(t.zones=a[0]),t.getDevices();case 20:case"end":return e.stop()}}),e)})))()},getDevices:function(){var t=this;return tt(Y().mark((function e(){var r;return Y().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,v["a"].get("virtualDevices",t.user.apitoken,{filter:{where:{controller_id:t.controller.id},include:["designator","deviceParameters"],limit:500}});case 2:r=e.sent,r&&r.length&&(t.devices=r[0],t.devices.forEach((function(e){e.deviceTypeName=t.deviceTypes[e.virtualDeviceType_id].typename||"",e.stateName=t.states[e.state_id].stateName||"",e.deviceParameters&&e.deviceParameters.length&&e.deviceParameters.forEach((function(e){"boardComponent_id"===e.parameterType?e.posibleValuesList=t.boardComponents.map((function(t){return{id:t.id,name:"[".concat(t.addresspath,"] - ").concat(t.name)}})):"zone_id"===e.parameterType?e.posibleValuesList=t.zones.map((function(t){return{id:t.id,name:"".concat(t.zonename)}})):"device_id"===e.parameterType?e.posibleValuesList=t.devices.map((function(t){return{id:t.id,name:"[".concat(t.id,"] - ").concat(t.name)}})):e.possibleValues&&""!==e.possibleValues?e.posibleValuesList=e.possibleValues.split(",").map((function(t){return{id:t,name:t}})):e.posibleValuesList=[]})),e.deviceParameters&&e.deviceParameters.sort((function(t,e){return t.parameter.indexOf("digOut")>=0?-1:t.parameter>e.parameter?1:-1}))})),t.isLoading=!1);case 4:case"end":return e.stop()}}),e)})))()},expandRow:function(t,e){var r=this;return tt(Y().mark((function n(){var i,a;return Y().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.item,r.selectedVirtualDevice=i,r.$set(i,"platforms",{}),r.$set(i,"isLoading",!0),i.expanded=e||!i.expanded,n.next=7,v["a"].get("platformDevices",r.user.apitoken,{filter:{where:{device_id:i.id},limit:500}});case 7:a=n.sent,a&&a.length&&r.$set(i,"platforms",r.platforms.map((function(t){return{selected:!!a[0].filter((function(e){return Number(e.platform_id)===Number(t.id)})).length,id:Number(t.id),name:"".concat(r.platformGroup.platformGroupName," - ").concat(t.platformName)}}))),r.$set(i,"isLoading",!1);case 10:case"end":return n.stop()}}),n)})))()},savePlatformGroup:function(t){var e=this;return tt(Y().mark((function r(){var n,i,a;return Y().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(!t.platforms||!t.platforms.length){r.next=7;break}for(n=[],i=0;i<t.platforms.length;i++)t.platforms[i].selected&&n.push({platform_id:t.platforms[i].id,device_id:t.id,deviceType_id:t.virtualDeviceType_id});return r.next=5,v["a"].post("platformDevices/bulkUpdate",e.user.apitoken,{platformDevices:n,deviceId:t.id});case 5:a=r.sent,a&&a.length&&y["a"].success("Platforms Updated");case 7:case"end":return r.stop()}}),r)})))()},saveParameters:function(t){var e=this;return tt(Y().mark((function r(){var n,i;return Y().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(!t.deviceParameters){r.next=6;break}return n=t.deviceParameters.map((function(t){var e={virtualDevice_id:t.device_id,virtualDeviceTypeParameter_id:t.parameter_id,description:t.description?t.description:t.parameter,textValue:"TEXT"===t.fieldtype&&t.textValue&&""!==t.textValue?t.textValue:t.defaultTextValue,numericValue:"NUMERIC"===t.fieldtype&&t.numericValue&&""!==t.numericValue?t.numericValue:t.defaultNumericValue};return t.parameterValue_id&&(e.id=t.parameterValue_id),e})),r.next=4,v["a"].post("virtualDeviceParameterValues/bulkUpdate",e.user.apitoken,{parameterValues:n});case 4:i=r.sent,i&&i.length?y["a"].success("Parameters Updated"):y["a"].error("An error occurred. Please try again later.");case 6:case"end":return r.stop()}}),r)})))()}}},rt=et,nt=Object(H["a"])(rt,p,m,!1,null,null,null);e["a"]=nt.exports},4545:function(t,e,r){},"454d":function(t,e,r){},4766:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("4bd4"),s=r("132d"),l=r("2fa4"),c=r("8414"),u=r("1e06"),d=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[t.isTemplate?e("h2",{staticStyle:{width:"calc(100% - 120px)","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}},[t._v("\n      "+t._s(t.phase.growPhase_id?"".concat(t.isViewing?"":"Edit Phase Template - ").concat(t.phase.growPhaseName):"New Phase Template")+"\n    ")]):e("h2",{staticStyle:{width:"calc(100% - 120px)","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}},[t._v("\n      "+t._s(t.phase.growPhase_id?"".concat(t.isViewing?"":"Edit Phase - ").concat(t.phase.growPhaseName):"New Phase")+"\n    ")]),e(l["a"]),t.helpTopicKey?e("help-button",{attrs:{"help-topic-key":t.helpTopicKey}}):t._e(),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(s["a"],[t._v("close")])],1)],1),e(a["c"],{staticClass:"editphasetext"},[e(o["a"],{ref:"form",model:{value:t.isValid,callback:function(e){t.isValid=e},expression:"isValid"}},[e(c["a"],{attrs:{dense:""}},[e(u["a"],{attrs:{large:"",icon:"fingerprint"}},[t.phase?e("general-info",{attrs:{growplan:t.growplan,disabled:t.isViewing,isTemplate:t.isTemplate,isException:t.isException,expand:t.expand},on:{"update-preset":t.onUpdatePreset,input:t.generalInfoChanged},model:{value:t.phase,callback:function(e){t.phase=e},expression:"phase"}}):t._e()],1),t.isTemplate||t.isException||""!==t.phase.selectedPhasePreset||t.phase.growPhase_id?e(u["a"],{attrs:{large:"",icon:"highlight"}},[e("photoperiod",{attrs:{disabled:t.isViewing,isException:t.isException,invertable:!0},on:{revalidate:t.revalidate},model:{value:t.phase,callback:function(e){t.phase=e},expression:"phase"}})],1):t._e(),t.isTemplate||t.isException||""!==t.phase.selectedPhasePreset||t.phase.growPhase_id?e(u["a"],{attrs:{icon:"grain",large:""}},[e("irrigation-schedule",{ref:"irrigation",attrs:{photoperiod:t.phase.photoperiod,designators:t.designators,defaultData:t.selectedPreset,phase:t.phase,readonly:t.isViewing,isException:t.isException,"controller-id":t.controllerId},on:{revalidate:t.revalidate,oninheritirrigationschedulechange:t.onInheritIrrigationScheduleChange,onnoirrigationchange:t.onNoIrrigationChange,oncustomirrigationdurationchange:t.onCustomIrrigationDurationChange},model:{value:t.phase.deviceSchedules,callback:function(e){t.$set(t.phase,"deviceSchedules",e)},expression:"phase.deviceSchedules"}})],1):t._e(),t.isTemplate||t.isException||""!==t.phase.selectedPhasePreset||t.phase.growPhase_id?e(u["a"],{attrs:{icon:"air",large:""}},[e("environment",{attrs:{disabled:t.isViewing,isException:t.isException,phase:t.phase},model:{value:t.phase.environmentalSettings,callback:function(e){t.$set(t.phase,"environmentalSettings",e)},expression:"phase.environmentalSettings"}})],1):t._e(),t.isTemplate||t.isException||""!==t.phase.selectedPhasePreset||t.phase.growPhase_id?e(u["a"],{attrs:{icon:"assignment_ind",large:""}},[e("tasks",{attrs:{phase:t.phase,disabled:t.isViewing},on:{"create-task":t.onCreateTask,"edit-task":t.onEditTask},model:{value:t.phase.ag_growTasks,callback:function(e){t.$set(t.phase,"ag_growTasks",e)},expression:"phase.ag_growTasks"}})],1):t._e()],1)],1)],1),t.isViewing?t._e():e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{disabled:t.invalidData||!t.isValid||t.isLoading,color:"primary",isLoading:t.isLoading},on:{click:t.onSavePhase}},[t._v(t._s(t.phase.growPhase_id?"Save":"Create"))])],1)],1)},h=[],f=r("2f62"),p=r("d67f"),m=r("c6a6"),v=r("ac7c"),y=r("62ad"),g=r("0fd9"),b=r("b974"),w=r("8654"),x=r("a844"),S=r("3a2f"),_=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{id:"editPhaseGeneralInfo"}},[e(a["d"],[e("span",{staticClass:"timelinecardtitle"},[t._v("Phase Attributes")]),e(l["a"]),e("help-button",{class:{"mr-2":t.isTemplate||t.isException,"mx-0":!t.isTemplate&&!t.isException},attrs:{"help-topic-key":"cultivation-grow-plans-phases-attributes"}}),t.isTemplate||t.isException?e(v["a"],{staticClass:"titlefield",attrs:{label:"Public"},on:{change:t.onFieldChange},model:{value:t.phase.isPublic,callback:function(e){t.$set(t.phase,"isPublic",e)},expression:"phase.isPublic"}}):t._e()],1),e(a["c"],[e(g["a"],{attrs:{"no-gutters":""}},[t.isTemplate||t.isException?t._e():e(y["a"],{attrs:{md:"12"}},[e(m["a"],{attrs:{label:"Grow Phase Template",items:t.filteredPhasePresets,"item-text":"growPhaseName","item-value":"growPhaseName",disabled:t.disabled},model:{value:t.selectedPreset,callback:function(e){t.selectedPreset=e},expression:"selectedPreset"}})],1),t.isException?[e(y["a"],{staticClass:"pr-2",attrs:{md:"12"}},[e(w["a"],{attrs:{label:"Name",disabled:t.disabled,counter:"75"},model:{value:t.selectedGrowPhaseName,callback:function(e){t.selectedGrowPhaseName=e},expression:"selectedGrowPhaseName"}})],1),e(y["a"],{staticClass:"pr-2",attrs:{md:"12"}},[e("span",[t._v("Phase Duration")])]),e(y["a"],{staticClass:"pr-2",attrs:{md:"4"}},[e(w["a"],{attrs:{label:"Days",type:"number",disabled:t.disabled,rules:[t.rules.daysInRange]},on:{change:t.onDayChange},model:{value:t.selectedDuration.days,callback:function(e){t.$set(t.selectedDuration,"days",e)},expression:"selectedDuration.days"}})],1),e(y["a"],{staticClass:"pr-2",attrs:{md:"4"}},[e(w["a"],{attrs:{label:"Hours",type:"number",value:t.selectedDuration.hours,disabled:t.disabled,rules:[t.rules.hoursInRange]},on:{change:t.onHourChange}})],1),e(y["a"],{staticClass:"pr-2",attrs:{md:"4"}},[e(b["a"],{attrs:{label:"Duration Unit","item-value":"id","item-text":"label",items:t.durationUnits},model:{value:t.durationUnit,callback:function(e){t.durationUnit=e},expression:"durationUnit"}})],1),e(y["a"],{attrs:{cols:"12"}},[e(x["a"],{attrs:{"auto-grow":"",counter:"255",label:"Description",rows:"1"},on:{change:t.onFieldChange},model:{value:t.phase.description,callback:function(e){t.$set(t.phase,"description",e)},expression:"phase.description"}})],1)]:[e(y["a"],{staticClass:"pr-2",attrs:{md:"5"}},[e(w["a"],{attrs:{label:"Name",disabled:t.disabled,counter:"75"},model:{value:t.selectedGrowPhaseName,callback:function(e){t.selectedGrowPhaseName=e},expression:"selectedGrowPhaseName"}})],1),e(y["a"],{staticClass:"pr-2",attrs:{md:"3"}},[e(b["a"],{attrs:{label:"Growth Stage","item-value":"id","item-text":"label",disabled:t.disabled,items:t.growStages,rules:[t.rules.requiredNumber]},on:{change:t.onFieldChange},model:{value:t.phase.ag_growStage_id,callback:function(e){t.$set(t.phase,"ag_growStage_id",e)},expression:"phase.ag_growStage_id"}})],1),e(y["a"],{attrs:{md:"4"}},[e(b["a"],{attrs:{label:"Phase End Transition",disabled:t.disabled,items:["MANUAL","AUTOMATIC"]},on:{change:t.onFieldChange},model:{value:t.phase.phaseEnd,callback:function(e){t.$set(t.phase,"phaseEnd",e)},expression:"phase.phaseEnd"}})],1)],t.isException?t._e():e(y["a"],{staticClass:"pr-2",attrs:{md:"12"}},[e(b["a"],{attrs:{label:"Plant Container Type",disabled:t.disabled,items:t.plantContainerTypes,"item-text":"plantcontainerType","item-value":"id"},model:{value:t.selectedPlantContainerType,callback:function(e){t.selectedPlantContainerType=e},expression:"selectedPlantContainerType"}})],1),t.isException?t._e():e(y["a"],{staticClass:"pr-2 py-2",attrs:{md:"12"}},[e("span",[t._v("Phase Duration")])]),t.isException?t._e():e(y["a"],{staticClass:"pr-2",attrs:{md:"4"}},[e(w["a"],{attrs:{label:"Days",type:"number",disabled:t.disabled,rules:[t.rules.daysInRange]},on:{change:t.onDayChange},model:{value:t.selectedDuration.days,callback:function(e){t.$set(t.selectedDuration,"days",e)},expression:"selectedDuration.days"}})],1),t.isException?t._e():e(y["a"],{staticClass:"pr-2",attrs:{md:"4"}},[e(w["a"],{attrs:{label:"Hours",type:"number",value:t.selectedDuration.hours,disabled:t.disabled,rules:[t.rules.hoursInRange]},on:{change:t.onHourChange}})],1),t.isTemplate?e(y["a"],{staticClass:"pr-2",attrs:{md:"2"}},[e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(w["a"],t._g({attrs:{label:"Min Phases Req'd",type:"number",disabled:t.disabled,min:"0",max:"phasesRequired",rules:[t.rules.phasesMaxMinRequired,t.phasesRequiredNumber]},on:{input:t.onFieldChange},model:{value:t.phase.minPhases,callback:function(e){t.$set(t.phase,"minPhases",e)},expression:"phase.minPhases"}},n))]}}],null,!1,3448133054)},[e("span",[t._v("The minimum number of phases that must be present in a grow plan\n            in order for this template to be selectable")])])],1):t._e(),t.isTemplate?e(y["a"],{staticClass:"pr-2",attrs:{md:"2"}},[e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(w["a"],t._g({attrs:{label:"Max Phases",type:"number",disabled:t.disabled,min:"0",max:"phasesRequired",rules:[t.rules.phasesMaxMinRequired,t.phasesRequiredNumber]},on:{input:t.onFieldChange},model:{value:t.phase.maxPhases,callback:function(e){t.$set(t.phase,"maxPhases",e)},expression:"phase.maxPhases"}},n))]}}],null,!1,1697834651)},[e("span",[t._v("The maximum number of phases that must be present in a grow plan\n            in order for this template to be selectable")])])],1):t._e(),t.isTemplate||t.isException?t._e():e(y["a"],{attrs:{md:"4"}},[e(w["a"],{attrs:{label:"Growplan Days",disabled:!0},model:{value:t.newPhaseGrowplanDays,callback:function(e){t.newPhaseGrowplanDays=e},expression:"newPhaseGrowplanDays"}})],1)],2)],1)],1)},C=[],O=r("38e4"),P=r("d0eb"),D=r("372a"),k=r("7ce3");function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function j(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */j=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==T(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(T(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function E(t,e){return U(t)||M(t,e)||L(t,e)||I()}function I(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function L(t,e){if(t){if("string"==typeof t)return A(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(t,e):void 0}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function M(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function U(t){if(Array.isArray(t))return t}function N(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function F(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){N(a,n,i,o,s,"next",t)}function s(t){N(a,n,i,o,s,"throw",t)}o(void 0)}))}}function G(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?G(Object(r),!0).forEach((function(e){$(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $(t,e,r){return(e=H(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H(t){var e=V(t,"string");return"symbol"==T(e)?e:e+""}function V(t,e){if("object"!=T(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var B={name:"general-info",components:{HelpButton:k["a"]},mixins:[D["a"]],props:["value","update-preset","growplan","disabled","isTemplate","isException"],data:function(){var t=this;return{Trimaster:P["a"],plantContainerTypes:[],rules:{phasesMaxMinRequired:function(t){return parseInt(t)>=0||"Required"},requiredNumber:function(t){return parseInt(t)>0||"Required"},maxNumber:function(e){return!e||(parseInt(e)<=t.phaseDurationMax||"Must be less or equal than ".concat(t.phaseDurationMax))},daysInRange:function(t){if(t&&t.length>0){if(isNaN(t))return"Must be a number";if(parseFloat(t)<parseFloat(0))return"Cannot be less than 0";if(parseFloat(t)>180)return"Cannot be more than 180"}return!0},hoursInRange:function(t){if(t&&t.length>0){if(isNaN(t))return"Must be a number";if(parseFloat(t)<parseFloat(0))return"Cannot be less than 0";if(parseFloat(t)>23)return"Cannot be more than 23"}return!0}},invalidData:!1,phaseDurationMax:15552e3,phasesRequired:30,phase:{},selectedPreset:"",selectedGrowPhaseName:"",selectedPlantContainerType:"",selectedDuration:{days:"0",hours:"0",totalSeconds:0},phasePresets:[],growStages:[],durationUnit:"days",durationUnits:[{id:"hours",label:"Hours"},{id:"days",label:"Days"}]}},beforeMount:function(){this.isTemplate||this.isException||this.getPhasePresets(this.getUser.apitoken),this.getPlantContainerTypes(),this.getGrowStages(),this.refresh()},computed:R(R({},Object(f["c"])(["getUser","getPhasePresetsSuccess"])),{},{newPhaseGrowplanDays:function(){var t=1;this.phase.startSeconds&&(t=Object(O["e"])(this.phase.startSeconds));var e=t+ +this.selectedDuration.days,r=this.selectedDuration.hours;return 0!=r?"".concat(t," - ").concat(e," days (+").concat(r," hours)"):"".concat(t," - ").concat(e)},phaseDurationInDays:function(){var t=this.phase.endSeconds-this.phase.startSeconds,e=t/3600/24;return e},filteredPhasePresets:function(){var t=this.phasePresets,e=[];if(P["a"].isAdmin(this.getUser))return t.sort((function(t,e){return t.growPhaseName>e.growPhaseName?1:-1}));if(this.growplan&&this.growplan.growplan_id){if(t.length>0&&!this.phase.id)for(var r=t.length,n=0;n<r;n++)(this.growplan.growPhases.length>=t[n].minPhases&&this.growplan.growPhases.length<=t[n].maxPhases||this.selectedPreset==t[n].growPhaseName)&&e.push(t[n]);else if(t.length>0&&this.phase.id>0){for(var i=0,a=0;a<this.growplan.growPhases.length;a++)if(this.growplan.growPhases[a].id==this.phase.id){i=a;break}for(var o=t.length,s=0;s<o;s++)(i>=t[s].minPhases&&i<=t[s].maxPhases||this.selectedPreset==t[s].growPhaseName)&&e.push(t[s])}return e.sort((function(t,e){return t.growPhaseName>e.growPhaseName?1:-1}))}return t}}),methods:{getGrowStages:function(){var t=this;return F(j().mark((function e(){var r,n,i;return j().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,P["a"].get("ag_growStages",t.getUser.apitoken,{fields:["id","label"],order:"seq",where:{isCannabis:P["a"].isCannabisFacility()}});case 2:r=e.sent,n=E(r,1),i=n[0],t.growStages=i;case 6:case"end":return e.stop()}}),e)})))()},getPlantContainerTypes:function(){var t=this;P["a"].get("ag_facilityPlantContainerTypes",this.getUser.apitoken,{filter:{include:["plantContainerType"],where:{facility_id:this.getUser.facility_id}}}).then((function(e){for(var r=E(e,2),n=r[0],i=(r[1],[]),a=0;a<n.length;a++)n[a].plantContainerType&&i.push(n[a].plantContainerType);t.plantContainerTypes=i}))},phasesRequiredNumber:function(t){return parseInt(t)<=parseInt(this.phasesRequired)||"Must be less or equal than ".concat(this.phasesRequired)},onFieldChange:function(){this.phase.minPhases>this.phasesRequired||this.phase.maxPhases>this.phasesRequired||this.selectedSecondsDuration>this.phaseDurationMax||this.isTemplate&&isNaN(parseInt(this.phase.minPhases))||this.isTemplate&&isNaN(parseInt(this.phase.maxPhases))?this.invalidData=!0:this.invalidData=!1,this.$emit("input",this.phase,this.invalidData)},getPhasePresets:function(){var t=this;t.getGrowPhases(this.getUser.apitoken,this.getAvailablePhasesQuery(),(function(e){var r=E(e,2),n=r[0];r[1];t.phasePresets=n}))},refresh:function(){this.phase=R({},this.value),this.selectedPreset=this.phase.growPhaseName,this.selectedGrowPhaseName=this.phase.growPhaseName,this.selectedPlantContainerType=this.phase.plantContainerType_id,""!==this.phase.plantContainerType_id&&(this.phase.plantContainerType_id=parseInt(this.phase.plantContainerType_id)),this.setPhaseDuration()},setPhaseDuration:function(){var t=this.phase.endSeconds-this.phase.startSeconds,e=t%86400,r=Object(O["e"])(t),n=0;e>0&&(n=Object(O["h"])(e)),this.selectedDuration={totalSeconds:t,days:"".concat(r),hours:"".concat(n)}},onDayChange:function(t){if(!(+t<0)){var e=this.phase.startSeconds,r=Object(O["b"])(+t),n=Object(O["c"])(+this.selectedDuration.hours),i=e+r+n,a=this.validateDuration(i);a?(this.phase.endSeconds=i,this.$emit("input",this.phase,this.invalidData)):this.setPhaseDuration()}},onHourChange:function(t){if(!(+t<0)){var e=this.phase.startSeconds,r=Object(O["b"])(+this.selectedDuration.days),n=Object(O["c"])(+t),i=e+r+n,a=this.validateDuration(i);a?(this.phase.endSeconds=i,this.$emit("input",this.phase,this.invalidData)):this.setPhaseDuration()}},validateDuration:function(t){if(this.phase.ag_growTasks&&this.phase.ag_growTasks.length>0)for(var e=0;e<this.phase.ag_growTasks.length;e++)if(this.phase.ag_growTasks[e].startSeconds>t)return p["a"].error("Invalid value - You have defined grow tasks that fall outside of your new phase duration."),!1;return!0}},watch:{selectedPreset:function(t,e){if(""!==t&&!this.isTemplate){if((this.phase&&this.phase.growPhase_id&&this.phase.growPhaseName!=t||""!=e||!this.phase.growPhase_id)&&this.phasePresets.length){var r=this.phasePresets.filter((function(e){return e.growPhaseName===t}));if(r.length){var n="",i=0;if(""!=this.phase.growPhase_id)n=this.phase.growPhase_id,i=this.phase.startSeconds;else if(this.growplan.ag_growPhases&&this.growplan.ag_growPhases.length>0){var a=this.growplan.ag_growPhases[this.growplan.ag_growPhases.length-1];i=a.endSeconds+1}else i=0;this.phase=JSON.parse(JSON.stringify(r[0])),this.phase.id=n,this.phase.isTemplate=!1,this.phase.isPublic=!1,this.phase.growPhase_id=n,this.phase.startSeconds=i,this.phase.endSeconds+=i,this.phase.photoperiod={photoperiod:this.phase.photoperiod,photoperiodStarttime:this.phase.photoperiodStarttime};for(var o=0;o<this.phase.deviceSchedules.length;o++)this.phase.deviceSchedules[o].id="";for(var s=-1,l=0;l<this.phase.ag_growTasks.length;l++)this.phase.ag_growTasks[l].id=s,this.phase.ag_growTasks[l].startSeconds+=this.phase.startSeconds,s--;this.$emit("input",this.phase)}}this.onFieldChange()}},selectedGrowPhaseName:function(t){""!==t&&(this.phase.growPhaseName=t,this.onFieldChange())},selectedPlantContainerType:function(t){""!==t&&(this.phase.plantContainerType_id=parseInt(t),this.onFieldChange())},value:function(){this.refresh()}}},z=B,Y=(r("9b25"),r("2877")),q=Object(Y["a"])(z,_,C,!1,null,null,null),W=q.exports,J=r("7c3e"),Z=r("0798"),X=r("169a"),K=r("adda"),Q=r("604c"),tt=r("67b6"),et=r("43a6"),rt=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{id:"irrigationSchedule"}},[e(a["d"],{staticClass:"pb-0"},[e("span",{staticClass:"timelinecardtitle"},[t._v("Irrigation Schedule")]),e(l["a"]),t.phase.inheritIrrigationSchedule?t._e():e(v["a"],{staticClass:"checkboxInTitle",attrs:{label:"No Irrigation",disabled:t.readonly},model:{value:t.phase.noIrrigation,callback:function(e){t.$set(t.phase,"noIrrigation",e)},expression:"phase.noIrrigation"}}),t.isException?e(v["a"],{staticClass:"pl-3 checkboxInTitle",attrs:{label:"Inherit from active phase"},model:{value:t.phase.inheritIrrigationSchedule,callback:function(e){t.$set(t.phase,"inheritIrrigationSchedule",e)},expression:"phase.inheritIrrigationSchedule"}}):t._e(),e("help-button",{staticClass:"ml-2",attrs:{"help-topic-key":"cultivation-grow-plans-phases-irrigation-schedule"}})],1),t.photoperiod&&t.photoperiod.photoperiod&&!t.phase.inheritIrrigationSchedule?e(a["c"],[t.Trimaster.isAdmin(t.getUser)?e(g["a"],{attrs:{"no-gutters":""}},[e(et["a"],{staticClass:"mt-0",attrs:{"hide-details":"",row:""},model:{value:t.irrigationScheduleType,callback:function(e){t.irrigationScheduleType=e},expression:"irrigationScheduleType"}},[e(tt["a"],{attrs:{label:"Frequency/Duration",value:"frequency"}}),e(tt["a"],{attrs:{label:"Custom Schedule",value:"custom"}}),e(tt["a"],{attrs:{label:"Crop Steering",value:"steering"},nativeOn:{"!click":function(e){return t.checkDisabled(e)}},scopedSlots:t._u([{key:"label",fn:function(){return[t.controllerId&&!t.moistureSensors.length||t.ineligiblePlatformGroups.length?[e("div",{on:{click:function(e){return t.checkDisabled(e)}}},[e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on,i=r.attrs;return[e("span",t._g(t._b({staticClass:"grey--text"},"span",i,!1),n),[t._v("Crop Steering")])]}}],null,!1,1525085756)},[e("span",{staticClass:"d-flex flex-column justify-center align-content-center"},[e("span",[t._v("There are existing lifeycles that use this growplan")]),e("span",[t._v("that do not have moisture sensors. Crop steering")]),e("span",[t._v("irrigation will not work for those lifecyles.")])])])],1)]:[e("div",{staticClass:"d-flex align-items-center"},[e("span",{staticClass:"my-auto"},[t._v("Crop Steering")]),e(n["a"],{attrs:{size:"small",icon:"",color:"grey"},on:{click:function(e){t.openCropSteeringDiagram=!0}}},[e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(s["a"],t._g({attrs:{size:"x-large"}},n),[t._v("help_outline")])]}}],null,!1,717019179)},[e("span",[t._v("View Diagram")])])],1)],1)]]},proxy:!0}],null,!1,3444690851)})],1)],1):t._e(),"steering"===t.irrigationScheduleType&&t.Trimaster.isAdmin(t.getUser)?e("div",{staticClass:"mt-3"},[t.controllerId&&!t.moistureSensors.length?e(Z["a"],{staticClass:"mb-2",attrs:{color:"orange",type:"warning"}},[t._v("\n        No moisture sensor detected on selected platform. Crop steering irrigation will not work.\n      ")]):t._e(),t.ineligiblePlatformGroups.length?e(Z["a"],{staticClass:"mb-2",attrs:{color:"orange",type:"warning"}},[t._v("\n        There are existing lifeycles that use this growplan that do not have moisture sensors. Crop steering irrigation will not work for those lifecyles.\n      ")]):t._e(),e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{attrs:{cols:"8"}},[e(b["a"],{attrs:{label:"Nutrient Mix",items:t.irrigationDesignators,"item-text":"designatorName","item-value":"id",disabled:t.readonly},on:{change:t.calculateIrrigationData},model:{value:t.steeringNutrientMix,callback:function(e){t.steeringNutrientMix=e},expression:"steeringNutrientMix"}})],1),e(y["a"],{attrs:{cols:"4"}},[e(w["a"],{staticClass:"ml-2",attrs:{label:"Flow Rate",type:"number",suffix:"mL/s"},on:{change:t.calculateIrrigationData},model:{value:t.steeringIrrigationRate,callback:function(e){t.steeringIrrigationRate=e},expression:"steeringIrrigationRate"}})],1)],1),e("div",{staticClass:"text-subtitle-1"},[t._v("Irrigation Ramp Up Phase:")]),e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{attrs:{cols:"3"}},[e("div",[e("div",{staticClass:"d-flex align-content-center justify-space-between"},[e("span",[t._v("Minimum VWC")]),e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on,i=r.attrs;return[e(s["a"],t._g(t._b({attrs:{color:"grey",small:""}},"v-icon",i,!1),n),[t._v("\n                    question_mark\n                  ")])]}}],null,!1,3696841632)},[e("span",{staticClass:"d-flex flex-column justify-center align-content-center"},[e("span",[t._v("Volumetric Water Content target")]),e("span",[t._v("that triggers irrigation start.")])])])],1),e(w["a"],{attrs:{type:"number",suffix:"%"},on:{change:t.calculateIrrigationData},model:{value:t.steeringMinimumVWC,callback:function(e){t.steeringMinimumVWC=e},expression:"steeringMinimumVWC"}})],1)]),e(y["a"],{attrs:{cols:"3"}},[e("div",{staticClass:"ml-3"},[e("span",[t._v("Shot Size")]),e(w["a"],{attrs:{type:"number",suffix:"mL"},on:{change:t.calculateIrrigationData},model:{value:t.steeringRampUpIrrigationVolume,callback:function(e){t.steeringRampUpIrrigationVolume=e},expression:"steeringRampUpIrrigationVolume"}})],1)]),e(y["a"],{attrs:{cols:"3"}},[e("div",{staticClass:"ml-3"},[e("div",{staticClass:"d-flex align-content-center justify-space-between"},[e("span",[t._v("Dryback")]),e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on,i=r.attrs;return[e(s["a"],t._g(t._b({attrs:{color:"grey",small:""}},"v-icon",i,!1),n),[t._v("\n                    question_mark\n                  ")])]}}],null,!1,3696841632)},[e("span",{staticClass:"d-flex flex-column justify-center align-content-center"},[e("span",[t._v("The drop in VWC required before")]),e("span",[t._v("triggering next irrigation event.")])])])],1),e(w["a"],{attrs:{type:"number",suffix:"%"},on:{change:t.calculateIrrigationData},model:{value:t.steeringRampUpDryback,callback:function(e){t.steeringRampUpDryback=e},expression:"steeringRampUpDryback"}})],1)]),e(y["a"],{attrs:{cols:"3"}},[e("div",{staticClass:"ml-3"},[e("div",{staticClass:"d-flex align-content-center justify-space-between"},[e("span",[t._v("Phase Timeout")]),e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on,i=r.attrs;return[e(s["a"],t._g(t._b({attrs:{color:"grey",small:""}},"v-icon",i,!1),n),[t._v("\n                    question_mark\n                  ")])]}}],null,!1,3696841632)},[e("span",{staticClass:"d-flex flex-column justify-center align-content-center"},[e("span",[t._v("How long to wait before automatically")]),e("span",[t._v("transitioning to irrigation maintenance phase.")])])])],1),e(w["a"],{attrs:{type:"number",suffix:"mins"},on:{change:t.calculateIrrigationData},model:{value:t.steeringRampUpTimeoutMinutes,callback:function(e){t.steeringRampUpTimeoutMinutes=e},expression:"steeringRampUpTimeoutMinutes"}})],1)])],1),e("div",{staticClass:"text-subtitle-1"},[t._v("Irrigation Maintenance Phase:")]),e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{attrs:{cols:"3"}},[e("div",{},[e("div",{staticClass:"d-flex align-content-center justify-space-between"},[e("span",[t._v("Target Max VWC")]),e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on,i=r.attrs;return[e(s["a"],t._g(t._b({attrs:{color:"grey",small:""}},"v-icon",i,!1),n),[t._v("\n                    question_mark\n                  ")])]}}],null,!1,3696841632)},[e("span",{staticClass:"d-flex flex-column justify-center align-content-center"},[e("span",[t._v("Volumetric Water Content target")]),e("span",[t._v("that triggers irrigation maintenance phase.")])])])],1),e(w["a"],{attrs:{type:"number",suffix:"%"},on:{change:t.calculateIrrigationData},model:{value:t.steeringMaximumVWC,callback:function(e){t.steeringMaximumVWC=e},expression:"steeringMaximumVWC"}})],1)]),e(y["a"],{attrs:{cols:"3"}},[e("div",{staticClass:"ml-3"},[e("span",[t._v("Shot Size")]),e(w["a"],{attrs:{type:"number",suffix:"mL"},on:{change:t.calculateIrrigationData},model:{value:t.steeringMaintenanceIrrigationVolume,callback:function(e){t.steeringMaintenanceIrrigationVolume=e},expression:"steeringMaintenanceIrrigationVolume"}})],1)]),e(y["a"],{attrs:{cols:"3"}},[e("div",{staticClass:"ml-3"},[e("div",{staticClass:"d-flex align-content-center justify-space-between"},[e("span",[t._v("Dryback")]),e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on,i=r.attrs;return[e(s["a"],t._g(t._b({attrs:{color:"grey",small:""}},"v-icon",i,!1),n),[t._v("\n                    question_mark\n                  ")])]}}],null,!1,3696841632)},[e("span",{staticClass:"d-flex flex-column justify-center align-content-center"},[e("span",[t._v("The drop in VWC required before")]),e("span",[t._v("triggering next irrigation event.")])])])],1),e(w["a"],{attrs:{type:"number",suffix:"%"},on:{change:t.calculateIrrigationData},model:{value:t.steeringMaintenanceDryback,callback:function(e){t.steeringMaintenanceDryback=e},expression:"steeringMaintenanceDryback"}})],1)]),e(y["a"],{attrs:{cols:"3"}},[e("div",{staticClass:"ml-3"},[e("div",{staticClass:"d-flex align-content-center justify-space-between"},[e("span",[t._v("Stop Irrigation Time")]),e(S["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on,i=r.attrs;return[e(s["a"],t._g(t._b({attrs:{color:"grey",small:""}},"v-icon",i,!1),n),[t._v("\n                    question_mark\n                  ")])]}}],null,!1,3696841632)},[e("span",{staticClass:"d-flex flex-column justify-center align-content-center"},[e("span",[t._v("The time after which no more")]),e("span",[t._v("irrigation events will occur.")])])])],1),e("vuetify-timepicker",{on:{change:t.calculateIrrigationData},model:{value:t.steeringEndTime,callback:function(e){t.steeringEndTime=e},expression:"steeringEndTime"}})],1)])],1)],1):t._e(),"custom"===t.irrigationScheduleType&&t.Trimaster.isAdmin(t.getUser)?e("div",{attrs:{"no-gutters":""}},[t.photoperiod&&t.photoperiod.photoperiod&&!t.phase.inheritIrrigationSchedule&&!t.phase.noIrrigation?e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{attrs:{cols:"4"}},[e(b["a"],{attrs:{label:"Nutrient Mix",items:t.irrigationDesignators,"item-text":"designatorName","item-value":"id","return-object":"",disabled:t.readonly},model:{value:t.customNutrientMix,callback:function(e){t.customNutrientMix=e},expression:"customNutrientMix"}})],1),e(y["a"],{attrs:{cols:"3"}},[e("vuetify-timepicker",{attrs:{label:"Irrigate At"},model:{value:t.customBeginTime,callback:function(e){t.customBeginTime=e},expression:"customBeginTime"}})],1),e(y["a"],{attrs:{cols:"2"}},[e("div",{staticClass:"ml-2"},[e(w["a"],{attrs:{type:"number",label:"Minutes",rules:t.max59MinutesRule},model:{value:t.customMinutes,callback:function(e){t.customMinutes=e},expression:"customMinutes"}})],1)]),e(y["a"],{staticClass:"d-flex align-center",attrs:{cols:"3"}},[e("div",{staticClass:"mx-2 flex-grow-1"},[e(w["a"],{attrs:{type:"number",label:"Seconds",rules:t.max59MinutesRule},model:{value:t.customSeconds,callback:function(e){t.customSeconds=e},expression:"customSeconds"}})],1),e(n["a"],{attrs:{icon:"",outlined:"",color:"primary"}},[e(s["a"],{attrs:{disabled:!t.allowAddCustomTime},on:{click:t.addCustomIrrigationTime}},[t._v("add")])],1)],1)],1):t._e(),t.conflictingTime?e(Z["a"],{attrs:{type:"warning",dismissible:""},on:{input:function(e){t.conflictingTime=null}}},[t._v("\n        "+t._s(t.conflictingMessage)+"\n      ")]):t._e(),e("div",{staticClass:"d-flex flex-column"},[t.phase.noIrrigation?t._e():e("h3",{staticClass:"v-subheader subhead2",staticStyle:{"padding-left":"0px"}},[t._v("\n          Irrigation Schedule Times\n        ")]),e("div",[e("schedule-chips-custom",{directives:[{name:"show",rawName:"v-show",value:!t.phase.noIrrigation,expression:"!phase.noIrrigation"}],attrs:{blocks:t.allCustomTimes,closeable:!0},on:{"remove-day":t.removeFromDaySchedule,"remove-night":t.removeFromNightSchedule}}),0==t.nightSchedule.customTimes.length&&0==t.daySchedule.customTimes.length?e("div",{staticClass:"text-center pt-4"},[t._v("\n            <No scheduled irrigations have been defined>\n          ")]):t._e()],1)])],1):t._e(),"frequency"===t.irrigationScheduleType?[e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{staticClass:"pr-4",attrs:{md:"6"}},[e("h3",{directives:[{name:"show",rawName:"v-show",value:!t.phase.noIrrigation,expression:"!phase.noIrrigation"}],staticClass:"v-subheader subhead2",staticStyle:{"padding-left":"0px"}},[t._v("\n            Lights On Irrigation\n            "),e(l["a"]),e(v["a"],{staticClass:"checkboxInTitle customDurationCheckbox",attrs:{label:"Custom Duration"},model:{value:t.customIrrigationDurationCheckbox,callback:function(e){t.customIrrigationDurationCheckbox=e},expression:"customIrrigationDurationCheckbox"}})],1),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.phase.noIrrigation,expression:"!phase.noIrrigation"}]},[t.photoperiod&&t.photoperiod.photoperiod&&!t.phase.inheritIrrigationSchedule?e(g["a"],{attrs:{"no-gutters":"",justify:"center"}},[e(y["a"],{attrs:{cols:"12"}},[e(b["a"],{attrs:{label:"Nutrient Mix",items:t.irrigationDesignators,"item-text":"designatorName","item-value":"id","return-object":"",disabled:t.readonly},on:{change:t.calculateIrrigationData},model:{value:t.nutrientMixLightsOn,callback:function(e){t.nutrientMixLightsOn=e},expression:"nutrientMixLightsOn"}})],1)],1):t._e(),e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{staticClass:"pr-4",attrs:{md:"6"}},[e(Q["b"],[e("label",[t._v("Frequency - Every:")]),e(g["a"],[e(y["a"],{staticClass:"pr-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Hours",disabled:t.phase.noIrrigation||t.readonly,rules:[t.max24HoursRules]},on:{change:t.calculateIrrigationData},model:{value:t.daySchedule.hourFrequency,callback:function(e){t.$set(t.daySchedule,"hourFrequency",e)},expression:"daySchedule.hourFrequency"}})],1),e(y["a"],{staticClass:"pl-1",attrs:{md:"6"}},[e(w["a"],{staticClass:"pr-4",attrs:{type:"number",label:"Minutes",disabled:t.phase.noIrrigation||t.readonly,rules:t.max59MinutesRules},on:{change:t.calculateIrrigationData},model:{value:t.daySchedule.minFrequency,callback:function(e){t.$set(t.daySchedule,"minFrequency",e)},expression:"daySchedule.minFrequency"}})],1)],1)],1)],1),e(y["a"],{staticClass:"pl-4",attrs:{md:"6"}},[e(Q["b"],[e("label",[t._v("Duration - Irrigate For:")]),e(g["a"],[e(y["a"],{staticClass:"pr-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Minutes",disabled:t.phase.noIrrigation||t.readonly,rules:t.requiredNumber},on:{change:t.calculateIrrigationData},model:{value:t.daySchedule.minDuration,callback:function(e){t.$set(t.daySchedule,"minDuration",e)},expression:"daySchedule.minDuration"}})],1),e(y["a"],{staticClass:"pl-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Seconds",disabled:t.phase.noIrrigation||t.readonly,rules:t.requiredNumber},on:{change:t.calculateIrrigationData},model:{value:t.daySchedule.secDuration,callback:function(e){t.$set(t.daySchedule,"secDuration",e)},expression:"daySchedule.secDuration"}})],1)],1)],1)],1)],1),e(g["a"],{attrs:{"no-gutters":""}},[t.isException&&t.phase.inheritLightSchedule?t._e():e(y["a"],{staticClass:"pr-1",attrs:{cols:"6"}},[e("vuetify-timepicker",{attrs:{label:"Starting At",readonly:t.readonly,min:t.dayScheduleMinTimeStart,max:t.dayScheduleMaxTimeStart},on:{change:t.calculateIrrigationData},model:{value:t.dayScheduleBeginTime,callback:function(e){t.dayScheduleBeginTime=e},expression:"dayScheduleBeginTime"}})],1),t.isException&&t.phase.inheritLightSchedule?t._e():e(y["a"],{staticClass:"pl-1",attrs:{cols:"6"}},[e("vuetify-timepicker",{attrs:{label:"Ending At",readonly:t.readonly,min:t.dayScheduleMinTimeEnd,max:t.dayScheduleMaxTimeEnd},on:{change:t.calculateIrrigationData},model:{value:t.dayScheduleEndTime,callback:function(e){t.dayScheduleEndTime=e},expression:"dayScheduleEndTime"}})],1)],1),t.customIrrigationDuration>=0?e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{staticClass:"pr-4",attrs:{cols:"6"}},[e("label",[t._v("Custom"),e("br"),t._v("First Irrigation"),e("br"),t._v("Duration:")])]),e(y["a"],{staticClass:"pl-4",attrs:{md:"6"}},[e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{staticClass:"pr-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Minutes",rules:t.requiredNumber},on:{change:t.onChangeCustomIrrigationDurationMins},model:{value:t.customIrrigationDurationMins,callback:function(e){t.customIrrigationDurationMins=e},expression:"customIrrigationDurationMins"}})],1),e(y["a"],{staticClass:"pl-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Seconds",rules:t.requiredNumber},on:{change:t.onChangeCustomIrrigationDurationSecs},model:{value:t.customIrrigationDurationSecs,callback:function(e){t.customIrrigationDurationSecs=e},expression:"customIrrigationDurationSecs"}})],1)],1)],1)],1):t._e()],1)]),t.phase.noIrrigation?t._e():e(y["a"],{staticClass:"pl-4",staticStyle:{"border-left":"1px solid silver"},attrs:{md:"6"}},[e("h3",{staticClass:"v-subheader subhead2",staticStyle:{"padding-left":"0px"}},[t._v("\n            Lights Off Irrigation\n          ")]),!t.phase.noIrrigation&&t.isException&&t.phase.inheritLightSchedule||+t.photoperiod.photoperiod<24&&!t.phase.noIrrigation?e("div",[e(g["a"],{attrs:{"no-gutters":"",justify:"center"}},[e(y["a"],{attrs:{cols:"12"}},[e(b["a"],{attrs:{label:"Nutrient Mix",items:t.irrigationDesignators,"item-text":"designatorName","item-value":"id","return-object":"",disabled:t.readonly},on:{change:t.calculateIrrigationData},model:{value:t.nutrientMixLightsOff,callback:function(e){t.nutrientMixLightsOff=e},expression:"nutrientMixLightsOff"}})],1)],1),e(g["a"],{attrs:{"no-gutters":""}},[e(y["a"],{staticClass:"pr-4",attrs:{md:"6"}},[e(Q["b"],[e("label",[t._v("Frequency - Every")]),e(g["a"],[e(y["a"],{staticClass:"pr-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Hours",disabled:t.phase.noIrrigation||t.readonly,rules:[t.requiredDarkFrequencyHours]},on:{change:t.calculateIrrigationData},model:{value:t.nightSchedule.hourFrequency,callback:function(e){t.$set(t.nightSchedule,"hourFrequency",e)},expression:"nightSchedule.hourFrequency"}})],1),e(y["a"],{staticClass:"pl-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Minutes",disabled:t.phase.noIrrigation||t.readonly,rules:[t.requiredDarkFrequencyMinutes]},on:{change:t.calculateIrrigationData},model:{value:t.nightSchedule.minFrequency,callback:function(e){t.$set(t.nightSchedule,"minFrequency",e)},expression:"nightSchedule.minFrequency"}})],1)],1)],1)],1),e(y["a"],{staticClass:"pl-4",attrs:{md:"6"}},[e(Q["b"],[e("label",[t._v("Duration - Irrigate For")]),e(g["a"],[e(y["a"],{staticClass:"pr-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Minutes",disabled:t.phase.noIrrigation||t.readonly,rules:t.requiredNumber},on:{change:t.calculateIrrigationData},model:{value:t.nightSchedule.minDuration,callback:function(e){t.$set(t.nightSchedule,"minDuration",e)},expression:"nightSchedule.minDuration"}})],1),e(y["a"],{staticClass:"pl-1",attrs:{md:"6"}},[e(w["a"],{attrs:{type:"number",label:"Seconds",disabled:t.phase.noIrrigation||t.readonly,rules:t.requiredNumber},on:{change:t.calculateIrrigationData},model:{value:t.nightSchedule.secDuration,callback:function(e){t.$set(t.nightSchedule,"secDuration",e)},expression:"nightSchedule.secDuration"}})],1)],1)],1)],1)],1),e(g["a"],{attrs:{"no-gutters":""}},[t.isException&&t.phase.inheritLightSchedule?t._e():e(y["a"],{staticClass:"pr-1",attrs:{cols:"6",md:"6"}},[+t.photoperiod.photoperiod<24||t.isException&&t.phase.inheritLightSchedule?e("vuetify-timepicker",{attrs:{label:"Starting At",readonly:t.readonly,min:t.nightScheduleMinTimeStart,max:t.nightScheduleMaxTimeStart},on:{change:t.calculateIrrigationData},model:{value:t.nightScheduleBeginTime,callback:function(e){t.nightScheduleBeginTime=e},expression:"nightScheduleBeginTime"}}):t._e()],1),t.isException&&t.phase.inheritLightSchedule?t._e():e(y["a"],{staticClass:"pl-1",attrs:{cols:"6",md:"6"}},[e("vuetify-timepicker",{attrs:{label:"Ending At",readonly:t.readonly,min:t.nightScheduleMinTimeEnd,max:t.nightScheduleMaxTimeEnd},on:{change:t.calculateIrrigationData},model:{value:t.nightScheduleEndTime,callback:function(e){t.nightScheduleEndTime=e},expression:"nightScheduleEndTime"}})],1)],1)],1):e("div",{staticStyle:{"padding-top":"70px","text-align":"center"}},[t._v("\n            <Not Applicable>\n          ")])])],1),t.isException&&t.phase.inheritLightSchedule?t._e():[t.daySchedule.hourFrequency<24?[e("h3",{directives:[{name:"show",rawName:"v-show",value:!t.phase.noIrrigation,expression:"!phase.noIrrigation"}],staticClass:"v-subheader subhead2",staticStyle:{"padding-left":"0px"}},[t._v("\n          Estimated Irrigation Schedule Times\n        ")]),e("schedule-chips-simple",{directives:[{name:"show",rawName:"v-show",value:!t.phase.noIrrigation,expression:"!phase.noIrrigation"}],attrs:{type:"on",duration:t.dayDuration.number,blocks:t.daySchedule.timesToRun}}),!t.phase.noIrrigation&&t.nightSchedule.minDuration+t.nightSchedule.secDuration>0?e("schedule-chips-simple",{attrs:{type:"off",duration:t.dayDuration.number,blocks:t.nightSchedule.timesToRun}}):t._e(),0==t.nightSchedule.timesToRun.length&&0==t.daySchedule.timesToRun.length?e("div",{staticClass:"text-center pt-4"},[t._v("\n          <No scheduled irrigations have been defined>\n        ")]):t._e()]:t._e()]]:t._e()],2):t._e(),e(X["a"],{attrs:{width:"80%"},model:{value:t.openCropSteeringDiagram,callback:function(e){t.openCropSteeringDiagram=e},expression:"openCropSteeringDiagram"}},[e(K["a"],{attrs:{src:"/img/CropSteering.jpg"}})],1)],1)},nt=[],it=r("d720"),at=r("dd20"),ot=r("c1df"),st=r.n(ot),lt={methods:{convertTimeToHours:function(t){var e=parseInt(t.substring(0,2)),r=parseInt(t.substring(2,4))/60;return e+r},convertNumberToTimeMoment:function(t){var e=st()();if(e.set("hour",t),t%1===0)e.set("minutes",0);else{var r="0."+String(t).split(".")[1];e.set("minutes",60*r)}return e}}},ct=r("1cc0");function ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ut(Object(r),!0).forEach((function(e){ht(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ht(t,e,r){return(e=ft(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ft(t){var e=pt(t,"string");return"symbol"==mt(e)?e:e+""}function pt(t,e){if("object"!=mt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function vt(t){return bt(t)||gt(t)||_t(t)||yt()}function yt(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function bt(t){if(Array.isArray(t))return Ct(t)}function wt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */wt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==mt(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(mt(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function xt(t,e){return Pt(t)||Ot(t,e)||_t(t,e)||St()}function St(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _t(t,e){if(t){if("string"==typeof t)return Ct(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ct(t,e):void 0}}function Ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ot(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Pt(t){if(Array.isArray(t))return t}function Dt(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function kt(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){Dt(a,n,i,o,s,"next",t)}function s(t){Dt(a,n,i,o,s,"throw",t)}o(void 0)}))}}var Tt={name:"irrigation-schedule",mixins:[D["a"],lt],props:["designators","defaultData","value","phase","photoperiod","isException","readonly","controllerId"],components:{ScheduleChipsCustom:ct["a"],HelpButton:k["a"],ScheduleChipsSimple:it["a"],VuetifyTimepicker:at["a"]},beforeMount:function(){var t=this;this.timeFormat=14===Number(this.timePreference24Hour)?"HH:mm":"h:mm a",this.photoperiod&&this.calculatePhotoperiod(this.photoperiod),this.value&&this.value.length>=1?(this.value[0].designator_id||(this.value[0].designator_id=this.irrigationDesignators[0].id),this.value.forEach((function(e){"Lights On"===e.scheduledFor?(t.nutrientMixLightsOn=e.designator_id,t.daySchedule.deviceDesignator=e.designator_id,e.customTimes&&e.customTimes.length?t.irrigationScheduleType="custom":e.cropSteering&&(t.irrigationScheduleType="steering")):(t.nutrientMixLightsOff=e.designator_id,t.nightSchedule.deviceDesignator=e.designator_id,e.customTimes&&e.customTimes.length?t.irrigationScheduleType="custom":e.cropSteering&&(t.irrigationScheduleType="steering"))})),"Lights On"==this.value[0].scheduledFor?(this.lightsOnIndex=0,this.lightsOffIndex=1):(this.lightsOffIndex=0,this.lightsOnIndex=1),this.$set(this,"daySchedule",this.toUIData(this.value[this.lightsOnIndex],this.photoperiod,!1)),this.value.length>1&&this.$set(this,"nightSchedule",this.toUIData(this.value[this.lightsOffIndex],this.photoperiod,!0))):this.defaultData&&this.onDefaultDataChange(this.defaultData),this.controllerId?this.loadMoistureSensorDevices():this.moistureSensors=[],this.initialized=!0,this.calculateIrrigationData(),this.checkCropSteeringEligibility()},mounted:function(){var t=this;if(!isNaN(this.phase.customFirstLightIrrigationDuration)&&this.phase.customFirstLightIrrigationDuration>0){var e=this.phase.customFirstLightIrrigationDuration;this.customIrrigationDurationCheckbox=!0,setTimeout((function(){t.customIrrigationDuration=e,t.customIrrigationDurationMins=Math.floor(e/60),t.customIrrigationDurationSecs=e-60*t.customIrrigationDurationMins}),50)}else this.customIrrigationDuration=-1},data:function(){return{Trimaster:P["a"],irrigationScheduleType:"frequency",steeringNutrientMix:null,steeringIrrigationVolume:500,steeringIrrigationRate:5,steeringMinimumVWC:47,steeringRampUpIrrigationVolume:500,steeringRampUpDryback:2,steeringRampUpTimeoutMinutes:180,steeringMaximumVWC:60,steeringMaintenanceIrrigationVolume:500,steeringMaintenanceDryback:4,steeringEndTime:"16:00",customNutrientMix:null,customBeginTime:"12:00",customMinutes:null,customSeconds:null,lightsOnIndex:0,lightsOffIndex:1,customIrrigationDuration:-1,customIrrigationDurationCheckbox:!1,customIrrigationDurationMins:0,customIrrigationDurationSecs:0,dayScheduleMinTimeStart:"00:00",dayScheduleMaxTimeStart:"23:59",dayScheduleMinTimeEnd:"00:00",dayScheduleMaxTimeEnd:"23:59",nightScheduleMinTimeStart:"00:00",nightScheduleMaxTimeStart:"23:59",nightScheduleMinTimeEnd:"00:00",nightScheduleMaxTimeEnd:"23:59",initialized:!1,nightScheduleAllowedHours:[],dayScheduleAllowedHours:[],max59MinutesRules:[function(t){return!isNaN(parseInt(t))||"Required"},function(t){return t>=0&&t<=59||"Must be between 0 and 59"}],max59MinutesRule:[function(t){return t>=0&&t<=59||"Must be between 0 and 59"}],requiredNumber:[function(t){return!isNaN(parseInt(t))||"Required"},function(t){return t>=0||"Must be non-negative value"}],dayScheduleBeginTime:"00:00",dayScheduleEndTime:"00:00",nightScheduleBeginTime:"00:00",nightScheduleEndTime:"00:00",irrigationSchedule:{scheduledFor:"Lights On",duration:{number:"",units:"minutes"},frequency:{number:"",units:"hours"},deviceSchedules:[],deviceDesignator:"",designator_id:"",startTime:"",cronSchedule:""},irrigationScheduleStartTime:"12:00",nutrientMix:0,nutrientMixLightsOn:0,nutrientMixLightsOff:0,daySchedule:{deviceDesignator:"",beginTime:"00:00",minDuration:0,secDuration:0,hourFrequency:0,minFrequency:0,cronSchedule:"",timesToRun:[],customTimes:[],cropSteering:null},nightSchedule:{deviceDesignator:"",beginTime:"00:00",minDuration:0,secDuration:0,hourFrequency:0,minFrequency:0,cronSchedule:"",timesToRun:[],customTimes:[],cropSteering:null},timeFormat:"h:mm a",conflictingTime:null,moistureSensors:[],ineligiblePlatformGroups:[],openCropSteeringDiagram:!1}},methods:{checkDisabled:function(t){if(this.controllerId&&!this.moistureSensors.length||this.ineligiblePlatformGroups.length)return t.stopPropagation(),t.preventDefault(),!1},loadMoistureSensorDevices:function(){var t=this;return kt(wt().mark((function e(){var r,n,i;return wt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,P["a"].get("virtualDevices",t.getUser.apitoken,{filter:{where:{controller_id:t.controllerId,sensorDevice_id:{neq:null},designator_id:53,state_id:1}}});case 2:r=e.sent,n=xt(r,2),i=n[0],n[1],t.moistureSensors=i;case 7:case"end":return e.stop()}}),e)})))()},addCustomIrrigationTime:function(){var t=this,e=st()(this.customBeginTime,"HH:mm"),r=e.format(this.timeFormat),n=e.format("HHmm"),i=this.daySchedule.customTimes.find((function(t){return t.startTime===r})),a=this.nightSchedule.customTimes.find((function(t){return t.startTime===r}));if(!i&&!a){var o=[{start:this.dayScheduleMinTimeStart.replace(":",""),end:this.dayScheduleMaxTimeStart.replace(":","")},{start:this.dayScheduleMinTimeEnd.replace(":",""),end:this.dayScheduleMaxTimeEnd.replace(":","")}],s=[{start:this.nightScheduleMinTimeStart.replace(":",""),end:this.nightScheduleMaxTimeStart.replace(":","")},{start:this.nightScheduleMinTimeEnd.replace(":",""),end:this.nightScheduleMaxTimeEnd.replace(":","")}],l=[].concat(vt(this.daySchedule.customTimes),vt(this.nightSchedule.customTimes)),c=null;l.some((function(e){var r=st()(n,"HHmm").seconds(0).add(t.customMinutes,"minutes").add(t.customSeconds,"seconds").format("HHmm"),i=st()(e.timeString,"HHmm").seconds(0).add(e.durationSecs,"seconds").format("HHmm");return(Number(n)>Number(e.timeString)&&Number(n)<i||r>Number(e.timeString)&&r<i||Number(n)<Number(e.timeString)&&r>=i)&&(c=e,!0)})),c?this.conflictingTime=c:(this.conflictingTime=null,o.some((function(e){if(Number(n)>=Number(e.start)&&Number(n)<=Number(e.end)){var i=vt(t.daySchedule.customTimes);return i.push({startTime:r,durationSecs:60*Number(t.customMinutes)+Number(t.customSeconds),designatorId:t.customNutrientMix.id,designatorName:t.customNutrientMix.designatorName,timeString:n}),i.sort((function(t,e){return t.timeString<e.timeString?-1:1})),t.$set(t.daySchedule,"customTimes",i),!0}return!1})),s.some((function(e){if(Number(n)>=Number(e.start)&&Number(n)<=Number(e.end)){var i=vt(t.nightSchedule.customTimes);return i.push({startTime:r,durationSecs:60*Number(t.customMinutes)+Number(t.customSeconds),designatorId:t.customNutrientMix.id,designatorName:t.customNutrientMix.designatorName,timeString:n}),i.sort((function(t,e){return t.timeString<e.timeString?-1:1})),t.$set(t.nightSchedule,"customTimes",i),!0}return!1})),this.customMinutes=null,this.customSeconds=null)}},removeFromDaySchedule:function(t){var e=this.daySchedule.customTimes.filter((function(e){return e.timeString!==t.timeString}));this.$set(this.daySchedule,"customTimes",e),e.length||this.nightSchedule.customTimes.length||this.$emit("onnoirrigationchange",!0)},removeFromNightSchedule:function(t){var e=this.nightSchedule.customTimes.filter((function(e){return e.timeString!==t.timeString}));this.$set(this.nightSchedule,"customTimes",e),e.length||this.daySchedule.customTimes.length||this.$emit("onnoirrigationchange",!0)},onChangeCustomIrrigationDurationMins:function(t){this.customIrrigationDuration=60*t+parseInt(this.customIrrigationDurationSecs)},onChangeCustomIrrigationDurationSecs:function(t){this.customIrrigationDuration=60*this.customIrrigationDurationMins+parseInt(t)},requiredDarkFrequencyHours:function(t){return!(isNaN(parseInt(t))||parseInt(t)<0)||"Required"},requiredDarkFrequencyMinutes:function(t){return!(isNaN(parseInt(t))||parseInt(t)<0)||"Required"},max24HoursRules:function(t){return isNaN(parseInt(t))&&0!=t?"Required":24==this.photoperiod.photoperiod||(t>=0&&t<=24||"Must be between 0 and 24")},getDeviceDesignatorByName:function(t){for(var e=0;e<this.irrigationDesignators.length;e++)if(this.irrigationDesignators[e].designatorName==t)return this.irrigationDesignators[e];return null},onDefaultDataChange:function(t){var e=this,r=this;t&&(t.irrigationSchedule&&t.irrigationSchedule.forEach((function(n){"both"!==n.type&&"Lights On"!==n.type&&"light"!=n.type||(r.$set(r,"daySchedule",e.toUIData(n,t.photoPeriod)),"auto"!=n.startTime&&(r.dayScheduleBeginTime=n.startTime.substring(0,2)+":"+n.startTime.substring(2,4),n.finishTime&&(r.dayScheduleEndTime=n.finishTime.substring(0,2)+":"+n.finishTime.substring(2,4)))),"both"!==n.type&&"Lights Off"!==n.type&&"dark"!=n.type||(r.$set(r,"nightSchedule",e.toUIData(n,t.photoPeriod,!0)),"auto"!=n.starttime&&(r.nightScheduleBeginTime=n.starttime)),"Lights On"!==n.type&&"light"!=n.type||(e.nutrientMixLightsOn=e.getDeviceDesignatorByName(n.deviceDesignator)),"Lights Off"!==n.type&&"dark"!=n.type||(e.nutrientMixLightsOff=e.getDeviceDesignatorByName(n.deviceDesignator))})),this.calculateIrrigationData())},validateIndividualSchedule:function(t,e){var r="".concat(e," schedule"),n=60*t.minDuration+t.secDuration,i=60*t.hourFrequency+t.minFrequency,a={isValid:!0};return t.deviceDesignator?n?(!i||i>86400)&&(a.message="".concat(r," - Enter a valid light frequency value"),a.isValid=!1):(a.message="".concat(r," - Enter a valid light irrigation duration"),a.isValid=!1):(a.message="".concat(r," - Select an irrigation device"),a.isValid=!1),a},serializeSchedule:function(t,e){var r={autoScheduled:0,growphase_id:this.phase.growPhase_id,cronSchedule:t.cronSchedule,duration:{number:60*parseInt(t.minDuration)+parseInt(t.secDuration),units:"seconds"},scheduledFor:e,startTime:t.startTime,finishTime:t.finishTime,frequency:{number:60*parseInt(t.hourFrequency)+parseInt(t.minFrequency),units:"minutes"},notes:"",irrigationScheduleType:this.irrigationScheduleType,customTimes:t.customTimes,cropSteering:t.cropSteering},n="Lights On"===e?this.nutrientMixLightsOn:this.nutrientMixLightsOff;return"object"==mt(n)?(r.designator_id=n.id,r.deviceDesignator=n.designatorName):t.deviceDesignator?(r.designator_id=t.deviceDesignator,r.deviceDesignator=""):(r.designator_id=n,r.deviceDesignator=""),"Lights On"==e&&this.value.length>0&&this.value[this.lightsOnIndex].id?r.id=this.value[this.lightsOnIndex].id:"Lights Off"==e&&this.value.length>1&&this.value[this.lightsOffIndex].id&&(r.id=this.value[this.lightsOffIndex].id),r},calculateDuration:function(t,e,r){return{number:60*parseInt(e)+parseInt(r),units:t}},convertTimeForUi:function(t,e){var r="";return r="0"==t[0]?parseInt(t[1]):parseInt(t.substring(0,2)),e||(r+=this.getUser.facility_UTCOffset),r<0&&(r=24+r),r=String(r),1==r.length&&(r="0"+r),r+":"+t.substring(2,4)},toUIData:function(t,e,r){var n=this;r?(this.nightScheduleBeginTime=this.convertTimeForUi(t.startTime),t.finishTime?this.nightScheduleEndTime=this.convertTimeForUi(t.finishTime):(t.finishTime=e.photoperiodStarttime,this.nightScheduleEndTime=this.convertTimeForUi(t.finishTime,!0))):(this.dayScheduleBeginTime=this.convertTimeForUi(t.startTime),t.finishTime?this.dayScheduleEndTime=this.convertTimeForUi(t.finishTime):(24==e.photoperiod?t.finishTime=e.photoperiodStarttime:t.finishTime=this.getPhotoPeriodEndTime().format("HHmm"),this.dayScheduleEndTime=this.convertTimeForUi(t.finishTime,!0)));var i=null;i=isNaN(parseInt(t.designator_id))?this.designatorsMap[t.designator_id]:this.irrigationDesignators.find((function(e){return e.id==t.designator_id}));var a=[];t.customTimes&&(a=t.customTimes.map((function(t){var e=st.a.utc(t.startTime,"HHmm").add(n.getUser.facility_UTCOffset,"hours"),r=n.irrigationDesignators.find((function(e){return e.id==t.designatorId}));return{startTime:e.format(n.timeFormat),durationSecs:t.durationSecs,designatorId:t.designatorId,designatorName:r?r.designatorName:null,timeString:e.format("HHmm")}})),a.sort((function(t,e){return t.timeString<e.timeString?-1:1})));var o=null;return t.cropSteering&&(o=JSON.parse(t.cropSteering),o.finishTime=st.a.utc(o.finishTime,"HHmm").add(this.getUser.facility_UTCOffset,"hours").format("HH:mm")),{customTimes:a,timesToRun:[],cronSchedule:"",deviceDesignator:i,minDuration:Math.floor(t.cronDurationSecs/60),secDuration:t.cronDurationSecs%60,hourFrequency:Math.floor(t.frequencyMins/60),minFrequency:t.frequencyMins%60,cropSteering:o}},validate:function(){var t=this.validateIndividualSchedule(this.daySchedule,"Lights On"),e=this.validateIndividualSchedule(this.nightSchedule,"Lights Off"),r=!1===t.isValid?t:e;return this.$emit("valid",r),r},calcSchedule:function(t,e,r,n,i){var a={customTimes:n.customTimes?n.customTimes:[],timesToRun:[],beginTime:"Lights On"===i?this.dayScheduleBeginTime:this.nightScheduleBeginTime,deviceDesignator:n.deviceDesignator,hourFrequency:n.hourFrequency,minDuration:n.minDuration,minFrequency:n.minFrequency,secDuration:n.secDuration,startTime:"Lights On"===i?this.formatHoursMins(this.dayScheduleBeginTime,":"):this.formatHoursMins(this.nightScheduleBeginTime,":"),finishTime:"Lights On"===i?this.formatHoursMins(this.dayScheduleEndTime,":"):this.formatHoursMins(this.nightScheduleEndTime,":"),cropSteering:n.cropSteering,cronSchedule:" "};return a},getPhotoPeriodEndTime:function(){var t=st()().hours(parseInt(this.photoperiod.photoperiodStarttime.substring(0,2)));return t.minutes(parseInt(this.photoperiod.photoperiodStarttime.substring(2,4))),t.seconds(0),t.add(this.photoperiod.photoperiod,"hours"),t},checkCropSteeringEligibility:function(){var t=this;return kt(wt().mark((function e(){var r,n,i;return wt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.ineligiblePlatformGroups=[],e.next=3,P["a"].get("ag_growPhases/checkCropSteeringEligibilityForPhase",t.getUser.apitoken,{growPhase_id:t.phase.id});case 3:r=e.sent,n=xt(r,2),i=n[0],n[1],i.success&&(t.ineligiblePlatformGroups=i.data.ineligiblePlatformGroups);case 8:case"end":return e.stop()}}),e)})))()},calculateIrrigationData:function(){var t=this;if(this.initialized&&this.dayScheduleBeginTime){var e=st()().hours(parseInt(this.dayScheduleBeginTime.split(":")[0]));e.minutes(parseInt(this.dayScheduleBeginTime.split(":")[1])),e.seconds(0);var r=e.clone();24==this.photoperiod.photoperiod?r.add(1,"days"):(r=st()().hours(parseInt(this.dayScheduleEndTime.split(":")[0])),r.minutes(parseInt(this.dayScheduleEndTime.split(":")[1])),r.seconds(0));var n=60*this.daySchedule.hourFrequency+parseInt(this.daySchedule.minFrequency);if(this.$set(this,"daySchedule",this.calcSchedule(e,r,n,this.daySchedule,"Lights On")),24!=this.photoperiod.photoperiod||this.isException&&this.phase.inheritLightSchedule?(this.nightScheduleBeginTime||this.calculatePhotoperiod(this.photoperiod),"00:00"!=this.nightScheduleBeginTime?(e=st()().hours(parseInt(this.nightScheduleBeginTime.split(":")[0])),e.minutes(parseInt(this.nightScheduleBeginTime.split(":")[1])),e.seconds(0),r=e.clone(),e.hours()<12&&e.add(1,"days"),"00:00"!=this.nightScheduleBeginTime&&r.add(1,"days"),r.hours(parseInt(this.nightScheduleEndTime.split(":")[0])),r.minutes(parseInt(this.nightScheduleEndTime.substring(2,4))),n=60*parseInt(this.nightSchedule.hourFrequency)+parseInt(this.nightSchedule.minFrequency)):(e=st()("2019-01-01 00:00"),r=st()("2019-01-01 "+this.photoperiod.photoperiodStarttime.substring(0,2)+":"+this.photoperiod.photoperiodStarttime.substring(2,4)),n=60*this.nightSchedule.hourFrequency+parseInt(this.nightSchedule.minFrequency)),this.$set(this,"nightSchedule",this.calcSchedule(e,r,n,this.nightSchedule,"Lights Off"))):this.nightSchedule={deviceDesignator:"",beginTime:"00:00",minDuration:0,secDuration:0,hourFrequency:0,startTime:"0000",finishTime:"0000",minFrequency:0,cronSchedule:"",timesToRun:[],customTimes:[],cropSteering:null},this.calcIrrigationRuntimes(this.daySchedule,this.nightSchedule),"custom"===this.irrigationScheduleType)if(this.daySchedule.customTimes.length||this.nightSchedule.customTimes.length){var i=[{start:this.dayScheduleMinTimeStart.replace(":",""),end:this.dayScheduleMaxTimeStart.replace(":","")},{start:this.dayScheduleMinTimeEnd.replace(":",""),end:this.dayScheduleMaxTimeEnd.replace(":","")}],a=[{start:this.nightScheduleMinTimeStart.replace(":",""),end:this.nightScheduleMaxTimeStart.replace(":","")},{start:this.nightScheduleMinTimeEnd.replace(":",""),end:this.nightScheduleMaxTimeEnd.replace(":","")}],o=[],s=[];this.daySchedule.customTimes.forEach((function(e){if(!e.designatorName){var r=t.irrigationDesignators.find((function(t){return t.id===e.designatorId}));e.designatorName=r?r.designatorName:null}i.some((function(t){return Number(e.timeString)>=Number(t.start)&&Number(e.timeString)<Number(t.end)&&(o.push(e),!0)})),a.some((function(t){return Number(e.timeString)>=Number(t.start)&&Number(e.timeString)<Number(t.end)&&(s.push(e),!0)}))}));var l=[],c=[];this.nightSchedule.customTimes.forEach((function(e){if(!e.designatorName){var r=t.irrigationDesignators.find((function(t){return t.id===e.designatorId}));e.designatorName=r?r.designatorName:null}i.some((function(t){return Number(e.timeString)>=Number(t.start)&&Number(e.timeString)<Number(t.end)&&(c.push(e),!0)})),a.some((function(t){return Number(e.timeString)>=Number(t.start)&&Number(e.timeString)<Number(t.end)&&(l.push(e),!0)}))})),o=[].concat(vt(o),c),l=[].concat(vt(l),s),o.sort((function(t,e){return t.timeString<e.timeString?-1:1})),l.sort((function(t,e){return t.timeString<e.timeString?-1:1})),this.$set(this.daySchedule,"customTimes",o),this.$set(this.nightSchedule,"customTimes",l)}else{var u=this.daySchedule.timesToRun.map((function(e){var r=st()(e,t.timeFormat).format("HHmm"),n=t.irrigationDesignators.find((function(e){return e.id===t.daySchedule.deviceDesignator}));return{startTime:e,durationSecs:60*t.daySchedule.minDuration+t.daySchedule.secDuration,designatorId:t.daySchedule.deviceDesignator,designatorName:n?n.designatorName:null,timeString:r}}));u.sort((function(t,e){return t.timeString<e.timeString?-1:1})),this.$set(this.daySchedule,"customTimes",u);var d=this.nightSchedule.timesToRun.map((function(e){var r=st()(e,t.timeFormat).format("HHmm"),n=t.irrigationDesignators.find((function(e){return e.id===t.nightSchedule.deviceDesignator}));return{startTime:e,durationSecs:60*t.nightSchedule.minDuration+t.nightSchedule.secDuration,designatorId:t.nightSchedule.deviceDesignator,designatorName:n?n.designatorName:null,timeString:r}}));d.sort((function(t,e){return t.timeString<e.timeString?-1:1})),this.$set(this.nightSchedule,"customTimes",d)}"steering"===this.irrigationScheduleType&&(this.steeringNutrientMix?this.$set(this.daySchedule,"cropSteering",{designatorId:this.steeringNutrientMix,irrigationVolume:this.steeringRampUpIrrigationVolume,irrigationRate:this.steeringIrrigationRate,minimumVWC:this.steeringMinimumVWC,rampUpDryback:this.steeringRampUpDryback,rampUpTimeoutMinutes:this.steeringRampUpTimeoutMinutes,maximumVWC:this.steeringMaximumVWC,maintenanceIrrigationVolume:this.steeringMaintenanceIrrigationVolume,maintenanceDryback:this.steeringMaintenanceDryback,finishTime:this.steeringEndTime}):this.daySchedule.cropSteering&&(this.steeringNutrientMix=this.daySchedule.cropSteering.designatorId,this.steeringRampUpIrrigationVolume=this.daySchedule.cropSteering.irrigationVolume,this.steeringIrrigationRate=this.daySchedule.cropSteering.irrigationRate,this.steeringMinimumVWC=this.daySchedule.cropSteering.minimumVWC,this.steeringRampUpDryback=this.daySchedule.cropSteering.rampUpDryback,this.steeringRampUpTimeoutMinutes=this.daySchedule.cropSteering.rampUpTimeoutMinutes,this.steeringMaximumVWC=this.daySchedule.cropSteering.maximumVWC,this.steeringMaintenanceIrrigationVolume=this.daySchedule.cropSteering.maintenanceIrrigationVolume,this.steeringMaintenanceDryback=this.daySchedule.cropSteering.maintenanceDryback,this.steeringEndTime=this.daySchedule.cropSteering.finishTime)),this.data=[this.serializeSchedule(this.daySchedule,"Lights On")],(24!=this.photoperiod.photoperiod||this.isException&&this.phase.inheritLightSchedule)&&this.data.push(this.serializeSchedule(this.nightSchedule,"Lights Off")),this.$emit("input",this.data)}},calculatePhotoperiod:function(t){var e=dt({},t),r=0,n=0;if(e.photoperiod||this.$emit("onnoirrigationchange",!0),24!==e.photoperiod){var i=this.convertTimeToHours(e.photoperiodStarttime);if(e.inverted){var a=parseInt(e.photoperiodStarttime.substring(0,2));a+=parseInt(e.photoperiodStarttime.substring(2,4))/60,a+=parseFloat(e.photoperiod),24===a&&(a=0);var o=this.convertNumberToTimeMoment(a);e={photoperiod:24-e.photoperiod,photoperiodStarttime:o.format("HHmm"),inverted:!0}}else if(i<0){i=24+i;var s=e.photoperiod-(24-i),l=this.convertNumberToTimeMoment(s);e={photoperiod:i-s,photoperiodStarttime:l.format("HHmm"),inverted:!0}}r=parseInt(e.photoperiodStarttime.substring(0,2)),n=parseInt(e.photoperiodStarttime.substring(2,4))}var c=st()();c.set("hour",r),c.set("minute",n);var u=c.clone().add(e.photoperiod,"h");if(24!==e.photoperiod){this.dayScheduleBeginTime=c.format("HH:mm"),this.dayScheduleEndTime=u.format("HH:mm"),this.dayScheduleMinTimeStart=this.dayScheduleBeginTime,this.dayScheduleMaxTimeStart=this.dayScheduleEndTime,"00:00"===this.dayScheduleEndTime&&(this.dayScheduleMaxTimeStart="23:59"),this.dayScheduleMaxTimeStart="00:00"===this.dayScheduleMaxTimeStart?"23:59":this.dayScheduleMaxTimeStart,this.dayScheduleMinTimeEnd=this.dayScheduleBeginTime,this.dayScheduleMaxTimeEnd=this.dayScheduleEndTime,this.dayScheduleMaxTimeEnd="00:00"===this.dayScheduleMaxTimeEnd?"23:59":this.dayScheduleMaxTimeEnd,this.nightScheduleBeginTime=u.format("HH:mm"),this.nightScheduleEndTime=this.dayScheduleBeginTime,this.nightScheduleMinTimeEnd="00:00",this.nightScheduleMaxTimeEnd=this.dayScheduleBeginTime,this.nightScheduleMinTimeStart=this.dayScheduleEndTime,this.nightScheduleMaxTimeStart="23:59";var d=[],h=parseInt(c.format("H")),f=parseInt(u.format("H"));while(h!==f)d.push(h),h++,24===h&&(h=0);if(d.push(h),this.dayScheduleAllowedHours=d,e.inverted){this.dayScheduleMinTimeStart=this.dayScheduleBeginTime,this.dayScheduleMaxTimeStart="23:59",this.dayScheduleMinTimeEnd="00:00",this.dayScheduleMaxTimeEnd=this.dayScheduleEndTime,this.nightScheduleMinTimeStart=this.dayScheduleEndTime,this.nightScheduleMaxTimeStart=this.dayScheduleBeginTime,this.nightScheduleMaxTimeStart="00:00"===this.nightScheduleMaxTimeStart?"23:59":this.nightScheduleMaxTimeStart,this.nightScheduleMinTimeEnd=this.dayScheduleEndTime,this.nightScheduleMaxTimeEnd=this.dayScheduleBeginTime,this.nightScheduleMaxTimeEnd="00:00"===this.nightScheduleMaxTimeEnd?"23:59":this.nightScheduleMaxTimeEnd;var p=[],m=parseInt(c.format("H")),v=parseInt(u.format("H"));while(m!==v)p.push(m),m++,24===m&&(m=0);this.nightScheduleAllowedHours=p}else{var y=[],g=parseInt(u.format("H")),b=parseInt(c.format("H"));while(g!==b)y.push(g),g++,24===g&&(g=0);this.nightScheduleAllowedHours=y}}else this.dayScheduleBeginTime="00:00",this.dayScheduleEndTime="23:59",this.dayScheduleMinTimeStart="00:00",this.dayScheduleMaxTimeStart="23:59",this.dayScheduleMinTimeEnd="00:00",this.dayScheduleMaxTimeEnd="23:59",this.dayScheduleAllowedHours=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23];this.calculateIrrigationData()}},computed:dt(dt({},Object(f["c"])(["getUser","timePreference24Hour"])),{},{allCustomTimes:function(){var t=[];return this.daySchedule.customTimes.forEach((function(e){t.push(dt(dt({},e),{},{lightsOn:!0}))})),this.nightSchedule.customTimes.forEach((function(e){t.push(dt(dt({},e),{},{lightsOn:!1}))})),t.sort((function(t,e){return t.timeString<e.timeString?-1:1})),t},allowAddCustomTime:function(){return this.customNutrientMix&&this.customBeginTime&&(this.customMinutes||this.customSeconds)},conflictingMessage:function(){var t="Cannot add an irrigation that overlaps ",e=Math.floor(this.conflictingTime.durationSecs/60),r=this.conflictingTime.durationSecs%60,n="";return e>0&&(n+="".concat(e,"m")),r>0&&(n+="".concat(r,"s")),t+="".concat(this.conflictingTime.designatorName," for ").concat(n,"@").concat(this.conflictingTime.startTime),t},designatorsMap:function(){return this.designators.reduce((function(t,e){return t[e.designatorName]=e,t}),{})},dayDuration:function(){return this.calculateDuration("seconds",this.daySchedule.minDuration,this.daySchedule.secDuration)},irrigationDesignators:function(){return this.designators.filter((function(t){return"irrigation"==t.designatorType})).sort((function(t,e){return t.designatorName>e.designatorName?1:-1}))}}),watch:{controllerId:function(t,e){t&&t!==e&&this.loadMoistureSensorDevices(),t||(this.moistureSensors=[])},irrigationScheduleType:function(t){"custom"===t?this.customBeginTime=this.dayScheduleBeginTime:0===this.daySchedule.hourFrequency&&0===this.daySchedule.minFrequency&&0===this.nightSchedule.hourFrequency&&0===this.nightSchedule.minFrequency||(this.$set(this.daySchedule,"customTimes",[]),this.$set(this.nightSchedule,"customTimes",[]),this.daySchedule.cropSteering=null,this.nightSchedule.cropSteering=null),this.calculateIrrigationData()},customIrrigationDurationCheckbox:function(t,e){this.customIrrigationDuration=t?0:-1},customIrrigationDuration:function(t,e){t>=0&&(this.customIrrigationDurationMins=Math.floor(t/60),this.customIrrigationDurationSecs=t-60*Math.floor(t/60)),this.$emit("oncustomirrigationdurationchange",t)},defaultData:function(t){this.onDefaultDataChange(t)},photoperiod:function(t){this.calculatePhotoperiod(t)},"nightSchedule.hourFrequency":function(t){this.$emit("revalidate")},"nightSchedule.minFrequency":function(t){this.$emit("revalidate")},"phase.inheritIrrigationSchedule":function(t,e){!0===e&&!1===t&&this.calculatePhotoperiod(this.photoperiod),this.$emit("oninheritirrigationschedulechange")},"phase.noIrrigation":function(t,e){this.$emit("onnoirrigationchange",t)},nutrientMixLightsOn:function(t){this.daySchedule.deviceDesignator=t},nutrientMixLightsOff:function(t){this.nightSchedule.deviceDesignator=t},designators:function(){this.calculateIrrigationData()},"phase.id":function(t,e){t!==e&&this.checkCropSteeringEligibility()}}},jt=Tt,Et=(r("5877"),r("b3f4"),Object(Y["a"])(jt,rt,nt,!1,null,"238793b8",null)),It=Et.exports,Lt=r("e0c7"),At=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{id:"growphaseenvironmentalsettings"}},[e(a["d"],[e("span",{staticClass:"timelinecardtitle"},[t._v("Environmental Settings")]),e(l["a"]),t.phase.inheritEnvironmentalSettings?t._e():[t.showAdvanced?t._e():e(S["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;r.attrs;return[e(n["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.toggleAdvanced(!0)}}},i),[e(s["a"],[t._v("arrow_circle_down")])],1)]}}],null,!1,4081700838)},[e("span",[t._v("Show Advanced Options")])]),t.showAdvanced?e(S["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;r.attrs;return[e(n["a"],t._g({directives:[{name:"show",rawName:"v-show",value:t.showAdvanced,expression:"showAdvanced"}],attrs:{icon:""},on:{click:function(e){return t.toggleAdvanced(!1)}}},i),[e(s["a"],[t._v("arrow_circle_up")])],1)]}}],null,!1,1278526499)},[e("span",[t._v("Hide Advanced Options")])]):t._e()],t.isException?e(v["a"],{staticClass:"checkboxInTitle mr-2",attrs:{label:"Inherit from active phase"},model:{value:t.phase.inheritEnvironmentalSettings,callback:function(e){t.$set(t.phase,"inheritEnvironmentalSettings",e)},expression:"phase.inheritEnvironmentalSettings"}}):t._e(),e("help-button",{class:{"mr-2":t.isException,"mx-0":!t.isException},attrs:{"help-topic-key":"cultivation-grow-plans-phases-environmental-settings"}})],2),t.phase.inheritEnvironmentalSettings?t._e():e(a["c"],[t.showAdvanced?t._e():e("div",[e("simple-environment-table",{attrs:{disabled:t.disabled,showDarkPhase:24!=t.phase.photoperiod.photoperiod},on:{save:t.saveSimple},model:{value:t.simpleEnvironmentSettings,callback:function(e){t.simpleEnvironmentSettings=e},expression:"simpleEnvironmentSettings"}})],1),t.showAdvanced?e("div",[e("div",{staticClass:"etable",staticStyle:{"padding-bottom":"10px"}},[e(Lt["a"],[e(s["a"],[t._v("satellite")]),t._v("Temperature ")],1),e("environment-table",{attrs:{disabled:t.disabled,showDarkPhase:24!=t.phase.photoperiod.photoperiod,type:"Temperature",unit:"imperial"===t.userUnitPreference.setting?" F":" C",min:"imperial"===t.userUnitPreference.setting?41:5,max:"imperial"===t.userUnitPreference.setting?140:60},on:{save:t.save},model:{value:t.temperature,callback:function(e){t.temperature=e},expression:"temperature"}})],1),e("div",{staticClass:"divider"}),e("div",{staticClass:"etable",staticStyle:{"padding-bottom":"10px"}},[e(Lt["a"],[e(s["a"],[t._v("opacity")]),t._v("Humidity ")],1),e("environment-table",{attrs:{disabled:t.disabled,showDarkPhase:24!=t.phase.photoperiod.photoperiod,type:"Humidity",unit:"%",min:10,max:100},on:{save:t.save},model:{value:t.humidity,callback:function(e){t.humidity=e},expression:"humidity"}})],1),e("div",{staticClass:"divider"}),e("div",{staticClass:"etable"},[e(Lt["a"],[e(s["a"],[t._v("filter_drama")]),t._v("CO2 ")],1),e("environment-table",{attrs:{disabled:t.disabled,type:"CO2",unit:"ppm",min:200,max:5e3,showDarkPhase:24!=t.phase.photoperiod.photoperiod},on:{save:t.save},model:{value:t.co2,callback:function(e){t.co2=e},expression:"co2"}})],1)]):t._e()])],1)},Mt=[],Ut=r("dd56"),Nt=r("8f0b"),Ft=r("8fea"),Gt=function(){var t=this,e=t._self._c;return e("div",[e(o["a"],{ref:"form",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(Ft["a"],{attrs:{headers:t.headers,"hide-default-footer":!0,items:t.rec,flat:"",options:t.pagination,height:"100%"},on:{"update:options":function(e){t.pagination=e}},scopedSlots:t._u([{key:"item",fn:function(r){var n=r.item;r.select;return["Lights On"==n.lightState||"Zone"==n.lightState||t.showDarkPhase?e("tr",[e("td",{staticStyle:{width:"120px"}},["Lights On"==n.lightState?e(s["a"],{attrs:{color:"rgb(255,0,255)"}},[t._v("highlight")]):e(s["a"],{attrs:{color:"silver"}},[t._v("highlight")]),e("span",{staticStyle:{"font-size":"13px"}},[t._v(t._s(n.lightState))])],1),e("td",[e("div",{staticClass:"env-set"},[e(w["a"],{attrs:{type:"number",suffix:t.temperatureSuffix,rules:[t.rules.required,t.rules.positiveNumber,t.rules.required]},on:{change:function(e){return t.save(n.temperature,"temperature",n.lightState)}},model:{value:n.temperature,callback:function(e){t.$set(n,"temperature",e)},expression:"item.temperature"}})],1)]),e("td",[e("div",{staticClass:"env-set"},[e(w["a"],{attrs:{type:"number",suffix:"%",rules:[t.rules.integer,t.rules.positiveNumber,t.rules.required]},on:{change:function(e){return t.save(n.humidity,"humidity",n.lightState)}},model:{value:n.humidity,callback:function(e){t.$set(n,"humidity",e)},expression:"item.humidity"}})],1)]),e("td",[e(w["a"],{attrs:{type:"number",suffix:"ppm",rules:[t.rules.integer,t.rules.positiveNumber,t.rules.required]},on:{change:function(e){return t.save(n.co2,"co2",n.lightState)}},model:{value:n.co2,callback:function(e){t.$set(n,"co2",e)},expression:"item.co2"}})],1)]):t._e()]}}])})],1)],1)},Rt=[],$t=r("9c4f");function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}function Vt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Vt(Object(r),!0).forEach((function(e){zt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function zt(t,e,r){return(e=Yt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yt(t){var e=qt(t,"string");return"symbol"==Ht(e)?e:e+""}function qt(t,e){if("object"!=Ht(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Wt={name:"",props:["type","value","showDarkPhase"],mixins:[$t["a"]],data:function(){return{pagination:{sortDesc:[!0],sortBy:["lightState"]},rec:[],valid:!0,temperatureSuffix:"F",headers:[{text:"State",value:"lightState",width:300,sortable:!1},{text:"Temperature",value:"temperature",sortable:!1,width:100},{text:"Humidity",value:"Min",sortable:!1,width:100},{text:"CO2",value:"SetPoint",sortable:!1,width:100}]}},beforeMount:function(){this.copyArray(this.value),this.temperatureSuffix=P["a"].displayMetric(this.getUser)?"C":"F"},computed:Bt({},Object(f["c"])(["getUser"])),methods:{editMode:function(t){t.edit=!0},save:function(t,e,r){this.valid?(this.$emit("input",this.rec),this.$emit("save",t,e,r)):(this.$refs.form.validate(),p["a"].error("Invalid Input"))},copyArray:function(t){this.rec=JSON.parse(JSON.stringify(t))}},watch:{value:function(){this.copyArray(this.value)}}},Jt=Wt,Zt=Object(Y["a"])(Jt,Gt,Rt,!1,null,null,null),Xt=Zt.exports;function Kt(t){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(t)}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function te(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qt(Object(r),!0).forEach((function(e){ee(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ee(t,e,r){return(e=re(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function re(t){var e=ne(t,"string");return"symbol"==Kt(e)?e:e+""}function ne(t,e){if("object"!=Kt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var ie={name:"environment",props:["value","disabled","isException","phase"],components:{HelpButton:k["a"],EnvironmentTable:Nt["a"],SimpleEnvironmentTable:Xt},data:function(){return{showAdvanced:!1,environmentSettings:{},temperature:[],humidity:[],co2:[],simpleEnvironmentSettings:[{mode:"Lights On",temperature:null,humidity:null,co2:null}],environmentIds:{"Lights On":"","Lights Off":""}}},beforeMount:function(){this.value&&this.setEnvironmentSettings(this.value)},computed:te(te({},Object(f["c"])(["getUser"])),{},{userUnitPreference:function(){return this.getUser.preferences.find((function(t){return"units"===t.preference}))}}),methods:{toggleAdvanced:function(t){this.showAdvanced=t},setEnvironmentSettings:function(t){this.temperature=[],this.humidity=[],this.co2=[],this.simpleEnvironmentSettings=[];for(var e=0;e<t.length;e++){var r=t[e];r.id&&(this.environmentIds[r.lightState]=r.id),this.simpleEnvironmentSettings.push({lightState:r.lightState,temperature:parseFloat(this.convertTempSetPoint(r.tempSetpoint)),humidity:parseInt(r.humiditySetpoint),co2:parseInt(r.CO2Setpoint)}),this.temperature.push({lightState:r.lightState,WarnMin:this.convertTempSetPoint(r.tempWarnMin),Min:this.convertTempSetPoint(r.tempMin),SetPoint:this.convertTempSetPoint(r.tempSetpoint),Max:this.convertTempSetPoint(r.tempMax),WarnMax:this.convertTempSetPoint(r.tempWarnMax),edit:!1}),this.humidity.push({lightState:r.lightState,WarnMin:r.humidityWarnMin,Min:r.humidityMin,SetPoint:r.humiditySetpoint,Max:r.humidityMax,WarnMax:r.humidityWarnMax,edit:!1}),this.co2.push({lightState:r.lightState,WarnMin:r.CO2WarnMin,Min:r.CO2Min,SetPoint:r.CO2Setpoint,Max:r.CO2Max,WarnMax:r.CO2WarnMax,edit:!1})}},convertTempSetPoint:function(t){return"imperial"===this.userUnitPreference.setting?Object(Ut["a"])(t).toFixed(1):t},editEnvironment:function(t,e){this.$emit("edit-env-setting",t,e)},getRecByLightState:function(t,e){return t[0].lightState==e?t[0]:t[1]},saveSimple:function(t,e,r){var n=null;switch(console.log("changing "+r+" "+e+" : "+t),e){case"temperature":var i=this.getRecByLightState(this.temperature,r);n=parseFloat(t),"imperial"===this.userUnitPreference.setting?(i.setPoint=n,i.SetPoint=n,i.Min=n-1,i.Max=n+1,i.WarnMin=n-3,i.WarnMax=n+3):(i.setPoint=n,i.SetPoint=n,i.Min=n-.6,i.Max=n+.6,i.WarnMin=n-1.5,i.WarnMax=n+1.5);break;case"humidity":var a=parseInt(t),o=this.getRecByLightState(this.humidity,r);o.setPoint=a,o.SetPoint=a,o.Min=a-5,o.Max=a+5,o.WarnMin=a-10,o.WarnMax=a+10;break;case"co2":var s=parseInt(t),l=this.getRecByLightState(this.co2,r);l.SetPoint=s,l.setPoint=s,l.Min=s-100,l.Max=s+100,l.WarnMin=s-200,l.WarnMax=s+200;break}this.save()},save:function(){for(var t=[],e="",r=0;r<=1;r++){e=0==r?"Lights On":"Lights Off";var n=this.getRecByLightState(this.co2,e),i=this.getRecByLightState(this.humidity,e),a=this.getRecByLightState(this.temperature,e);t.push(ee({id:this.environmentIds[e],lightState:e,CO2Max:Number(n.Max),CO2Min:Number(n.Min),CO2WarnMax:Number(n.WarnMax),CO2WarnMin:Number(n.WarnMin),CO2Setpoint:Number(n.SetPoint),humidityMax:Number(i.Max),humidityMin:Number(i.Min),humidityWarnMax:Number(i.WarnMax),humidityWarnMin:Number(i.WarnMin),humiditySetpoint:Number(i.SetPoint),tempMax:"imperial"===this.userUnitPreference.setting?Object(Ut["b"])(Number(a.Max)):this.temperature[r].Max,tempMin:"imperial"===this.userUnitPreference.setting?Object(Ut["b"])(Number(a.Min)):a.Min,tempSetpoint:"imperial"===this.userUnitPreference.setting?Object(Ut["b"])(Number(a.SetPoint)):a.SetPoint,tempWarnMax:"imperial"===this.userUnitPreference.setting?Object(Ut["b"])(Number(a.WarnMax)):a.WarnMax,tempWarnMin:"imperial"===this.userUnitPreference.setting?Object(Ut["b"])(Number(a.WarnMin)):a.WarnMin},"lightState",e))}console.log(t),this.$emit("input",t)}},watch:{value:function(t){t&&this.setEnvironmentSettings(t)}}},ae=ie,oe=(r("a6fc"),Object(Y["a"])(ae,At,Mt,!1,null,"291c3fe6",null)),se=oe.exports,le=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{id:"phasetaskeditor"}},[e(a["d"],[e("span",{staticClass:"timelinecardtitle"},[t._v("Tasks")]),e(l["a"]),t.disabled?t._e():e(n["a"],{attrs:{text:"",color:"primary"},on:{click:function(e){return t.createPhaseTask(t.phase)}}},[t._v("Create new Task")]),e("help-button",{class:{"mr-2":!t.disabled,"mx-0":t.disabled},attrs:{"help-topic-key":"cultivation-grow-plans-phases-tasks"}})],1),e(a["c"],[e("div",[e(Ft["a"],{attrs:{headers:t.headers,items:t.filteredTasks,options:t.customSorter,"hide-default-footer":""},on:{"update:options":function(e){t.customSorter=e}},scopedSlots:t._u([{key:"item.actions",fn:function(r){var n=r.item;return[e(s["a"],{staticClass:"mr-2",attrs:{small:""},on:{click:function(e){return t.onEditTask(n)}}},[t._v("edit")]),t.phase.id?t._e():e(s["a"],{staticClass:"ml-2",attrs:{small:""},on:{click:function(e){return t.deletePhaseTask(n)}}},[t._v("delete")])]}},{key:"item.startSeconds",fn:function(e){var r=e.item;return[t._v(t._s(t.secondsToDays(r.startSeconds)+1))]}},{key:"item.timeEstimateSeconds",fn:function(r){var n=r.item;return[t._v("\n          "+t._s(t.secondsToDuration(n.timeEstimateSeconds))+"\n          "),n.timeEstimatePerPlant?e("span",[t._v("Per Plant")]):t._e()]}}])})],1),t.selectedGrowTask?e(X["a"],{attrs:{width:"40%"},model:{value:t.deleteDialog,callback:function(e){t.deleteDialog=e},expression:"deleteDialog"}},[e(i["a"],[e(a["d"],[e("h2",[t._v("Confirm")])]),e(a["c"],[t._v("Are you sure you want to delete "+t._s(t.selectedGrowTask.growTaskName)+"?")]),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{color:"error"},on:{click:t.onConfirmDelete}},[t._v("Confirm Delete")])],1)],1)],1):t._e(),e(X["a"],{attrs:{width:"550",persistent:""},model:{value:t.showTaskModal,callback:function(e){t.showTaskModal=e},expression:"showTaskModal"}},[t.selectedGrowTask?e("task-edit",{staticClass:"vh70",attrs:{mode:"deferredsave",phase:t.phase,disabled:!1},on:{save:t.onSaveGrowTask,close:function(e){t.showTaskModal=!1,t.selectedGrowTask=null}},model:{value:t.selectedGrowTask,callback:function(e){t.selectedGrowTask=e},expression:"selectedGrowTask"}}):t._e()],1)],1)],1)},ce=[],ue=r("b647");function de(t){return me(t)||pe(t)||fe(t)||he()}function he(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fe(t,e){if(t){if("string"==typeof t)return ve(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ve(t,e):void 0}}function pe(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function me(t){if(Array.isArray(t))return ve(t)}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ye={name:"tasks",props:["value","phase","disabled","create-task","edit-task"],components:{HelpButton:k["a"],TaskEdit:ue["a"]},data:function(){return{newIdCounter:-100,deleteDialog:!1,deleteName:"",showTaskModal:!1,selectedGrowTask:null,customSorter:{page:1,itemsPerPage:-1,sortBy:["startSeconds"]},headers:[{text:"Actions",align:"left",value:"actions",sortable:!1},{text:"Grow Task",align:"left",value:"growTaskName"},{text:"Target Day",align:"center",value:"startSeconds"},{text:"Duration",align:"center",value:"timeEstimateSeconds"}]}},beforeMount:function(){this.growTasks=de(this.value),this.disabled&&this.headers.shift()},methods:{secondsToDays:O["e"],secondsToDuration:O["g"],secondsToTime:O["i"],onSaveGrowTask:function(t){if(t.new)t.new=!1,this.newIdCounter=this.newIdCounter-1,t.id=this.newIdCounter,this.value.push(t);else for(var e=0;e<this.value.length;e++)if(this.value[e].id==t.id){for(var r in t)this.value[e][r]=t[r];break}this.showTaskModal=!1,this.selectedGrowTask=null,this.$emit("input",this.value)},createPhaseTask:function(){this.selectedGrowTask={assignedToRole_id:1,attributes:[],frequencyType:0,beginTime:"12:00",new:!0,growTaskName:"",notes:"",requireMovement:!1,startSeconds:this.phase.startSeconds,timeEstimateSeconds:1800},this.showTaskModal=!0},onEditTask:function(t){var e=t;if(!isNaN(e.startSeconds)){var r=st.a.duration(e.startSeconds,"seconds"),n=r.hours();2!=String(n).length&&(n="0"+n);var i=r.minutes();2!=String(i).length&&(i="0"+i),e.beginTime=n+":"+i}this.selectedGrowTask=e,this.showTaskModal=!0},deletePhaseTask:function(t){this.selectedGrowTask=t,this.deleteDialog=!0},onConfirmDelete:function(){for(var t=0;t<this.value.length;t++)if(this.value[t].id==this.selectedGrowTask.id){this.$set(this.value[t],"deleted",!0),this.deleteDialog=!1,this.$emit("input",this.value);break}}},watch:{},computed:{filteredTasks:function(){return this.value.filter((function(t){return!t.deleted}))}}},ge=ye,be=(r("a74b"),Object(Y["a"])(ge,le,ce,!1,null,null,null)),we=be.exports,xe=["growplan_id","endtime","ag_growStage_id","maxPhases","minPhases","plantContainerType_id"];function Se(t){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(t)}function _e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_e=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Se(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Se(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Ce(t,e){if(null==t)return{};var r,n,i=Oe(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Oe(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}function Pe(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function De(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){Pe(a,n,i,o,s,"next",t)}function s(t){Pe(a,n,i,o,s,"throw",t)}o(void 0)}))}}function ke(t,e){return Le(t)||Ie(t,e)||je(t,e)||Te()}function Te(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function je(t,e){if(t){if("string"==typeof t)return Ee(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ee(t,e):void 0}}function Ee(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ie(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Le(t){if(Array.isArray(t))return t}function Ae(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ae(Object(r),!0).forEach((function(e){Ue(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ae(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ue(t,e,r){return(e=Ne(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ne(t){var e=Fe(t,"string");return"symbol"==Se(e)?e:e+""}function Fe(t,e){if("object"!=Se(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Ge={name:"edit-phase",props:["value","isViewing","growplan","create-task","edit-task","reload-data","isTemplate","isException","expand","helpTopicKey","controllerId"],components:{HelpButton:k["a"],GeneralInfo:W,Photoperiod:J["a"],IrrigationSchedule:It,Environment:se,Tasks:we},data:function(){return{isLoading:!1,isValid:!1,invalidData:!1,phase:{},selectedPreset:null,consumablesList:[],designators:[]}},beforeMount:function(){var t=Me({},this.value);if(t.photoperiod.photoperiodStarttime){var e=this.convertTimeToHours(t.photoperiod.photoperiodStarttime);if(24!==t.photoperiod.photoperiod&&e+t.photoperiod.photoperiod>24){e=24+e;var r=t.photoperiod.photoperiod-(24-e),n=this.convertNumberToTimeMoment(r);t.photoperiod={photoperiod:e-r,photoperiodStarttime:n.format("HHmm"),inverted:!0}}}this.phase=t,this.getDesignators()},computed:Me({},Object(f["c"])(["getUser"])),methods:{convertTimeToHours:function(t){var e=parseInt(t.substring(0,2)),r=parseInt(t.substring(2,4))/60;return e+r},convertNumberToTimeMoment:function(t){var e=st()();if(e.set("hour",t),t%1===0)e.set("minutes",0);else{var r="0."+String(t).split(".")[1];e.set("minutes",60*r)}return e},getDesignators:function(){var t=this;P["a"].get("ag_deviceDesignators",this.getUser.apitoken,{filter:{order:"designatorName",include:"agDesignatortypes"}}).then((function(e){for(var r=ke(e,2),n=r[0],i=(r[1],[]),a=0;a<n.length;a++){var o=n[a];i.push({id:o.id,designatorName:o.designatorName,schedulable:o.agDesignatortypes.schedulable,designatorType:o.agDesignatortypes.designatorType})}t.designators=i}))},onCustomIrrigationDurationChange:function(t){this.phase.customFirstLightIrrigationDuration=t},onNoIrrigationChange:function(t){this.phase.noIrrigation=t},onInheritIrrigationScheduleChange:function(t){this.phase.inheritIrrigationScheduleChange=t},revalidate:function(){this.$refs.form.validate()},onUpdatePreset:function(t){this.selectedPreset=t},generalInfoChanged:function(t,e){this.invalidData=e},onCreateTask:function(t){this.$emit("input",this.phase),this.$emit("create-task",t)},onEditTask:function(t){this.$emit("input",this.phase),this.$emit("edit-task",t)},onClose:function(){this.$emit("close")},convertTimeToUtc:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HHmm";if(!t)return null;var r=st()(t,e);return r.add(-1*this.getUser.facility_UTCOffset,"hours"),r.format("HHmm")},onSavePhase:function(){var t=this;return De(_e().mark((function e(){var r,n,i,a,o,s,l,c,u,d,h,f,m,v,y,g,b,w,x,S,_,C,O,D;return _e().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=t,r.isLoading=!0,!t.validatePhase()){e.next=45;break}for(t.$refs["irrigation"].calculateIrrigationData(),i=t.phase,i.growplan_id,a=i.endtime,o=i.ag_growStage_id,s=i.maxPhases,l=i.minPhases,c=i.plantContainerType_id,u=Ce(i,xe),d=Me({},u),a&&(d.endtime=a),o&&(d.ag_growStage_id=o),s&&(d.maxPhases=+s),l&&(d.minPhases=+l),c&&(d.plantContainerType_id=c),t.growplan&&t.growplan.growplan_id&&(d.growplan_id=t.growplan.growplan_id),h=t.phase.photoperiod.photoperiodStarttime,f=t.phase.photoperiod.photoperiodEndtime,m=t.phase.photoperiod.photoperiod,null!==(n=t.phase)&&void 0!==n&&null!==(n=n.photoperiod)&&void 0!==n&&n.inverted&&(v=h,y=parseInt(h.substring(0,2)),g=parseInt(h.substring(2,4))/60,b=y+g,b+=m,m=24-m,h=f||t.convertNumberToTimeMoment(b).format("HHmm"),f=v),w="",w=t.phase.isTemplate||t.isException?h:t.convertTimeToUtc(h),d.photoperiod={hours:m,starttime:w},d.isCannabis=P["a"].isCannabisFacility(),d.isHemp=P["a"].isHempFacility(),d.isLeafyGreens=P["a"].isLeafyGreensFacility(),x=0;x<t.phase.deviceSchedules.length;x++)d.deviceSchedules[x]=Me({},t.phase.deviceSchedules[x]),d.deviceSchedules[x].startTime=t.convertTimeToUtc(d.deviceSchedules[x].startTime),d.deviceSchedules[x].finishTime=t.convertTimeToUtc(d.deviceSchedules[x].finishTime);return 2==d.deviceSchedules.length&&""==d.deviceSchedules[1].designator_id&&(d.deviceSchedules[1].designator_id=d.deviceSchedules[0].designator_id,d.deviceSchedules[1].deviceDesignator=d.deviceSchedules[0].deviceDesignator),d.deviceSchedules.forEach((function(e){e.irrigationScheduleType&&"custom"===e.irrigationScheduleType?(t.phase.noIrrigation?e.customTimes=[]:(e.customTimes=e.customTimes.map((function(e){return{startTime:t.convertTimeToUtc(e.timeString),durationSecs:e.durationSecs,designatorId:e.designatorId}})),e.frequency.number=0,e.duration.number=0),delete e.cropSteering):e.irrigationScheduleType&&"steering"===e.irrigationScheduleType&&e.cropSteering?(e.cropSteering={designatorId:e.cropSteering.designatorId,irrigationVolume:Number(e.cropSteering.irrigationVolume),irrigationRate:Number(e.cropSteering.irrigationRate),minimumVWC:Number(e.cropSteering.minimumVWC),rampUpDryback:Number(e.cropSteering.rampUpDryback),rampUpTimeoutMinutes:Number(e.cropSteering.rampUpTimeoutMinutes),maximumVWC:Number(e.cropSteering.maximumVWC),maintenanceDryback:Number(e.cropSteering.maintenanceDryback),finishTime:t.convertTimeToUtc(e.cropSteering.finishTime,"HH:mm")},delete e.customTimes):(delete e.customTimes,delete e.cropSteering)})),d.updateuser=t.getUser.firstname+" "+t.getUser.lastname,d.photoPeriodIntensity=d.photoPeriodIntensity&&"string"===typeof d.photoPeriodIntensity?Number(d.photoPeriodIntensity):d.photoPeriodIntensity,d.photoPeriodInterlightIntensity=d.photoPeriodInterlightIntensity&&"string"===typeof d.photoPeriodInterlightIntensity?Number(d.photoPeriodInterlightIntensity):d.photoPeriodInterlightIntensity,e.next=30,P["a"].post("ag_growPhases/saveGrowplanPhase",r.getUser.apitoken,d);case 30:if(S=e.sent,_=ke(S,1),C=_[0],r.isLoading=!1,null===C||void 0===C||!C.success||null===C||void 0===C||!C.data){e.next=42;break}if(r.phase.isTemplate||r.phase.exceptionHandler){e.next=38;break}return e.next=38,P["a"].post("controllerCommands/reloadLifecyclesByGrowplan",r.getUser.apitoken,{growplan_id:(null===(O=r.growplan)||void 0===O?void 0:O.growplan_id)||(null===(D=r.growplan)||void 0===D?void 0:D.id)});case 38:r.$emit("reload-data"),p["a"].success("The grow phase was saved successfully"),e.next=43;break;case 42:p["a"].error("An error occurred. Please try again later.");case 43:e.next=47;break;case 45:r.isLoading=!1,p["a"].error("An error occurred. Please try again later.");case 47:case"end":return e.stop()}}),e)})))()},validatePhase:function(){var t=this;if(!this.phase.growPhaseName)return p["a"].error("You must enter a grow phase name"),!1;if(!this.phase.plantContainerType_id&&!this.phase.exceptionHandler)return p["a"].error("The grow phase '".concat(this.phase.growPhaseName,"' must have an assigned plant container type")),!1;if(this.phase.endSeconds<=this.phase.startSeconds)return p["a"].error("The phase must have a valid duration"),!1;if(!this.phase.photoperiod||0===this.phase.photoperiod||this.phase.photoperiod>24)return p["a"].error("The phase must have a valid photoperiod"),!1;if(this.phase.ag_growTasks&&this.phase.ag_growTasks.length){var e=this.phase.ag_growTasks.filter((function(e){return e.startSeconds+1<t.phase.startSeconds||e.startSeconds>t.phase.endSeconds}));if(e.length)return p["a"].error("The ".concat(e[0].growTaskName," task must be inside of phase")),!1}return!0}},watch:{value:{immediate:!0,handler:function(t){var e=this;this.selectedPreset=null,this.phase=Me({},t),t.growPhase_id||setTimeout((function(){e.$refs.form.resetValidation()}),250)}}}},Re=Ge,$e=Object(Y["a"])(Re,d,h,!1,null,null,null);e["a"]=$e.exports},"486c":function(t,e,r){},"488d":function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=r("8860"),o=r("da13"),s=r("5d23"),l=r("e449"),c=r("8e36"),u=r("e0c7"),d=function(){var t=this,e=t._self._c;return t.showContextMenu?e(l["a"],{attrs:{"position-x":t.contextMenuX,"position-y":t.contextMenuY,absolute:"","offset-y":"",transition:"scale-transition"},model:{value:t.showContextMenu,callback:function(e){t.showContextMenu=e},expression:"showContextMenu"}},[e(n["a"],[t.selectedContextMenuItem?e(i["d"],{staticClass:"py-2 d-flex justify-center",staticStyle:{"background-color":"#1876d2",color:"white"}},[e("span",[t._v(t._s(t.selectedContextMenuItem.platformGroupName)+" Actions")])]):t._e(),t.isLoadingBatchActions?e(c["a"],{staticStyle:{position:"absolute",top:"48px"},attrs:{indeterminate:""}}):t._e(),e(i["c"],{staticClass:"pt-0",staticStyle:{height:"250px","overflow-y":"auto"}},[e(a["a"],{attrs:{dense:""}},[t.selectedContextMenuItem.lifecycles?t._e():e(o["a"],{staticClass:"context-action",on:{click:t.onShowStartLifecycle}},[e(s["c"],[t._v("Start Growing")])],1),t._l(t.filteredBatchActions,(function(r,n){return[r.header?e(u["a"],[t._v(t._s(r.label))]):e(o["a"],{staticClass:"context-action",attrs:{disabled:!!r.disabled},on:{click:function(e){return e.stopPropagation(),t.onSelectContextAction(r)}}},[e(s["c"],[t._v(t._s(r.label))])],1)]})),t.showAdminActions?e("div",[e(u["a"],[t._v("ADMIN ACTIONS")]),e(o["a"],{staticClass:"context-action",on:{click:function(e){return t.refresh(!0)}}},[e(s["c"],[t._v("Refresh screen")])],1),e(o["a"],{staticClass:"context-action",on:{click:t.onCopySshToClipboard}},[e(s["c"],[t._v("Copy SSH to Clipboard")])],1),e(o["a"],{staticClass:"context-action",on:{click:t.onEditControllerConfig}},[e(s["c"],[t._v("Configure Devices")])],1),e(o["a"],{staticClass:"context-action",on:{click:t.onShowDeviceHistory}},[e(s["c"],[t._v("Display Device Log")])],1),e(o["a"],{staticClass:"context-action",on:{click:t.onRegisterDump}},[e(s["c"],[t._v("Display Register Values")])],1),e(o["a"],{staticClass:"context-action",on:{click:t.onFinalAssemblyTests}},[e(s["c"],[t._v("Final Assembly Tests")])],1),e(o["a"],{staticClass:"context-action",on:{click:t.onSetDnD}},[e(s["c"],[t._v("Set Do Not Disturb")])],1)],1):t._e()],2)],1)],1),e("register-dump",{ref:"registerDump"})],1):t._e()},h=[],f=r("d0eb"),p=r("81f6"),m=r("2f62"),v=r("4216"),y=r("67b4"),g=r("d67f"),b=r("9194");function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function x(t,e){return P(t)||O(t,e)||_(t,e)||S()}function S(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(t,e){if(t){if("string"==typeof t)return C(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(t,e):void 0}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function O(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function P(t){if(Array.isArray(t))return t}function D(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */D=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var x={};c(x,o,(function(){return this}));var S=Object.getPrototypeOf,_=S&&S(S(L([])));_&&_!==r&&n.call(_,o)&&(x=_);var C=b.prototype=y.prototype=Object.create(x);function O(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==w(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(w(e)+" is not iterable")}return g.prototype=b,i(C,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(C),t},e.awrap=function(t){return{__await:t}},O(P.prototype),c(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new P(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},O(C),c(C,l,"Generator"),c(C,o,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function k(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function T(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){k(a,n,i,o,s,"next",t)}function s(t){k(a,n,i,o,s,"throw",t)}o(void 0)}))}}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){I(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function I(t,e,r){return(e=L(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L(t){var e=A(t,"string");return"symbol"==w(e)?e:e+""}function A(t,e){if("object"!=w(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var M={name:"ContextMenu",components:{RegisterDump:y["a"]},mixins:[v["a"]],computed:E(E(E(E({},Object(m["c"])(["getUser"])),Object(m["c"])("universalDashboard",["selectedContextMenuItem","isPerformingContextMenuAction"])),Object(m["c"])("batchActions",["batchActions"])),{},{showAdminActions:function(){return f["a"].isAdmin(this.getUser)&&this.showFullList},filteredBatchActions:function(){var t=this,e=this.batchActions.filter((function(e){return e.deviceType&&"HeaterStrip"===e.deviceType?""!==t.selectedContextMenuItem.heaterstripState:(!e.deviceType||"ECU"!==e.deviceType)&&((!e.deviceType||"TwoStageDehumidifier"!==e.deviceType)&&((!e.deviceType||"CO2"!==e.deviceType)&&((!e.deviceType||"VFUHumidifier"!==e.deviceType)&&(!(e.deviceType&&"Curtains"===e.deviceType||"CURTAINS"===e.label)&&(e.id&&e.id===b["r"]?"OFF"===t.selectedContextMenuItem.irrigationState&&"MANUAL"===t.selectedContextMenuItem.mode:e.id&&e.id===b["E"]?"ON"===t.selectedContextMenuItem.irrigationState&&"MANUAL"===t.selectedContextMenuItem.mode:e.id&&e.id===b["B"]||e.id&&e.id===b["e"]?"MANUAL"===t.selectedContextMenuItem.mode:e.id&&e.id===b["v"]?"AUTOMATIC"===t.selectedContextMenuItem.mode:e.id&&e.id===b["A"]?"MANUAL"===t.selectedContextMenuItem.mode:e.id&&e.id===b["b"]?"OFF"===t.selectedContextMenuItem.lightState&&"MANUAL"===t.selectedContextMenuItem.mode:e.id&&e.id===b["a"]?"ON"===t.selectedContextMenuItem.lightState&&"MANUAL"===t.selectedContextMenuItem.mode:e.id&&e.id===b["o"]?"AUTOMATIC"===t.selectedContextMenuItem.mode&&"IMPAIREDCHILL"!==t.selectedContextMenuItem.currentState:e.id&&e.id===b["D"]?""!==t.selectedContextMenuItem.curtainState&&"MANUAL"===t.selectedContextMenuItem.mode:e.deviceType&&"Bard"===e.deviceType?""!==t.selectedContextMenuItem.BardState:e.id&&e.id===b["F"]?null!==t.$store.state.universalDashboard.filterPlatformGroupCollection:("HUMIDITY"!==e.label||""!==t.selectedContextMenuItem.vfuHumidifierState||""!==t.selectedContextMenuItem.vfuDehumidifierState)&&("TEMPERATURE"!==e.label||""!==t.selectedContextMenuItem.heaterstripState||""!==t.selectedContextMenuItem.ECUState||""!==t.selectedContextMenuItem.BardState))))))})),r={},n=e.filter((function(t){return!!t.group})),i=e.filter((function(t){return!!t.header}));return i.forEach((function(t){r[t.header]=0})),n.forEach((function(t){r[t.group]++})),e.filter((function(t){return!t.header||r[t.header]>0}))}}),data:function(){return{showContextMenu:!1,contextMenuX:null,contextMenuY:null,isLoadingBatchActions:!1,showFullList:!1}},beforeMount:function(){this.$store.dispatch("batchActions/loadBatchActions")},mounted:function(){p["a"].$on("show-context-menu",this.onShowContextMenu)},beforeDestroy:function(){},methods:{onShowContextMenu:function(t,e){var r=this;t.preventDefault(),e.item||(e.item=e);var n=291,i=window.innerHeight;this.showContextMenu=!1,t.clientY+n>i?this.contextMenuY=i-n-20:this.contextMenuY=t.clientY,this.contextMenuX=t.clientX,this.$nextTick((function(){r.$store.dispatch("universalDashboard/setSelectedContextMenuItem",e.item),r.showContextMenu=!0}))},onSelectContextAction:function(t){var e=this;return T(D().mark((function r(){return D().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(t.id!==b["m"]&&t.id!==b["n"]){r.next=8;break}return e.isLoadingBatchActions=!0,e.showFullList=t.id===b["m"],r.next=5,e.$store.dispatch("batchActions/loadBatchActions",t.id);case 5:e.isLoadingBatchActions=!1,r.next=9;break;case 8:t.disabled||(e.showContextMenu=!1,e.$nextTick((function(){e.$store.commit("universalDashboard/setIsPerformingContextMenuAction",!0),e.onChangeBatchAction(t.id)})));case 9:case"end":return r.stop()}}),r)})))()},onChangeBatchAction:function(t){this.$store.dispatch("batchActions/changeBatchAction",t)},onShowDeviceHistory:function(){this.$store.dispatch("universalDashboard/setShowDeviceHistory",!0)},onShowStartLifecycle:function(){this.$store.dispatch("universalDashboard/setShowStartLifecycle",!0)},refresh:function(){p["a"].$emit("universal-dashboard-refresh")},onRegisterDump:function(){(f["a"].isAdmin(this.getUser)||f["a"].isUserInRole(this.getUser,"MAINTENANCE"))&&this.$refs.registerDump.show(this.selectedContextMenuItem.controller_id,this.selectedContextMenuItem.platformGroupName)},onCopySshToClipboard:function(){f["a"].isAdmin(this.getUser)&&navigator.clipboard.writeText("ssh agrinamics@"+this.selectedContextMenuItem.ipAddress).then((function(){g["a"].success("Ip address copied to clipboard")}),(function(){g["a"].error("Could not write data to clipboard")}))},onEditControllerConfig:function(){var t=this;f["a"].get("controllers/"+this.selectedContextMenuItem.controller_id,this.getUser.apitoken).then((function(e){var r=x(e,2),n=r[0];r[1];t.$store.dispatch("universalDashboard/setSelectedController",n),t.$store.dispatch("universalDashboard/setShowDeviceConfigurationViewer",!0)}))},onFinalAssemblyTests:function(){this.$store.dispatch("universalDashboard/setShowAssemblyTests",!0)},onSetDnD:function(){this.$store.dispatch("universalDashboard/setShowSetDnD",!0)}}},U=M,N=r("2877"),F=Object(N["a"])(U,d,h,!1,null,null,null);e["a"]=F.exports},"49e2":function(t,e,r){"use strict";var n=r("0789"),i=r("9d65"),a=r("a9ad"),o=r("3206"),s=r("80d2"),l=r("58df");const c=Object(l["a"])(i["a"],a["a"],Object(o["a"])("expansionPanel","v-expansion-panel-content","v-expansion-panel"));e["a"]=c.extend().extend({name:"v-expansion-panel-content",data:()=>({isActive:!1}),computed:{parentIsActive(){return this.expansionPanel.isActive}},watch:{parentIsActive:{immediate:!0,handler(t,e){t&&(this.isBooted=!0),null==e?this.isActive=t:this.$nextTick(()=>this.isActive=t)}}},created(){this.expansionPanel.registerContent(this)},beforeDestroy(){this.expansionPanel.unregisterContent()},render(t){return t(n["a"],this.showLazyContent(()=>[t("div",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-content",directives:[{name:"show",value:this.isActive}]}),[t("div",{class:"v-expansion-panel-content__wrap"},Object(s["u"])(this))])]))}})},"4b2e":function(t,e,r){},"4b5c":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("8fea"),l=r("ce7e"),c=r("0fd9"),u=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content gridcard dense-table",attrs:{id:"device-lifecycles",flat:""}},[e(a["c"],{staticClass:"overflow-auto d-flex flex-column"},[t.currentDevice.lifecyclesRaw?t._e():e("div",{staticClass:"text-center",staticStyle:{"padding-top":"20px"}},[t._v("\n      No lifecycles are present\n    ")]),t._l(t.currentDevice.lifecyclesRaw,(function(r,i){return e("div",{key:"lifecycle-".concat(i)},[0!=i?e(l["a"],{staticClass:"mt-1 mb-1"}):t._e(),e("div",{staticClass:"lifecycles-container d-flex flex-column"},[e(c["a"],[e(o["a"],[e("div",[e("strong",[t._v(t._s(r.growplanName)+" (Lifecycle "+t._s(r.lifecycle_id)+") :\n                "+t._s(r.currentPhase.growPhaseName)+" Phase ("+t._s(r.strainName)+")")])]),t._v("\n             "+t._s(r.plants)+" Plants\n            "),e("span",{directives:[{name:"show",rawName:"v-show",value:t.showDetails,expression:"showDetails"}]},[e("br"),t._v("Photo period:\n            "),e("br",{staticClass:"hidden-md-and-up"}),t._v("\n            "+t._s(r.currentPhase.photoperiod)+" hours starting at\n            "+t._s(t.formatPhotoperiodStartTime(r.currentPhase.photoperiodStartTime))+"\n            local time. "),e("br"),t._v("Scheduled Start:\n            "),e("br",{staticClass:"hidden-md-and-up"}),t._v("\n            "+t._s(r.currentPhase.scheduledStart)+"\n            "),e("br"),t._v("Scheduled End:\n            "),e("br",{staticClass:"hidden-md-and-up"}),t._v("\n            "+t._s(r.currentPhase.scheduledEnd)+"\n            ")])]),"small"!=t.mode?e(o["a"],{staticClass:"hidden-sm-and-down",attrs:{md:"2"}},[e(n["a"],{attrs:{small:"",outlined:"",color:"primary"},on:{click:function(e){return t.reloadLifecycles()}}},[t._v("Reload Lifecycles")])],1):t._e()],1),e(s["a"],{directives:[{name:"show",rawName:"v-show",value:t.showDetails,expression:"showDetails"}],staticStyle:{"max-height":"200px"},attrs:{headers:t.headers,items:t.currentPhaseEnvironments(r),"hide-default-footer":""},scopedSlots:t._u([{key:"item.temp.min",fn:function(e){var r=e.item;return[t._v(t._s(t.calculateTemperatureDisplay(r.temp.min,1)))]}},{key:"item.temp.setpoint",fn:function(e){var r=e.item;return[t._v(t._s(t.calculateTemperatureDisplay(r.temp.setpoint,1)))]}},{key:"item.temp.max",fn:function(e){var r=e.item;return[t._v(t._s(t.calculateTemperatureDisplay(r.temp.max,1)))]}},{key:"item.humidity.min",fn:function(e){var r=e.item;return[t._v(t._s(r.humidity.min)+" %")]}},{key:"item.humidity.setpoint",fn:function(e){var r=e.item;return[t._v(t._s(r.humidity.setpoint)+" %")]}},{key:"item.humidity.max",fn:function(e){var r=e.item;return[t._v(t._s(r.humidity.max)+" %")]}},{key:"item.co2.min",fn:function(e){var r=e.item;return[t._v(t._s(r.co2.min)+" ppm")]}},{key:"item.co2.setpoint",fn:function(e){var r=e.item;return[t._v(t._s(r.co2.setpoint)+" ppm")]}},{key:"item.co2.max",fn:function(e){var r=e.item;return[t._v(t._s(r.co2.max)+" ppm")]}}],null,!0)})],1),Object.keys(t.loadedLifecyclesPlatforms).length?e("div",{staticClass:"plants-position-container"},t._l(t.loadedLifecyclesPlatforms,(function(n,i){return e(c["a"],{key:i,staticStyle:{"padding-top":"5px",width:"100%"},attrs:{"no-gutters":"",align:"center",justify:"center"}},[t._l(n.platforms,(function(i,a){return[i.lifecycleIds[r.lifecycle_id]?e(o["a"],{key:a,attrs:{cols:"12",sm:"12",md:t.isSmall}},[e("platform",{key:a,attrs:{platform:i,"lifecycle-id":r.lifecycle_id,platformGroup:{id:n.id,platformGroupName:n.platformGroupName},positions:i.ag_platformPositions}})],1):t._e()]}))],2)})),1):t._e()],1)})),e("loading",{attrs:{show:t.loading}})],2),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{staticClass:"hidden-md-and-up",attrs:{small:"",color:"primary"},on:{click:function(e){return t.reloadLifecycles()}}},[t._v("Reload Lifecycles")]),e(n["a"],{attrs:{color:"primary",small:""},on:{click:function(e){t.showDetails=!t.showDetails}}},[e("span",{directives:[{name:"show",rawName:"v-show",value:!t.showDetails,expression:"!showDetails"}]},[t._v("Show Details")]),e("span",{directives:[{name:"show",rawName:"v-show",value:t.showDetails,expression:"showDetails"}]},[t._v("Hide Details")])])],1)],1)},d=[],h=r("2f62"),f=r("d0eb"),p=r("dd56"),m=r("d89d"),v=r("d67f"),y=r("9908"),g=r("a9b3"),b=r("c1df"),w=r.n(b);function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){C(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function C(t,e,r){return(e=O(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function O(t){var e=P(t,"string");return"symbol"==x(e)?e:e+""}function P(t,e){if("object"!=x(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function D(t,e){return I(t)||E(t,e)||T(t,e)||k()}function k(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(t,e){if(t){if("string"==typeof t)return j(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function E(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function I(t){if(Array.isArray(t))return t}var L={name:"zone-devices-lifecycles",props:["currentDevice","mode"],mixins:[g["a"]],components:{Platform:m["a"],Loading:y["a"]},beforeMount:function(){this.currentDevice.lifecyclesRaw&&this.refresh(),"small"==this.mode&&(this.headers=[{text:"Period",value:"lightState",sortable:!1},{text:"Temp",value:"temp.setpoint",sortable:!1},{text:"RH",value:"humidity.setpoint",sortable:!1},{text:"CO2",value:"co2.setpoint",sortable:!1}])},data:function(){return{Trimaster:f["a"],growplanName:"",showDetails:!1,lifecycleIdsArray:[],loading:!1,items:[],headers:[{text:"Period",value:"lightState",sortable:!1},{text:"Min Temp",value:"temp.min",sortable:!1},{text:"Temp Setpoint",value:"temp.setpoint",sortable:!1},{text:"Max Temp",value:"temp.max",sortable:!1},{text:"Min Humid",value:"humidity.min",sortable:!1},{text:"Humid Setpoint",value:"humidity.setpoint",sortable:!1},{text:"Max Humid",value:"humidity.max",sortable:!1},{text:"Min CO2",value:"co2.min",sortable:!1},{text:"CO2 Setpoint",value:"co2.setpoint",sortable:!1},{text:"Max CO2",value:"co2.max",sortable:!1}],loadedLifecyclesPlatforms:[]}},methods:{reloadLifecycles:function(){var t=this,e=t.currentDevice,r={controller_id:e.controller_id,action_id:51,virtualDevice_id:e.id,user_id:t.getUser.id};f["a"].get("controllerCommands",t.getUser.apitoken,{filter:{where:{controller_id:e.controller_id}}}).then((function(e){for(var n=D(e,2),i=n[0],a=(n[1],!1),o=0;o<i.length;o++)51==i[o].action_id&&(a=!0);a?v["a"].info("This command is already queued for this controller."):f["a"].post("controllerCommands",t.getUser.apitoken,r).then((function(t){t.length&&t[0].id?v["a"].success("Action Submitted."):v["a"].error("Error sending command. Please try again later.")}))}))},formatPhotoperiodStartTime:function(t){var e=10*parseInt(t[0])+parseInt(t[1]);return e+=this.getUser.facility_UTCOffset,e<10&&(e="0"+e),e+":"+t.substring(2,4)},calculateTemperatureDisplay:function(t){var e=this.getUser.preferences.find((function(t){return"units"==t.preference}));return e&&"imperial"==e.setting?"".concat(parseFloat(Object(p["a"])(t)).toFixed(1)," F"):"".concat(parseFloat(t).toFixed(1)," C")},currentPhaseEnvironments:function(t){for(var e=[],r=0;r<t.currentPhase.environments.length;r++){var n=t.currentPhase.environments[r];("Lights On"==n.lightState||"Lights Off"==n.lightState&&t.currentPhase.photoperiod<24)&&e.push(n)}return e},refresh:function(){var t=this,e=[];t.loading=!0,t.currentDevice.lifecyclesRaw.map((function(r){t.lifecycleIdsArray.push(r.lifecycle_id),e.push(f["a"].get("/ag_lifecycles/getLifecyclePhases",t.getUser.apitoken,{apitoken:t.getUser.apitoken,lifecycle_id:r.lifecycle_id}))})),f["a"].get("platformGroups/getLifecyclesPlatformGroups",t.getUser.apitoken,{lifecycleIdsArray:t.lifecycleIdsArray,platformGroup_id:t.currentDevice.platformGroup_id}).then((function(r){var n=D(r,2),i=n[0],a=n[1];if(a)return t.loading=!1,v["a"].error(a);t.loadedLifecyclesPlatforms=i||{},Promise.all(e).then((function(e){e.map((function(e){e&&e[0].lifecycle.phases.map((function(e){t.currentDevice.lifecyclesRaw.map((function(r){if(r.currentPhase.id===e.growPhase_id){var n="MM/DD/YYYY h:mm a";r.currentPhase.scheduledStart=w.a.tz(r.currentPhase.scheduledStart,t.getUser.facility_timezone).format(n)+" local time",r.currentPhase.scheduledEnd=w.a.tz(r.currentPhase.scheduledEnd,t.getUser.facility_timezone).format(n)+" local time"}}))}))})),t.loading=!1})).catch((function(e){t.loading=!1,v["a"].error(e)}))}))}},computed:_(_({},Object(h["c"])(["getUser"])),{},{isSmall:function(){return"small"==this.mode?12:5}})},A=L,M=(r("3c10"),r("2877")),U=Object(M["a"])(A,u,d,!1,null,null,null);e["a"]=U.exports},"4c1e":function(t,e,r){"use strict";var n=r("c6a6"),i=r("8336"),a=r("b0af"),o=r("99d9"),s=r("4bd4"),l=r("132d"),c=r("2fa4"),u=r("8654"),d=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"d-flex flex-column"},[t.hideTitle?t._e():e(o["d"],[e("h2",[t._v(t._s(t.value.id?"Edit":"Add")+" Camera Registration")]),e(c["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(o["c"],{staticClass:"flex-grow-auto overflow-auto"},[e(s["a"],{ref:"form",model:{value:t.isValid,callback:function(e){t.isValid=e},expression:"isValid"}},[e(n["a"],{attrs:{items:t.cameraTypes,"item-value":"id","item-text":"label",label:"Camera Type"},model:{value:t.rec.cameraType_id,callback:function(e){t.$set(t.rec,"cameraType_id",e)},expression:"rec.cameraType_id"}}),e(u["a"],{attrs:{label:"Label",counter:"45",rules:[t.rules.requiredNoBlanks]},model:{value:t.rec.label,callback:function(e){t.$set(t.rec,"label",e)},expression:"rec.label"}}),e(u["a"],{attrs:{label:"IP Address",counter:"15",rules:[t.rules.requiredNoBlanks]},model:{value:t.rec.ip,callback:function(e){t.$set(t.rec,"ip",e)},expression:"rec.ip"}}),e(u["a"],{attrs:{label:"User Name",counter:"45",rules:[t.rules.requiredNoBlanks]},model:{value:t.rec.cameraUsername,callback:function(e){t.$set(t.rec,"cameraUsername",e)},expression:"rec.cameraUsername"}}),e(u["a"],{attrs:{label:"Password",counter:"45",rules:[t.rules.requiredNoBlanks],"append-icon":t.showPassword?"mdi-eye":"mdi-eye-off",type:t.showPassword?"text":"password"},on:{"click:append":function(e){t.showPassword=!t.showPassword}},model:{value:t.rec.cameraPassword,callback:function(e){t.$set(t.rec,"cameraPassword",e)},expression:"rec.cameraPassword"}}),e(u["a"],{attrs:{label:"MAC Address",counter:"17",rules:[t.rules.requiredNoBlanks]},model:{value:t.rec.macAddr,callback:function(e){t.$set(t.rec,"macAddr",e)},expression:"rec.macAddr"}}),e(u["a"],{attrs:{label:"Snapshot REST API Url",counter:"80"},model:{value:t.rec.cameraUrl,callback:function(e){t.$set(t.rec,"cameraUrl",e)},expression:"rec.cameraUrl"}}),e(u["a"],{attrs:{label:"Stream URL",counter:"80"},model:{value:t.rec.streamUrl,callback:function(e){t.$set(t.rec,"streamUrl",e)},expression:"rec.streamUrl"}})],1)],1),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{loading:t.isLoading,text:"",color:"primary",disabled:!t.isValid},on:{click:t.onSave}},[t._v("Save")])],1)],1)},h=[],f=r("2f62"),p=(r("c1df"),r("d67f")),m=r("d0eb"),v=r("9c4f");function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){return _(t)||S(t,e)||w(t,e)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function _(t){if(Array.isArray(t))return t}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return(e=D(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D(t){var e=k(t,"string");return"symbol"==y(e)?e:e+""}function k(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var T={name:"ControllerCameraEdit",props:{value:{type:Object,required:!0},platformGroup:{type:Object,required:!1,default:function(){return null}},hideTitle:{type:Boolean,required:!1,default:function(){return!1}}},mixins:[v["a"]],components:{},data:function(){return{rec:null,isLoading:!0,cameras:[],showPassword:!1,cameraTypes:[],isValid:!0}},beforeMount:function(){this.init(),this.refresh()},computed:O({},Object(f["c"])(["getUser"])),methods:{init:function(){var t=this;this.isLoading=!0;var e=O({},this.value);e.facility_id=e.facility_id?e.facility_id:this.getUser.facility_id,this.rec=e,m["a"].get("cameraTypes",this.getUser.apitoken,{filter:{sort:"label"}}).then((function(e){var r=g(e,2),n=r[0];r[1];t.cameraTypes=n,t.isLoading=!1}))},resetValidation:function(){this.$refs.form.resetValidation()},onClose:function(){this.$emit("close")},onSave:function(){var t=this;t.isLoading=!0,m["a"].patch("cameras",this.getUser.apitoken,this.rec).then((function(e){var r=g(e,2),n=r[0];r[1];n?(t.platformGroup&&m["a"].post("ag_platformGroupCameras/setPlatformGroupForCamera",t.getUser.apitoken,{camera_id:n.id,ag_platformGroup_id:t.platformGroup.id}),p["a"].success("Record Saved."),t.$emit("save",t.rec),t.$emit("edit",t.rec),t.onClose()):p["a"].error("An error occurred. Please try again later."),t.isLoading=!1}))},refresh:function(){}},watch:{value:function(t,e){var r=O({},t);r.facility_id=r.facility_id?r.facility_id:this.getUser.facility_id,this.rec=r,this.$refs.form.resetValidation()}}},j=T,E=r("2877"),I=Object(E["a"])(j,d,h,!1,null,null,null);e["a"]=I.exports},"4d4d":function(t,e,r){},"4e2b":function(t,e,r){"use strict";r("2282")},"4f68":function(t,e,r){"use strict";r("2be8")},"4f6f0":function(t,e,r){"use strict";r("d86f")},"52f4":function(t,e,r){"use strict";r("5ae2")},"53da":function(t,e,r){"use strict";r("4472")},5490:function(t,e,r){},"54a5":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("4bd4"),l=r("0fd9"),c=r("b974"),u=r("2fa4"),d=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content"},[e(a["d"],[e("h2",{staticClass:"text-truncate",staticStyle:{width:"calc(100% - 400px)"}},[t._v("\n      Multi-Rack Environmental Comparison for "+t._s(t.platformGroupLabels)+"\n    ")]),e(u["a"]),e(n["a"],{directives:[{name:"show",rawName:"v-show",value:"table"==t.displayMode,expression:"displayMode == 'table'"}],staticClass:"mr-2",attrs:{outlined:"",color:"primary"},on:{click:t.toggleDisplayMode}},[t._v("View Chart")]),e(n["a"],{directives:[{name:"show",rawName:"v-show",value:"chart"==t.displayMode,expression:"displayMode == 'chart'"}],staticClass:"mr-2",attrs:{outlined:"",color:"primary"},on:{click:t.toggleDisplayMode}},[t._v("View Table")]),e(n["a"],{staticClass:"mr-2",attrs:{disabled:"chart"==t.displayMode,outlined:"",color:"primary"},on:{click:t.onDownload}},[t._v("Download")]),e(n["a"],{attrs:{outlined:"",color:"primary"},on:{click:t.refresh}},[t._v("Refresh")])],1),e(a["c"],{staticClass:"d-flex flex-column"},[e(s["a"],[e(l["a"],{staticClass:"pl-4 pr-4",attrs:{justify:"center","no-gutters":""}},[e(o["a"],{staticClass:"pr-2",attrs:{md:"3"}},[e(l["a"],{attrs:{"no-gutters":""}},[e(o["a"],{staticClass:"pr-1",attrs:{md:"6"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate")},model:{value:t.selectedStartDate,callback:function(e){t.selectedStartDate=e},expression:"selectedStartDate"}})],1),e(o["a"],{staticClass:"pl-1",attrs:{md:"6"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime")},model:{value:t.selectedStartTime,callback:function(e){t.selectedStartTime=e},expression:"selectedStartTime"}})],1)],1)],1),e(o["a"],{staticClass:"pl-2 pr-2",attrs:{md:"3"}},[e(l["a"],{attrs:{"no-gutters":""}},[e(o["a"],{staticClass:"pr-1",attrs:{md:"6"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.endDate")},model:{value:t.selectedEndDate,callback:function(e){t.selectedEndDate=e},expression:"selectedEndDate"}})],1),e(o["a"],{staticClass:"pl-2 pr-2",attrs:{md:"6"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.endTime")},model:{value:t.selectedEndTime,callback:function(e){t.selectedEndTime=e},expression:"selectedEndTime"}})],1)],1)],1),e(o["a"],{staticClass:"pl-2 pr-2",attrs:{md:"1"}},[e(c["a"],{attrs:{items:t.chartUnits,label:t.$t("common.precision")},model:{value:t.selectedUnit,callback:function(e){t.selectedUnit=e},expression:"selectedUnit"}})],1),e(o["a"],{staticClass:"pl-2 pr-2",attrs:{md:"3",lg:"2"}},[e(c["a"],{attrs:{label:"Data Series",items:["Temps","Humidity","CO2"],multiple:""},on:{change:t.refresh},model:{value:t.selectedSeries,callback:function(e){t.selectedSeries=e},expression:"selectedSeries"}})],1),e(o["a"],{staticClass:"pl-2",attrs:{md:"2",lg:"1"}},[e(c["a"],{attrs:{label:"Readings",items:t.readingTypes,"item-text":"label","item-value":"id"},on:{change:t.refresh},model:{value:t.datasetTypeProperty,callback:function(e){t.datasetTypeProperty=e},expression:"datasetTypeProperty"}})],1),e(o["a"],{staticClass:"pl-2",attrs:{md:"2",lg:"1"}},[e(c["a"],{attrs:{label:"Axes",items:["Fixed","Floating"]},on:{change:t.refresh},model:{value:t.axesType,callback:function(e){t.axesType=e},expression:"axesType"}})],1)],1)],1),0==t.chartData.dataset.length?e("div",{staticClass:"text-center p-xl flex-grow-auto"},[e("h2",[t._v("No data to display.")])]):e("div",{staticClass:"flex-grow-auto"},["chart"==t.displayMode?e("div",{staticStyle:{height:"calc(100%)"}},[e("h-c-status-chart",{key:t.keyId,attrs:{type:t.chartData.type,title:t.chartData.title,datasets:t.chartData.dataset,yAxes:t.chartData.yAxes,xAxes:t.chartData.xAxes,plotBandsData:t.chartData.plotBands,plotLinesData:t.chartData.plotLines,showPlotBands:t.chartData.showPlotBands,showPlotLines:t.chartData.showPlotLines,tz:t.getUser.facility_timezone,verticalLegend:!0}})],1):t._e(),"chart"!=t.displayMode?e("chart-data-table-multiple2",{ref:"chartDatatable",attrs:{datasets:t.chartData.dataset}}):t._e()],1)],1),e("loading",{attrs:{show:t.isLoading}})],1)},h=[],f=r("dd56"),p=r("f941"),m=r("8fea"),v=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chartdatatable2 h-100 d-flex flex-column"},[e("div",{staticClass:"flex-grow-auto"},[e(m["a"],{staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,items:t.data,"hide-default-footer":"",options:t.pagination,height:"100%","fixed-header":""},scopedSlots:t._u([{key:"item.datetime",fn:function(r){var n=r.item;return[e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(n.datetime))}})]}}])})],1),e(l["a"],{attrs:{justify:"center"}},[e(o["a"],{attrs:{md:"2"}},[e(c["a"],{attrs:{dense:"","single-line":"",items:["Grouped By Field","Grouped By Rack"],label:"Column Layout"},model:{value:t.fieldLayout,callback:function(e){t.fieldLayout=e},expression:"fieldLayout"}})],1)],1)],1)},y=[],g=r("d0eb"),b=r("c1df"),w=r.n(b),x=r("2f62"),S=r("a9b3");function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function C(t){return k(t)||D(t)||P(t)||O()}function O(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}function D(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function k(t){if(Array.isArray(t))return T(t)}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){I(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function I(t,e,r){return(e=L(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L(t){var e=A(t,"string");return"symbol"==_(e)?e:e+""}function A(t,e){if("object"!=_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var M={name:"ChartDataTable2",props:["datasets"],mixins:[S["a"]],components:{},beforeMount:function(){this.refresh()},data:function(){return{isLoading:!1,pagination:{itemsPerPage:-1,sortBy:["datetime"]},fieldLayout:"Grouped By Field",rawDiagnostics:[],data:[],headers:[],columns:[],Trimaster:g["a"]}},computed:E(E({},Object(x["c"])(["getUser"])),{},{userUnitPreference:function(){return this.getUser.preferences.find((function(t){return"units"===t.preference}))}}),watch:{fieldLayout:function(t,e){this.getDiagnosticHeaders()},datasets:function(t,e){this.refresh()}},methods:{getDiagnosticHeaders:function(){var t=[{text:"Date/Time",align:"left",value:"datetime"}];"Grouped By Rack"==this.fieldLayout?this.columns.sort((function(t,e){return t.rackLabel+t.datatype>e.rackLabel+e.datatype?1:-1})):this.columns.sort((function(t,e){return t.datatype+t.rackLabel>e.datatype+e.rackLabel?1:-1})),this.headers=[].concat(t,C(this.columns))},download:function(){g["a"].csvExport(this.data,"Environment.csv",this.getUser.apitoken)},refresh:function(){for(var t={},e=[],r=0;r<this.datasets.length;r++){var n=this.datasets[r];e.push({text:n.label,value:n.label,align:"center",datatype:n.datatype,rackLabel:n.rackLabel});for(var i=0;i<n.data.length;i++){var a=n.data[i],o=w()(a.x).seconds(0);o.minutes()%2===1&&o.minutes(o.minutes()+1),o=o.format(),t[o]||(t[o]={datetime:o,title:n.label}),t[o][n.label]=a.y.toFixed(1)}}var s=[];for(var l in t)s.push(t[l]);this.columns=e,this.getDiagnosticHeaders(),this.data=s}}},U=M,N=r("2877"),F=Object(N["a"])(U,v,y,!1,null,null,null),G=F.exports,R=r("4458"),$=r("dd20"),H=r("0583"),V=r("dbd0"),B=r("9908");r("d67f");function z(t,e){return Z(t)||J(t,e)||q(t,e)||Y()}function Y(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(t,e){if(t){if("string"==typeof t)return W(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?W(t,e):void 0}}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function J(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Z(t){if(Array.isArray(t))return t}var X={name:"chart-multiple-zone-devices",mixins:[S["a"]],components:{HCStatusChart:p["a"],ManualControlOptions:H["a"],Lifecycles:V["a"],VuetifyDatepicker:R["a"],VuetifyTimepicker:$["a"],Loading:B["a"],ChartDataTableMultiple2:G},props:["user","platformGroups"],data:function(){var t=this.nowInTZPref().subtract(5,"hour"),e=this.nowInTZPref(),r=t.clone().format("YYYY-MM-DD"),n=t.clone().format("HH:mm"),i=e.clone().format("YYYY-MM-DD"),a=e.clone().format("HH:mm");return{axesType:"Fixed",keyId:1,allRawData:null,diagnosticData:[],tableDisplayMode:"Developer",selectedDevices:[],selectedSeries:["Temps"],displayMode:"chart",datasetTypes:["Minimums","Averages","Maximums","Latest"],datasetType:"Averages",datasetTypeProperties:["minReading","avgReading","maxReading","reading"],readingTypes:[{id:"minReading",label:"Minimums"},{id:"avgReading",label:"Average"},{id:"maxReading",label:"Maximums"},{id:"reading",label:"Latest"}],datasetTypeProperty:"reading",device:null,Trimaster:g["a"],isLoading:!1,selectedUnit:"minute",platformGroupId:0,deviceId:0,controllerId:0,chartData:{type:"line",title:"Unit Status",dataset:[],xAxes:[],yAxes:[],plotBands:[],plotLines:[],showPlotBands:!1,showPlotLines:!1,tempSeries:[],humiditySeries:[],co2Series:[]},chartUnits:[{text:this.$t("time.minute"),value:"minute"},{text:this.$t("time.hour"),value:"hour"},{text:this.$t("time.day"),value:"day"},{text:this.$t("time.month"),value:"month"}],chartDevice:{humidity:"",co2:"",temperature:""},temperatureChartData:[],humidityChartData:[],co2ChartData:[],startDate:t,endDate:e,selectedStartDate:r,selectedStartTime:n,selectedEndDate:i,selectedEndTime:a}},beforeMount:function(){this.refresh()},computed:{filters:function(){return{startDate:this.startDate.utc().format(),endDate:this.endDate.utc().format(),series:this.selectedSeries}},platformGroupLabels:function(){return this.platformGroups.map((function(t){return t.platformGroupName})).join(",")},systemId:function(){return this.item.device+"-"+this.item.device_id},userUnitPreference:function(){return this.user.preferences.find((function(t){return"units"===t.preference}))},groupId:function(){return this.$route.params.groupId},id:function(){return this.$route.params.id},itemState:function(){return this.item&&this.item.state?this.item.state[0].toUpperCase()+this.item.state.substr(1).toLowerCase():""},startDateStr:function(){return this.startDate.utc().format()},endDateStr:function(){return this.endDate.utc().format()}},methods:{onDownload:function(){this.$refs.chartDatatable.download()},refresh:function(){var t=this;this.isLoading=!0;var e=this.platformGroups.map((function(t){return t.platformGroup_id})),r=[];this.chartData.tempSeries=[],this.chartData.humiditySeries=[],this.chartData.co2Series=[],this.temperatureChartData=[],this.humidityChartData=[],this.co2ChartData=[],this.chartSetup(),g["a"].get("devices",this.user.apitoken,{filter:{where:{platformGroup_id:{inq:e},deviceType:"Sensor"}}}).then((function(e){var n=z(e,2),i=n[0],a=(n[1],[]);t.selectedDevices=[];for(var o="",s=0;s<i.length;s++){if(0==i[s].device.indexOf("Temp")){if(!t.selectedSeries.includes("Temps"))continue;r.push(i[s]),o="temperatureSensorHistories/getChartData"}else if(0==i[s].device.indexOf("Hum")){if(!t.selectedSeries.includes("Humidity"))continue;r.push(i[s]),o="humiditySensorHistories/getChartData"}else if(0==i[s].device.indexOf("CO2")){if(!t.selectedSeries.includes("CO2"))continue;r.push(i[s]),o="co2SensorHistories/getChartData"}a.push(g["a"].get(o,t.user.apitoken,{startDate:t.startDateStr,endDate:t.endDateStr,interval:t.selectedUnit,device_id:i[s].device_id,start:0,limit:t.getTimeDifferenceByUnit()}))}return t.selectedDevices=r,Promise.all(a)})).then((function(e){t.allRawData=e;for(var r=0;r<e.length;r++){var n=e[r][0];0==t.selectedDevices[r].device.indexOf("Temp")?(t.temperatureChartData.push({label:t.selectedDevices[r].platformGroupName,rawData:n}),t.processTemperatureData(n,t.selectedDevices[r].platformGroupName)):0==t.selectedDevices[r].device.indexOf("Hum")?(t.humidityChartData.push({label:t.selectedDevices[r].platformGroupName,rawData:n}),t.processHumidityData(n,t.selectedDevices[r].platformGroupName)):0==t.selectedDevices[r].device.indexOf("CO2")&&(t.co2ChartData.push({label:t.selectedDevices[r].platformGroupName,rawData:n}),t.processCO2Data(n,t.selectedDevices[r].platformGroupName))}t.isLoading=!1,t.redrawChart()}))},toggleDisplayMode:function(){"chart"==this.displayMode?this.displayMode="table":this.displayMode="chart"},processTemperatureData:function(t,e){var r=this,n=this;if(t&&t.length){this.sortValsByTime(t,"date");var i=t.filter((function(t){return w.a.utc(t.date).isBefore(r.endDate.utc())}));this.chartData.tempSeries.push({id:e+Date.now(),rackLabel:e,datatype:"Temp",label:e+" Temp",yAxisID:1,data:i.map((function(t){return{x:w.a.utc(t.date).valueOf(),y:t[n.datasetTypeProperty]?"metric"===r.userUnitPreference.setting?t[n.datasetTypeProperty]:Object(f["a"])(t[n.datasetTypeProperty]):0}})),tooltip:{pointFormatter:function(){var t="metric"===n.userUnitPreference.setting?"°C":"°F";return"<span>Temp ".concat(this.y.toFixed(1)," ").concat(t,"</span><br />")}}})}},processHumidityData:function(t,e){var r=this,n=this;if(t&&t.length){this.sortValsByTime(t,"date");var i=t.filter((function(t){return w.a.utc(t.date).isBefore(r.endDate.utc())}));this.chartData.humiditySeries.push({id:e+Date.now(),rackLabel:e,datatype:"Humidity",label:e+" Humidity",yAxisID:2,data:i.map((function(t){return{x:w.a.utc(t.date).valueOf(),y:t[n.datasetTypeProperty]?100*t[n.datasetTypeProperty]:0}})),tooltip:{pointFormatter:function(){return"<span>RH ".concat(this.y.toFixed(1)," %</span><br />")}}})}},processCO2Data:function(t,e){var r=this,n=this;if(t&&t.length){this.sortValsByTime(t,"date");var i=t.filter((function(t){return w.a.utc(t.date).isBefore(r.endDate.utc())}));this.chartData.co2Series.push({id:e+Date.now(),rackLabel:e,datatype:"CO2",label:e+" CO2",yAxisID:0,data:i.map((function(t){return{x:w.a.utc(t.date).valueOf(),y:t[n.datasetTypeProperty]?t[n.datasetTypeProperty]:0}})),tooltip:{pointFormatter:function(){return"<span>CO₂ ".concat(this.y.toFixed(1)," ppm</span><br />")}}})}},replotData:function(){var t=this;this.temperatureChartData.map((function(e){t.processTemperatureData(e.rawData,e.label)})),this.humidityChartData.map((function(e){t.processHumidityData(e.rawData,e.label)})),this.co2ChartData.map((function(e){t.processCO2Data(e.rawData,e.label)})),this.redrawChart()},redrawChart:function(){var t=[];null!=this.chartData.tempSeries&&(t=t.concat(this.chartData.tempSeries)),null!=this.chartData.humiditySeries&&(t=t.concat(this.chartData.humiditySeries)),null!=this.chartData.co2Series&&(t=t.concat(this.chartData.co2Series)),this.$set(this.chartData,"dataset",t),this.keyId++},plotData:function(t){},chartSetup:function(){this.chartData.xAxes=[{type:"datetime",crosshair:!0,plotLines:[],plotBands:[],dateTimeLabelFormats:{minute:"%I:%M %P",hour:"%I:%M %P"}}],"Fixed"==this.axesType?this.chartData.yAxes=[{title:{text:"CO₂ (ppm)"},min:200,max:1800,gridLineWidth:0},{title:{text:"Temperature ".concat("metric"===this.userUnitPreference.setting?"(°C)":"(°F)")},min:"metric"===this.userUnitPreference.setting?5:Object(f["a"])(5),max:"metric"===this.userUnitPreference.setting?50:Object(f["a"])(50),gridLineWidth:0},{title:{text:"Humidity (%)"},min:0,max:100,gridLineWidth:0,opposite:!0}]:this.chartData.yAxes=[{title:{text:"CO₂ (ppm)"}},{title:{text:"Temperature ".concat("metric"===this.userUnitPreference.setting?"(°C)":"(°F)")}},{title:{text:"Humidity (%)"},opposite:!0}]},getTimeDifferenceByUnit:function(){var t=w.a.duration(w()(this.endDate).diff(this.startDate)),e=1;return"day"===this.selectedUnit?e=t.asDays():"hour"===this.selectedUnit?e=t.asHours():"minute"===this.selectedUnit?e=t.asMinutes():"month"===this.selectedUnit&&(e=t.asMonths()),e<1&&(e=2),Math.round(e)>1e3?1e3:Math.round(e)},onDatesChanged:function(){this.startDate=w()("".concat(this.selectedStartDate," ").concat(this.selectedStartTime)),this.endDate=w()("".concat(this.selectedEndDate," ").concat(this.selectedEndTime)),this.refresh()},sortValsByTime:function(t,e){return t.sort((function(t,r){var n=w.a.utc(t[e]).valueOf(),i=w.a.utc(r[e]).valueOf();return n<i?-1:n>i?1:0}))}},watch:{selectedStartDate:function(t){this.onDatesChanged()},selectedEndDate:function(t){this.onDatesChanged()},selectedStartTime:function(t){this.onDatesChanged()},selectedEndTime:function(t){this.onDatesChanged()},selectedUnit:function(t){this.refresh()}}},K=X,Q=(r("be66"),Object(N["a"])(K,d,h,!1,null,null,null));e["a"]=Q.exports},"54f5":function(t,e,r){"use strict";r("ad4e")},"567b":function(t,e,r){"use strict";var n=r("4ca6"),i=r("8336"),a=r("b0af"),o=r("99d9"),s=r("8fea"),l=r("132d"),c=r("2fa4"),u=r("71a3"),d=r("c671"),h=r("fe57"),f=r("aac8"),p=r("3a2f"),m=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{loading:t.isLoading}},[e(o["d"],[e("h2",[t._v("\n      Irrigation Summary\n    ")]),e(c["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(o["c"],{staticClass:"flex-tabs-container"},[e(h["a"],{staticClass:"pb-3",attrs:{centered:""},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},t._l(t.zones,(function(r){return e(u["a"],{key:r.zoneId},[t.getCurrentlyIrrigating(r).length?[e(n["a"],{attrs:{color:"primary",content:t.getCurrentlyActive(r).length}},[t._v("\n            "+t._s(r.zoneName)+"\n          ")])]:[t._v("\n          "+t._s(r.zoneName)+"\n        ")]],2)})),1),e(f["a"],{model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},t._l(t.zones,(function(r){return e(d["a"],{key:r.zoneId},[e(a["a"],{staticClass:"screen-height-container flex-content"},[e(o["d"],{staticClass:"pb-1 d-flex justify-center"},[e(p["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on;return[e(i["a"],t._g({attrs:{icon:"",large:""},on:{click:t.filterIrrigating}},o),[e(n["a"],{attrs:{left:"",overlap:"",color:"primary",value:0!==t.getCurrentlyIrrigating(r).length},scopedSlots:t._u([{key:"badge",fn:function(){return[e("span",[t._v(t._s(t.getCurrentlyIrrigating(r).length))])]},proxy:!0}],null,!0)},[e(l["a"],{attrs:{color:"blue"}},[t._v("water_drop")])],1)],1)]}}],null,!0)},[e("span",[t._v("Irrigation valve open")])]),e(p["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(a){var o=a.on;return[e(i["a"],t._g({attrs:{icon:"",large:""},on:{click:t.filterWaiting}},o),[e(n["a"],{attrs:{left:"",overlap:"",color:"primary",value:0!==t.getCurrentlyWaiting(r).length},scopedSlots:t._u([{key:"badge",fn:function(){return[e("span",[t._v(t._s(t.getCurrentlyWaiting(r).length))])]},proxy:!0}],null,!0)},[e(l["a"],{attrs:{color:"teal"}},[t._v("water_drop")])],1)],1)]}}],null,!0)},[e("span",[t._v("Irrigation Waiting to acquire lease")])]),e(i["a"],{attrs:{color:"primary",text:""},on:{click:t.filterAll}},[t._v("All")])],1),e(o["c"],[e(s["a"],{attrs:{loading:t.isLoading,headers:t.headers,items:t.getZoneDevices(r),options:t.pagination,"must-sort":"","fixed-header":"",height:"100%","items-per-page":-1,"hide-default-footer":""},scopedSlots:t._u([{key:"item.irrigationState",fn:function(r){var n=r.item;return[e("irrigation-state",{model:{value:n.irrigationState,callback:function(e){t.$set(n,"irrigationState",e)},expression:"item.irrigationState"}})]}}],null,!0)})],1)],1)],1)})),1)],1)],1)},v=[],y=r("2f62"),g=r("60e0"),b=r("d0eb");function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function x(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */x=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var S={};c(S,o,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,o)&&(S=C);var O=b.prototype=y.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==w(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(w(e)+" is not iterable")}return g.prototype=b,i(O,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function S(t,e){return D(t)||P(t,e)||C(t,e)||_()}function _(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(t,e){if(t){if("string"==typeof t)return O(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(t,e):void 0}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function P(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function D(t){if(Array.isArray(t))return t}function k(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function T(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){k(a,n,i,o,s,"next",t)}function s(t){k(a,n,i,o,s,"throw",t)}o(void 0)}))}}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){I(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function I(t,e,r){return(e=L(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L(t){var e=A(t,"string");return"symbol"==w(e)?e:e+""}function A(t,e){if("object"!=w(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var M={name:"IrrigationSummary",props:{zoneDevices:{type:Array,required:!0}},components:{IrrigationState:g["a"]},data:function(){return{activeTab:0,isLoading:!1,pagination:{itemsPerPage:250},headers:[{text:"Name",value:"platformGroupName"},{text:"Status",value:"irrigationState",sortable:!1,align:"center",width:225}],filterState:null,zoneMappings:{}}},beforeMount:function(){},mounted:function(){console.log("zoneDevices",this.zoneDevices),this.loadZones()},computed:E(E({},Object(y["c"])(["getUser"])),{},{irrigationDevices:function(){return this.zoneDevices.filter((function(t){return!!t.irrigationState}))},zones:function(){var t=this,e={};return Object.keys(this.zoneMappings).forEach((function(r){e[t.zoneMappings[r].zoneId]=t.zoneMappings[r]})),Object.keys(e).map((function(t){return e[t]}))}}),methods:{loadZones:function(){var t=this;return T(x().mark((function e(){var r,n,i,a,o;return x().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,r=t.irrigationDevices.map((function(t){return t.platformGroup_id})),e.next=4,b["a"].get("deviceParametersView",t.getUser.apitoken,{filter:{where:{platformGroup_id:{inq:r},parameterType:"zone_id",zoneType:"Irrigation"},limit:1e3}});case 4:n=e.sent,i=S(n,2),a=i[0],i[1],t.isLoading=!1,o={},a.forEach((function(t){o[t.platformGroup_id]={zoneId:t.numericValue,zoneName:t.zonename}})),t.zoneMappings=o;case 12:case"end":return e.stop()}}),e)})))()},onClose:function(){this.$emit("closed")},getZoneDevices:function(t){var e=this,r=this.irrigationDevices.filter((function(r){return e.zoneMappings[r.platformGroup_id].zoneId===t.zoneId}));return r=this.filterState?r.filter((function(t){return t.irrigationState.toLowerCase()===e.filterState})):r.filter((function(t){return"off"!==t.irrigationState.toLowerCase()})),r},getCurrentlyActive:function(t){var e=this;return this.irrigationDevices.filter((function(r){return e.zoneMappings[r.platformGroup_id].zoneId===t.zoneId&&"off"!==r.irrigationState.toLowerCase()}))},getCurrentlyIrrigating:function(t){var e=this;return this.irrigationDevices.filter((function(r){return e.zoneMappings[r.platformGroup_id].zoneId===t.zoneId&&"on"===r.irrigationState.toLowerCase()}))},getCurrentlyWaiting:function(t){var e=this;return this.irrigationDevices.filter((function(r){return e.zoneMappings[r.platformGroup_id].zoneId===t.zoneId&&"waiting"===r.irrigationState.toLowerCase()}))},getCurrentlyOff:function(t){var e=this;return this.irrigationDevices.filter((function(r){return e.zoneMappings[r.platformGroup_id].zoneId===t.zoneId&&"off"===r.irrigationState.toLowerCase()}))},filterIrrigating:function(){this.filterState="on"},filterWaiting:function(){this.filterState="waiting"},filterOff:function(){this.filterState="off"},filterAll:function(){this.filterState=null}},watch:{}},U=M,N=r("2877"),F=Object(N["a"])(U,m,v,!1,null,null,null);e["a"]=F.exports},"56a4":function(t,e,r){"use strict";var n=r("9d26"),i=r("a9ad"),a=r("3206"),o=r("5607"),s=r("58df"),l=r("80d2");const c=Object(s["a"])(i["a"],Object(a["a"])("stepper","v-stepper-step","v-stepper"));e["a"]=c.extend().extend({name:"v-stepper-step",directives:{ripple:o["a"]},inject:["stepClick"],props:{color:{type:String,default:"primary"},complete:Boolean,completeIcon:{type:String,default:"$complete"},editable:Boolean,editIcon:{type:String,default:"$edit"},errorIcon:{type:String,default:"$error"},rules:{type:Array,default:()=>[]},step:[Number,String]},data(){return{isActive:!1,isInactive:!0}},computed:{classes(){return{"v-stepper__step--active":this.isActive,"v-stepper__step--editable":this.editable,"v-stepper__step--inactive":this.isInactive,"v-stepper__step--error error--text":this.hasError,"v-stepper__step--complete":this.complete}},hasError(){return this.rules.some(t=>!0!==t())}},mounted(){this.stepper&&this.stepper.register(this)},beforeDestroy(){this.stepper&&this.stepper.unregister(this)},methods:{click(t){t.stopPropagation(),this.$emit("click",t),this.editable&&this.stepClick(this.step)},genIcon(t){return this.$createElement(n["a"],t)},genLabel(){return this.$createElement("div",{staticClass:"v-stepper__label"},this.$slots.default)},genStep(){const t=!(this.hasError||!this.complete&&!this.isActive)&&this.color;return this.$createElement("span",this.setBackgroundColor(t,{staticClass:"v-stepper__step__step"}),this.genStepContent())},genStepContent(){const t=[];return this.hasError?t.push(this.genIcon(this.errorIcon)):this.complete?this.editable?t.push(this.genIcon(this.editIcon)):t.push(this.genIcon(this.completeIcon)):t.push(String(this.step)),t},keyboardClick(t){t.keyCode===l["A"].space&&this.click(t)},toggle(t){this.isActive=t.toString()===this.step.toString(),this.isInactive=Number(t)<Number(this.step)}},render(t){return t("div",{attrs:{tabindex:this.editable?0:-1},staticClass:"v-stepper__step",class:this.classes,directives:[{name:"ripple",value:this.editable}],on:{click:this.click,keydown:this.keyboardClick}},[this.genStep(),this.genLabel()])}})},5877:function(t,e,r){"use strict";r("8403")},5900:function(t,e,r){"use strict";var n=r("62ad"),i=r("a523"),a=r("0fd9"),o=r("3a2f"),s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"platform-id",attrs:{"data-platform-id":t.platform_id||t.platform.platform_id}},[e("h4",{staticStyle:{"text-align":"center"}},[t._v(t._s(t.name))]),e("div",{key:"platform_"+(t.platform_id||t.platform.platform_id)+"_"+t.redrawCounter,ref:"platformbox",staticClass:"mb-2 platform",class:{positionNewSelected:t.hasNewLifecyclePositionsSelected,platformSelected:t.hasAllLifecyclePositionsSelected},style:{"min-height":"140px",height:45*t.rowsPerPlatform+"px"},on:{click:t.onPlatformClick}},[e(i["a"],{staticClass:"fill-height"},t._l(t.rowsPerPlatform,(function(r,i){return e(a["a"],{key:"row"+i,attrs:{"no-gutters":"",justify:"space-around",align:"center"}},t._l(t.platformPositionLength,(function(r,a){return e(n["a"],{key:a,staticClass:"border-all",class:[{positionDetailed:t.positionIsDetailed(t.platform.platformPositions[a+i*t.platformPositionLength]),positionNewSelected:t.positionIsNewSelected(t.platform.platformPositions[a+i*t.platformPositionLength]),positionSelected:t.positionIsSelected(t.platform.platformPositions[a+i*t.platformPositionLength])}],staticStyle:{position:"relative"},style:t.colStyle,attrs:{cols:t.colsize},on:{click:function(e){return t.onPositionClick(a,t.platform.platformPositions[a+i*t.platformPositionLength])},dblclick:function(e){return t.onPositionDblClick(a,t.platform.platformPositions[a+i*t.platformPositionLength])}}},[t.platform.platformPositions[a+i*t.platformPositionLength].plantCount>0?e("span",{staticClass:"badge-basin"},[t._v(t._s(t.platform.platformPositions[a+i*t.platformPositionLength].plantCount))]):t._e(),""==t.platform.platformPositions[a+i*t.platformPositionLength].plantContainer_id||0==t.platform.platformPositions[a+i*t.platformPositionLength].lifecycles.length?e("img",{staticClass:"plants-icon",attrs:{src:"/img/icons/none.svg","data-original-title":""}}):t._e(),""!=t.platform.platformPositions[a+i*t.platformPositionLength].plantContainer_id&&t.hasLifecyclePlants(t.platform.platformPositions[a+i*t.platformPositionLength])?e(o["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e("img",t._g({staticClass:"plants-icon",attrs:{src:t.platform.platformPositions[a+i*t.platformPositionLength].plant&&t.platform.platformPositions[a+i*t.platformPositionLength].plant.destroy?"/img/icons/leaf_gray.svg":"/img/icons/leaf.svg","data-position-id":t.platform.platformPositions[a+i*t.platformPositionLength].platformPosition_id}},n))]}}],null,!0)},[e("span",[t._v(t._s(t.containerInfo(t.platform.platformPositions[a+i*t.platformPositionLength])))])]):t._e(),""!=t.platform.platformPositions[a+i*t.platformPositionLength].plantContainer_id&&t.platform.platformPositions[a+i*t.platformPositionLength].lifecycles.length>0&&!t.hasLifecyclePlants(t.platform.platformPositions[a+i*t.platformPositionLength])?e("img",{staticClass:"plants-icon",attrs:{src:"/img/icons/leaf_gray.svg","data-position-id":t.platform.platformPositions[a+i*t.platformPositionLength].platformPosition_id,"data-toggle":"tooltip","data-placement":"top","data-html":"true",title:t.containerInfo(t.platform.platformPositions[a+i*t.platformPositionLength])}}):t._e()],1)})),1)})),1)],1)])},l=[],c=r("2f62"),u=r("d67f"),d=r("b047"),h=r.n(d);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t){var e=g(t,"string");return"symbol"==f(e)?e:e+""}function g(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var b={name:"platform",props:["name","platform","platform_id","lifecycleId","side","selectedPlatformPositions","selectedEmptyPositions","triggerIndividualPlants","newContainer","currentLifecycles","selectAllOrder","preventOverselection","remainingSelectionsCount","allowMultipleLifecycles","useBarcodeScanner","addPlants"],data:function(){return{redrawCounter:0,trigger:!0,selectedAllPositions:!1,selectedEmptyAllPositions:!1,requestedFrom:"",platformIndex:0,containersToRequest:[],block:!0,rowsPerPlatform:0,colsize:1,remainingCount:0,isLoaded:!1,colStyle:{}}},mounted:function(){this.remainingCount=this.remainingSelectionsCount},created:function(){console.log(this.platform);var t=this;this.redraw=h()((function(){t.redrawCounter++}),500)},beforeMount:function(){var t=this.platform.platformPositions;this.rowsPerPlatform=t[t.length-1].row;var e=t[t.length-1].col,r=Math.floor(100/e);this.colStyle={width:"".concat(r,"%"),maxWidth:"8.33%",flex:"0 0 ".concat(r,"%")}},methods:m(m({},Object(c["b"])(["getPlantContainerList"])),{},{containerInfo:function(t){if(t.plant){var e=t.plant.strainName||t.plant.growplanName;return t.plant.tag?e+=" | Tag: "+t.plant.tag:e+=" | No Tag Specified",t.plant.motherplant_tag?e+=" | Mother: "+t.plant.motherplant_tag:e+=" | No Mother Specified",t.plant.destroy&&(e+=" | Marked for Destruction"),e}return"Lifecycle: "+t.lifecycles+" | Platform Position: "+t.platformPosition_id+" | Plant Container: "+t.plantContainer_id},positionIsDetailed:function(t){var e=!1;return this.newContainer&&this.newContainer.platform&&""!==t.plantContainer_id&&(e=this.newContainer.platform.position.plantContainer_id===t.plantContainer_id),e},positionIsSelected:function(t){return-1!==this.selectedPlatformPositions.indexOf(t)&&"left"===this.side},positionIsNewSelected:function(t){return-1!==this.selectedEmptyPositions.indexOf(t)&&"right"===this.side},positionExist:function(t){return-1!==this.platform.platformPositions.indexOf(t)},hasLifecyclePlants:function(t){return t.lifecycles&&-1!==t.lifecycles.split(",").indexOf(String(this.lifecycleId))},deselectAll:function(){this.requestedFrom=this.platform.platform_id,this.setPositionsSelected(!1,!1,this.selectedPlatformPositions),this.setPositionsSelected(!1,!0,this.selectedPlatformPositions)},selectAll:function(){this.requestedFrom=this.platform.platform_id,this.setPositionsSelected(!0,!1,this.selectedPlatformPositions),this.setPositionsSelected(!0,!0,this.selectedPlatformPositions)},onPlatformClick:function(t){if(!this.useBarcodeScanner&&!this.addPlants){var e=!1;if(this.disabled)return u["a"].error("Unable to use this platform. There is a different lifecycle that is already present.");if("number"===typeof t&&t!=this.platform.platformPositions.length){e=!0;for(var r=[],n=0;n<this.platform.platformPositions.length;n++){var i=this.platform.platformPositions[n];r.length!=i.row&&(r[i.row-1]=[]),r[i.row-1][i.col-1]=i}for(var a=this.platform.platformPositions.length-t,o=0,s=0;s<a;s++){switch(o){case 0:r[0].shift();break;case 1:r[0].pop();break;case 2:r[1].shift();break;case 3:r[1].pop();break}o++,4==o&&(o=0)}for(var l=[].concat(r[0],r[1]),c=0;c<l.length;c++)this.onPositionClick(null,l[c])}e||this.block&&("left"===this.side?this.trigger&&(this.requestedFrom=this.platform.platform_id,this.selectedAllPositions=!this.selectedAllPositions,this.setPositionsSelected(this.selectedAllPositions,!1,this.selectedPlatformPositions),this.setPositionsSelected(this.selectedAllPositions,!0,this.selectedPlatformPositions)):"right"===this.side&&this.trigger&&(this.selectedAllPositions=!this.selectedAllPositions,this.setEmptyPositionsSelected(this.selectedAllPositions,!1,this.selectedEmptyPositions),this.setEmptyPositionsSelected(this.selectedAllPositions,!0,this.selectedEmptyPositions))),this.trigger=!0}},setEmptyPositionsSelected:function(t,e,r){for(var n=0;n<this.platform.platformPositions.length;n++)e?!t||""!==this.platform.platformPositions[n].plantContainer_id&&0!=this.platform.platformPositions[n].plantCount?t||this.setPositionSelected(n,t,r):this.positionIsNewSelected(this.platform.platformPositions[n])||(this.remainingCount>0||!this.preventOverselection)&&(r.push(this.platform.platformPositions[n]),this.remainingCount--):this.setPositionSelected(n,t,r)},setPositionsSelected:function(t,e,r){if("reverse"==this.selectAllOrder)for(this.platformIndex=this.platform.platformPositions.length-1;this.platformIndex>=0;this.platformIndex--)e?t&&this.hasLifecyclePlants(this.platform.platformPositions[this.platformIndex])?this.positionIsSelected(this.platform.platformPositions[this.platformIndex])||r.push(this.platform.platformPositions[this.platformIndex]):t||this.setPositionSelected(this.platformIndex,t,r):this.setPositionSelected(this.platformIndex,t,r);else for(this.platformIndex=0;this.platformIndex<this.platform.platformPositions.length;this.platformIndex++)e?t&&this.hasLifecyclePlants(this.platform.platformPositions[this.platformIndex])?this.positionIsSelected(this.platform.platformPositions[this.platformIndex])||r.push(this.platform.platformPositions[this.platformIndex]):t||this.setPositionSelected(this.platformIndex,t,r):this.setPositionSelected(this.platformIndex,t,r)},setPositionSelected:function(t,e,r){if(!e){var n=r.indexOf(this.platform.platformPositions[t]);n>=0&&r.splice(n,1)}},onPositionClick:function(t,e){this.addPlants?(e.plantCount?u["a"].error("You must select an empty position"):this.positionIsSelected(e)?this.selectedPlatformPositions.splice(this.selectedPlatformPositions.indexOf(e),1):this.selectedPlatformPositions.push(e),this.trigger=!1):this.block&&("left"===this.side?(""!==e.plantContainer_id&&this.hasLifecyclePlants(e)&&(this.positionIsSelected(e)?this.selectedPlatformPositions.splice(this.selectedPlatformPositions.indexOf(e),1):(this.remainingCount>0||!this.preventOverselection)&&(this.platformIndex=1,this.requestedFrom=this.platform.platform_id,this.useBarcodeScanner?(1==this.selectedPlatformPositions.length&&this.selectedPlatformPositions.shift(),this.selectedPlatformPositions.push(e)):this.selectedPlatformPositions.push(e),isNaN(parseInt(this.remainingCount))||this.remainingCount--)),this.trigger=!1):(""!==e.plantContainer_id&&0!=e.plantCount||""!==e.lifecycles||(this.positionIsNewSelected(e)?this.selectedEmptyPositions.splice(this.selectedEmptyPositions.indexOf(e),1):(this.remainingCount>0||!this.preventOverselection)&&(this.selectedEmptyPositions.push(e),this.remainingCount--)),this.trigger=!1))},onPositionDblClick:function(t,e){},requestPlantContainer:function(t){t.length>=8?(this.requestedFrom=this.platform.platform_id,this.getPlantContainerList({apitoken:this.getUser.apitoken,plantContainer_id:t.splice(0,8).join()})):t.length<8&&t.length>0&&this.getPlantContainerList({apitoken:this.getUser.apitoken,plantContainer_id:t.splice(0,t.length).join()})}}),computed:m(m({},Object(c["c"])(["getUser","multipleContainers"])),{},{platformPositionLength:function(){return this.platform.platformPositions.length/this.rowsPerPlatform},disabled:function(){var t=this;return!(!this.currentLifecycles||!this.currentLifecycles.find((function(e){return e!=t.lifecycleId}))||this.allowMultipleLifecycles)},hasAllLifecyclePositionsSelected:function(){for(var t=!0,e=!1,r=0;r<this.platform.platformPositions.length&&t;r++){var n=this.platform.platformPositions[r];this.hasLifecyclePlants(n)&&(e=!0,-1===this.selectedPlatformPositions.indexOf(n)&&(t=!1))}return t&&e&&"left"===this.side},hasNewLifecyclePositionsSelected:function(){for(var t=!0,e=!1,r=0;r<this.platform.platformPositions.length&&t;r++){var n=this.platform.platformPositions[r];""===n.plantContainer_id&&(e=!0,-1===this.selectedEmptyPositions.indexOf(n)&&(t=!1))}return t&&e&&"right"===this.side},platformClass:function(){var t="platform";return this.platform.platformType?t.concat("type-"+this.platform.platformType_id," ",this.platform.platformType.replace(" ","")):t}}),watch:{remainingSelectionsCount:function(t,e){this.remainingCount=t},selectedPlatformPositions:{handler:function(t,e){var r=this;t&&t.length&&this.requestedFrom===this.platform.platform_id&&(this.platform.platformPositions.length!==this.platformIndex&&1!==this.platformIndex||t.forEach((function(t){t.positions||r.containersToRequest.push(t.plantContainer_id)}))),this.requestPlantContainer(this.containersToRequest)},deep:!0},multipleContainers:function(t){if(t&&t.plantContainers&&t.plantContainers.length&&this.requestedFrom===this.platform.platform_id){for(var e=0;e<this.selectedPlatformPositions.length;e++)for(var r=this.selectedPlatformPositions[e],n=0;n<t.plantContainers.length;n++){var i=t.plantContainers[n];r.plantContainer_id===i.plantContainer_id&&(r.positions=i.positions,r.plantcontainerType=i.plantcontainerType,r.plantcontainerType_id=i.plantcontainerType_id,1==r.plantCount&&r.positions&&1==r.positions.length&&(r.plant=i.positions[0]))}this.containersToRequest.length?this.requestPlantContainer(this.containersToRequest):(this.platformIndex=0,this.requestedFrom="")}this.redraw()}}},w=b,x=(r("0f6a"),r("2877")),S=Object(x["a"])(w,s,l,!1,null,"1b5f8d22",null);e["a"]=S.exports},5940:function(t,e,r){},"5a2f":function(t,e,r){},"5ae2":function(t,e,r){},"5b01":function(t,e,r){var n,i;(function(a){t.exports?(a["default"]=a,t.exports=a):(n=[r("ea7f")],i=function(t){return a(t),a.Highcharts=t,a}.apply(e,n),void 0===i||(t.exports=i))})((function(t){function e(t,e,r,n){t.hasOwnProperty(e)||(t[e]=n.apply(null,r),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}t=t?t._modules:{},e(t,"Extensions/Annotations/Mixins/EventEmitterMixin.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],(function(t,e){var r=e.addEvent,n=e.fireEvent,i=e.objectEach,a=e.pick,o=e.removeEvent;return{addEvents:function(){var e=this,a=function(n){r(n,t.isTouchDevice?"touchstart":"mousedown",(function(t){e.onMouseDown(t)}),{passive:!1})};if(a(this.graphic.element),(e.labels||[]).forEach((function(t){t.options.useHTML&&t.graphic.text&&a(t.graphic.text.element)})),i(e.options.events,(function(t,n){var i=function(r){"click"===n&&e.cancelClick||t.call(e,e.chart.pointer.normalize(r),e.target)};-1===(e.nonDOMEvents||[]).indexOf(n)?e.graphic.on(n,i):r(e,n,i,{passive:!1})})),e.options.draggable&&(r(e,"drag",e.onDrag),!e.graphic.renderer.styledMode)){var o={cursor:{x:"ew-resize",y:"ns-resize",xy:"move"}[e.options.draggable]};e.graphic.css(o),(e.labels||[]).forEach((function(t){t.options.useHTML&&t.graphic.text&&t.graphic.text.css(o)}))}e.isUpdating||n(e,"add")},removeDocEvents:function(){this.removeDrag&&(this.removeDrag=this.removeDrag()),this.removeMouseUp&&(this.removeMouseUp=this.removeMouseUp())},onMouseDown:function(e){var i=this,o=i.chart.pointer;if(e.preventDefault&&e.preventDefault(),2!==e.button){e=o.normalize(e);var s=e.chartX,l=e.chartY;i.cancelClick=!1,i.chart.hasDraggedAnnotation=!0,i.removeDrag=r(t.doc,t.isTouchDevice?"touchmove":"mousemove",(function(t){i.hasDragged=!0,t=o.normalize(t),t.prevChartX=s,t.prevChartY=l,n(i,"drag",t),s=t.chartX,l=t.chartY}),t.isTouchDevice?{passive:!1}:void 0),i.removeMouseUp=r(t.doc,t.isTouchDevice?"touchend":"mouseup",(function(t){var e=a(i.target&&i.target.annotation,i.target);e&&(e.cancelClick=i.hasDragged),i.cancelClick=i.hasDragged,i.hasDragged=!1,i.chart.hasDraggedAnnotation=!1,n(a(e,i),"afterUpdate"),i.onMouseUp(t)}),t.isTouchDevice?{passive:!1}:void 0)}},onMouseUp:function(t){var e=this.chart;t=this.target||this;var r=e.options.annotations;e=e.annotations.indexOf(t),this.removeDocEvents(),r[e]=t.options},onDrag:function(t){if(this.chart.isInsidePlot(t.chartX-this.chart.plotLeft,t.chartY-this.chart.plotTop,{visiblePlotOnly:!0})){var e=this.mouseMoveToTranslation(t);"x"===this.options.draggable&&(e.y=0),"y"===this.options.draggable&&(e.x=0),this.points.length?this.translate(e.x,e.y):(this.shapes.forEach((function(t){t.translate(e.x,e.y)})),this.labels.forEach((function(t){t.translate(e.x,e.y)}))),this.redraw(!1)}},mouseMoveToRadians:function(t,e,r){var n=t.prevChartY-r,i=t.prevChartX-e;return r=t.chartY-r,t=t.chartX-e,this.chart.inverted&&(e=i,i=n,n=e,e=t,t=r,r=e),Math.atan2(r,t)-Math.atan2(n,i)},mouseMoveToTranslation:function(t){var e=t.chartX-t.prevChartX;if(t=t.chartY-t.prevChartY,this.chart.inverted){var r=t;t=e,e=r}return{x:e,y:t}},mouseMoveToScale:function(t,e,r){return e=(t.chartX-e||1)/(t.prevChartX-e||1),t=(t.chartY-r||1)/(t.prevChartY-r||1),this.chart.inverted&&(r=t,t=e,e=r),{x:e,y:t}},destroy:function(){this.removeDocEvents(),o(this),this.hcEvents=null}}})),e(t,"Extensions/Annotations/ControlPoint.js",[t["Core/Utilities.js"],t["Extensions/Annotations/Mixins/EventEmitterMixin.js"]],(function(t,e){var r=t.merge,n=t.pick;return function(){function t(t,r,i,a){this.addEvents=e.addEvents,this.graphic=void 0,this.mouseMoveToRadians=e.mouseMoveToRadians,this.mouseMoveToScale=e.mouseMoveToScale,this.mouseMoveToTranslation=e.mouseMoveToTranslation,this.onDrag=e.onDrag,this.onMouseDown=e.onMouseDown,this.onMouseUp=e.onMouseUp,this.removeDocEvents=e.removeDocEvents,this.nonDOMEvents=["drag"],this.chart=t,this.target=r,this.options=i,this.index=n(i.index,a)}return t.prototype.setVisibility=function(t){this.graphic.attr("visibility",t?"visible":"hidden"),this.options.visible=t},t.prototype.render=function(){var t=this.chart,e=this.options;this.graphic=t.renderer.symbol(e.symbol,0,0,e.width,e.height).add(t.controlPointsGroup).css(e.style),this.setVisibility(e.visible),this.addEvents()},t.prototype.redraw=function(t){this.graphic[t?"animate":"attr"](this.options.positioner.call(this,this.target))},t.prototype.destroy=function(){e.destroy.call(this),this.graphic&&(this.graphic=this.graphic.destroy()),this.options=this.target=this.chart=null},t.prototype.update=function(t){var e=this.chart,n=this.target,i=this.index;t=r(!0,this.options,t),this.destroy(),this.constructor(e,n,t,i),this.render(e.controlPointsGroup),this.redraw()},t}()})),e(t,"Extensions/Annotations/MockPoint.js",[t["Core/Series/Series.js"],t["Core/Utilities.js"],t["Core/Axis/Axis.js"]],(function(t,e,r){var n=e.defined,i=e.fireEvent;return function(){function e(e,r,n){this.y=this.x=this.ttBelow=this.plotY=this.plotX=this.negative=this.isInside=void 0,this.mock=!0,this.series={visible:!0,chart:e,getPlotBox:t.prototype.getPlotBox},this.target=r||null,this.options=n,this.applyOptions(this.getOptions())}return e.fromPoint=function(t){return new e(t.series.chart,null,{x:t.x,y:t.y,xAxis:t.series.xAxis,yAxis:t.series.yAxis})},e.pointToPixels=function(t,e){var r=t.series,n=r.chart,i=t.plotX,a=t.plotY;return n.inverted&&(t.mock?(i=t.plotY,a=t.plotX):(i=n.plotWidth-t.plotY,a=n.plotHeight-t.plotX)),r&&!e&&(t=r.getPlotBox(),i+=t.translateX,a+=t.translateY),{x:i,y:a}},e.pointToOptions=function(t){return{x:t.x,y:t.y,xAxis:t.series.xAxis,yAxis:t.series.yAxis}},e.prototype.hasDynamicOptions=function(){return"function"===typeof this.options},e.prototype.getOptions=function(){return this.hasDynamicOptions()?this.options(this.target):this.options},e.prototype.applyOptions=function(t){this.command=t.command,this.setAxis(t,"x"),this.setAxis(t,"y"),this.refresh()},e.prototype.setAxis=function(t,e){e+="Axis",t=t[e];var i=this.series.chart;this.series[e]=t instanceof r?t:n(t)?i[e][t]||i.get(t):null},e.prototype.toAnchor=function(){var t=[this.plotX,this.plotY,0,0];return this.series.chart.inverted&&(t[0]=this.plotY,t[1]=this.plotX),t},e.prototype.getLabelConfig=function(){return{x:this.x,y:this.y,point:this}},e.prototype.isInsidePlot=function(){var t=this.plotX,e=this.plotY,r=this.series.xAxis,a=this.series.yAxis,o={x:t,y:e,isInsidePlot:!0};return r&&(o.isInsidePlot=n(t)&&0<=t&&t<=r.len),a&&(o.isInsidePlot=o.isInsidePlot&&n(e)&&0<=e&&e<=a.len),i(this.series.chart,"afterIsInsidePlot",o),o.isInsidePlot},e.prototype.refresh=function(){var t=this.series,e=t.xAxis;t=t.yAxis;var r=this.getOptions();e?(this.x=r.x,this.plotX=e.toPixels(r.x,!0)):(this.x=void 0,this.plotX=r.x),t?(this.y=r.y,this.plotY=t.toPixels(r.y,!0)):(this.y=null,this.plotY=r.y),this.isInside=this.isInsidePlot()},e.prototype.translate=function(t,e,r,n){this.hasDynamicOptions()||(this.plotX+=r,this.plotY+=n,this.refreshOptions())},e.prototype.scale=function(t,e,r,n){if(!this.hasDynamicOptions()){var i=this.plotY*n;this.plotX=(1-r)*t+this.plotX*r,this.plotY=(1-n)*e+i,this.refreshOptions()}},e.prototype.rotate=function(t,e,r){if(!this.hasDynamicOptions()){var n=Math.cos(r);r=Math.sin(r);var i=this.plotX,a=this.plotY;i-=t,a-=e,this.plotX=i*n-a*r+t,this.plotY=i*r+a*n+e,this.refreshOptions()}},e.prototype.refreshOptions=function(){var t=this.series,e=t.xAxis;t=t.yAxis,this.x=this.options.x=e?this.options.x=e.toValue(this.plotX,!0):this.plotX,this.y=this.options.y=t?t.toValue(this.plotY,!0):this.plotY},e}()})),e(t,"Extensions/Annotations/Mixins/ControllableMixin.js",[t["Extensions/Annotations/ControlPoint.js"],t["Extensions/Annotations/MockPoint.js"],t["Core/Tooltip.js"],t["Core/Utilities.js"]],(function(t,e,r,n){var i=n.isObject,a=n.isString,o=n.merge,s=n.splat;return{init:function(t,e,r){this.annotation=t,this.chart=t.chart,this.options=e,this.points=[],this.controlPoints=[],this.index=r,this.linkPoints(),this.addControlPoints()},attr:function(){this.graphic.attr.apply(this.graphic,arguments)},getPointsOptions:function(){var t=this.options;return t.points||t.point&&s(t.point)},attrsFromOptions:function(t){var e,r=this.constructor.attrsMap,n={},i=this.chart.styledMode;for(e in t){var a=r[e];!a||i&&-1!==["fill","stroke","stroke-width"].indexOf(a)||(n[a]=t[e])}return n},anchor:function(t){var e=t.series.getPlotBox(),n=t.series.chart,i=t.mock?t.toAnchor():r.prototype.getAnchor.call({chart:t.series.chart},t);return i={x:i[0]+(this.options.x||0),y:i[1]+(this.options.y||0),height:i[2]||0,width:i[3]||0},{relativePosition:i,absolutePosition:o(i,{x:i.x+(t.mock?e.translateX:n.plotLeft),y:i.y+(t.mock?e.translateY:n.plotTop)})}},point:function(t,r){return t&&t.series?t:(r&&null!==r.series||(i(t)?r=new e(this.chart,this,t):a(t)?r=this.chart.get(t)||null:"function"===typeof t&&(r=t.call(r,this),r=r.series?r:new e(this.chart,this,t))),r)},linkPoints:function(){var t,e=this.getPointsOptions(),r=this.points,n=e&&e.length||0;for(t=0;t<n;t++){var i=this.point(e[t],r[t]);if(!i)return void(r.length=0);i.mock&&i.refresh(),r[t]=i}return r},addControlPoints:function(){var e=this.options.controlPoints;(e||[]).forEach((function(r,n){r=o(this.options.controlPointOptions,r),r.index||(r.index=n),e[n]=r,this.controlPoints.push(new t(this.chart,this,r))}),this)},shouldBeDrawn:function(){return!!this.points.length},render:function(t){this.controlPoints.forEach((function(t){t.render()}))},redraw:function(t){this.controlPoints.forEach((function(e){e.redraw(t)}))},transform:function(t,e,r,n,i){if(this.chart.inverted){var a=e;e=r,r=a}this.points.forEach((function(a,o){this.transformPoint(t,e,r,n,i,o)}),this)},transformPoint:function(t,r,n,i,a,o){var s=this.points[o];s.mock||(s=this.points[o]=e.fromPoint(s)),s[t](r,n,i,a)},translate:function(t,e){this.transform("translate",null,null,t,e)},translatePoint:function(t,e,r){this.transformPoint("translate",null,null,t,e,r)},translateShape:function(t,e,r){var n=this.annotation.chart,i=this.annotation.userOptions,a=n.annotations.indexOf(this.annotation);n=n.options.annotations[a],this.translatePoint(t,e,0),r&&this.translatePoint(t,e,1),n[this.collection][this.index].point=this.options.point,i[this.collection][this.index].point=this.options.point},rotate:function(t,e,r){this.transform("rotate",t,e,r)},scale:function(t,e,r,n){this.transform("scale",t,e,r,n)},setControlPointsVisibility:function(t){this.controlPoints.forEach((function(e){e.setVisibility(t)}))},destroy:function(){this.graphic&&(this.graphic=this.graphic.destroy()),this.tracker&&(this.tracker=this.tracker.destroy()),this.controlPoints.forEach((function(t){t.destroy()})),this.options=this.controlPoints=this.points=this.chart=null,this.annotation&&(this.annotation=null)},update:function(t){var e=this.annotation;t=o(!0,this.options,t);var r=this.graphic.parentGroup;this.destroy(),this.constructor(e,t,this.index),this.render(r),this.redraw()}}})),e(t,"Extensions/Annotations/Mixins/MarkerMixin.js",[t["Core/Chart/Chart.js"],t["Core/Renderer/SVG/SVGRenderer.js"],t["Core/Utilities.js"]],(function(t,e,r){function n(t){return function(e){this.attr(t,"url(#"+e+")")}}var i=r.addEvent,a=r.defined,o=r.merge,s=r.uniqueKey,l={arrow:{tagName:"marker",attributes:{id:"arrow",refY:5,refX:9,markerWidth:10,markerHeight:10},children:[{tagName:"path",attributes:{d:"M 0 0 L 10 5 L 0 10 Z","stroke-width":0}}]},"reverse-arrow":{tagName:"marker",attributes:{id:"reverse-arrow",refY:5,refX:1,markerWidth:10,markerHeight:10},children:[{tagName:"path",attributes:{d:"M 0 5 L 10 0 L 10 10 Z","stroke-width":0}}]}};return e.prototype.addMarker=function(t,e){var r={attributes:{id:t}},n={stroke:e.color||"none",fill:e.color||"rgba(0, 0, 0, 0.75)"};return r.children=e.children&&e.children.map((function(t){return o(n,t)})),e=o(!0,{attributes:{markerWidth:20,markerHeight:20,refX:0,refY:0,orient:"auto"}},e,r),e=this.definition(e),e.id=t,e},e={markerEndSetter:n("marker-end"),markerStartSetter:n("marker-start"),setItemMarkers:function(t){var e=t.options,r=t.chart,n=r.options.defs,i=e.fill,l=a(i)&&"none"!==i?i:e.stroke;["markerStart","markerEnd"].forEach((function(i){var a,c=e[i];if(c){for(a in n){var u=n[a];if((c===(u.attributes&&u.attributes.id)||c===u.id)&&"marker"===u.tagName){var d=u;break}}d&&(c=t[i]=r.renderer.addMarker((e.id||s())+"-"+c,o(d,{color:l})),t.attr(i,c.getAttribute("id")))}}))}},i(t,"afterGetContainer",(function(){this.options.defs=o(l,this.options.defs||{})})),e})),e(t,"Extensions/Annotations/Controllables/ControllablePath.js",[t["Extensions/Annotations/Mixins/ControllableMixin.js"],t["Core/Globals.js"],t["Extensions/Annotations/Mixins/MarkerMixin.js"],t["Core/Utilities.js"]],(function(t,e,r,n){var i=n.extend,a="rgba(192,192,192,"+(e.svg?1e-4:.002)+")";return function(){function e(e,n,i){this.addControlPoints=t.addControlPoints,this.anchor=t.anchor,this.attr=t.attr,this.attrsFromOptions=t.attrsFromOptions,this.destroy=t.destroy,this.getPointsOptions=t.getPointsOptions,this.init=t.init,this.linkPoints=t.linkPoints,this.point=t.point,this.rotate=t.rotate,this.scale=t.scale,this.setControlPointsVisibility=t.setControlPointsVisibility,this.setMarkers=r.setItemMarkers,this.transform=t.transform,this.transformPoint=t.transformPoint,this.translate=t.translate,this.translatePoint=t.translatePoint,this.translateShape=t.translateShape,this.update=t.update,this.type="path",this.init(e,n,i),this.collection="shapes"}return e.prototype.toD=function(){var t=this.options.d;if(t)return"function"===typeof t?t.call(this):t;t=this.points;var e=t.length,r=e,n=t[0],i=r&&this.anchor(n).absolutePosition,a=0,o=[];if(i)for(o.push(["M",i.x,i.y]);++a<e&&r;)n=t[a],r=n.command||"L",i=this.anchor(n).absolutePosition,"M"===r||"L"===r?o.push([r,i.x,i.y]):"Z"===r&&o.push([r]),r=n.series.visible;return r?this.chart.renderer.crispLine(o,this.graphic.strokeWidth()):null},e.prototype.shouldBeDrawn=function(){return t.shouldBeDrawn.call(this)||!!this.options.d},e.prototype.render=function(e){var n=this.options,o=this.attrsFromOptions(n);this.graphic=this.annotation.chart.renderer.path([["M",0,0]]).attr(o).add(e),n.className&&this.graphic.addClass(n.className),this.tracker=this.annotation.chart.renderer.path([["M",0,0]]).addClass("highcharts-tracker-line").attr({zIndex:2}).add(e),this.annotation.chart.styledMode||this.tracker.attr({"stroke-linejoin":"round",stroke:a,fill:a,"stroke-width":this.graphic.strokeWidth()+2*n.snap}),t.render.call(this),i(this.graphic,{markerStartSetter:r.markerStartSetter,markerEndSetter:r.markerEndSetter}),this.setMarkers(this)},e.prototype.redraw=function(e){var r=this.toD(),n=e?"animate":"attr";r?(this.graphic[n]({d:r}),this.tracker[n]({d:r})):(this.graphic.attr({d:"M 0 -9000000000"}),this.tracker.attr({d:"M 0 -9000000000"})),this.graphic.placed=this.tracker.placed=!!r,t.redraw.call(this,e)},e.attrsMap={dashStyle:"dashstyle",strokeWidth:"stroke-width",stroke:"stroke",fill:"fill",zIndex:"zIndex"},e}()})),e(t,"Extensions/Annotations/Controllables/ControllableRect.js",[t["Extensions/Annotations/Mixins/ControllableMixin.js"],t["Extensions/Annotations/Controllables/ControllablePath.js"],t["Core/Utilities.js"]],(function(t,e,r){var n=r.merge;return function(){function r(e,r,n){this.addControlPoints=t.addControlPoints,this.anchor=t.anchor,this.attr=t.attr,this.attrsFromOptions=t.attrsFromOptions,this.destroy=t.destroy,this.getPointsOptions=t.getPointsOptions,this.init=t.init,this.linkPoints=t.linkPoints,this.point=t.point,this.rotate=t.rotate,this.scale=t.scale,this.setControlPointsVisibility=t.setControlPointsVisibility,this.shouldBeDrawn=t.shouldBeDrawn,this.transform=t.transform,this.transformPoint=t.transformPoint,this.translatePoint=t.translatePoint,this.translateShape=t.translateShape,this.update=t.update,this.type="rect",this.translate=t.translateShape,this.init(e,r,n),this.collection="shapes"}return r.prototype.render=function(e){var r=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.rect(0,-9e9,0,0).attr(r).add(e),t.render.call(this)},r.prototype.redraw=function(e){var r=this.anchor(this.points[0]).absolutePosition;r?this.graphic[e?"animate":"attr"]({x:r.x,y:r.y,width:this.options.width,height:this.options.height}):this.attr({x:0,y:-9e9}),this.graphic.placed=!!r,t.redraw.call(this,e)},r.attrsMap=n(e.attrsMap,{width:"width",height:"height"}),r}()})),e(t,"Extensions/Annotations/Controllables/ControllableCircle.js",[t["Extensions/Annotations/Mixins/ControllableMixin.js"],t["Extensions/Annotations/Controllables/ControllablePath.js"],t["Core/Utilities.js"]],(function(t,e,r){var n=r.merge;return function(){function r(e,r,n){this.addControlPoints=t.addControlPoints,this.anchor=t.anchor,this.attr=t.attr,this.attrsFromOptions=t.attrsFromOptions,this.destroy=t.destroy,this.getPointsOptions=t.getPointsOptions,this.init=t.init,this.linkPoints=t.linkPoints,this.point=t.point,this.rotate=t.rotate,this.scale=t.scale,this.setControlPointsVisibility=t.setControlPointsVisibility,this.shouldBeDrawn=t.shouldBeDrawn,this.transform=t.transform,this.transformPoint=t.transformPoint,this.translatePoint=t.translatePoint,this.translateShape=t.translateShape,this.update=t.update,this.type="circle",this.translate=t.translateShape,this.init(e,r,n),this.collection="shapes"}return r.prototype.render=function(e){var r=this.attrsFromOptions(this.options);this.graphic=this.annotation.chart.renderer.circle(0,-9e9,0).attr(r).add(e),t.render.call(this)},r.prototype.redraw=function(e){var r=this.anchor(this.points[0]).absolutePosition;r?this.graphic[e?"animate":"attr"]({x:r.x,y:r.y,r:this.options.r}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!r,t.redraw.call(this,e)},r.prototype.setRadius=function(t){this.options.r=t},r.attrsMap=n(e.attrsMap,{r:"r"}),r}()})),e(t,"Extensions/Annotations/Controllables/ControllableEllipse.js",[t["Extensions/Annotations/Mixins/ControllableMixin.js"],t["Extensions/Annotations/Controllables/ControllablePath.js"],t["Core/Utilities.js"]],(function(t,e,r){var n=r.merge,i=r.defined;return function(){function r(e,r,n){this.addControlPoints=t.addControlPoints,this.anchor=t.anchor,this.attr=t.attr,this.attrsFromOptions=t.attrsFromOptions,this.destroy=t.destroy,this.getPointsOptions=t.getPointsOptions,this.linkPoints=t.linkPoints,this.point=t.point,this.scale=t.scale,this.setControlPointsVisibility=t.setControlPointsVisibility,this.shouldBeDrawn=t.shouldBeDrawn,this.transform=t.transform,this.translatePoint=t.translatePoint,this.transformPoint=t.transformPoint,this.type="ellipse",this.init(e,r,n),this.collection="shapes"}return r.prototype.init=function(e,r,n){i(r.yAxis)&&r.points.forEach((function(t){t.yAxis=r.yAxis})),i(r.xAxis)&&r.points.forEach((function(t){t.xAxis=r.xAxis})),t.init.call(this,e,r,n)},r.prototype.render=function(e){this.graphic=this.annotation.chart.renderer.createElement("ellipse").attr(this.attrsFromOptions(this.options)).add(e),t.render.call(this)},r.prototype.translate=function(e,r){t.translateShape.call(this,e,r,!0)},r.prototype.getDistanceFromLine=function(t,e,r,n){return Math.abs((e.y-t.y)*r-(e.x-t.x)*n+e.x*t.y-e.y*t.x)/Math.sqrt((e.y-t.y)*(e.y-t.y)+(e.x-t.x)*(e.x-t.x))},r.prototype.getAttrs=function(t,e){var r=t.x,n=t.y,i=e.x,a=e.y;e=(r+i)/2,t=(n+a)/2;var o=Math.sqrt((r-i)*(r-i)/4+(n-a)*(n-a)/4);return n=180*Math.atan((a-n)/(i-r))/Math.PI,e<r&&(n+=180),r=this.getRY(),{cx:e,cy:t,rx:o,ry:r,angle:n}},r.prototype.getRY=function(){var t=this.getYAxis();return i(t)?Math.abs(t.toPixels(this.options.ry)-t.toPixels(0)):this.options.ry},r.prototype.getYAxis=function(){return this.chart.yAxis[this.options.yAxis]},r.prototype.getAbsolutePosition=function(t){return this.anchor(t).absolutePosition},r.prototype.redraw=function(e){var r=this.getAbsolutePosition(this.points[0]),n=this.getAbsolutePosition(this.points[1]);n=this.getAttrs(r,n),r?this.graphic[e?"animate":"attr"]({cx:n.cx,cy:n.cy,rx:n.rx,ry:n.ry,rotation:n.angle,rotationOriginX:n.cx,rotationOriginY:n.cy}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!r,t.redraw.call(this,e)},r.prototype.setYRadius=function(t){this.options.ry=t,this.annotation.userOptions.shapes[0].ry=t,this.annotation.options.shapes[0].ry=t},r.attrsMap=n(e.attrsMap,{ry:"ry"}),r}()})),e(t,"Extensions/Annotations/Controllables/ControllableLabel.js",[t["Extensions/Annotations/Mixins/ControllableMixin.js"],t["Core/FormatUtilities.js"],t["Extensions/Annotations/MockPoint.js"],t["Core/Renderer/SVG/SVGRenderer.js"],t["Core/Tooltip.js"],t["Core/Utilities.js"]],(function(t,e,r,n,i,a){var o=e.format;e=n.prototype.symbols;var s=a.extend,l=a.isNumber,c=a.pick;return a=function(){function e(e,r,n){this.addControlPoints=t.addControlPoints,this.attr=t.attr,this.attrsFromOptions=t.attrsFromOptions,this.destroy=t.destroy,this.getPointsOptions=t.getPointsOptions,this.init=t.init,this.linkPoints=t.linkPoints,this.point=t.point,this.rotate=t.rotate,this.scale=t.scale,this.setControlPointsVisibility=t.setControlPointsVisibility,this.shouldBeDrawn=t.shouldBeDrawn,this.transform=t.transform,this.transformPoint=t.transformPoint,this.translateShape=t.translateShape,this.update=t.update,this.init(e,r,n),this.collection="labels"}return e.alignedPosition=function(t,e){var r,n,i=t.align,a=t.verticalAlign,o=(e.x||0)+(t.x||0),s=(e.y||0)+(t.y||0);return"right"===i?r=1:"center"===i&&(r=2),r&&(o+=(e.width-(t.width||0))/r),"bottom"===a?n=1:"middle"===a&&(n=2),n&&(s+=(e.height-(t.height||0))/n),{x:Math.round(o),y:Math.round(s)}},e.justifiedOptions=function(t,e,r,n){var i=r.align,a=r.verticalAlign,o=e.box?0:e.padding||0,s=e.getBBox();e={align:i,verticalAlign:a,x:r.x,y:r.y,width:e.width,height:e.height},r=(n.x||0)-t.plotLeft,n=(n.y||0)-t.plotTop;var l=r+o;return 0>l&&("right"===i?e.align="left":e.x=(e.x||0)-l),l=r+s.width-o,l>t.plotWidth&&("left"===i?e.align="right":e.x=(e.x||0)+t.plotWidth-l),l=n+o,0>l&&("bottom"===a?e.verticalAlign="top":e.y=(e.y||0)-l),l=n+s.height-o,l>t.plotHeight&&("top"===a?e.verticalAlign="bottom":e.y=(e.y||0)+t.plotHeight-l),e},e.prototype.translatePoint=function(e,r){t.translatePoint.call(this,e,r,0)},e.prototype.translate=function(t,e){var r=this.annotation.chart,n=this.annotation.userOptions,i=r.annotations.indexOf(this.annotation);i=r.options.annotations[i],r.inverted&&(r=t,t=e,e=r),this.options.x+=t,this.options.y+=e,i[this.collection][this.index].x=this.options.x,i[this.collection][this.index].y=this.options.y,n[this.collection][this.index].x=this.options.x,n[this.collection][this.index].y=this.options.y},e.prototype.render=function(r){var n=this.options,i=this.attrsFromOptions(n),a=n.style;this.graphic=this.annotation.chart.renderer.label("",0,-9999,n.shape,null,null,n.useHTML,null,"annotation-label").attr(i).add(r),this.annotation.chart.styledMode||("contrast"===a.color&&(a.color=this.annotation.chart.renderer.getContrast(-1<e.shapesWithoutBackground.indexOf(n.shape)?"#FFFFFF":n.backgroundColor)),this.graphic.css(n.style).shadow(n.shadow)),n.className&&this.graphic.addClass(n.className),this.graphic.labelrank=n.labelrank,t.render.call(this)},e.prototype.redraw=function(e){var r=this.options,n=this.text||r.format||r.text,i=this.graphic,a=this.points[0];i.attr({text:n?o(n,a.getLabelConfig(),this.annotation.chart):r.formatter.call(a,this)}),r=this.anchor(a),(n=this.position(r))?(i.alignAttr=n,n.anchorX=r.absolutePosition.x,n.anchorY=r.absolutePosition.y,i[e?"animate":"attr"](n)):i.attr({x:0,y:-9999}),i.placed=!!n,t.redraw.call(this,e)},e.prototype.anchor=function(e){var r=t.anchor.apply(this,arguments),n=this.options.x||0,i=this.options.y||0;return r.absolutePosition.x-=n,r.absolutePosition.y-=i,r.relativePosition.x-=n,r.relativePosition.y-=i,r},e.prototype.position=function(t){var n=this.graphic,a=this.annotation.chart,o=this.points[0],l=this.options,u=t.absolutePosition,d=t.relativePosition,h=o.series.visible&&r.prototype.isInsidePlot.call(o);t=n.width,t=void 0===t?0:t;var f=n.height;if(f=void 0===f?0:f,h){if(l.distance)var p=i.prototype.getPosition.call({chart:a,distance:c(l.distance,16)},t,f,{plotX:d.x,plotY:d.y,negative:o.negative,ttBelow:o.ttBelow,h:d.height||d.width});else l.positioner?p=l.positioner.call(this):(o={x:u.x,y:u.y,width:0,height:0},p=e.alignedPosition(s(l,{width:t,height:f}),o),"justify"===this.options.overflow&&(p=e.alignedPosition(e.justifiedOptions(a,n,l,p),o)));l.crop&&(n=p.x-a.plotLeft,l=p.y-a.plotTop,h=a.isInsidePlot(n,l)&&a.isInsidePlot(n+t,l+f))}return h?p:null},e.attrsMap={backgroundColor:"fill",borderColor:"stroke",borderWidth:"stroke-width",zIndex:"zIndex",borderRadius:"r",padding:"padding"},e.shapesWithoutBackground=["connector"],e}(),e.connector=function(t,e,r,n,i){var a=i&&i.anchorX;i=i&&i.anchorY;var o=r/2;if(l(a)&&l(i)){var s=[["M",a,i]],c=e-i;0>c&&(c=-n-c),c<r&&(o=a<t+r/2?c:r-c),i>e+n?s.push(["L",t+o,e+n]):i<e?s.push(["L",t+o,e]):a<t?s.push(["L",t,e+n/2]):a>t+r&&s.push(["L",t+r,e+n/2])}return s||[]},a})),e(t,"Extensions/Annotations/Controllables/ControllableImage.js",[t["Extensions/Annotations/Controllables/ControllableLabel.js"],t["Extensions/Annotations/Mixins/ControllableMixin.js"]],(function(t,e){return function(){function r(t,r,n){this.addControlPoints=e.addControlPoints,this.anchor=e.anchor,this.attr=e.attr,this.attrsFromOptions=e.attrsFromOptions,this.destroy=e.destroy,this.getPointsOptions=e.getPointsOptions,this.init=e.init,this.linkPoints=e.linkPoints,this.point=e.point,this.rotate=e.rotate,this.scale=e.scale,this.setControlPointsVisibility=e.setControlPointsVisibility,this.shouldBeDrawn=e.shouldBeDrawn,this.transform=e.transform,this.transformPoint=e.transformPoint,this.translatePoint=e.translatePoint,this.translateShape=e.translateShape,this.update=e.update,this.type="image",this.translate=e.translateShape,this.init(t,r,n),this.collection="shapes"}return r.prototype.render=function(t){var r=this.attrsFromOptions(this.options),n=this.options;this.graphic=this.annotation.chart.renderer.image(n.src,0,-9e9,n.width,n.height).attr(r).add(t),this.graphic.width=n.width,this.graphic.height=n.height,e.render.call(this)},r.prototype.redraw=function(r){var n=this.anchor(this.points[0]);(n=t.prototype.position.call(this,n))?this.graphic[r?"animate":"attr"]({x:n.x,y:n.y}):this.graphic.attr({x:0,y:-9e9}),this.graphic.placed=!!n,e.redraw.call(this,r)},r.attrsMap={width:"width",height:"height",zIndex:"zIndex"},r}()})),e(t,"Extensions/Annotations/Annotations.js",[t["Core/Animation/AnimationUtilities.js"],t["Core/Chart/Chart.js"],t["Extensions/Annotations/Mixins/ControllableMixin.js"],t["Extensions/Annotations/Controllables/ControllableRect.js"],t["Extensions/Annotations/Controllables/ControllableCircle.js"],t["Extensions/Annotations/Controllables/ControllableEllipse.js"],t["Extensions/Annotations/Controllables/ControllablePath.js"],t["Extensions/Annotations/Controllables/ControllableImage.js"],t["Extensions/Annotations/Controllables/ControllableLabel.js"],t["Extensions/Annotations/ControlPoint.js"],t["Extensions/Annotations/Mixins/EventEmitterMixin.js"],t["Core/Globals.js"],t["Extensions/Annotations/MockPoint.js"],t["Core/Pointer.js"],t["Core/Utilities.js"]],(function(t,e,r,n,i,a,o,s,l,c,u,d,h,f,p){var m=t.getDeferredAnimation;t=e.prototype;var v=p.addEvent,y=p.defined,g=p.destroyObjectProperties,b=p.erase,w=p.extend,x=p.find,S=p.fireEvent,_=p.merge,C=p.pick,O=p.splat;p=p.wrap;var P=function(){function t(t,e){this.annotation=void 0,this.coll="annotations",this.shapesGroup=this.labelsGroup=this.labelCollector=this.group=this.graphic=this.animationConfig=this.collection=void 0,this.chart=t,this.points=[],this.controlPoints=[],this.coll="annotations",this.labels=[],this.shapes=[],this.options=_(this.defaultOptions,e),this.userOptions=e,e=this.getLabelsAndShapesOptions(this.options,e),this.options.labels=e.labels,this.options.shapes=e.shapes,this.init(t,this.options)}return t.prototype.init=function(){var t=this.chart,e=this.options.animation;this.linkPoints(),this.addControlPoints(),this.addShapes(),this.addLabels(),this.setLabelCollector(),this.animationConfig=m(t,e)},t.prototype.getLabelsAndShapesOptions=function(t,e){var r={};return["labels","shapes"].forEach((function(n){t[n]&&(r[n]=e[n]?O(e[n]).map((function(e,r){return _(t[n][r],e)})):t[n])})),r},t.prototype.addShapes=function(){(this.options.shapes||[]).forEach((function(t,e){t=this.initShape(t,e),_(!0,this.options.shapes[e],t.options)}),this)},t.prototype.addLabels=function(){(this.options.labels||[]).forEach((function(t,e){t=this.initLabel(t,e),_(!0,this.options.labels[e],t.options)}),this)},t.prototype.addClipPaths=function(){this.setClipAxes(),this.clipXAxis&&this.clipYAxis&&this.options.crop&&(this.clipRect=this.chart.renderer.clipRect(this.getClipBox()))},t.prototype.setClipAxes=function(){var t=this.chart.xAxis,e=this.chart.yAxis,r=(this.options.labels||[]).concat(this.options.shapes||[]).reduce((function(r,n){return n=n&&(n.point||n.points&&n.points[0]),[t[n&&n.xAxis]||r[0],e[n&&n.yAxis]||r[1]]}),[]);this.clipXAxis=r[0],this.clipYAxis=r[1]},t.prototype.getClipBox=function(){if(this.clipXAxis&&this.clipYAxis)return{x:this.clipXAxis.left,y:this.clipYAxis.top,width:this.clipXAxis.width,height:this.clipYAxis.height}},t.prototype.setLabelCollector=function(){var t=this;t.labelCollector=function(){return t.labels.reduce((function(t,e){return e.options.allowOverlap||t.push(e.graphic),t}),[])},t.chart.labelCollectors.push(t.labelCollector)},t.prototype.setOptions=function(t){this.options=_(this.defaultOptions,t)},t.prototype.redraw=function(t){this.linkPoints(),this.graphic||this.render(),this.clipRect&&this.clipRect.animate(this.getClipBox()),this.redrawItems(this.shapes,t),this.redrawItems(this.labels,t),r.redraw.call(this,t)},t.prototype.redrawItems=function(t,e){for(var r=t.length;r--;)this.redrawItem(t[r],e)},t.prototype.renderItems=function(t){for(var e=t.length;e--;)this.renderItem(t[e])},t.prototype.render=function(){var t=this.chart.renderer;this.graphic=t.g("annotation").attr({opacity:0,zIndex:this.options.zIndex,visibility:this.options.visible?"visible":"hidden"}).add(),this.shapesGroup=t.g("annotation-shapes").add(this.graphic),this.options.crop&&this.shapesGroup.clip(this.chart.plotBoxClip),this.labelsGroup=t.g("annotation-labels").attr({translateX:0,translateY:0}).add(this.graphic),this.addClipPaths(),this.clipRect&&this.graphic.clip(this.clipRect),this.renderItems(this.shapes),this.renderItems(this.labels),this.addEvents(),r.render.call(this)},t.prototype.setVisibility=function(t){var e=this.options,r=this.chart.navigationBindings;t=C(t,!e.visible),this.graphic.attr("visibility",t?"visible":"hidden"),t||(this.setControlPointsVisibility(!1),r.activeAnnotation===this&&r.popup&&"annotation-toolbar"===r.popup.formType&&S(r,"closePopup")),e.visible=t},t.prototype.setControlPointsVisibility=function(t){var e=function(e){e.setControlPointsVisibility(t)};r.setControlPointsVisibility.call(this,t),this.shapes.forEach(e),this.labels.forEach(e)},t.prototype.destroy=function(){var t=this.chart,e=function(t){t.destroy()};this.labels.forEach(e),this.shapes.forEach(e),this.clipYAxis=this.clipXAxis=null,b(t.labelCollectors,this.labelCollector),u.destroy.call(this),r.destroy.call(this),g(this,t)},t.prototype.remove=function(){return this.chart.removeAnnotation(this)},t.prototype.update=function(t,e){var r=this.chart,n=this.getLabelsAndShapesOptions(this.userOptions,t),i=r.annotations.indexOf(this);t=_(!0,this.userOptions,t),t.labels=n.labels,t.shapes=n.shapes,this.destroy(),this.constructor(r,t),r.options.annotations[i]=t,this.isUpdating=!0,C(e,!0)&&r.redraw(),S(this,"afterUpdate"),this.isUpdating=!1},t.prototype.initShape=function(e,r){return e=_(this.options.shapeOptions,{controlPointOptions:this.options.controlPointOptions},e),r=new t.shapesMap[e.type](this,e,r),r.itemType="shape",this.shapes.push(r),r},t.prototype.initLabel=function(t,e){return t=_(this.options.labelOptions,{controlPointOptions:this.options.controlPointOptions},t),e=new l(this,t,e),e.itemType="label",this.labels.push(e),e},t.prototype.redrawItem=function(t,e){t.linkPoints(),t.shouldBeDrawn()?(t.graphic||this.renderItem(t),t.redraw(C(e,!0)&&t.graphic.placed),t.points.length&&this.adjustVisibility(t)):this.destroyItem(t)},t.prototype.adjustVisibility=function(t){var e=!1,r=t.graphic;t.points.forEach((function(t){!1!==t.series.visible&&!1!==t.visible&&(e=!0)})),e?"hidden"===r.visibility&&r.show():r.hide()},t.prototype.destroyItem=function(t){b(this[t.itemType+"s"],t),t.destroy()},t.prototype.renderItem=function(t){t.render("label"===t.itemType?this.labelsGroup:this.shapesGroup)},t.ControlPoint=c,t.MockPoint=h,t.shapesMap={rect:n,circle:i,ellipse:a,path:o,image:s},t.types={},t}();return _(!0,P.prototype,r,u,_(P.prototype,{nonDOMEvents:["add","afterUpdate","drag","remove"],defaultOptions:{visible:!0,animation:{},crop:!0,draggable:"xy",labelOptions:{align:"center",allowOverlap:!1,backgroundColor:"rgba(0, 0, 0, 0.75)",borderColor:"#000000",borderRadius:3,borderWidth:1,className:"highcharts-no-tooltip",crop:!1,formatter:function(){return y(this.y)?this.y:"Annotation label"},includeInDataExport:!0,overflow:"justify",padding:5,shadow:!1,shape:"callout",style:{fontSize:"11px",fontWeight:"normal",color:"contrast"},useHTML:!1,verticalAlign:"bottom",x:0,y:-16},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1,fill:"rgba(0, 0, 0, 0.75)",r:0,snap:2},controlPointOptions:{symbol:"circle",width:10,height:10,style:{cursor:"pointer",fill:"#ffffff",stroke:"#000000","stroke-width":2},visible:!1,events:{}},events:{},zIndex:6}})),d.extendAnnotation=function(t,e,r,n){e=e||P,w(t.prototype,_(e.prototype,r)),t.prototype.defaultOptions=_(t.prototype.defaultOptions,n||{})},w(t,{initAnnotation:function(t){return t=new(P.types[t.type]||P)(this,t),this.annotations.push(t),t},addAnnotation:function(t,e){return t=this.initAnnotation(t),this.options.annotations.push(t.options),C(e,!0)&&(t.redraw(),t.graphic.attr({opacity:1})),t},removeAnnotation:function(t){var e=this.annotations,r="annotations"===t.coll?t:x(e,(function(e){return e.options.id===t}));r&&(S(r,"remove"),b(this.options.annotations,r.options),b(e,r),r.destroy())},drawAnnotations:function(){this.plotBoxClip.attr(this.plotBox),this.annotations.forEach((function(t){t.redraw(),t.graphic.animate({opacity:1},t.animationConfig)}))}}),t.collectionsWithUpdate.push("annotations"),t.collectionsWithInit.annotations=[t.addAnnotation],v(e,"afterInit",(function(){this.annotations=[],this.options.annotations||(this.options.annotations=[])})),t.callbacks.push((function(t){t.plotBoxClip=this.renderer.clipRect(this.plotBox),t.controlPointsGroup=t.renderer.g("control-points").attr({zIndex:99}).clip(t.plotBoxClip).add(),t.options.annotations.forEach((function(e,r){if(!t.annotations.some((function(t){return t.options===e}))){var n=t.initAnnotation(e);t.options.annotations[r]=n.options}})),t.drawAnnotations(),v(t,"redraw",t.drawAnnotations),v(t,"destroy",(function(){t.plotBoxClip.destroy(),t.controlPointsGroup.destroy()})),v(t,"exportData",(function(e){var r=(this.options.exporting&&this.options.exporting.csv||{}).columnHeaderFormatter,n=!e.dataRows[1].xValues,i=t.options.lang&&t.options.lang.exportData&&t.options.lang.exportData.annotationHeader,a=function(t){if(r){var e=r(t);if(!1!==e)return e}return e=i+" "+t,n?{columnTitle:e,topLevelColumnTitle:e}:e},o=e.dataRows[0].length,s=t.options.exporting&&t.options.exporting.csv&&t.options.exporting.csv.annotations&&t.options.exporting.csv.annotations.itemDelimiter,l=t.options.exporting&&t.options.exporting.csv&&t.options.exporting.csv.annotations&&t.options.exporting.csv.annotations.join;t.annotations.forEach((function(t){t.options.labelOptions.includeInDataExport&&t.labels.forEach((function(t){if(t.options.text){var r=t.options.text;t.points.forEach((function(t){var n=t.x,i=t.series.xAxis?t.series.xAxis.options.index:-1,a=!1;if(-1===i){t=e.dataRows[0].length;for(var c=Array(t),u=0;u<t;++u)c[u]="";c.push(r),c.xValues=[],c.xValues[i]=n,e.dataRows.push(c),a=!0}if(a||e.dataRows.forEach((function(t){!a&&t.xValues&&void 0!==i&&n===t.xValues[i]&&(l&&t.length>o?t[t.length-1]+=s+r:t.push(r),a=!0)})),!a){for(t=e.dataRows[0].length,c=Array(t),u=0;u<t;++u)c[u]="";c[0]=n,c.push(r),c.xValues=[],void 0!==i&&(c.xValues[i]=n),e.dataRows.push(c)}}))}}))}));var c=0;e.dataRows.forEach((function(t){c=Math.max(c,t.length)}));for(var u=c-e.dataRows[0].length,d=0;d<u;d++){var h=a(d+1);n?(e.dataRows[0].push(h.topLevelColumnTitle),e.dataRows[1].push(h.columnTitle)):e.dataRows[0].push(h)}}))})),p(f.prototype,"onContainerMouseDown",(function(t){this.chart.hasDraggedAnnotation||t.apply(this,Array.prototype.slice.call(arguments,1))})),d.Annotation=P,P})),e(t,"Core/Chart/ChartNavigationComposition.js",[],(function(){var t;return function(t){t.compose=function(t){return t.navigation||(t.navigation=new e(t)),t};var e=function(){function t(t){this.updates=[],this.chart=t}return t.prototype.addUpdate=function(t){this.chart.navigation.updates.push(t)},t.prototype.update=function(t,e){var r=this;this.updates.forEach((function(n){n.call(r.chart,t,e)}))},t}();t.Additions=e}(t||(t={})),t})),e(t,"Extensions/Annotations/NavigationBindings.js",[t["Extensions/Annotations/Annotations.js"],t["Core/Chart/Chart.js"],t["Core/Chart/ChartNavigationComposition.js"],t["Core/FormatUtilities.js"],t["Core/Globals.js"],t["Core/DefaultOptions.js"],t["Core/Utilities.js"]],(function(t,e,r,n,i,a,o){function s(t,e){var r=x.Element.prototype,n=r.matches||r.msMatchesSelector||r.webkitMatchesSelector,i=null;if(r.closest)i=r.closest.call(t,e);else do{if(n.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return i}function l(t){var e=t.prototype.defaultOptions.events&&t.prototype.defaultOptions.events.click;y(!0,t.prototype.defaultOptions.events,{click:function(t){var r=this,n=r.chart.navigationBindings,i=n.activeAnnotation;e&&e.call(r,t),i!==r?(n.deselectAnnotation(),n.activeAnnotation=r,r.setControlPointsVisibility(!0),h(n,"showPopup",{annotation:r,formType:"annotation-toolbar",options:n.annotationToFields(r),onSubmit:function(t){var e={};"remove"===t.actionType?(n.activeAnnotation=!1,n.chart.removeAnnotation(r)):(n.fieldsToOptions(t.fields,e),n.deselectAnnotation(),t=e.typeOptions,"measure"===r.options.type&&(t.crosshairY.enabled=0!==t.crosshairY.strokeWidth,t.crosshairX.enabled=0!==t.crosshairX.strokeWidth),r.update(e))}})):h(n,"closePopup"),t.activeAnnotation=!0}})}var c=n.format;n=a.setOptions;var u=o.addEvent,d=o.attr,h=o.fireEvent,f=o.isArray,p=o.isFunction,m=o.isNumber,v=o.isObject,y=o.merge,g=o.objectEach,b=o.pick,w=i.doc,x=i.win,S=function(){function t(t,e){this.selectedButton=this.boundClassNames=void 0,this.chart=t,this.options=e,this.eventsToUnbind=[],this.container=w.getElementsByClassName(this.options.bindingsClassName||"")}return t.prototype.initEvents=function(){var t=this,e=t.chart,r=t.container,n=t.options;t.boundClassNames={},g(n.bindings||{},(function(e){t.boundClassNames[e.className]=e})),[].forEach.call(r,(function(e){t.eventsToUnbind.push(u(e,"click",(function(r){var n=t.getButtonEvents(e,r);n&&-1===n.button.className.indexOf("highcharts-disabled-btn")&&t.bindingsButtonClick(n.button,n.events,r)})))})),g(n.events||{},(function(e,r){p(e)&&t.eventsToUnbind.push(u(t,r,e,{passive:!1}))})),t.eventsToUnbind.push(u(e.container,"click",(function(r){!e.cancelClick&&e.isInsidePlot(r.chartX-e.plotLeft,r.chartY-e.plotTop,{visiblePlotOnly:!0})&&t.bindingsChartClick(this,r)}))),t.eventsToUnbind.push(u(e.container,i.isTouchDevice?"touchmove":"mousemove",(function(e){t.bindingsContainerMouseMove(this,e)}),i.isTouchDevice?{passive:!1}:void 0))},t.prototype.initUpdate=function(){var t=this;r.compose(this.chart).navigation.addUpdate((function(e){t.update(e)}))},t.prototype.bindingsButtonClick=function(t,e,r){var n=this.chart,i=n.renderer.boxWrapper,a=!0;this.selectedButtonElement&&(this.selectedButtonElement.classList===t.classList&&(a=!1),h(this,"deselectButton",{button:this.selectedButtonElement}),this.nextEvent&&(this.currentUserDetails&&"annotations"===this.currentUserDetails.coll&&n.removeAnnotation(this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1)),a?(this.selectedButton=e,this.selectedButtonElement=t,h(this,"selectButton",{button:t}),e.init&&e.init.call(this,t,r),(e.start||e.steps)&&n.renderer.boxWrapper.addClass("highcharts-draw-mode")):(n.stockTools&&n.stockTools.toggleButtonAciveClass(t),i.removeClass("highcharts-draw-mode"),this.mouseMoveEvent=this.nextEvent=!1,this.selectedButton=null)},t.prototype.bindingsChartClick=function(t,e){t=this.chart;var r=this.activeAnnotation,n=this.selectedButton;t=t.renderer.boxWrapper,r&&(r.cancelClick||e.activeAnnotation||!e.target.parentNode||s(e.target,".highcharts-popup")?r.cancelClick&&setTimeout((function(){r.cancelClick=!1}),0):h(this,"closePopup")),n&&n.start&&(this.nextEvent?(this.nextEvent(e,this.currentUserDetails),this.steps&&(this.stepIndex++,n.steps[this.stepIndex]?this.mouseMoveEvent=this.nextEvent=n.steps[this.stepIndex]:(h(this,"deselectButton",{button:this.selectedButtonElement}),t.removeClass("highcharts-draw-mode"),n.end&&n.end.call(this,e,this.currentUserDetails),this.mouseMoveEvent=this.nextEvent=!1,this.selectedButton=null))):(this.currentUserDetails=n.start.call(this,e))&&n.steps?(this.stepIndex=0,this.steps=!0,this.mouseMoveEvent=this.nextEvent=n.steps[this.stepIndex]):(h(this,"deselectButton",{button:this.selectedButtonElement}),t.removeClass("highcharts-draw-mode"),this.steps=!1,this.selectedButton=null,n.end&&n.end.call(this,e,this.currentUserDetails)))},t.prototype.bindingsContainerMouseMove=function(t,e){this.mouseMoveEvent&&this.mouseMoveEvent(e,this.currentUserDetails)},t.prototype.fieldsToOptions=function(t,e){return g(t,(function(t,r){var n=parseFloat(t),i=r.split("."),a=e,o=i.length-1;!m(n)||t.match(/px/g)||r.match(/format/g)||(t=n),""!==t&&"undefined"!==t&&i.forEach((function(e,r){var n=b(i[r+1],"");o===r?a[e]=t:(a[e]||(a[e]=n.match(/\d/g)?[]:{}),a=a[e])}))})),e},t.prototype.deselectAnnotation=function(){this.activeAnnotation&&(this.activeAnnotation.setControlPointsVisibility(!1),this.activeAnnotation=!1)},t.prototype.annotationToFields=function(e){function r(t,n,i,s){if(i&&t&&-1===l.indexOf(n)&&(0<=(i.indexOf&&i.indexOf(n))||i[n]||!0===i))if(f(t))s[n]=[],t.forEach((function(t,e){v(t)?(s[n][e]={},g(t,(function(t,i){r(t,i,a[n],s[n][e])}))):r(t,0,a[n],s[n])}));else if(v(t)){var u={};f(s)?(s.push(u),u[n]={},u=u[n]):s[n]=u,g(t,(function(t,e){r(t,e,0===n?i:a[n],u)}))}else"format"===n?s[n]=[c(t,e.labels[0].points[0]).toString(),"text"]:f(s)?s.push([t,o(t)]):s[n]=[t,o(t)]}var n=e.options,i=t.annotationsEditable,a=i.nestedOptions,o=this.utils.getFieldType,s=b(n.type,n.shapes&&n.shapes[0]&&n.shapes[0].type,n.labels&&n.labels[0]&&n.labels[0].itemType,"label"),l=t.annotationsNonEditable[n.langKey]||[],u={langKey:n.langKey,type:s};return g(n,(function(t,e){"typeOptions"===e?(u[e]={},g(n[e],(function(t,n){r(t,n,a,u[e],!0)}))):r(t,e,i[s],u)})),u},t.prototype.getClickedClassNames=function(t,e){var r,n=e.target;for(e=[];n&&((r=d(n,"class"))&&(e=e.concat(r.split(" ").map((function(t){return[t,n]})))),n=n.parentNode,n!==t););return e},t.prototype.getButtonEvents=function(t,e){var r,n=this;return this.getClickedClassNames(t,e).forEach((function(t){n.boundClassNames[t[0]]&&!r&&(r={events:n.boundClassNames[t[0]],button:t[1]})})),r},t.prototype.update=function(t){this.options=y(!0,this.options,t),this.removeEvents(),this.initEvents()},t.prototype.removeEvents=function(){this.eventsToUnbind.forEach((function(t){t()}))},t.prototype.destroy=function(){this.removeEvents()},t.annotationsEditable={nestedOptions:{labelOptions:["style","format","backgroundColor"],labels:["style"],label:["style"],style:["fontSize","color"],background:["fill","strokeWidth","stroke"],innerBackground:["fill","strokeWidth","stroke"],outerBackground:["fill","strokeWidth","stroke"],shapeOptions:["fill","strokeWidth","stroke"],shapes:["fill","strokeWidth","stroke"],line:["strokeWidth","stroke"],backgroundColors:[!0],connector:["fill","strokeWidth","stroke"],crosshairX:["strokeWidth","stroke"],crosshairY:["strokeWidth","stroke"]},circle:["shapes"],ellipse:["shapes"],verticalLine:[],label:["labelOptions"],measure:["background","crosshairY","crosshairX"],fibonacci:[],tunnel:["background","line","height"],pitchfork:["innerBackground","outerBackground"],rect:["shapes"],crookedLine:[],basicAnnotation:["shapes","labelOptions"]},t.annotationsNonEditable={rectangle:["crosshairX","crosshairY","labelOptions"],ellipse:["labelOptions"],circle:["labelOptions"]},t}();return S.prototype.utils={getFieldType:function(t){return{string:"text",number:"number",boolean:"checkbox"}[typeof t]},updateRectSize:function(t,e){var r=e.chart,n=e.options.typeOptions,i=m(n.xAxis)&&r.xAxis[n.xAxis],a=m(n.yAxis)&&r.yAxis[n.yAxis];i&&a&&(i=i.toValue(t[i.horiz?"chartX":"chartY"]),t=a.toValue(t[a.horiz?"chartX":"chartY"]),a=i-n.point.x,n=n.point.y-t,e.update({typeOptions:{background:{width:r.inverted?n:a,height:r.inverted?a:n}}}))},getAssignedAxis:function(t){return t.filter((function(t){var e=t.axis.getExtremes(),r=e.min;e=e.max;var n=b(t.axis.minPointOffset,0);return m(r)&&m(e)&&t.value>=r-n&&t.value<=e+n&&!t.axis.options.isInternal}))[0]}},e.prototype.initNavigationBindings=function(){var t=this.options;t&&t.navigation&&t.navigation.bindings&&(this.navigationBindings=new S(this,t.navigation),this.navigationBindings.initEvents(),this.navigationBindings.initUpdate())},u(e,"load",(function(){this.initNavigationBindings()})),u(e,"destroy",(function(){this.navigationBindings&&this.navigationBindings.destroy()})),u(S,"deselectButton",(function(){this.selectedButtonElement=null})),u(t,"remove",(function(){this.chart.navigationBindings&&this.chart.navigationBindings.deselectAnnotation()})),i.Annotation&&(l(t),g(t.types,(function(t){l(t)}))),n({lang:{navigation:{popup:{simpleShapes:"Simple shapes",lines:"Lines",circle:"Circle",ellipse:"Ellipse",rectangle:"Rectangle",label:"Label",shapeOptions:"Shape options",typeOptions:"Details",fill:"Fill",format:"Text",strokeWidth:"Line width",stroke:"Line color",title:"Title",name:"Name",labelOptions:"Label options",labels:"Labels",backgroundColor:"Background color",backgroundColors:"Background colors",borderColor:"Border color",borderRadius:"Border radius",borderWidth:"Border width",style:"Style",padding:"Padding",fontSize:"Font size",color:"Color",height:"Height",shapes:"Shape options"}}},navigation:{bindingsClassName:"highcharts-bindings-container",bindings:{circleAnnotation:{className:"highcharts-circle-annotation",start:function(t){var e=this.chart.pointer.getCoordinates(t);t=this.utils.getAssignedAxis(e.xAxis),e=this.utils.getAssignedAxis(e.yAxis);var r=this.chart.options.navigation;if(t&&e)return this.chart.addAnnotation(y({langKey:"circle",type:"basicAnnotation",shapes:[{type:"circle",point:{x:t.value,y:e.value,xAxis:t.axis.options.index,yAxis:e.axis.options.index},r:5}]},r.annotationsOptions,r.bindings.circleAnnotation.annotationsOptions))},steps:[function(t,e){var r=e.options.shapes[0].point;if(m(r.xAxis)&&m(r.yAxis)){var n=this.chart.inverted,i=this.chart.xAxis[r.xAxis].toPixels(r.x);r=this.chart.yAxis[r.yAxis].toPixels(r.y),n=Math.max(Math.sqrt(Math.pow(n?r-t.chartX:i-t.chartX,2)+Math.pow(n?i-t.chartY:r-t.chartY,2)),5)}e.update({shapes:[{r:n}]})}]},ellipseAnnotation:{className:"highcharts-ellipse-annotation",start:function(t){var e=this.chart.pointer.getCoordinates(t);t=this.utils.getAssignedAxis(e.xAxis),e=this.utils.getAssignedAxis(e.yAxis);var r=this.chart.options.navigation;if(t&&e)return this.chart.addAnnotation(y({langKey:"ellipse",type:"basicAnnotation",shapes:[{type:"ellipse",xAxis:t.axis.options.index,yAxis:e.axis.options.index,points:[{x:t.value,y:e.value},{x:t.value,y:e.value}],ry:1}]},r.annotationsOptions,r.bindings.ellipseAnnotation.annotationOptions))},steps:[function(t,e){e=e.shapes[0];var r=e.getAbsolutePosition(e.points[1]);e.translatePoint(t.chartX-r.x,t.chartY-r.y,1),e.redraw(!1)},function(t,e){e=e.shapes[0];var r=e.getAbsolutePosition(e.points[0]),n=e.getAbsolutePosition(e.points[1]);t=e.getDistanceFromLine(r,n,t.chartX,t.chartY),r=e.getYAxis(),t=Math.abs(r.toValue(0)-r.toValue(t)),e.setYRadius(t),e.redraw(!1)}]},rectangleAnnotation:{className:"highcharts-rectangle-annotation",start:function(t){t=this.chart.pointer.getCoordinates(t);var e=this.utils.getAssignedAxis(t.xAxis),r=this.utils.getAssignedAxis(t.yAxis);if(e&&r){t=e.value;var n=r.value;e=e.axis.options.index,r=r.axis.options.index;var i=this.chart.options.navigation;return this.chart.addAnnotation(y({langKey:"rectangle",type:"basicAnnotation",shapes:[{type:"path",points:[{xAxis:e,yAxis:r,x:t,y:n},{xAxis:e,yAxis:r,x:t,y:n},{xAxis:e,yAxis:r,x:t,y:n},{xAxis:e,yAxis:r,x:t,y:n},{command:"Z"}]}]},i.annotationsOptions,i.bindings.rectangleAnnotation.annotationsOptions))}},steps:[function(t,e){var r=e.options.shapes[0].points,n=this.chart.pointer.getCoordinates(t);t=this.utils.getAssignedAxis(n.xAxis),n=this.utils.getAssignedAxis(n.yAxis),t&&n&&(t=t.value,n=n.value,r[1].x=t,r[2].x=t,r[2].y=n,r[3].y=n,e.update({shapes:[{points:r}]}))}]},labelAnnotation:{className:"highcharts-label-annotation",start:function(t){var e=this.chart.pointer.getCoordinates(t);t=this.utils.getAssignedAxis(e.xAxis),e=this.utils.getAssignedAxis(e.yAxis);var r=this.chart.options.navigation;if(t&&e)return this.chart.addAnnotation(y({langKey:"label",type:"basicAnnotation",labelOptions:{format:"{y:.2f}"},labels:[{point:{xAxis:t.axis.options.index,yAxis:e.axis.options.index,x:t.value,y:e.value},overflow:"none",crop:!0}]},r.annotationsOptions,r.bindings.labelAnnotation.annotationsOptions))}}},events:{},annotationsOptions:{animation:{defer:0}}}}),u(e,"render",(function(){var t=this,e=t.navigationBindings;if(t&&e){var r=!1;t.series.forEach((function(t){!t.options.isInternal&&t.visible&&(r=!0)})),g(e.boundClassNames,(function(e,n){if(t.navigationBindings&&t.navigationBindings.container&&t.navigationBindings.container[0]&&(n=t.navigationBindings.container[0].querySelectorAll("."+n)))for(var i=0;i<n.length;i++){var a=n[i],o=a.className;"normal"===e.noDataState||r?-1!==o.indexOf("highcharts-disabled-btn")&&a.classList.remove("highcharts-disabled-btn"):-1===o.indexOf("highcharts-disabled-btn")&&(a.className+=" highcharts-disabled-btn")}}))}})),u(S,"closePopup",(function(){this.deselectAnnotation()})),S})),e(t,"Extensions/Annotations/Popup.js",[t["Core/Renderer/HTML/AST.js"],t["Core/Globals.js"],t["Extensions/Annotations/NavigationBindings.js"],t["Core/DefaultOptions.js"],t["Core/Pointer.js"],t["Core/Utilities.js"]],(function(t,e,r,n,i,a){var o=e.doc,s=e.isFirefox,l=n.getOptions,c=a.addEvent,u=a.createElement,d=a.defined,h=a.fireEvent,f=a.isArray,p=a.isObject,m=a.objectEach,v=a.pick,y=a.stableSort;n=a.wrap;var g,b=/\d/g;(function(t){t[t["params.algorithm"]=0]="params.algorithm",t[t["params.average"]=1]="params.average"})(g||(g={}));var w={"algorithm-pivotpoints":["standard","fibonacci","camarilla"],"average-disparityindex":["sma","ema","dema","tema","wma"]};return n(i.prototype,"onContainerMouseDown",(function(t,e){this.inClass(e.target,"highcharts-popup")||t.apply(this,Array.prototype.slice.call(arguments,1))})),e.Popup=function(t,e,r){this.init(t,e,r)},e.Popup.prototype={init:function(t,r,n){this.chart=n,this.container=u("div",{className:"highcharts-popup highcharts-no-tooltip"},void 0,t),c(this.container,"mousedown",(function(){var t=n&&n.navigationBindings&&n.navigationBindings.activeAnnotation;if(t){t.cancelClick=!0;var r=c(e.doc,"click",(function(){setTimeout((function(){t.cancelClick=!1}),0),r()}))}})),this.lang=this.getLangpack(),this.iconsURL=r,this.addCloseBtn()},addCloseBtn:function(){var t=this,e=this.iconsURL,r=u("div",{className:"highcharts-popup-close"},void 0,this.container);r.style["background-image"]="url("+(e.match(/png|svg|jpeg|jpg|gif/gi)?e:e+"close.svg")+")",["click","touchstart"].forEach((function(e){c(r,e,(function(){t.chart?h(t.chart.navigationBindings,"closePopup"):t.closePopup()}))}))},addColsContainer:function(t){var e=u("div",{className:"highcharts-popup-lhs-col"},void 0,t);return t=u("div",{className:"highcharts-popup-rhs-col"},void 0,t),u("div",{className:"highcharts-popup-rhs-col-wrapper"},void 0,t),{lhsCol:e,rhsCol:t}},addInput:function(t,e,r,n){var i=t.split(".");i=i[i.length-1];var a=this.lang;return e="highcharts-"+e+"-"+v(n.htmlFor,i),e.match(b)||u("label",{htmlFor:e,className:n.labelClassName},void 0,r).appendChild(o.createTextNode(a[i]||i)),r=u("input",{name:e,value:n.value,type:n.type,className:"highcharts-popup-field"},void 0,r),r.setAttribute("highcharts-data-name",t),r},addButton:function(t,e,r,n,i){var a=this,s=this.closePopup,l=this.getFields,d=u("button",void 0,void 0,t);return d.appendChild(o.createTextNode(e)),i&&["click","touchstart"].forEach((function(t){c(d,t,(function(){return s.call(a),i(l(n,r))}))})),d},getFields:function(t,e){var r=Array.prototype.slice.call(t.querySelectorAll("input")),n=Array.prototype.slice.call(t.querySelectorAll("select")),i=t.querySelectorAll("#highcharts-select-series > option:checked")[0];t=t.querySelectorAll("#highcharts-select-volume > option:checked")[0];var a={actionType:e,linkedTo:i&&i.getAttribute("value")||"",fields:{}};return r.forEach((function(t){var e=t.getAttribute("highcharts-data-name");t.getAttribute("highcharts-data-series-id")?a.seriesId=t.value:e?a.fields[e]=t.value:a.type=t.value})),n.forEach((function(t){var e=t.id;"highcharts-select-series"!==e&&"highcharts-select-volume"!==e&&(e=e.split("highcharts-select-")[1],a.fields[e]=t.value)})),t&&(a.fields["params.volumeSeriesID"]=t.getAttribute("value")||""),a},showPopup:function(){var e=this.container,r=e.querySelectorAll(".highcharts-popup-close")[0];this.formType=void 0,e.innerHTML=t.emptyHTML,0<=e.className.indexOf("highcharts-annotation-toolbar")&&(e.classList.remove("highcharts-annotation-toolbar"),e.removeAttribute("style")),e.appendChild(r),e.style.display="block",e.style.height=""},closePopup:function(){v(this.popup&&this.popup.container,this.container).style.display="none"},showForm:function(t,e,r,n){e&&(this.popup=e.navigationBindings.popup,this.showPopup(),"indicators"===t&&this.indicators.addForm.call(this,e,r,n),"annotation-toolbar"===t&&this.annotations.addToolbar.call(this,e,r,n),"annotation-edit"===t&&this.annotations.addForm.call(this,e,r,n),"flag"===t&&this.annotations.addForm.call(this,e,r,n,!0),this.formType=t,this.container.style.height=this.container.offsetHeight+"px")},getLangpack:function(){return l().lang.navigation.popup},annotations:{addToolbar:function(t,e,r){var n=this,i=this.lang,a=this.popup.container,s=this.showForm;-1===a.className.indexOf("highcharts-annotation-toolbar")&&(a.className+=" highcharts-annotation-toolbar"),t&&(a.style.top=t.plotTop+10+"px"),u("span",void 0,void 0,a).appendChild(o.createTextNode(v(i[e.langKey]||e.langKey,e.shapes&&e.shapes[0].type)));var l=this.addButton(a,i.removeButton||"remove","remove",a,r);l.className+=" highcharts-annotation-remove-button",l.style["background-image"]="url("+this.iconsURL+"destroy.svg)",l=this.addButton(a,i.editButton||"edit","edit",a,(function(){s.call(n,"annotation-edit",t,e,r)})),l.className+=" highcharts-annotation-edit-button",l.style["background-image"]="url("+this.iconsURL+"edit.svg)"},addForm:function(t,e,r,n){var i=this.popup.container,a=this.lang;if(t){var s=u("h2",{className:"highcharts-popup-main-title"},void 0,i);s.appendChild(o.createTextNode(a[e.langKey]||e.langKey||"")),s=u("div",{className:"highcharts-popup-lhs-col highcharts-popup-lhs-full"},void 0,i);var l=u("div",{className:"highcharts-popup-bottom-row"},void 0,i);this.annotations.addFormFields.call(this,s,t,"",e,[],!0),this.addButton(l,n?a.addButton||"add":a.saveButton||"save",n?"add":"save",i,r)}},addFormFields:function(t,e,r,n,i,a){var l,c,d=this,h=this.annotations.addFormFields,v=this.addInput,g=this.lang;e&&(m(n,(function(n,a){l=""!==r?r+"."+a:a,p(n)&&(!f(n)||f(n)&&p(n[0])?(c=g[a]||a,c.match(b)||i.push([!0,c,t]),h.call(d,t,e,l,n,i,!1)):i.push([d,l,"annotation",t,n]))})),a&&(y(i,(function(t){return t[1].match(/format/g)?-1:1})),s&&i.reverse(),i.forEach((function(t){!0===t[0]?u("span",{className:"highcharts-annotation-title"},void 0,t[2]).appendChild(o.createTextNode(t[1])):(t[4]={value:t[4][0],type:t[4][1]},v.apply(t[0],t.splice(1)))}))))}},indicators:{addForm:function(t,e,r){var n=this.indicators,i=this.lang;if(t){this.tabs.init.call(this,t),e=this.popup.container.querySelectorAll(".highcharts-tab-item-content"),this.addColsContainer(e[0]),n.addSearchBox.call(this,t,e[0]),n.addIndicatorList.call(this,t,e[0],"add");var a=e[0].querySelectorAll(".highcharts-popup-rhs-col")[0];this.addButton(a,i.addButton||"add","add",a,r),this.addColsContainer(e[1]),n.addIndicatorList.call(this,t,e[1],"edit"),a=e[1].querySelectorAll(".highcharts-popup-rhs-col")[0],this.addButton(a,i.saveButton||"save","edit",a,r),this.addButton(a,i.removeButton||"remove","remove",a,r)}},filterSeries:function(t,e){var r,n=this.indicators,i=this.chart&&this.chart.options.lang,a=i&&i.navigation&&i.navigation.popup&&i.navigation.popup.indicatorAliases,o=[];return m(t,(function(t,i){var s=t.options;if(t.params||s&&s.params)if(s=n.getNameType(t,i),i=s.indicatorFullName,s=s.indicatorType,e){var l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");l=new RegExp(l,"i");var c=a&&a[s]&&a[s].join(" ")||"";(i.match(l)||c.match(l))&&(r={indicatorFullName:i,indicatorType:s,series:t},o.push(r))}else r={indicatorFullName:i,indicatorType:s,series:t},o.push(r)})),o},filterSeriesArray:function(t){var e,r=[];return t.forEach((function(t){t.is("sma")&&(e={indicatorFullName:t.name,indicatorType:t.type,series:t},r.push(e))})),r},addIndicatorList:function(e,r,n,i){var a=this,s=a.indicators,l=a.lang,d=r.querySelectorAll(".highcharts-popup-lhs-col")[0];r=r.querySelectorAll(".highcharts-popup-rhs-col")[0];var h="edit"===n,p=this.indicators.addFormFields;if(n=h?e.series:e.options.plotOptions||{},e||!n){var m,v=[];h||f(n)?f(n)&&(v=s.filterSeriesArray.call(this,n)):v=s.filterSeries.call(this,n,i),y(v,(function(t,e){return t=t.indicatorFullName.toLowerCase(),e=e.indicatorFullName.toLowerCase(),t<e?-1:t>e?1:0})),d.children[1]&&d.children[1].remove();var g=u("ul",{className:"highcharts-indicator-list"},void 0,d),b=r.querySelectorAll(".highcharts-popup-rhs-col-wrapper")[0];v.forEach((function(t){var r=t.indicatorFullName,n=t.indicatorType,i=t.series;m=u("li",{className:"highcharts-indicator-list"},void 0,g),m.appendChild(o.createTextNode(r)),["click","touchstart"].forEach((function(t){c(m,t,(function(){var t=b.parentNode.children[1];p.call(a,e,i,n,b),t&&(t.style.display="block"),h&&i.options&&u("input",{type:"hidden",name:"highcharts-id-"+n,value:i.options.id},void 0,b).setAttribute("highcharts-data-series-id",i.options.id)}))}))})),0<g.childNodes.length?g.childNodes[0].click():h||(t.setElementHTML(b.parentNode.children[0],l.noFilterMatch||""),b.parentNode.children[1].style.display="none")}},addSearchBox:function(t,e){var r=this,n=e.querySelectorAll(".highcharts-popup-lhs-col")[0];e=this.lang.clearFilter,n=u("div",{className:"highcharts-input-wrapper"},void 0,n);var i=function(e){r.indicators.addIndicatorList.call(r,t,r.container,"add",e)},a=this.addInput("searchIndicators","input",n,{value:"",type:"text",htmlFor:"search-indicators",labelClassName:"highcharts-input-search-indicators-label"}),o=u("a",{textContent:e},void 0,n);a.classList.add("highcharts-input-search-indicators"),o.classList.add("clear-filter-button"),c(a,"input",(function(t){i(this.value),o.style.display=this.value.length?"inline-block":"none"})),["click","touchstart"].forEach((function(t){c(o,t,(function(){a.value="",i(""),o.style.display="none"}))}))},addSelection:function(t,e,r){var n=e.split(".");n=n[n.length-1],t="highcharts-"+e+"-type-"+t;var i=this.lang;return u("label",{htmlFor:t},null,r).appendChild(o.createTextNode(i[n]||e)),r=u("select",{name:t,className:"highcharts-popup-field",id:"highcharts-select-"+e},null,r),r.setAttribute("id","highcharts-select-"+e),r},addSelectionOptions:function(t,e,r,n,i,a,s){"series"===e||"volume"===e?t.series.forEach((function(t){var n=t.options,i=n.name||n.params?t.name:n.id||"";"highcharts-navigator-series"!==n.id&&n.id!==(s&&s.options&&s.options.id)&&(d(a)||"volume"!==e||"column"!==t.type||(a=n.id),u("option",{value:n.id},void 0,r).appendChild(o.createTextNode(i)))})):n&&i&&w[i+"-"+n].forEach((function(t){u("option",{value:t},void 0,r).appendChild(o.createTextNode(t))})),d(a)&&(r.value=a)},getNameType:function(t,r){var n=t.options,i=e.seriesTypes;return i=i[r]&&i[r].prototype.nameBase||r.toUpperCase(),n&&n.type&&(r=t.options.type,i=t.name),{indicatorFullName:i,indicatorType:r}},listAllSeries:function(t,e,r,n,i,a){var o=this.indicators;r&&(t=o.addSelection.call(this,t,e,n),o.addSelectionOptions.call(this,r,e,t,void 0,void 0,void 0,i),d(a)&&(t.value=a))},addFormFields:function(e,r,n,i){var a=r.params||r.options.params,s=this.indicators.getNameType;i.innerHTML=t.emptyHTML,u("h3",{className:"highcharts-indicator-title"},void 0,i).appendChild(o.createTextNode(s(r,n).indicatorFullName)),u("input",{type:"hidden",name:"highcharts-type-"+n,value:n},void 0,i),this.indicators.listAllSeries.call(this,n,"series",e,i,r,r.linkedParent&&r.linkedParent.options.id),a.volumeSeriesID&&this.indicators.listAllSeries.call(this,n,"volume",e,i,r,r.linkedParent&&a.volumeSeriesID),this.indicators.addParamInputs.call(this,e,"params",a,n,i)},addParamInputs:function(t,e,r,n,i){var a,o=this,s=o.indicators,l=this.indicators.addParamInputs,c=this.addInput;t&&m(r,(function(r,u){if(a=e+"."+u,d(r)&&a)if(p(r)&&(c.call(o,a,n,i,{}),l.call(o,t,a,r,n,i)),a in g){var h=s.addSelection.call(o,n,a,i);s.addSelectionOptions.call(o,t,e,h,n,u,r)}else"params.volumeSeriesID"===a||f(r)||c.call(o,a,n,i,{value:r,type:"text"})}))},getAmount:function(){var t=0;return this.series.forEach((function(e){var r=e.options;(e.params||r&&r.params)&&t++})),t}},tabs:{init:function(t){var e=this.tabs,r=this.indicators.getAmount.call(t);t&&(t=e.addMenuItem.call(this,"add"),e.addMenuItem.call(this,"edit",r),e.addContentItem.call(this,"add"),e.addContentItem.call(this,"edit"),e.switchTabs.call(this,r),e.selectTab.call(this,t,0))},addMenuItem:function(t,e){var r=this.popup.container,n="highcharts-tab-item",i=this.lang;return 0===e&&(n+=" highcharts-tab-disabled"),e=u("span",{className:n},void 0,r),e.appendChild(o.createTextNode(i[t+"Button"]||t)),e.setAttribute("highcharts-data-tab-type",t),e},addContentItem:function(){return u("div",{className:"highcharts-tab-item-content highcharts-no-mousewheel"},void 0,this.popup.container)},switchTabs:function(t){var e,r=this;this.popup.container.querySelectorAll(".highcharts-tab-item").forEach((function(n,i){e=n.getAttribute("highcharts-data-tab-type"),"edit"===e&&0===t||["click","touchstart"].forEach((function(t){c(n,t,(function(){r.tabs.deselectAll.call(r),r.tabs.selectTab.call(r,this,i)}))}))}))},selectTab:function(t,e){var r=this.popup.container.querySelectorAll(".highcharts-tab-item-content");t.className+=" highcharts-tab-item-active",r[e].className+=" highcharts-tab-item-show"},deselectAll:function(){var t,e=this.popup.container,r=e.querySelectorAll(".highcharts-tab-item");for(e=e.querySelectorAll(".highcharts-tab-item-content"),t=0;t<r.length;t++)r[t].classList.remove("highcharts-tab-item-active"),e[t].classList.remove("highcharts-tab-item-show")}}},c(r,"showPopup",(function(t){this.popup||(this.popup=new e.Popup(this.chart.container,this.chart.options.navigation.iconsURL||this.chart.options.stockTools&&this.chart.options.stockTools.gui.iconsURL||"https://code.highcharts.com/10.0.0/gfx/stock-icons/",this.chart)),this.popup.showForm(t.formType,this.chart,t.options,t.onSubmit)})),c(r,"closePopup",(function(){this.popup&&this.popup.closePopup()})),e.Popup})),e(t,"masters/modules/annotations.src.js",[],(function(){}))}))},"5b57":function(t,e,r){},"5ba5":function(t,e,r){},"5e66":function(t,e,r){"use strict";r("63b7");var n=r("f665"),i=r("afdd"),a=r("9d26"),o=r("37c6"),s=r("3860"),l=r("80d2"),c=r("d9bd");e["a"]=n["a"].extend({name:"v-carousel",props:{continuous:{type:Boolean,default:!0},cycle:Boolean,delimiterIcon:{type:String,default:"$delimiter"},height:{type:[Number,String],default:500},hideDelimiters:Boolean,hideDelimiterBackground:Boolean,interval:{type:[Number,String],default:6e3,validator:t=>t>0},mandatory:{type:Boolean,default:!0},progress:Boolean,progressColor:String,showArrows:{type:Boolean,default:!0},verticalDelimiters:{type:String,default:void 0}},provide(){return{parentTheme:this.theme}},data(){return{internalHeight:this.height,slideTimeout:void 0}},computed:{classes(){return{...n["a"].options.computed.classes.call(this),"v-carousel":!0,"v-carousel--hide-delimiter-background":this.hideDelimiterBackground,"v-carousel--vertical-delimiters":this.isVertical}},isDark(){return this.dark||!this.light},isVertical(){return null!=this.verticalDelimiters}},watch:{internalValue:"restartTimeout",interval:"restartTimeout",height(t,e){t!==e&&t&&(this.internalHeight=t)},cycle(t){t?this.restartTimeout():(clearTimeout(this.slideTimeout),this.slideTimeout=void 0)}},created(){this.$attrs.hasOwnProperty("hide-controls")&&Object(c["a"])("hide-controls",':show-arrows="false"',this)},mounted(){this.startTimeout()},methods:{genControlIcons(){return this.isVertical?null:n["a"].options.methods.genControlIcons.call(this)},genDelimiters(){return this.$createElement("div",{staticClass:"v-carousel__controls",style:{left:"left"===this.verticalDelimiters&&this.isVertical?0:"auto",right:"right"===this.verticalDelimiters?0:"auto"}},[this.genItems()])},genItems(){const t=this.items.length,e=[];for(let r=0;r<t;r++){const n=this.$createElement(i["a"],{staticClass:"v-carousel__controls__item",attrs:{"aria-label":this.$vuetify.lang.t("$vuetify.carousel.ariaLabel.delimiter",r+1,t)},props:{icon:!0,small:!0,value:this.getValue(this.items[r],r)}},[this.$createElement(a["a"],{props:{size:18}},this.delimiterIcon)]);e.push(n)}return this.$createElement(s["a"],{props:{value:this.internalValue,mandatory:this.mandatory},on:{change:t=>{this.internalValue=t}}},e)},genProgress(){return this.$createElement(o["a"],{staticClass:"v-carousel__progress",props:{color:this.progressColor,value:(this.internalIndex+1)/this.items.length*100}})},restartTimeout(){this.slideTimeout&&clearTimeout(this.slideTimeout),this.slideTimeout=void 0,window.requestAnimationFrame(this.startTimeout)},startTimeout(){this.cycle&&(this.slideTimeout=window.setTimeout(this.next,+this.interval>0?+this.interval:6e3))}},render(t){const e=n["a"].options.render.call(this,t);return e.data.style=`height: ${Object(l["i"])(this.height)};`,this.hideDelimiters||e.children.push(this.genDelimiters()),(this.progress||this.progressColor)&&e.children.push(this.genProgress()),e}})},"616f":function(t,e){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s="fae3")}({"01f9":function(t,e,r){"use strict";var n=r("2d00"),i=r("5ca1"),a=r("2aba"),o=r("32e9"),s=r("84f2"),l=r("41a0"),c=r("7f20"),u=r("38fd"),d=r("2b4c")("iterator"),h=!([].keys&&"next"in[].keys()),f="@@iterator",p="keys",m="values",v=function(){return this};t.exports=function(t,e,r,y,g,b,w){l(r,e,y);var x,S,_,C=function(t){if(!h&&t in k)return k[t];switch(t){case p:return function(){return new r(this,t)};case m:return function(){return new r(this,t)}}return function(){return new r(this,t)}},O=e+" Iterator",P=g==m,D=!1,k=t.prototype,T=k[d]||k[f]||g&&k[g],j=T||C(g),E=g?P?C("entries"):j:void 0,I="Array"==e&&k.entries||T;if(I&&(_=u(I.call(new t)),_!==Object.prototype&&_.next&&(c(_,O,!0),n||"function"==typeof _[d]||o(_,d,v))),P&&T&&T.name!==m&&(D=!0,j=function(){return T.call(this)}),n&&!w||!h&&!D&&k[d]||o(k,d,j),s[e]=j,s[O]=v,g)if(x={values:P?j:C(m),keys:b?j:C(p),entries:E},w)for(S in x)S in k||a(k,S,x[S]);else i(i.P+i.F*(h||D),e,x);return x}},"0d58":function(t,e,r){var n=r("ce10"),i=r("e11e");t.exports=Object.keys||function(t){return n(t,i)}},1495:function(t,e,r){var n=r("86cc"),i=r("cb7c"),a=r("0d58");t.exports=r("9e1e")?Object.defineProperties:function(t,e){i(t);var r,o=a(e),s=o.length,l=0;while(s>l)n.f(t,r=o[l++],e[r]);return t}},"230e":function(t,e,r){var n=r("d3f4"),i=r("7726").document,a=n(i)&&n(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},"2aba":function(t,e,r){var n=r("7726"),i=r("32e9"),a=r("69a8"),o=r("ca5a")("src"),s=r("fa5b"),l="toString",c=(""+s).split(l);r("8378").inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,r,s){var l="function"==typeof r;l&&(a(r,"name")||i(r,"name",e)),t[e]!==r&&(l&&(a(r,o)||i(r,o,t[e]?""+t[e]:c.join(String(e)))),t===n?t[e]=r:s?t[e]?t[e]=r:i(t,e,r):(delete t[e],i(t,e,r)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[o]||s.call(this)}))},"2aeb":function(t,e,r){var n=r("cb7c"),i=r("1495"),a=r("e11e"),o=r("613b")("IE_PROTO"),s=function(){},l="prototype",c=function(){var t,e=r("230e")("iframe"),n=a.length,i="<",o=">";e.style.display="none",r("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+o+"document.F=Object"+i+"/script"+o),t.close(),c=t.F;while(n--)delete c[l][a[n]];return c()};t.exports=Object.create||function(t,e){var r;return null!==t?(s[l]=n(t),r=new s,s[l]=null,r[o]=t):r=c(),void 0===e?r:i(r,e)}},"2b4c":function(t,e,r){var n=r("5537")("wks"),i=r("ca5a"),a=r("7726").Symbol,o="function"==typeof a,s=t.exports=function(t){return n[t]||(n[t]=o&&a[t]||(o?a:i)("Symbol."+t))};s.store=n},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},"32e9":function(t,e,r){var n=r("86cc"),i=r("4630");t.exports=r("9e1e")?function(t,e,r){return n.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},"38fd":function(t,e,r){var n=r("69a8"),i=r("4bf8"),a=r("613b")("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),n(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},"41a0":function(t,e,r){"use strict";var n=r("2aeb"),i=r("4630"),a=r("7f20"),o={};r("32e9")(o,r("2b4c")("iterator"),(function(){return this})),t.exports=function(t,e,r){t.prototype=n(o,{next:i(1,r)}),a(t,e+" Iterator")}},4588:function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"4bf8":function(t,e,r){var n=r("be13");t.exports=function(t){return Object(n(t))}},5537:function(t,e,r){var n=r("8378"),i=r("7726"),a="__core-js_shared__",o=i[a]||(i[a]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:n.version,mode:r("2d00")?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"5ca1":function(t,e,r){var n=r("7726"),i=r("8378"),a=r("32e9"),o=r("2aba"),s=r("9b43"),l="prototype",c=function(t,e,r){var u,d,h,f,p=t&c.F,m=t&c.G,v=t&c.S,y=t&c.P,g=t&c.B,b=m?n:v?n[e]||(n[e]={}):(n[e]||{})[l],w=m?i:i[e]||(i[e]={}),x=w[l]||(w[l]={});for(u in m&&(r=e),r)d=!p&&b&&void 0!==b[u],h=(d?b:r)[u],f=g&&d?s(h,n):y&&"function"==typeof h?s(Function.call,h):h,b&&o(b,u,h,t&c.U),w[u]!=h&&a(w,u,f),y&&x[u]!=h&&(x[u]=h)};n.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},"613b":function(t,e,r){var n=r("5537")("keys"),i=r("ca5a");t.exports=function(t){return n[t]||(n[t]=i(t))}},"626a":function(t,e,r){var n=r("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},6821:function(t,e,r){var n=r("626a"),i=r("be13");t.exports=function(t){return n(i(t))}},"69a8":function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},"6a99":function(t,e,r){var n=r("d3f4");t.exports=function(t,e){if(!n(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!n(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},7726:function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},"77f1":function(t,e,r){var n=r("4588"),i=Math.max,a=Math.min;t.exports=function(t,e){return t=n(t),t<0?i(t+e,0):a(t,e)}},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"7f20":function(t,e,r){var n=r("86cc").f,i=r("69a8"),a=r("2b4c")("toStringTag");t.exports=function(t,e,r){t&&!i(t=r?t:t.prototype,a)&&n(t,a,{configurable:!0,value:e})}},"7f7f":function(t,e,r){var n=r("86cc").f,i=Function.prototype,a=/^\s*function ([^ (]*)/,o="name";o in i||r("9e1e")&&n(i,o,{configurable:!0,get:function(){try{return(""+this).match(a)[1]}catch(t){return""}}})},8378:function(t,e){var r=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=r)},"84f2":function(t,e){t.exports={}},"86cc":function(t,e,r){var n=r("cb7c"),i=r("c69a"),a=r("6a99"),o=Object.defineProperty;e.f=r("9e1e")?Object.defineProperty:function(t,e,r){if(n(t),e=a(e,!0),n(r),i)try{return o(t,e,r)}catch(s){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},"9b43":function(t,e,r){var n=r("d8e8");t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}},"9c6c":function(t,e,r){var n=r("2b4c")("unscopables"),i=Array.prototype;void 0==i[n]&&r("32e9")(i,n,{}),t.exports=function(t){i[n][t]=!0}},"9def":function(t,e,r){var n=r("4588"),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},"9e1e":function(t,e,r){t.exports=!r("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},ac6a:function(t,e,r){for(var n=r("cadf"),i=r("0d58"),a=r("2aba"),o=r("7726"),s=r("32e9"),l=r("84f2"),c=r("2b4c"),u=c("iterator"),d=c("toStringTag"),h=l.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(f),m=0;m<p.length;m++){var v,y=p[m],g=f[y],b=o[y],w=b&&b.prototype;if(w&&(w[u]||s(w,u,h),w[d]||s(w,d,y),l[y]=h,g))for(v in n)w[v]||a(w,v,n[v],!0)}},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},c366:function(t,e,r){var n=r("6821"),i=r("9def"),a=r("77f1");t.exports=function(t){return function(e,r,o){var s,l=n(e),c=i(l.length),u=a(o,c);if(t&&r!=r){while(c>u)if(s=l[u++],s!=s)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===r)return t||u||0;return!t&&-1}}},c69a:function(t,e,r){t.exports=!r("9e1e")&&!r("79e5")((function(){return 7!=Object.defineProperty(r("230e")("div"),"a",{get:function(){return 7}}).a}))},ca5a:function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},cadf:function(t,e,r){"use strict";var n=r("9c6c"),i=r("d53b"),a=r("84f2"),o=r("6821");t.exports=r("01f9")(Array,"Array",(function(t,e){this._t=o(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?r:"values"==e?t[r]:[r,t[r]])}),"values"),a.Arguments=a.Array,n("keys"),n("values"),n("entries")},cb7c:function(t,e,r){var n=r("d3f4");t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},ce10:function(t,e,r){var n=r("69a8"),i=r("6821"),a=r("c366")(!1),o=r("613b")("IE_PROTO");t.exports=function(t,e){var r,s=i(t),l=0,c=[];for(r in s)r!=o&&n(s,r)&&c.push(r);while(e.length>l)n(s,r=e[l++])&&(~a(c,r)||c.push(r));return c}},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d53b:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},e11e:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f6fd:function(t,e){(function(t){var e="currentScript",r=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(n){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(t in r)if(r[t].src==e||"interactive"==r[t].readyState)return r[t];return null}}})})(document)},fa5b:function(t,e,r){t.exports=r("5537")("native-function-to-string",Function.toString)},fab2:function(t,e,r){var n=r("7726").document;t.exports=n&&n.documentElement},fae3:function(t,e,r){"use strict";var n;(r.r(e),r.d(e,"longClickDirective",(function(){return a})),"undefined"!==typeof window)&&(r("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(r.p=n[1]));r("ac6a"),r("7f7f");var i=function(t){var e=t.delay,r=void 0===e?400:e,n=t.interval,i=void 0===n?50:n;return{bind:function(t,e,n){if("function"!==typeof e.value){var a=n.context.name,o="[longclick:] provided expression '".concat(e.expression,"' is not a function, but has to be");a&&(o+="Found in component '".concat(a,"' ")),console.warn(o)}var s=null,l=null,c=function(t){"click"===t.type&&0!==t.button||null===s&&(s=setTimeout((function(){i&&i>0&&(l=setInterval((function(){d()}),i)),d()}),r))},u=function(){null!==s&&(clearTimeout(s),s=null),l&&(clearInterval(l),l=null)},d=function(t){e.value(t)};["mousedown","touchstart"].forEach((function(e){return t.addEventListener(e,c)})),["click","mouseout","touchend","touchcancel"].forEach((function(e){return t.addEventListener(e,u)}))}}},a=i}})},"63b3":function(t,e,r){"use strict";r("6ae8")},"63b7":function(t,e,r){},"63f9":function(t,e,r){},"664b":function(t,e,r){},"664e":function(t,e,r){"use strict";r("ab5f")},"67b4":function(t,e,r){"use strict";var n=r("0798"),i=r("8336"),a=r("b0af"),o=r("99d9"),s=r("169a"),l=r("132d"),c=r("1f4f"),u=r("3129"),d=r("2fa4"),h=r("3a2f"),f=function(){var t=this,e=t._self._c;return e(s["a"],{attrs:{persistent:"",width:"600",id:"registerDumpDialog"},model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[e(a["a"],{attrs:{loading:t.isLoading}},[t.isDeadCortex?e(n["a"],{attrs:{type:"error",dense:"",outlined:""}},[t._v("\n      ECU Cortex Board Malfunctioning - Please Replace\n    ")]):t._e(),t.isInBootloaderMode?e(n["a"],{attrs:{type:"error",dense:"",outlined:""}},[t._v("\n      Stuck in Bootloader Mode. Please re-flash the ECU board firmware.\n    ")]):t._e(),e(o["d"],[e("h2",[t._v("Current Register Values for "+t._s(t.platformGroupName))]),e(d["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(o["c"],[e("h3",{staticStyle:{"text-align":"center"}},[t._v("Controller "+t._s(t.controller_id))]),t.data?e(c["a"],{staticClass:"hexTable"},[e("tr",t._l(16,(function(r){return e("th",{key:r},[t._v("\n            "+t._s((r-1).toString(16))+"\n          ")])})),0),t._l(8,(function(r){return e("tr",{key:"row"+r},t._l(16,(function(n){return e("td",{key:"r"+r+"c"+n,class:t.data[r-1][n-1].class},[t.data[r-1][n-1].message?e(h["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(i){var a=i.on;i.attrs;return[e("div",t._g({},a),[t._v("\n                  "+t._s(t.data[r-1][n-1].value)+"\n                ")])]}}],null,!0)},[e("span",[t._v(t._s(t.data[r-1][n-1].message))])]):e("span",[t._v("\n              "+t._s(t.data[r-1][n-1].value)+"\n            ")])],1)})),0)}))],2):e(u["a"],{attrs:{type:"table-row@4"}})],1)],1)],1)},p=[],m=r("d0eb"),v=(r("c1df"),r("d67f")),y=r("2f62");r("ea10");function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function b(t,e){return C(t)||_(t,e)||x(t,e)||w()}function w(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){if(t){if("string"==typeof t)return S(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function C(t){if(Array.isArray(t))return t}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return(e=k(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k(t){var e=T(t,"string");return"symbol"==g(e)?e:e+""}function T(t,e){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var j={name:"RegisterDump",props:[],components:{},beforeMount:function(){},mounted:function(){},data:function(){return{isDeadCortex:!1,showDialog:!1,isLoading:!1,data:null,eventSource:null,platformGroupName:null,controller_id:null,timeout:null,isInBootloaderMode:!1,attrs:{boilerplate:!0}}},computed:P({},Object(y["c"])(["getUser"])),watch:{controller_id:function(t,e){t&&this.refresh()}},methods:{onClose:function(){this.eventSource&&this.stopListening(),this.showDialog=!1,this.controller_id=null},stopListening:function(){this.eventSource.removeEventListener("data",this.handleMessage),this.eventSource.close(),this.eventSource=null,this.isLoading=!1},show:function(t,e){this.controller_id=t,this.platformGroupName=e,this.showDialog=!0},handleMessage:function(t){clearTimeout(this.timeout),this.isLoading=!1,this.isDeadCortex=!1,this.isInBootloaderMode=!1;var e=JSON.parse(t.data).data;e.controller_id==this.controller_id&&this.stopListening();var r=JSON.parse(e.json),n=[],i=[];for(var a in r)i[parseInt(a)]=parseInt(r[a]);for(var o=0;o<i.length/16;o++)n[o]=[];for(var s=0;s<i.length;s++){var l=Math.floor(s/16),c=i[s].toString(16).toUpperCase();1==c.length&&(c="0"+c),n[l].push({value:c,class:"dcell",message:null})}for(var u=[{row:0,col:3,invalidValue:"XX",message:"ECU board problem"},{row:0,col:3,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:0,col:3,invalidValue:"00",message:"Sensor or i2c cable problem"},{row:0,col:4,invalidValue:"XX",message:"ECU board problem"},{row:0,col:4,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:0,col:4,invalidValue:"00",message:"Sensor or i2c cable problem"},{row:0,col:5,invalidValue:"XX",message:"ECU board problem"},{row:0,col:5,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:0,col:5,invalidValue:"00",message:"Sensor or i2c cable problem"},{row:0,col:6,invalidValue:"XX",message:"ECU board problem"},{row:0,col:6,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:0,col:6,invalidValue:"00",message:"Sensor or i2c cable problem"},{row:0,col:7,invalidValue:"XX",message:"ECU board problem"},{row:0,col:7,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:0,col:7,invalidValue:"00",message:"Sensor or i2c cable problem"},{row:2,col:8,invalidValue:"XX",message:"ECU board problem"},{row:2,col:8,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:2,col:9,invalidValue:"XX",message:"ECU board problem"},{row:2,col:9,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:2,col:10,invalidValue:"XX",message:"ECU board problem"},{row:2,col:10,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:2,col:11,invalidValue:"XX",message:"ECU board problem"},{row:2,col:11,invalidValue:"FF",message:"Sensor or i2c cable problem"},{row:2,col:12,invalidValue:"XX",message:"ECU board problem"},{row:2,col:12,invalidValue:"FF",message:"Sensor or i2c cable problem"}],d=0;d<u.length;d++){var h=n[u[d].row][u[d].col];h.value==u[d].invalidValue&&(h.class+=" alert",h.message=u[d].message)}switch(n[3][2].message="Version number of VFU",n[3][2].class+=" info",n[3][2].value){case"36":"11"!=n[0][15].value&&(n[0][15].class+=" alert",n[0][15].message="Sensor board and relay board not detected"),"03"!=n[4][14].value&&(n[4][14].class+=" alert",n[4][14].message="Bus is not functioning correctly")}for(var f=!0,p=0;p<n.length;p++){for(var m=0;m<n[p].length;m++)if("XX"!=n[p][m].value){f=!1;break}if(!f)break}f&&(this.isDeadCortex=!0),"01"==n[0][0].value&&"1F"==n[0][1].value&&"01"==n[0][2].value&&"1F"==n[0][3].value&&"01"==n[0][4].value&&"1F"==n[0][5].value&&(this.isInBootloaderMode=!0),this.data=n},refresh:function(){var t=this;t.isLoading=!0,t.data=null;var e=Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"}),r="".concat(e.VUE_APP_trimaster,"/api/v1/registerDumps/change-stream?_format=event-stream&access_token=")+this.getUser.apitoken;this.eventSource=new EventSource(r),this.eventSource.addEventListener("data",this.handleMessage),m["a"].post("controllerCommands",this.getUser.apitoken,{controller_id:this.controller_id,user_id:this.getUser.id,action_id:106}).then((function(e){var r=b(e,2),n=r[0];r[1];n?t.timeout=setTimeout((function(){t.timeout=null,t.isLoading=!1,v["a"].error("No data could be loaded. Please try again later."),t.onClose()}),5e3):(t.isLoading=!1,v["a"].error("An error occurred. Please try again later."))}))}}},E=j,I=(r("36a5"),r("2877")),L=Object(I["a"])(E,f,p,!1,null,null,null);e["a"]=L.exports},6841:function(t,e,r){"use strict";var n=r("cd55"),i=r("49e2"),a=r("c865"),o=function(){var t=this,e=t._self._c;return e(n["a"],{directives:[{name:"show",rawName:"v-show",value:t.isVisibleDisplayUnitType,expression:"isVisibleDisplayUnitType"}],staticClass:"flex-grow-auto flex-column",class:{"d-flex":t.isVisibleDisplayUnitType}},[e(a["a"],{staticClass:"d-flex justify-between"},[e("span",{staticClass:"flex-grow-auto"},[t._v(t._s(t.displayUnits.length)+" Plant Platforms")])]),e(i["a"],{staticClass:"flex-grow-auto"},[e("unit-results",{attrs:{"display-units":t.displayUnits}})],1),e("edit-phase-modal",{on:{refresh:t.refresh},model:{value:t.growPhase_id,callback:function(e){t.growPhase_id=e},expression:"growPhase_id"}})],1)},s=[],l=r("c1df"),c=r.n(l),u=r("ab66"),d=r("b3c5"),h=r("ea10"),f=r("d0eb"),p=r("d67f"),m=r("2f62"),v=r("a9b3"),y=r("8ac5"),g=r("12ad");function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){return O(t)||C(t,e)||S(t,e)||x()}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function O(t){if(Array.isArray(t))return t}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=j(t,"string");return"symbol"==b(e)?e:e+""}function j(t,e){if("object"!=b(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var E={name:"PlantPlatformExpansionPanel",mixins:[v["a"]],components:{UnitResults:g["a"],LifecyclePlatforms:y["a"],LockedColumnDatatable:u["a"],EditPhaseModal:d["a"]},props:{selectedDisplayTypes:{type:Array,required:!1,default:function(){return[]}},displayUnits:{type:Array,required:!1,default:function(){return[]}},maximizedDisplayType:{type:Number,required:!1,default:function(){return null}},isLockingEnabled:{type:Boolean,required:!1,default:function(){return!1}},isLockingColumns:{type:Boolean,required:!1,default:function(){return!1}},displayUnitsLoading:{type:Boolean,required:!1,default:function(){return!1}},searchText:{type:String,required:!1,default:function(){return""}}},data:function(){return{moment:c.a,pagination:{itemsPerPage:250},footerprops:{"items-per-page-options":[25,50,75,100,250]},displayUnitsHeaders:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],displayUnitsExpanded:[],growPhase_id:null,isAdmin:!1}},computed:D(D({},Object(m["c"])(["getUser"])),{},{isVisibleDisplayUnitType:function(){return this.selectedDisplayTypes.find((function(t){return 2===t.id}))&&this.displayUnits&&this.displayUnits.length&&(!this.maximizedDisplayType||2===this.maximizedDisplayType)},filteredDisplayUnits:function(){var t=this;return""!==this.searchText&&this.searchText?this.displayUnits.filter((function(e){return e.platformGroupName.toLowerCase().includes(t.searchText.toLowerCase())})):this.displayUnits}}),beforeMount:function(){this.isAdmin=f["a"].isAdmin(this.getUser)||f["a"].isUserInRole(this.getUser,"Maintenance")},watch:{filteredDisplayUnits:function(){""!==this.searchText&&this.$emit("searched-length",this.filteredDisplayUnits.length)}},methods:{isExpanded:function(t){var e=this.displayUnitsExpanded.find((function(e){return e.id===t.id}));return!!e},fullscreenPanel:function(){this.$emit("fullscreen-panel",2)},minimizePanel:function(){this.$emit("minimize-panel")},refresh:function(){this.$emit("refresh")},goToDevice:function(){},onShowDisplayUnitLifecycle:function(t){var e=this.displayUnitsExpanded.findIndex((function(e){return e.platformGroup_id===t.platformGroup_id}));-1===e?this.displayUnitsExpanded.push(t):this.displayUnitsExpanded.splice(e,1)},createOperationalTask2:function(t,e){this.$router.push({name:"operational-task",params:{growplanId:t,lifecycleId:e}})},onEditPhase:function(t){this.growPhase_id=t.id},onToggleLifecycle:function(t){var e=this,r="";r=t.isSuspended?"Resume Lifecycle  "+t.lifecycle_id+"?":"Suspend Lifecycle  "+t.lifecycle_id+"?",h["a"].confirm("Please Confirm",r,(function(r){r&&f["a"].post("ag_lifecycles/toggleSuspend",e.getUser.apitoken,{lifecycle_id:t.lifecycle_id}).then((function(e){var r=w(e,2),n=r[0];r[1];n?(p["a"].success("Function Complete"),t.isSuspended=!t.isSuspended):p["a"].error("An error occurred. Please try again later")}))}))},getPhotoPeriodText:function(t){var e="Photo period: "+t.currentPhase.photoperiod+" hours at ";return t.currentPhase.photoPeriodIntensity!==t.currentPhase.photoPeriodInterlightIntensity?(e+=100*t.currentPhase.photoPeriodIntensity+"% Downlight, ",e+=Math.round(100*t.currentPhase.photoPeriodInterlightIntensity)+"% Interlight intensity, "):e+=Math.round(100*t.currentPhase.photoPeriodIntensity)+"% intensity, ",e+="starting at "+this.convertTime(t.currentPhase.photoperiodStartTime)+".",e},convertTime:function(t){return 12===+this.$root.timePreference?c.a.utc(t,"HH:mm").add(this.getUser.facility_UTCOffset,"hours").format("h:mm a"):c.a.utc(t,"HH:mm").local().format("h:mm a")}}},I=E,L=r("2877"),A=Object(L["a"])(I,o,s,!1,null,null,null);e["a"]=A.exports},"696f":function(t,e,r){},"69bf":function(t,e,r){"use strict";r.r(e);var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("ce7e"),s=r("132d"),l=r("2fa4"),c=r("7e85"),u=r("e516"),d=r("9c54"),h=r("56a4"),f=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wizardCardHeight"},[e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{id:"startlifecycle"}},[e(a["d"],[t.selectedGrowplanName.length>0?e("h2",{attrs:{slot:"header"},slot:"header"},[t._v("\n        Start New Lifecycle for "+t._s(t.selectedGrowplanName)+"\n      ")]):e("h2",{attrs:{slot:"header"},slot:"header"},[t._v("Start New Lifecycle")]),e(l["a"]),e("help-button",{attrs:{"help-topic-key":"cultivation-lifecycles-creating-a-lifecycle"}}),t.fullscreen?t._e():e(n["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(s["a"],[t._v("close")])],1)],1),e(a["c"],{staticClass:"pt-0",class:t.fullscreen?"full":"windowed"},[e(c["a"],{attrs:{"non-linear":""},model:{value:t.currentStep,callback:function(e){t.currentStep=e},expression:"currentStep"}},[e(d["a"],[e(h["a"],{attrs:{step:"1",complete:!!t.lifecycle.growplan_id,editable:""}},[t._v("Select Grow Plan")]),e(o["a"]),e(h["a"],{attrs:{step:"2",editable:!!t.lifecycle.growplan_id}},[t._v("Phase Information")]),e(o["a"]),e(h["a"],{attrs:{step:"3",editable:!!t.lifecycle.growplan_id}},[t._v("Platform Selection")])],1),e(d["b"],[e(u["a"],{attrs:{step:"1"}},[e("select-grow-plan",{on:{selection:t.onGrowplanSelection},model:{value:t.lifecycle.growplan_id,callback:function(e){t.$set(t.lifecycle,"growplan_id",e)},expression:"lifecycle.growplan_id"}})],1),e(u["a"],{attrs:{step:"2"}},[e("phase-information",{ref:"phaseInfo",model:{value:t.lifecycle,callback:function(e){t.lifecycle=e},expression:"lifecycle"}})],1),e(u["a"],{attrs:{step:"3"}},[e("platform-selection",{attrs:{expectedLifecycleId:-1,clonePlatformGroupsFilter:!1},model:{value:t.lifecycle,callback:function(e){t.lifecycle=e},expression:"lifecycle"}})],1)],1)],1),e("loading",{attrs:{show:t.isLoading}})],1),e(a["a"],[t.currentStep>1?e(n["a"],{attrs:{color:"primary"},on:{click:function(e){return t.nextStep(-1)}}},[t._v("Previous")]):t._e(),e(l["a"]),t.currentStep<3?e(n["a"],{attrs:{color:"primary",disabled:t.isNextDisabled()},on:{click:function(e){return t.nextStep(1)}}},[t._v("Next")]):t._e(),3==t.currentStep?e(n["a"],{attrs:{color:"primary",loading:t.isLoading},on:{click:function(e){return t.startingLifecycle()}}},[t._v("Create Lifecycle")]):t._e()],1)],1)],1)},p=[],m=r("2f62"),v=r("9908"),y=r("d0eb"),g=r("62ad"),b=r("0fd9"),w=r("b974"),x=r("8654"),S=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container",attrs:{flat:"",loading:t.isLoadingGrowPlan}},[e(a["c"],{staticStyle:{"padding-top":"0",overflow:"auto"}},[e(b["a"],{staticClass:"mb-4",attrs:{justify:"center","no-gutters":""}},[e(g["a"],{staticClass:"text-center",attrs:{md:"6"}},[e("label",{staticClass:"v-label"},[t._v(t._s(t.growPlan?t.growPlan.growplanName:""))])])],1),e(b["a"],{staticClass:"pb-3",attrs:{justify:"center","no-gutters":""}},[e(g["a"],{staticClass:"pr-1",attrs:{cols:"5"}},[e(w["a"],{attrs:{items:t.growPhases,label:"Starting Phase","item-value":"id","item-text":"growPhaseName"},model:{value:t.selectedPhaseId,callback:function(e){t.selectedPhaseId=e},expression:"selectedPhaseId"}})],1),e(g["a"],{staticClass:"pl-1",attrs:{cols:"2"}},[e(x["a"],{attrs:{label:"Day of Phase",rules:[t.rules.positiveNumber,t.rules.integer]},model:{value:t.dayOfPhase,callback:function(e){t.dayOfPhase=e},expression:"dayOfPhase"}})],1)],1),e(b["a"],{staticClass:"pb-3",attrs:{justify:"center","no-gutters":""}},[e(g["a"],{attrs:{md:"8",lg:"7"}},[e(w["a"],{attrs:{items:t.facilityPlantContainerTypes,label:"Plant Holder","item-value":"id","item-text":"plantcontainerType","return-object":""},on:{change:t.selectedPlantContainer},model:{value:t.selectedPlantContainerType,callback:function(e){t.selectedPlantContainerType=e},expression:"selectedPlantContainerType"}})],1)],1),e(b["a"],{staticClass:"pb-3",attrs:{justify:"center","no-gutters":""}},[e(g["a"],{class:{"pr-3":!t.isSinglePositionPlantContainer,"pr-1":t.isSinglePositionPlantContainer},attrs:{md:t.isSinglePositionPlantContainer?5:7}},[e(w["a"],{attrs:{items:t.strains,label:"Strain","item-value":"strainId","item-text":"strainName","return-object":""},model:{value:t.selectedStrain,callback:function(e){t.selectedStrain=e},expression:"selectedStrain"}})],1),t.isSinglePositionPlantContainer?e(g["a"],{staticClass:"pl-1",attrs:{cols:"2"}},[e(x["a"],{attrs:{label:"Number of Plants",type:"number",rules:[t.rules.positiveNumber,t.rules.integer]},model:{value:t.numberOfPlants,callback:function(e){t.numberOfPlants=e},expression:"numberOfPlants"}})],1):t._e()],1),e(b["a"],{staticClass:"pb-3",attrs:{justify:"center","no-gutters":""}},[t.lifecycleTypes.length>0?e(g["a"],{staticClass:"pr-3",attrs:{md:"7"}},[e(w["a"],{attrs:{items:t.lifecycleTypes,label:"License","item-value":"id","item-text":"name","return-object":""},model:{value:t.selectedLifecycleType,callback:function(e){t.selectedLifecycleType=e},expression:"selectedLifecycleType"}})],1):t._e()],1),t.getUser.facility.isMetrcEnabled?t._e():e(b["a"],{staticClass:"mt-0",attrs:{justify:"center","no-gutters":""}},[e(g["a"],{staticClass:"pr-1",attrs:{cols:"4"}},[e(x["a"],{attrs:{label:"Custom Tag Prefix"},model:{value:t.customtagPrefix,callback:function(e){t.customtagPrefix=e},expression:"customtagPrefix"}})],1),e(g["a"],{staticClass:"pl-1",attrs:{cols:"2"}},[e(x["a"],{attrs:{label:"Tag Length",disabled:0==t.customtagPrefix.length,rules:[t.rules.positiveNumber]},model:{value:t.customtagLength,callback:function(e){t.customtagLength=e},expression:"customtagLength"}})],1)],1),e(b["a"],{attrs:{justify:"center","no-gutters":""}},[e(g["a"],{staticClass:"pr-3",attrs:{cols:"12",md:"3"}},[e("div",{staticStyle:{position:"relative"}},[e("vuetify-datepicker",{attrs:{label:"Task Date"},model:{value:t.selectedDate,callback:function(e){t.selectedDate=e},expression:"selectedDate"}})],1)]),e(g["a"],{staticClass:"pl-2 pr-2",attrs:{cols:"12",md:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime")},model:{value:t.selectedStartTime,callback:function(e){t.selectedStartTime=e},expression:"selectedStartTime"}})],1),e(g["a"],{staticClass:"pl-2",attrs:{cols:"12",md:"2"}},[e("vuetify-timepicker",{attrs:{"error-messages":t.endErrors,error:t.endErrors.length>0,label:t.$t("common.endTime")},model:{value:t.selectedEndTime,callback:function(e){t.selectedEndTime=e},expression:"selectedEndTime"}})],1)],1),t._e()],1)],1)},_=[],C=r("c1df"),O=r.n(C),P=r("d67f"),D=r("dd20"),k=r("4458"),T=r("9c4f");function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function E(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */E=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==j(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(j(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function I(t,e){return N(t)||U(t,e)||A(t,e)||L()}function L(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(t,e){if(t){if("string"==typeof t)return M(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(t,e):void 0}}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function U(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function N(t){if(Array.isArray(t))return t}function F(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function G(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){F(a,n,i,o,s,"next",t)}function s(t){F(a,n,i,o,s,"throw",t)}o(void 0)}))}}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){H(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function H(t,e,r){return(e=V(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function V(t){var e=B(t,"string");return"symbol"==j(e)?e:e+""}function B(t,e){if("object"!=j(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var z={name:"phase-information",props:["value"],mixins:[T["a"]],components:{VuetifyTimepicker:D["a"],VuetifyDatepicker:k["a"]},data:function(){return{mothers:[],customtagPrefix:"",customtagLength:0,lifecycleTypes:[],rec:{},selectedDate:O()().format("YYYY-MM-DD"),selectedStartTime:O()().hours(0).minutes(0).seconds(0).format("HH:mm"),selectedEndTime:O()().hours(0).minutes(0).seconds(0).add(15,"minutes").format("HH:mm"),selectedMother:"",selectedLifecycleType:-1,endErrors:[],selectedMetrcLicense:null,strains:[],selectedStrain:null,growPlan:null,selectedPlantContainerType:null,facilityPlantContainerTypes:[],selectedPhaseId:null,dayOfPhase:1,isLoadingGrowPlan:!1,numberOfPlants:null,skipInitialIrrigation:!1}},beforeMount:function(){this.rec=$({},this.value),this.init()},computed:$($({},Object(m["c"])(["getUser","firstEvent"])),{},{isSinglePositionPlantContainer:function(){return this.selectedPlantContainerType?1===this.selectedPlantContainerType.positions:this.selectedPhase&&1===this.selectedPhase.plantContainerType.positions},growPhases:function(){if(!this.growPlan)return[];var t=this.growPlan.ag_growPhases.map((function(t){return $($({},t),{},{growPhaseName:"".concat(t.ag_growStage.label," - ").concat(t.growPhaseName)})}));return t.sort((function(t,e){return t.startSeconds<e.startSeconds?-1:1})),t},selectedPhase:function(){var t=this;return this.growPhases.find((function(e){return e.id===t.selectedPhaseId}))},firstEventPlantContainerType:function(){return this.firstEvent.plantContainerType&&this.firstEvent.plantContainerType.length>0?this.firstEvent.plantContainerType[0]:{plantcontainerType:"Not found"}},firstEventTask:function(){return this.firstEvent.growTasks&&this.firstEvent.growTasks.length>0?this.firstEvent.growTasks[0]:{}}}),methods:$($({},Object(m["b"])(["getGrowplanInitial","getLifeyclesByStrain"])),{},{onSetSelectedDate:function(t){this.rec.starttime=O()("".concat(t," ").concat(this.selectedStartTime),"YYYY-MM-DD HH:mm").utc().format(),this.rec.endtime=O()("".concat(t," ").concat(this.selectedEndTime),"YYYY-MM-DD HH:mm").utc().format(),this.$emit("input",this.rec)},customFilter:function(t,e,r){var n=t.tag.toLowerCase(),i=e.toLowerCase();return n.indexOf(i)>-1},itsOnSchedule:function(){return new Date(this.selectedDate).getTime()===new Date(this.getToday()).getTime()},getToday:function(){return O()().format("YYYY-MM-DD")},init:function(){var t=this;this.onSetSelectedDate(this.selectedDate),this.loadStrains().then((function(){t.loadGrowplan(),t.loadMothers(),t.loadLicenses(),t.loadFacilityPlantContainers()}))},loadStrains:function(){var t=this;return G(E().mark((function e(){var r,n,i;return E().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,y["a"].get("vFacilityGrowplanStrains",t.getUser.apitoken,{filter:{order:"strainName",where:{facility_id:t.getUser.facility_id}}});case 2:r=e.sent,n=I(r,2),i=n[0],n[1],t.strains=i;case 7:case"end":return e.stop()}}),e)})))()},loadLicenses:function(){var t=this;y["a"].get("ag_licenses",this.getUser.apitoken,{filter:{where:{facility_id:this.getUser.facility_id},include:["licenseType"],order:"name"}}).then((function(e){var r=I(e,2),n=r[0],i=r[1];(null===n||void 0===n?void 0:n.length)>0&&(t.lifecycleTypes=n,t.selectedLifecycleType=n[0]),null!==n&&void 0!==n&&n.length||P["a"].error("Error: There are no facility licenses."),i&&P["a"].error(i)}))},loadMothers:function(){var t=this;y["a"].get("vMothers",this.getUser.apitoken,{filter:{where:{facility_id:this.getUser.facility_id,strain_id:this.rec.strain_id,tag:{neq:null}},order:"tag"}}).then((function(e){var r=I(e,2),n=r[0];r[1];t.mothers=n}))},loadGrowplan:function(){var t=this;this.rec.growplan_id&&(this.isLoadingGrowPlan=!0,this.getGrowplanInitial({apitoken:this.getUser.apitoken,growplan_id:this.rec.growplan_id}),y["a"].get("ag_growplans/".concat(this.rec.growplan_id),this.getUser.apitoken,{filter:{include:[{relation:"ag_growPhases",scope:{include:["ag_growStage","plantContainerType"]}}]}}).then((function(e){var r=I(e,2),n=r[0];r[1];t.isLoadingGrowPlan=!1,t.growPlan=n,t.selectedPhaseId=n.ag_growPhases.length?n.ag_growPhases[0].id:null})))},loadFacilityPlantContainers:function(){var t=this;t.isLoading=!0,y["a"].get("ag_facilityPlantContainerTypes",this.getUser.apitoken,{filter:{include:["plantContainerType"],where:{facility_id:this.getUser.facility_id}}}).then((function(e){var r=I(e,2),n=r[0];r[1];t.isLoading=!1,t.facilityPlantContainerTypes=n.map((function(t){return t.plantContainerType}))}))},selectedPlantContainer:function(t){this.rec.plantContainerType=t,this.rec.plantContainerType_id=t.id,this.numberOfPlants=1===t.positions?1:null,this.$emit("input",this.rec)},checkTimes:function(){var t=O()(this.rec.starttime),e=O()(this.rec.endtime);t.isAfter(e)?this.endErrors=["End time is invalid"]:this.endErrors=[],this.rec.errors=this.endErrors,this.$emit("input",this.rec)}}),watch:{skipInitialIrrigation:function(t){this.rec.skipInitialIrrigation=t,this.$emit("input",this.rec)},firstEvent:function(t){t.strain_id&&(this.selectedStrain=this.strains.find((function(e){return e.strainId===t.strain_id}))),t.growTasks&&(t.growTasks.length>0?(this.rec.growPhase_id=t.growPhase_id,this.rec.growTask_id=t.growTasks[0].growTask_id,this.rec.starttime=O()("".concat(this.selectedDate," ").concat(this.selectedStartTime),"YYYY-MM-DD HH:mm").utc().format(),this.rec.endtime=O()("".concat(this.selectedDate," ").concat(this.selectedEndTime),"YYYY-MM-DD HH:mm").utc().format(),this.rec.facility_id=this.getUser.facility_id,this.$emit("input",this.rec),this.getLifeyclesByStrain({apitoken:this.getUser.apitoken,strain_id:this.firstEvent.strain_id})):(P["a"].error("The growplan dosen't have tasks"),this.$router.push("/growplans")))},selectedMetrcLicense:function(t,e){this.rec.metrcLicense=t,this.$emit("input",this.rec)},value:function(t,e){this.rec=$({},this.value),t.growplan_id!=e.growplan_id&&this.loadGrowplan(),this.loadMothers(),this.selectedMother=null},selectedMother:function(t){this.rec.parent_id=t,this.$emit("input",this.rec)},customtagPrefix:function(t){this.rec.customtagPrefix=t,this.$emit("input",this.rec)},customtagLength:function(t){this.rec.customtagLength=parseInt(t),this.$emit("input",this.rec)},selectedLifecycleType:function(t){this.rec.ag_licenses_id=t.id,this.rec.lifecycleType_id=t.licenseType.id,this.$emit("input",this.rec)},selectedStrain:function(t){this.rec.strainId=t.strainId,this.$emit("input",this.rec)},selectedPhase:function(t){this.rec.growPhase_id=t.id,this.rec.plantContainerType_id=parseInt(t.plantContainerType_id),this.rec.plantContainerType=t.plantContainerType,this.selectedPlantContainerType=t.plantContainerType,this.numberOfPlants=1===t.plantContainerType.positions?1:null,this.$emit("input",this.rec)},dayOfPhase:function(t){this.rec.dayOfPhase=parseInt(t),this.$emit("input",this.rec)},numberOfPlants:function(t){this.rec.numberOfPlants=parseInt(t),this.$emit("input",this.rec)},selectedDate:function(t){this.onSetSelectedDate(t)},selectedStartTime:function(t){this.rec.starttime=O()("".concat(this.selectedDate," ").concat(t),"YYYY-MM-DD HH:mm").utc().format(),this.$emit("input",this.rec),this.checkTimes()},selectedEndTime:function(t){this.rec.endtime=O()("".concat(this.selectedDate," ").concat(t),"YYYY-MM-DD HH:mm").utc().format(),this.$emit("input",this.rec),this.checkTimes()}}},Y=z,q=r("2877"),W=Object(q["a"])(Y,S,_,!1,null,null,null),J=W.exports,Z=r("ead4"),X=r("f36f"),K=r("7ce3"),Q=r("8e07");function tt(t){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(t)}function et(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */et=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==tt(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(tt(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function rt(t,e){return st(t)||ot(t,e)||it(t,e)||nt()}function nt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function it(t,e){if(t){if("string"==typeof t)return at(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?at(t,e):void 0}}function at(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ot(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function st(t){if(Array.isArray(t))return t}function lt(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function ct(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){lt(a,n,i,o,s,"next",t)}function s(t){lt(a,n,i,o,s,"throw",t)}o(void 0)}))}}function ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ut(Object(r),!0).forEach((function(e){ht(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ht(t,e,r){return(e=ft(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ft(t){var e=pt(t,"string");return"symbol"==tt(e)?e:e+""}function pt(t,e){if("object"!=tt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var mt={name:"start-lifecycle",props:{fullscreen:{type:Boolean,default:!0},shouldNavigateToLifecycles:{type:Boolean,required:!1,default:function(){return!0}}},data:function(){return{mode:"fullscreen",currentStep:1,isLoading:!1,selectedGrowplanName:"",selectedLifecycleType_id:null,metrcPayload:{},lifecycle:{growplan_id:parseInt(this.$route.params.growplanId),growPhase_id:0,growTask_id:0,lifecycleType_id:"",ag_licenses_id:"",facility_id:"",starttime:"",endtime:"",parent_id:"",attributeData:[],platformPositions:[],errors:[],skipInitialIrrigation:!1}}},beforeMount:function(){this.$route.params.growplanId&&(this.currentStep=2)},computed:dt({},Object(m["c"])(["getUser"])),methods:dt(dt({},Object(m["b"])(["setLifecyclePlatforms","setPlatformsGroups"])),{},{onCancel:function(){this.$emit("cancel")},isNextDisabled:function(){return!((1!==this.currentStep||this.lifecycle.growplan_id)&&!this.lifecycle.errors.length)},onGrowplanSelection:function(t){t&&t.ag_growPlanStrain&&(this.selectedGrowplanName=t.growplanName,t.ag_growPlanStrain.isCannabis||(this.lifecycle.lifecycleType_id=4),t.ag_growPlanStrain.isCannabis&&!this.lifecycle.lifecycleType_id&&(this.lifecycle.lifecycleType_id=5),this.lifecycle.lifecycleType_id&&(this.selectedLifecycleType_id=this.lifecycle.lifecycleType_id),this.lifecycle=dt(dt({},this.lifecycle),{},{strain_id:parseInt(t.growPlanStrain_id),growplan_id:parseInt(t.id),facility_id:this.getUser.facility_id}),this.selectedLifecycleType_id&&(this.lifecycle.lifecycleType_id=this.selectedLifecycleType_id),this.metrcPayload.name=t.growplanName,this.metrcPayload.strain=t.ag_growPlanStrain.strainName)},nextStep:function(t){this.currentStep=parseInt(this.currentStep)+t},startingLifecycle:function(){var t=this;return ct(et().mark((function e(){var r,n,i,a,o,s,l;return et().wrap((function(e){while(1)switch(e.prev=e.next){case 0:for(t.lifecycle.apitoken=t.getUser.apitoken,r=!1,n=t.lifecycle.platformPositions.length-1;n>=0;n--)0==t.lifecycle.platformPositions[n].plantContainerPositions.length&&t.lifecycle.platformPositions.splice(n,1);i=0;case 4:if(!(i<t.lifecycle.platformPositions.length)){e.next=17;break}a=0;case 6:if(!(a<t.lifecycle.platformPositions[i].plantContainerPositions.length)){e.next=12;break}return r=!0,e.abrupt("break",12);case 9:a++,e.next=6;break;case 12:if(!r){e.next=14;break}return e.abrupt("break",17);case 14:i++,e.next=4;break;case 17:if(r){e.next=20;break}return P["a"].error("You must select at least one plant container position to continue."),e.abrupt("return");case 20:if(t.lifecycle.ag_licenses_id){e.next=23;break}return P["a"].error("Error: There are no facility licenses."),e.abrupt("return");case 23:if(t.lifecycle.strainId&&(t.lifecycle.strain_id=t.lifecycle.strainId),!O()(t.lifecycle.endtime).isAfter(t.lifecycle.starttime)){e.next=55;break}if(""===t.lifecycle.lifecycleType_id){e.next=52;break}if(!(t.lifecycle.platformPositions.length>0)){e.next=49;break}return t.isLoading=!0,e.next=30,y["a"].post("ag_lifecycles/startLifecycle",t.getUser.apitoken,t.lifecycle);case 30:if(o=e.sent,s=rt(o,1),l=s[0],!l.success){e.next=46;break}return t.setLifecyclePlatforms(),t.setPlatformsGroups(),e.next=38,y["a"].post("task_task/decrementLifecycleTaskConsumables",t.getUser.apitoken,{ag_lifecycleTasks_id:l.lifecycleTask.id});case 38:return e.next=40,y["a"].post("controllerCommands/reloadLifecyclesByLifecycle",t.getUser.apitoken,{lifecycle_id:[l.lifecycle.id]});case 40:t.getUser.facility.isMetrcEnabled&&t.metrcCreatePlanting(t.lifecycle,l.metrcPlantBatchName),P["a"].success("The lifecycle was created successfully"),t.$emit("close"),t.shouldNavigateToLifecycles&&t.$router.push("/lifecycles"),e.next=47;break;case 46:P["a"].error(val.message);case 47:e.next=50;break;case 49:P["a"].error("No plants selected");case 50:e.next=53;break;case 52:P["a"].error("Invalid Lifecycle Type");case 53:e.next=56;break;case 55:P["a"].error("Invalid end time");case 56:case"end":return e.stop()}}),e)})))()},metrcCreatePlanting:function(t,e){var r=this;return ct(et().mark((function n(){var i,a,o,s,l,c,u,d;return et().wrap((function(n){while(1)switch(n.prev=n.next){case 0:for(i={},a=0;a<t.platformPositions.length;a++)o=t.platformPositions[a].platformGroupName,i[o]||(i[o]=0),i[o]+=t.platformPositions[a].plantContainerPositions.length;s=[],n.t0=et().keys(i);case 4:if((n.t1=n.t0()).done){n.next=16;break}return l=n.t1.value,s.push({LicenseNumber:localStorage.getItem("metrcLicense"),userMetrcApiKey:r.getUser.metrcApiKey||r.getUser.facility.metrcApiKey,payload:JSON.stringify([{Name:e,Type:"Clone",Count:i[l],Strain:r.metrcPayload.strain,Location:l,ActualDate:O()(r.lifecycle.starttime).format("YYYY-MM-DD")}]),action:"POST",service:"plantbatches/v1/createplantings",userId:r.getUser.id}),n.next=9,Q["a"].post("Outboxes",s);case 9:c=n.sent,u=rt(c,2),u[0],d=u[1],d&&alert("Metrc request failed"),n.next=4;break;case 16:case"end":return n.stop()}}),n)})))()}}),watch:{},components:{HelpButton:K["a"],Loading:v["a"],PhaseInformation:J,PlatformSelection:X["a"],SelectGrowPlan:Z["a"]}},vt=mt,yt=(r("739e"),Object(q["a"])(vt,f,p,!1,null,null,null));e["default"]=yt.exports},"6ae8":function(t,e,r){},"6b20":function(t,e,r){"use strict";r.r(e);var n=r("0798"),i=r("8336"),a=r("b0af"),o=r("99d9"),s=r("62ad"),l=r("169a"),c=r("132d"),u=r("67b6"),d=r("43a6"),h=r("0fd9"),f=r("b974"),p=r("2fa4"),m=r("b73d"),v=r("71a3"),y=r("c671"),g=r("fe57"),b=r("aac8"),w=function(){var t=this,e=t._self._c;return t.item?e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{id:"devicewrapper",loading:t.isLoading}},[t.isDnD?e(n["a"],{attrs:{border:"top","colored-border":"",type:"error",elevation:"1"}},[t._v("\n    DO NOT DISTURB UNTIL\n    "+t._s(t.moment.utc(t.localCurrentDevice.dndExpiration).local().format("MM/DD/YYYY H:mm a"))+"\n    - "+t._s(t.device.dndComment)+". Contact "+t._s(t.device.dndUserName)+".\n  ")]):t._e(),e(o["d"],[e(h["a"],{attrs:{align:"center",justify:"space-between","no-gutters":""}},[e(s["a"],{attrs:{md:"3",sm:"3",cols:"3"}},[e("h2",{class:{smallHeader:"sm"==t.$vuetify.breakpoint.name}},[t._v("\n          "+t._s(t.abbrevPlatformGroupName)+"\n        ")])]),e(s["a"],{staticClass:"v-label hidden-sm-and-up text-center",attrs:{cols:"6"}},[e("span",{staticStyle:{color:"#1876d2",cursor:"pointer"},on:{click:t.onShowStateMenu}},[t._v(t._s(t.item.state))])]),e(s["a"],{staticClass:"v-label d-none d-sm-flex",class:{"text-center":"xs"!=t.$vuetify.breakpoint.name},staticStyle:{"text-align":"center","align-items":"center","justify-content":"center"},attrs:{cols:"5",sm:"6",md:"4"}},[t.options&&t.options.length>1?[e("div",{directives:[{name:"show",rawName:"v-show",value:!t.changeState&&(t.automatic_mode||t.Trimaster.isAdmin(t.getUser)),expression:"\n              !changeState && (automatic_mode || Trimaster.isAdmin(getUser))\n            "}],class:t.inStateTransition?"blinking":"",staticStyle:{"white-space":"nowrap"}},[e("span",{staticClass:"hidden-sm-and-down"},[t._v("\n              "+t._s(t.$t("device.currentState"))+":\n            ")]),t._v("\n            "+t._s(t.item.state)+"\n            "),e(c["a"],{on:{click:function(e){t.changeState=!0}}},[t._v("build")])],1),e("div",{directives:[{name:"show",rawName:"v-show",value:t.changeState&&(t.automatic_mode||t.Trimaster.isAdmin(t.getUser)),expression:"\n              changeState && (automatic_mode || Trimaster.isAdmin(getUser))\n            "}],staticClass:"automodeselector"},[e(f["a"],{staticClass:"pt-0 mt-0 mb-0",staticStyle:{width:"calc(100% - 100px)","margin-right":"10px"},attrs:{label:"Set Control State","item-text":"action","item-value":"action_id",items:t.options,"single-line":"",loading:t.inStateTransition},model:{value:t.newState,callback:function(e){t.newState=e},expression:"newState"}}),e(i["a"],{attrs:{icon:""},on:{click:t.onVfuStateChange}},[e(c["a"],[t._v("done")])],1),e(i["a"],{attrs:{icon:""},on:{click:function(e){t.changeState=!1}}},[e(c["a"],[t._v("build")])],1)],1),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.automatic_mode&&!t.Trimaster.isAdmin(t.getUser),expression:"!automatic_mode && !Trimaster.isAdmin(getUser)"}]},[e("span",{staticStyle:{"white-space":"nowrap"}},[e("span",{staticClass:"hidden-sm-and-down"},[t._v("\n                "+t._s(t.$t("device.currentState"))+":\n              ")]),t._v("\n              Manual Mode\n            ")])])]:t._e()],2),e(s["a"],{staticClass:"text-right automodeselector align-end",attrs:{cols:"2",md:"3",sm:"3"}},[e(m["a"],{staticStyle:{"margin-top":"0px"},attrs:{inset:"",hint:"Auto Mode","hide-details":!0,dense:"xs"==t.$vuetify.breakpoint.name,label:"xs"!=t.$vuetify.breakpoint.name?"Auto":"",loading:t.transitionClass,"pl-3":""},on:{change:t.onAutomaticModeChange},model:{value:t.automatic_mode,callback:function(e){t.automatic_mode=e},expression:"automatic_mode"}}),e("help-button",{staticClass:"ml-2 d-none",attrs:{"help-topic-key":t.tabHelpTopicKey}})],1)],1)],1),e(o["c"],{staticClass:"pt-0 flex-tabs-container",staticStyle:{"overflow-y":"hidden"}},[t.item?e(g["a"],{staticClass:"densetabs",attrs:{centered:""},model:{value:t.tabmodel,callback:function(e){t.tabmodel=e},expression:"tabmodel"}},[e(v["a"],{key:"0"},[t._v(t._s(t.$t("device.environment")))]),t.showPhotos?e(v["a"],{key:"25"},[t._v(t._s(t.$t("device.photo")))]):t._e(),e(v["a"],{key:"1"},[t._v(" "+t._s(t.$t("device.manualControl")))]),t.item&&t.showManualScheduler?e(v["a"],{key:"20"},[t._v("\n        "+t._s(t.$t("device.schedules"))+"\n      ")]):t._e(),e(v["a"],{key:"2"},[t._v(t._s(t.$t("device.deviceLogs")))]),t.Trimaster.isAdmin(t.getUser)?e(v["a"],{key:"26"},[t._v("Activity")]):t._e(),t.showFsm?e(v["a"],{key:"10"},[t._v(t._s(t.$t("device.controlLoops")))]):t._e(),e(v["a"],{key:"3",attrs:{disabled:!t.localCurrentDevice||!t.localCurrentDevice.lifecyclesRaw}},[t._v("\n        "+t._s(t.$t("device.lifecycles"))+"\n      ")]),e(v["a"],{key:"4",staticClass:"hidden-sm-and-down",attrs:{disabled:!t.localCurrentDevice||!t.localCurrentDevice.lifecyclesRaw}},[t._v("\n        "+t._s(t.$t("device.lifecycleTasks"))+"\n      ")]),e(v["a"],{key:"5",attrs:{disabled:!t.localCurrentDevice||!t.localCurrentDevice.lifecyclesRaw}},[t._v("\n        "+t._s(t.$t("device.IPMScouting"))+"\n      ")]),e(v["a"],{key:"6",attrs:{disabled:!t.localCurrentDevice||!t.localCurrentDevice.lifecyclesRaw}},[t._v("\n        "+t._s(t.$t("device.healthReports"))+"\n      ")]),t.showFsm?e(v["a"],{key:"7",staticClass:"hidden-sm-and-down"},[t._v("\n        "+t._s(t.$t("device.zones"))+"\n      ")]):t._e(),e(v["a"],{key:"8",attrs:{disabled:t.disableServiceHistory}},[t._v(t._s(t.$t("device.serviceHistory")))])],1):t._e(),e(b["a"],{model:{value:t.tabmodel,callback:function(e){t.tabmodel=e},expression:"tabmodel"}},[e(y["a"],{key:"0"},[e("charts",{attrs:{facility:t.facility,platformGroup_id:t.platformGroupId,platformGroup_name:t.item?t.item.platformGroupName:"",device_id:t.deviceId,controllerId:t.controllerId,device:t.device,options:t.options,lastEventReceived:t.lastEventReceived},on:{"emit-action":t.emitAction}})],1),t.showPhotos?e(y["a"],{key:"25"},[e("vfu-photos",{ref:"vfuPhotos",attrs:{controller_id:t.controllerId,device_id:t.device_id,lastEventReceived:t.lastCameraMessageReceived}})],1):t._e(),e(y["a"],{key:"1",attrs:{eager:""}},[e("manual-control-options",{attrs:{platformGroupId:t.platformGroupId,deviceId:t.deviceId,controllerId:t.controllerId,"automatic-mode":t.automatic_mode,disabled:t.isDeviceDisabled(t.item),"zone-device":t.item,isSse:t.isSse,lastEventReceived:t.lastEventReceived}})],1),t.showManualScheduler?e(y["a"],{key:"20"},[t.showManualScheduler?e("lgu",{attrs:{device:t.device,user:t.getUser,hideHeader:!0}}):t._e()],1):t._e(),e(y["a"],{key:"2"},[e("deviceHistoryViewer",{attrs:{platformGroupId:t.platformGroupId,platformGroupName:t.item?t.item.platformGroupName:"",controller_id:t.controllerId,lastEventReceived:t.lastEventReceived},on:{chosen:function(e){t.devicePicker=!1}}})],1),t.Trimaster.isAdmin(t.getUser)?e(y["a"],{key:"26"},[e("unit-activity-log",{attrs:{platformGroupId:t.platformGroupId,platformGroupName:t.item?t.item.platformGroupName:"",controller_id:t.controllerId,"mode-details":t.autoModeDetails}})],1):t._e(),t.showFsm?e(y["a"],{key:"10"},[e("control-loops",{attrs:{controller_id:t.controllerId,platformGroupId:t.platformGroupId}})],1):t._e(),e(y["a"],{key:"3"},[e("device-lifecycles",{attrs:{currentDevice:t.localCurrentDevice,"platform-group-id":t.platformGroupId}})],1),e(y["a"],{key:"4"},[e("lifecycles",{attrs:{"platform-group-id":t.platformGroupId}})],1),e(y["a"],{key:"5"},[e("ipm-scouting-reports",{attrs:{platformGroup_id:t.platformGroup_id,facility_id:t.getUser.facility_id}})],1),e(y["a"],{key:"6"},[e("lifecycle-report",{attrs:{platformGroup_id:t.platformGroup_id},on:{add:t.onAddLifecycleReport}})],1),t.showFsm?e(y["a"],{key:"7"},[e("zone-parameters",{attrs:{device_id:t.device_id,platformGroup_id:t.platformGroup_id}})],1):t._e(),e(y["a"],{key:"8"},[t.item&&!t.disableServiceHistory?e("service-history",{attrs:{device:t.item,platformGroup_id:t.platformGroupId,co2Enabled:t.localCurrentDevice.co2Enabled},on:{refresh:t.refreshZoneDevices,disableservicehistory:t.onDisableServiceHistory,showalerts:t.onShowAlerts}}):t._e()],1)],1)],1),e(l["a"],{attrs:{persistent:"",scrollable:""},model:{value:t.showStateMenu,callback:function(e){t.showStateMenu=e},expression:"showStateMenu"}},[e(a["a"],[e(o["d"],[e("h2",[t._v("Select Operating Mode")]),e(p["a"]),e(i["a"],{attrs:{icon:""},on:{click:function(e){t.showStateMenu=!1}}},[e(c["a"],[t._v("close")])],1)],1),e(o["c"],[e(d["a"],{model:{value:t.newStateSelection,callback:function(e){t.newStateSelection=e},expression:"newStateSelection"}},t._l(t.options,(function(t){return e(u["a"],{key:t.action,attrs:{label:t.action,value:t.action_id}})})),1)],1),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{color:"primary",text:""},on:{click:t.onSetMode}},[t._v("Execute")])],1)],1)],1)],1):t._e()},x=[],S=r("2f62"),_=r("35d5"),C=r("da52"),O=r("0583"),P=r("dbd0"),D=r("e2cd"),k=r("c1df"),T=r.n(k),j=r("d67f"),E=r("d0eb"),I=r("de1e"),L=r("4b5c"),A=r("6ce0"),M=r("a9b3"),U=r("2fa3"),N=r("0276"),F=r("b7dd"),G=r("7ce3"),R=r("8fea"),$=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100"},[e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:""}},[e(o["c"],{staticClass:"d-flex flex-column"},[e("div",{staticClass:"flex-grow-auto h-100"},[e(R["a"],{directives:[{name:"show",rawName:"v-show",value:!t.showCustomize,expression:"!showCustomize"}],staticStyle:{border:"1px solid silver"},attrs:{options:t.pagination,headers:t.headers,items:t.data,"hide-default-footer":"",loading:t.isLoading,"fixed-header":"",height:"100%","show-expand":"","show-group-by":""},on:{"update:options":function(e){t.pagination=e}},scopedSlots:t._u([{key:"item.actions",fn:function(r){var n=r.item;return[e(i["a"],{attrs:{icon:""},on:{click:function(e){return t.displayFsa(n.id)}}},[e(c["a"],[t._v("preview")])],1)]}},{key:"expanded-item",fn:function(r){var n=r.headers,i=r.item;return[e("td",{attrs:{colspan:n.length}},[t._v(t._s(i.description))])]}}])}),t.deviceTypeIds?e("customize",{directives:[{name:"show",rawName:"v-show",value:t.showCustomize,expression:"showCustomize"}],attrs:{controller_id:t.controller_id,deviceTypeIds:t.deviceTypeIds},on:{refresh:t.refresh}}):t._e()],1)]),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{directives:[{name:"show",rawName:"v-show",value:!t.showCustomize,expression:"!showCustomize"}],attrs:{color:"primary"},on:{click:function(e){t.showCustomize=!0}}},[t._v("Customize")]),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:t.showCustomize,expression:"showCustomize"}],attrs:{color:"primary"},on:{click:function(e){t.showCustomize=!1}}},[t._v("Display Active FSAs")]),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:!t.showCustomize,expression:"!showCustomize"}],attrs:{color:"primary",loading:t.isLoading},on:{click:t.refresh}},[t._v("Refresh")])],1)],1),e(l["a"],{attrs:{width:"1024"},model:{value:t.showFsa,callback:function(e){t.showFsa=e},expression:"showFsa"}},[t.selectedId?e("display-fsa",{staticClass:"vh90",attrs:{id:t.selectedId},on:{close:function(e){t.showFsa=!1}}}):t._e()],1)],1)},H=[],V=r("b047"),B=r.n(V),z=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container flex-content"},[e(o["d"],[e("h2",[t._v(t._s(t.fsaTitle))]),e(p["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.close}},[e(c["a"],[t._v("close")])],1)],1),e(o["c"],{staticClass:"d-flex flex-column"},[e("div",{staticStyle:{height:"50%"},attrs:{id:"fsadisplay2"},domProps:{innerHTML:t._s(t.svgOut)}}),e(R["a"],{staticClass:"mt-4",staticStyle:{border:"1px solid silver",height:"50%"},attrs:{items:t.rules,"fixed-header":"",headers:t.ruleHeaders,options:t.pagination,"hide-default-footer":"",height:"100%","must-sort":""}})],1)],1)},Y=[],q=r("1d93");function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function J(t,e){return tt(t)||Q(t,e)||X(t,e)||Z()}function Z(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(t,e){if(t){if("string"==typeof t)return K(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(t,e):void 0}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Q(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function tt(t){if(Array.isArray(t))return t}function et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function rt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?et(Object(r),!0).forEach((function(e){nt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function nt(t,e,r){return(e=it(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function it(t){var e=at(t,"string");return"symbol"==W(e)?e:e+""}function at(t,e){if("object"!=W(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=W(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var ot={name:"",props:["id"],mixins:[q["a"]],components:{},data:function(){return{isLoading:!1,svgOut:null,fsaTitle:"",pagination:{sortBy:["id"],itemsPerPage:-1},rules:[],ruleHeaders:[{text:"#",value:"id",sortable:!0,width:85},{text:"Rule",value:"text",sortable:!1}]}},beforeMount:function(){},mounted:function(){this.refresh()},computed:rt({},Object(S["c"])(["getUser"])),methods:{refresh:function(){var t=this;E["a"].get("VirtualDeviceTypeFsas/"+this.id,this.getUser.apitoken,{filter:{include:["state","virtualDeviceType"]}}).then((function(e){var r=J(e,2),n=r[0];r[1];t.fsaTitle=n.label+" for "+n.virtualDeviceType.typename+" (v "+n.versionNumber+")",t.onJsonChange(n.jsonRepresentation,null,(function(e,r){t.svgOut=e,t.rules=r}))}))},close:function(){this.$emit("close")}},watch:{id:function(t,e){this.refresh()}}},st=ot,lt=(r("018f"),r("2877")),ct=Object(lt["a"])(st,z,Y,!1,null,null,null),ut=ct.exports,dt=function(){var t=this,e=t._self._c;return e("vuetify-datatable",{staticStyle:{border:"1px solid silver"},attrs:{options:t.pagination,headers:t.headers,items:t.data,"hide-default-footer":"","show-select":!0,loading:t.isLoading,"fixed-header":!0,height:"100%","show-group-by":!0,"show-expand":!0},on:{"update:options":function(e){t.pagination=e}},scopedSlots:t._u([{key:"item.updatedate",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.updatedate))}})]}},{key:"expanded-item",fn:function(r){var n=r.headers,i=r.item;return[e("td",{attrs:{colspan:n.length}},[t._v(t._s(i.description))])]}}]),model:{value:t.selectedOverrides,callback:function(e){t.selectedOverrides=e},expression:"selectedOverrides"}})},ht=[],ft=r("ed53");function pt(t){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(t)}function mt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?mt(Object(r),!0).forEach((function(e){yt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function yt(t,e,r){return(e=gt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gt(t){var e=bt(t,"string");return"symbol"==pt(e)?e:e+""}function bt(t,e){if("object"!=pt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function wt(t,e){return Ot(t)||Ct(t,e)||St(t,e)||xt()}function xt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function St(t,e){if(t){if("string"==typeof t)return _t(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_t(t,e):void 0}}function _t(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ct(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Ot(t){if(Array.isArray(t))return t}var Pt={name:"device-picker",props:["controller_id","deviceTypeIds"],mixins:[M["a"]],components:{VuetifyDatatable:ft["a"]},beforeMount:function(){this.refresh()},data:function(){return{isLoading:!1,moment:T.a,data:[],selectedOverrides:[],showFsa:!1,selectedId:null,pagination:{sortBy:["deviceLabel"],itemsPerPage:-1},headers:[{text:"Label",value:"label",sortable:!0,groupable:!1},{text:"Type",value:"typename",sortable:!0},{text:"State",value:"statename",sortable:!0},{text:"Version",value:"versionNumber",align:"center",groupable:!1},{text:"Updated",value:"updatedate",align:"center",groupable:!1},{text:"",value:"data-table-expand",groupable:!1,sortable:!1}]}},methods:{displayFsa:function(t){this.selectedId=t,this.showFsa=!0},refresh:function(t){var e=this;e.isLoading=!0;var r=[E["a"].get("ControllerFsaOverrides",this.getUser.apitoken,{filter:{where:{controller_id:this.controller_id}}}),E["a"].get("VirtualDeviceTypeFsas",this.getUser.apitoken,{filter:{include:["state","virtualDeviceType"],where:{isDeployed:!0,isDefault:!1,virtualDeviceType_id:{inq:this.deviceTypeIds}}}})];Promise.all(r).then((function(t){var r=wt(t,2),n=wt(r[0],2),i=n[0],a=(n[1],wt(r[1],2)),o=a[0];a[1];e.isLoading=!1;for(var s=[],l=[],c=i.map((function(t){return t.virtualDeviceTypeFsa_id})),u=0;u<o.length;u++){var d=o[u];s.push({id:d.id,label:d.label,versionNumber:d.versionNumber,description:d.description,statename:d.state?d.state.stateName:"All",typename:d.virtualDeviceType.typename,updatedate:d.updatedate}),c.includes(d.id)&&l.push(s[s.length-1])}e.data=s,e.selectedOverrides=l}))}},computed:vt({},Object(S["c"])(["getUser"])),watch:{selectedOverrides:function(t,e){var r=this;E["a"].post("ControllerFsaOverrides/batchSet",this.getUser.apitoken,{controller_id:this.controller_id,virtualDeviceTypeFsa_id:t.map((function(t){return t.id}))}).then((function(t,e){r.$emit("refresh")}))}}},Dt=Pt,kt=Object(lt["a"])(Dt,dt,ht,!1,null,null,null),Tt=kt.exports;function jt(t){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(t)}function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(r),!0).forEach((function(e){Lt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Lt(t,e,r){return(e=At(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function At(t){var e=Mt(t,"string");return"symbol"==jt(e)?e:e+""}function Mt(t,e){if("object"!=jt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function Ut(t,e){return $t(t)||Rt(t,e)||Ft(t,e)||Nt()}function Nt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ft(t,e){if(t){if("string"==typeof t)return Gt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gt(t,e):void 0}}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Rt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function $t(t){if(Array.isArray(t))return t}var Ht={name:"device-picker",props:["platformGroupId","controller_id"],mixins:[M["a"]],components:{DisplayFsa:ut,Customize:Tt},beforeMount:function(){this.refresh()},data:function(){return{isLoading:!1,data:[],showCustomize:!1,deviceTypeIds:null,showFsa:!1,selectedId:null,pagination:{sortBy:["stateName"],itemsPerPage:-1,groupBy:["deviceLabel"]},headers:[{value:"actions",sortable:!1,width:50,groupable:!1},{text:"Label",value:"label",sortable:!1,groupable:!1},{text:"Device",value:"deviceLabel",sortable:!0},{text:"State",sortable:!0,value:"stateName"},{text:"Version",align:"center",value:"versionNumber",groupable:!1},{text:"Default",value:"isDefault"},{text:"",value:"data-table-expand",groupable:!1,sortable:!1}]}},methods:{displayFsa:function(t){this.selectedId=t,this.showFsa=!0},refresh:function(t){var e=this;e.isLoading=!0,E["a"].get("ControllerFsaOverrides/getFsas",this.getUser.apitoken,{controller_id:this.controller_id}).then((function(t){var r=Ut(t,2),n=r[0];r[1];e.isLoading=!1,e.deviceTypeIds=n.devices.map((function(t){return t.deviceType_id}));for(var i=[],a=0;a<n.fsm.length;a++){var o=n.fsm[a];o.deviceLabel=o.virtualDeviceType.typename,o.state?o.stateName=o.state.stateName:o.stateName="All States",i.push(o)}e.data=i,console.log(e.data)}))}},computed:It({},Object(S["c"])(["getUser"])),watch:{}},Vt=Ht,Bt=Object(lt["a"])(Vt,$,H,!1,null,null,null),zt=Bt.exports,Yt=r("4bd4"),qt=r("8dd9"),Wt=r("3129"),Jt=r("8654"),Zt=r("71d9"),Xt=r("2a7f"),Kt=r("3a2f"),Qt=function(){var t=this,e=t._self._c;return e(a["a"],{attrs:{loading:t.isLoading,id:"VfuPhotoViewer"}},[e(o["c"],{staticClass:"h-100 d-flex flex-column"},[e(h["a"],{staticClass:"hidden-sm-and-down",attrs:{"no-gutters":""}},[e(s["a"],{staticClass:"pr-1",attrs:{cols:"2",lg:"1"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate"),noIcon:!0},model:{value:t.selectedStartDate,callback:function(e){t.selectedStartDate=e},expression:"selectedStartDate"}})],1),e(s["a"],{staticClass:"pr-1 pl-1",attrs:{cols:"2",md:"1",lg:"1"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime"),noIcon:!0},model:{value:t.selectedStartTime,callback:function(e){t.selectedStartTime=e},expression:"selectedStartTime"}})],1),e(s["a"],{staticClass:"pr-1 pl-1",attrs:{cols:"2",md:"2",lg:"1"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.endDate"),noIcon:!0},model:{value:t.selectedEndDate,callback:function(e){t.selectedEndDate=e},expression:"selectedEndDate"}})],1),e(s["a"],{staticClass:"pr-1 pl-1",attrs:{cols:"2",md:"1",lg:"1"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.endTime"),noIcon:!0},model:{value:t.selectedEndTime,callback:function(e){t.selectedEndTime=e},expression:"selectedEndTime"}})],1),e(s["a"],{staticClass:"pl-1 pr-1",attrs:{cols:"2",md:"3",lg:"5"}},[e(f["a"],{attrs:{label:"Show",items:t.frequency,"item-value":"id","item-text":"text"},model:{value:t.selectedFrequency,callback:function(e){t.selectedFrequency=e},expression:"selectedFrequency"}})],1),e(s["a"],{staticClass:"pr-1",attrs:{cols:"2"}},[e(f["a"],{attrs:{label:"Limit",items:t.limitItems,"item-value":"id","item-text":"text"},model:{value:t.limit,callback:function(e){t.limit=e},expression:"limit"}})],1),e(s["a"],{staticStyle:{"padding-top":"10px","text-align":"right"},attrs:{cols:"1"}},[e(Kt["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(i["a"],t._g({staticClass:"mr-2",attrs:{icon:"",outlined:"",color:"primary"},on:{click:t.onTakePhoto}},n),[e(c["a"],[t._v("add_a_photo")])],1)]}}])},[e("span",[t._v("Capture a new photo now")])]),e(Kt["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(i["a"],t._g({attrs:{outlined:"",icon:"",color:"primary"},on:{click:t.onResetRefresh}},n),[e(c["a"],[t._v("refresh")])],1)]}}])},[e("span",[t._v("Reload data from cloud")])])],1)],1),e(h["a"],{staticClass:"hidden-sm-and-down",attrs:{"no-gutters":""}},[e(s["a"],{staticClass:"pr-1",attrs:{cols:"11"}},[e(f["a"],{staticClass:"mt-0 mb-0",staticStyle:{"padding-top":"2px"},attrs:{label:"Select Cameras",multiple:"","small-chips":"","deletable-chips":"",items:t.cameras,"item-value":"id","item-text":"label"},model:{value:t.selectedCameras,callback:function(e){t.selectedCameras=e},expression:"selectedCameras"}})],1),e(s["a"],{attrs:{cols:"1"}},[e(Kt["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(m["a"],t._g({staticClass:"ml-4 mt-0 autoPhotoToggle",attrs:{loading:t.isAutoCapturingChanging,inset:"",label:"Auto"},model:{value:t.isAutoCapturing,callback:function(e){t.isAutoCapturing=e},expression:"isAutoCapturing"}},n))]}}])},[e("span",[t._v("Auto-capture every 15 minutes")])])],1)],1),e(qt["a"],{staticClass:"flex-grow-auto",staticStyle:{overflow:"auto",padding:"3px"}},[0==t.allSelectedCameras.length?e("div",{staticStyle:{"text-align":"center","padding-top":"80px"}},[t._v("\n        Please select at least one camera.\n      ")]):t._e(),t._l(t.allSelectedCameras,(function(r){return e("div",{key:"camera"+r.id},[e(Zt["a"],{staticClass:"mb-2",attrs:{dense:""}},[e(Xt["a"],[t._v(t._s(r.label))]),e(p["a"]),e("r-button",{staticClass:"mr-1 hidden-sm-and-down",attrs:{small:!0,color:"primary",icon:"movie",label:"Create Time-Lapse Movie"},on:{onclick:function(e){return t.onCreateTimeLapse(r.id)}}}),e("r-button",{attrs:{small:!0,color:"primary",icon:"drive_file_rename_outline",label:"Rename"},on:{onclick:function(e){return t.onRename(r.id)}}}),e("span",{staticClass:"d-flex d-sm-none"},[e("r-button",{staticClass:"pl-1",attrs:{small:!0,color:"primary",icon:"add_a_photo",label:"Take Photo"},on:{onclick:t.onTakePhoto}})],1)],1),e(h["a"],{attrs:{"no-gutters":""}},[t.waitingForImage?e(s["a"],{staticClass:"pr-1",attrs:{cols:"3",lg:"2"}},[e(Wt["a"],{staticClass:"mx-auto",attrs:{"max-width":"300",type:"card"}})],1):t._e(),t._l(r.images,(function(n,i){return e(s["a"],{key:"image"+i,staticClass:"pr-1",attrs:{cols:"6",sm:"4",md:"3",lg:"2"}},[e("photo",{staticClass:"mb-2",on:{show:t.onShow,tag:t.onTag},model:{value:r.images[i],callback:function(e){t.$set(r.images,i,e)},expression:"thisCamera.images[index]"}})],1)}))],2)],1)}))],2)],1),e(l["a"],{attrs:{persistent:"",width:"850"},model:{value:t.showCreateMovie,callback:function(e){t.showCreateMovie=e},expression:"showCreateMovie"}},[e("create-movie",{on:{close:function(e){t.showCreateMovie=!1}},model:{value:t.selectedImages,callback:function(e){t.selectedImages=e},expression:"selectedImages"}})],1),e(l["a"],{attrs:{width:"1100",fullscreen:t.fullscreenAnalysis},model:{value:t.showTagger,callback:function(e){t.showTagger=e},expression:"showTagger"}},[e("tag-photo",{staticClass:"vh100",staticStyle:{"max-height":"720px"},on:{close:function(e){t.showTagger=!1}},model:{value:t.selectedImage,callback:function(e){t.selectedImage=e},expression:"selectedImage"}})],1),e(l["a"],{attrs:{width:"400"},model:{value:t.showRename,callback:function(e){t.showRename=e},expression:"showRename"}},[e(a["a"],[e(o["d"],[e("h2",[t._v("Rename Camera")]),e(p["a"]),e(i["a"],{attrs:{icon:""},on:{click:function(e){t.showRename=!1}}},[e(c["a"],[t._v("close")])],1)],1),e(o["c"],[e(Yt["a"],{ref:"cameranameform",model:{value:t.isValidName,callback:function(e){t.isValidName=e},expression:"isValidName"}},[e(Jt["a"],{attrs:{label:"Name of Camera",counter:"255",rules:[t.rules.required]},model:{value:t.cameraName,callback:function(e){t.cameraName=e},expression:"cameraName"}})],1)],1),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{attrs:{color:"primary",text:"",disabled:!t.isValidName,loading:t.isLoading},on:{click:t.onChangeDeviceName}},[t._v("Save")])],1)],1)],1),e("photo-viewer",{model:{value:t.imagesToView,callback:function(e){t.imagesToView=e},expression:"imagesToView"}})],1)},te=[],ee=r("40dc"),re=r("a523"),ne=r("adda"),ie=function(){var t=this,e=t._self._c;return e(re["a"],[e(h["a"],{attrs:{justify:"space-around"}},[e(a["a"],{attrs:{width:"400"}},[e(ne["a"],{attrs:{height:"200px",src:t.thumbnailUrl},on:{click:t.onShow}},[e(ee["a"],{attrs:{flat:"",color:"rgba(0, 0, 0, 0)"}},[e(Kt["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(i["a"],t._g({staticClass:"hidden-sm-and-down",attrs:{color:"white",icon:""},on:{click:function(e){return e.stopPropagation(),t.onTag.apply(null,arguments)}}},n),[e(c["a"],[t._v("new_label")])],1)]}}])},[e("span",[t._v("Add/Edit Tags")])])],1),e(o["d"],{staticClass:"white--text mt-8"})],1),e(o["c"],[e("div",{staticClass:"justify-center font-weight-bold",staticStyle:{"font-size":"0.9em"}},[t._v("\n          "+t._s(t.moment(t.value.begintime).format("MM/DD/YYYY h:mm a"))+"\n        ")])])],1)],1)],1)},ae=[];r("ea10");function oe(t){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oe(t)}function se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function le(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?se(Object(r),!0).forEach((function(e){ce(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ce(t,e,r){return(e=ue(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ue(t){var e=de(t,"string");return"symbol"==oe(e)?e:e+""}function de(t,e){if("object"!=oe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var he={name:"",props:["value"],components:{},beforeMount:function(){var t=this.value.url.split("/");t=t[t.length-1],this.thumbnailUrl="https://agrinamics-images-resized.s3.amazonaws.com/resized-"+t},mounted:function(){},data:function(){return{moment:T.a,thumbnailUrl:null}},computed:le({},Object(S["c"])(["getUser"])),watch:{},methods:{onAnalyze:function(){this.$emit("analyze",this.value)},onTag:function(){this.$emit("tag",this.value)},onShow:function(){this.$emit("show",this.value)}}},fe=he,pe=Object(lt["a"])(fe,ie,ae,!1,null,null,null),me=pe.exports,ve=r("4458"),ye=r("dd20"),ge=function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"photoviewer"}},[e("viewer",{ref:"viewer",staticClass:"images clearfix",attrs:{images:t.value,options:t.imageViewerOptions},on:{inited:t.inited},scopedSlots:t._u([{key:"default",fn:function(r){return t._l(r.images,(function(n,i){return e("img",{key:"image"+i,staticClass:"image",attrs:{alt:i+1+" of "+r.images.length,src:n.url},on:{load:t.onImageLoad}})}))}}])})],1)},be=[],we=(r("0808"),r("172a")),xe={name:"",props:["value"],components:{Viewer:we["a"]},beforeMount:function(){},mounted:function(){},data:function(){return{showViewer:!1,imageViewerOptions:{inline:!1,button:!1,navbar:!1,title:[1,function(t,e){return"".concat(t.alt," (").concat(e.naturalWidth," × ").concat(e.naturalHeight,")")}],toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!1,keyboard:!1}}},computed:{},watch:{value:function(t,e){this.$viewer.view(0)}},methods:{onImageLoad:function(t){this.$viewer.view(0)},inited:function(t){this.$viewer=t}}},Se=xe,_e=(r("ddd7"),Object(lt["a"])(Se,ge,be,!1,null,null,null)),Ce=_e.exports,Oe=r("8e36"),Pe=function(){var t=this,e=t._self._c;return e(a["a"],[e(o["d"],[e("h2",[t._v("Create Time-Lapse Movie")]),e(p["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(c["a"],[t._v("close")])],1)],1),e(o["c"],{staticClass:"pb-0"},[e("canvas",{directives:[{name:"show",rawName:"v-show",value:t.isFilming,expression:"isFilming"}],staticStyle:{border:"1px solid silver"},attrs:{id:"createmoviecanvas",height:"600",width:"800"}}),e("video",{directives:[{name:"show",rawName:"v-show",value:!t.isLoading&&!t.isFilming,expression:"!isLoading && !isFilming"}],attrs:{src:t.downloadUrl,width:"800",height:"600",controls:""}}),t.isLoading?e(h["a"],{attrs:{id:"moviecanvasproxy","align-content":"center",justify:"center"}},[e(s["a"],{attrs:{cols:"10"}},[e("div",{staticStyle:{"text-align":"center"}},[t._v("\n          Images Loading. (This may take awhile)\n        ")]),e(Oe["a"],{attrs:{value:t.loadingProgress,height:"10",striped:""}})],1)],1):t._e()],1),e(o["a"],{staticClass:"justify-center"},[t.isFilming?e(Oe["a"],{attrs:{value:t.filmingProgress,height:"10",striped:""}}):t._e(),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:!t.isLoading&&!t.isFilming,expression:"!isLoading && !isFilming"}],attrs:{color:"primary",text:""},on:{click:t.downloadMovie}},[t._v("Download Movie")])],1)],1)},De=[];function ke(t){return ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ke(t)}function Te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function je(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Te(Object(r),!0).forEach((function(e){Ee(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ee(t,e,r){return(e=Ie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ie(t){var e=Le(t,"string");return"symbol"==ke(e)?e:e+""}function Le(t,e){if("object"!=ke(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Ae={name:"",props:["value"],components:{},beforeMount:function(){this.agrifyLogo.src="/img/AgrifyLogo.svg"},mounted:function(){this.start()},data:function(){return{ctx:null,agrifyLogo:new Image(60,60),downloadUrl:null,loadingProgress:0,isLoading:!1,isFilming:!1,loadedImages:[],counter:0,timer:null,stream:null,recorder:null,chunks:[]}},computed:je(je({},Object(S["c"])(["getUser"])),{},{filmingProgress:function(){return Math.round(this.counter/this.value.length*100)}}),watch:{value:function(t,e){this.start()}},methods:{onClose:function(){this.buildingCount=0,URL.revokeObjectURL(this.downloadUrl),this.recorder&&this.recorder.removeEventListener("dataavailable",this.finishMovie),this.recorder=null,this.counter=0,this.loadedImages=[],this.$emit("close")},start:function(){var t=this,e=this;this.isLoading=!0,this.loadingProgress=0,this.loadedImages=[];for(var r=function(r){t.loadedImages[r]=new Image,t.loadedImages[r].crossOrigin="anonymous",t.loadedImages[r].onload=function(t){e.loadedImages[r].isLoaded=!0;for(var n=0,i=0;i<e.loadedImages.length;i++)e.loadedImages[i].isLoaded&&n++;e.loadingProgress=Math.round(e.loadedImages.length/n*100),n==e.loadedImages.length&&e.refresh()},t.loadedImages[r].src=t.value[r]},n=0;n<this.value.length;n++)r(n)},showImage:function(){var t=this,e=document.getElementById("createmoviecanvas"),r=this.loadedImages[this.counter];this.ctx.drawImage(r,0,0,r.width,r.height,0,0,e.width,e.height),this.ctx.font="14px Arial",this.ctx.fillStyle="#FFFFFF",this.ctx.strokeStyle="#000000",this.ctx.fillText("Generated by Agrify Insights",10,590),t.ctx.drawImage(this.agrifyLogo,750,550,50,40),this.counter++,this.counter==this.value.length&&(clearInterval(this.timer),setTimeout((function(){t.recorder.stop()}),1500))},refresh:function(){var t=this;this.isLoading=!1,this.isFilming=!0,this.$nextTick((function(){var e=document.getElementById("createmoviecanvas");t.ctx=e.getContext("2d"),t.stream=e.captureStream(15),t.recorder=new MediaRecorder(t.stream,{mimeType:"video/webm"}),t.recorder.addEventListener("dataavailable",t.finishMovie),t.timer=setInterval(t.showImage,1e3),t.recorder.start()}))},finishMovie:function(t){var e=new Blob([t.data],{type:"video/webm"});this.downloadUrl=URL.createObjectURL(e),this.isFilming=!1},downloadMovie:function(t){var e=document.createElement("a");document.body.appendChild(e),e.style="display: none",e.href=this.downloadUrl,e.download="timelapse.webm",e.click()}}},Me=Ae,Ue=(r("9943"),Object(lt["a"])(Me,Pe,De,!1,null,null,null)),Ne=Ue.exports,Fe=r("c6a6"),Ge=r("a609"),Re=r("1d4d"),$e=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"d-flex flex-column",attrs:{loading:t.isLoading}},[e(o["d"],[e("h2",[t._v("Tag Photo "+t._s(t.value.id))]),e(p["a"]),e(Ge["a"],{attrs:{dark:""},model:{value:t.mode,callback:function(e){t.mode=e},expression:"mode"}},[e(i["a"],{staticStyle:{width:"110px"},attrs:{value:"Tag",small:"",color:"primary"}},[e(c["a"],{attrs:{left:""}},[t._v("label")]),t._v("\n        Tag\n      ")],1),e(i["a"],{staticStyle:{width:"110px"},attrs:{value:"Magnify",small:"",color:"primary"}},[e(c["a"],{attrs:{left:""}},[t._v("search")]),t._v("\n        Magnify\n      ")],1)],1),e(p["a"]),"Tag"==t.mode&&0==t.hotspots.length?e(Kt["a"],{scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(i["a"],t._g({attrs:{color:"primary",icon:""},on:{click:t.onImport}},n),[e(c["a"],[t._v("system_update")])],1)]}}],null,!1,2613766431)},[e("span",[t._v("Import tags from previous image")])]):t._e(),e(i["a"],{attrs:{color:"primary",icon:""},on:{click:t.refresh}},[e(c["a"],[t._v("refresh")])],1),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(c["a"],[t._v("close")])],1)],1),e(o["c"],{staticClass:"flex-grow-auto"},[e(h["a"],{staticClass:"h-100",attrs:{"no-gutters":""}},[e(s["a"],{staticClass:"h-100",attrs:{cols:"9"}},[t.showMagnifier?[e("div",{directives:[{name:"show",rawName:"v-show",value:t.showOriginal,expression:"showOriginal"}],staticClass:"imageBox"},[t.value?e("magnifier",{attrs:{src:t.value.url,"src-large":t.value.url}}):t._e()],1),t.showOriginal?t._e():e("div",{staticClass:"imageBox"},[t.value?e("magnifier",{attrs:{src:t.manipulatedImage,"src-large":t.manipulatedImage}}):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:t.autoHotspots.length>0,expression:"autoHotspots.length > 0"}],staticClass:"mt-3",staticStyle:{"text-align":"center"}},[e(i["a"],{attrs:{small:"",color:"primary",outlined:""}},[t._v("Export to Tags")])],1)],1)]:[e(Zt["a"],{staticStyle:{"margin-top":"4px"},attrs:{dense:""}},[e("span",{staticStyle:{width:"300px"}},[e(Fe["a"],{staticClass:"pl-1 pt-6 mb-0",attrs:{items:t.tags,label:"Anomaly","item-text":"label","item-value":"id","return-object":"",dense:""},model:{value:t.selectedTag,callback:function(e){t.selectedTag=e},expression:"selectedTag"}})],1),e(p["a"]),e(Ge["a"],{attrs:{small:""},model:{value:t.boxSize,callback:function(e){t.boxSize=e},expression:"boxSize"}},[e(i["a"],{attrs:{small:""}},[e(c["a"],[t._v("mdi-size-s")])],1),e(i["a"],{attrs:{small:""}},[e(c["a"],[t._v("mdi-size-m")])],1),e(i["a"],{attrs:{small:""}},[e(c["a"],[t._v("mdi-size-l")])],1)],1),e(p["a"]),e("span",{staticStyle:{width:"200px"}},[e("span",{staticClass:"v-label v-label--active primary--text",staticStyle:{float:"left","padding-right":"10px","padding-top":"5px"}},[t._v("Severity:\n              ")]),e(Re["a"],{attrs:{dense:"",hover:"",length:"5","empty-icon":"mdi-skull-crossbones-outline","full-icon":"mdi-skull-crossbones"},model:{value:t.ratingValue,callback:function(e){t.ratingValue=e},expression:"ratingValue"}})],1)],1),e("draw-area",{ref:"drawArea",staticClass:"imageBox",attrs:{photoUrl:t.value.url,boxSize:t.boxSize},on:{add:t.onHotspotAdd},model:{value:t.hotspots,callback:function(e){t.hotspots=e},expression:"hotspots"}})]],2),e(s["a"],{staticClass:"pl-1 h-100 overflow-auto",attrs:{cols:"3"}},t._l(t.hotspots,(function(r,n){return e(a["a"],{key:"hotspot"+n,staticClass:"mb-2 mt-1 mr-1"},[e(o["d"],[e("div",{staticClass:"smallTitle"},[r.label?e("span",[t._v(t._s(r.label))]):e("span",[t._v("Uncategorized")])]),e(p["a"]),e(i["a"],{attrs:{small:"",icon:"",color:"primary"},on:{click:function(e){return t.onEditHotspot(r)}}},[e(c["a"],{attrs:{small:""}},[t._v("edit")])],1)],1),e(o["c"],[e("div",{style:{width:r.width+"px",height:r.height+"px",border:"1px solid #4A8EDA","background-repeat":"no-repeat","background-position":"-"+r.left+"px -"+r.top+"px","background-image":"url("+t.value.url+")"}})]),e(o["a"],{staticClass:"justify-center pt-0"},[e(i["a"],{attrs:{small:"",text:"",color:"primary"},on:{click:function(e){return t.onDelete(n)}}},[t._v("Delete")])],1),t.selectedHotspot?e(l["a"],{attrs:{persistent:"",width:"720"},model:{value:t.showEditor,callback:function(e){t.showEditor=e},expression:"showEditor"}},[e("hotspot-editor",{attrs:{image:t.value,tags:t.tags},on:{close:function(e){t.showEditor=!1},save:t.saveHotspotEdits},model:{value:t.selectedHotspot,callback:function(e){t.selectedHotspot=e},expression:"selectedHotspot"}})],1):t._e()],1)})),1)],1)],1)],1)},He=[],Ve=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{height:"100%",width:"100%"}},[e("div",{staticClass:"vue-magnifier-container",staticStyle:{height:"100%",width:"100%"}},[t._t("default"),e("span",{ref:"magnificationElement",staticClass:"preview",style:{backgroundImage:"url("+t.src+")"}},[e("span",{ref:"glass",staticClass:"magnifying-glass",style:t.glassStyle})])],2)])},Be=[],ze={props:{src:String,srcLarge:String},computed:{glassStyle:function(){return{backgroundImage:"url(".concat(this.srcLarge,")"),backgroundPosition:this.backgroundPos,left:"".concat(this.cursorX,"px"),top:this.cursorY+"px"}}},methods:{getCursorPos:function(t){var e=window.Event?t.pageX:t.clientX;e-=document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;var r=window.Event?t.pageY:t.clientY;r-=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,this.cursorX=e-this.thumbPos.x,this.cursorY=r-this.thumbPos.y},getBounds:function(){var t=this.$refs.magnificationElement;this.bounds=t.getBoundingClientRect();var e=0,r=0;while(t){var n=this.getTransform(t);if("BODY"===t.tagName){var i=t.scrollLeft||document.documentElement.scrollLeft,a=t.scrollTop||document.documentElement.scrollTop;e+=t.offsetLeft-i+t.clientLeft+parseInt(n[0]),r+=t.offsetTop-a+t.clientTop+parseInt(n[1])}else e+=t.offsetLeft-t.scrollLeft+t.clientLeft+parseInt(n[0]),r+=t.offsetTop-t.scrollTop+t.clientTop+parseInt(n[1]);t=t.offsetParent}this.thumbPos={x:e,y:r}},moveMagnifier:function(t){t.preventDefault(),this.getBounds(),this.getCursorPos(t),this.backgroundPos="".concat(100*this.cursorX/this.bounds.width,"% ").concat(100*this.cursorY/this.bounds.height,"%")},getTransform:function(t){var e=window.getComputedStyle(t,null).getPropertyValue("-webkit-transform");function r(t){var e;if("none"!==t){var r=t.split("(")[1].split(")")[0].split(","),n=r[0],i=r[1];e=Math.round(Math.atan2(i,n)*(180/Math.PI))}else e=0;return e<0?e+=360:e}var n=e.match(/matrix(?:(3d)\(-{0,1}\d+\.?\d*(?:, -{0,1}\d+\.?\d*)*(?:, (-{0,1}\d+\.?\d*))(?:, (-{0,1}\d+\.?\d*))(?:, (-{0,1}\d+\.?\d*)), -{0,1}\d+\.?\d*\)|\(-{0,1}\d+\.?\d*(?:, -{0,1}\d+\.?\d*)*(?:, (-{0,1}\d+\.?\d*))(?:, (-{0,1}\d+\.?\d*))\))/),i=[0,0,0];return n&&("3d"===n[1]?i=n.slice(2,5):(n.push(0),i=n.slice(5,9)),i.push(r(e))),i}},mounted:function(){this.$nextTick((function(){this.$refs.magnificationElement.addEventListener("mousemove",this.moveMagnifier)}))},data:function(){return{img:null,width:null,height:null,bounds:null,cursorX:0,cursorY:0,thumbPos:{x:0,y:0},backgroundPos:"0 0"}}},Ye=ze,qe=(r("dc2f"),Object(lt["a"])(Ye,Ve,Be,!1,null,null,null)),We=qe.exports,Je=function(){var t=this,e=t._self._c;return e("div",{ref:"drawingArea",staticClass:"drawingArea",style:{"background-image":"url("+this.img.src+")"},on:{click:t.onDrawingAreaClick}},t._l(t.hotspots,(function(r,n){return e("vue-draggable-resizable",{key:"hotspot"+n+":r"+t.refresher,staticStyle:{border:"1px solid yellow"},attrs:{w:r.widthTranslated,h:r.heightTranslated,x:r.leftTranslated,y:r.topTranslated,parent:!0},on:{activated:function(e){return t.onActivated(r)},deactivated:t.onDeactivated,dragging:function(e,n){return t.dragging(r,e,n)},dragstop:function(e,n){return t.dragstop(r,e,n)},resizing:function(e,n,i,a){return t.onResize(r,e,n,i,a)}}})})),1)},Ze=[];function Xe(t){return Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(t)}function Ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ke(Object(r),!0).forEach((function(e){tr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function tr(t,e,r){return(e=er(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function er(t){var e=rr(t,"string");return"symbol"==Xe(e)?e:e+""}function rr(t,e){if("object"!=Xe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var nr={name:"",props:["photoUrl","value","boxSize"],components:{},beforeMount:function(){},mounted:function(){},data:function(){return{hotspots:[],refresher:0,addHotspot:!0,prevOffsetX:0,prevOffsetY:0,img:null,originalImageDimensions:{}}},computed:Qe({},Object(S["c"])(["getUser"])),watch:{value:{handler:function(t,e){this.hotspots=JSON.parse(JSON.stringify(t))},immediate:!0},photoUrl:{handler:function(t,e){this.img=new Image,this.img.onload=this.onImageLoad,this.img.src=this.photoUrl},immediate:!0},originalImageDimensions:function(t,e){this.redrawBoxes()}},methods:{redrawBoxes:function(){if(this.originalImageDimensions.w&&this.originalImageDimensions.h){for(var t=this.$refs.drawingArea,e=t.offsetWidth,r=e/this.originalImageDimensions.w,n=this.originalImageDimensions.h*r,i=n/this.originalImageDimensions.h,a=0;a<this.hotspots.length;a++){var o=this.hotspots[a];o.heightTranslated=Math.round(o.height*i),o.widthTranslated=Math.round(o.width*r),o.leftTranslated=Math.round(o.left*r),o.topTranslated=Math.round(o.top*i)}this.refresher++}},onImageLoad:function(t){this.originalImageDimensions={w:t.srcElement.width,h:t.srcElement.height}},enableHotspotCreation:function(){this.addHotspot=!0},disableHotspotCreation:function(){this.addHotspot=!1},onActivated:function(t){this.addHotspot=!1,this.$emit("select",t)},onDeactivated:function(){this.addHotspot=!0},onDrawingAreaClick:function(t){if(this.addHotspot){var e=15;switch(this.boxSize){case 0:e=10;break;case 1:break;case 2:e=20;break}var r={topTranslated:t.offsetY-e,leftTranslated:t.offsetX-e,widthTranslated:2*e,heightTranslated:2*e};this.convertLthw(r),this.hotspots.push(r),this.$emit("add",r),this.$emit("input",this.hotspots)}},convertLthw:function(t){var e=this.$refs.drawingArea,r=e.offsetWidth,n=this.originalImageDimensions.w/r,i=this.originalImageDimensions.h*(1/n),a=this.originalImageDimensions.h/i;return t.left=Math.round(t.leftTranslated*n),t.top=Math.round(t.topTranslated*a),t.height=Math.round(t.heightTranslated*a),t.width=Math.round(t.widthTranslated*n),t},onResize:function(t,e,r,n,i){t.leftTranslated=e,t.topTranslated=r,t.widthTranslated=n,t.heightTranslated=i,this.convertLthw(t),this.$emit("input",this.hotspots),this.$emit("change",t)},dragging:function(t,e,r){var n=e-t.leftTranslated,i=r-t.topTranslated;t.leftTranslated+=this.deltaX(n),t.topTranslated+=this.deltaX(i),this.convertLthw(t),this.$emit("input",this.hotspots)},dragstop:function(t,e,r){t.leftTranslated=e,t.topTranslated=r,this.convertLthw(t),this.prevOffsetX=0,this.prevOffsetY=0,this.$emit("input",this.hotspots),this.$emit("change",t)},deltaX:function(t){var e=t-this.prevOffsetX;return this.prevOffsetX=t,e},deltaY:function(t){var e=t-this.prevOffsetY;return this.prevOffsetY=t,e}}},ir=nr,ar=(r("c5a4"),Object(lt["a"])(ir,Je,Ze,!1,null,"b03abef0",null)),or=ar.exports,sr=r("a844"),lr=function(){var t=this,e=t._self._c;return e(a["a"],[e(o["d"],[e("h2",[t._v("Edit Hotspot")]),e(p["a"]),e(i["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(c["a"],[t._v("close")])],1)],1),e(o["c"],[e(h["a"],{attrs:{"no-gutters":""}},[e(s["a"],{staticClass:"pr-2",attrs:{cols:"7"}},[e(Fe["a"],{attrs:{items:t.tags,label:"Anomaly","item-text":"label","item-value":"id","return-object":""},model:{value:t.selectedTag,callback:function(e){t.selectedTag=e},expression:"selectedTag"}}),e("span",{staticClass:"v-label",staticStyle:{float:"left","padding-right":"10px","padding-top":"5px"}},[t._v("Severity:\n        ")]),e(Re["a"],{attrs:{dense:"",hover:"",length:"5","empty-icon":"mdi-skull-crossbones-outline","full-icon":"mdi-skull-crossbones"},model:{value:t.rec.severity,callback:function(e){t.$set(t.rec,"severity",e)},expression:"rec.severity"}}),e(sr["a"],{staticClass:"mt-3",attrs:{outlined:"",label:"Description/Notes"},model:{value:t.rec.description,callback:function(e){t.$set(t.rec,"description",e)},expression:"rec.description"}})],1),e(s["a"],{staticClass:"pl-2",attrs:{cols:"5"}},[e("fieldset",{staticStyle:{width:"100%",height:"265px",overflow:"auto",padding:"10px",display:"flex","justify-content":"center","align-items":"center"}},[e("legend",[t._v("Image")]),e("div",{style:{display:"inline-block",width:t.value.width+"px",height:t.value.height+"px",border:"1px solid silver","background-repeat":"no-repeat","background-position":"-"+t.value.left+"px -"+t.value.top+"px","background-image":"url("+t.image.url+")"}})])])],1)],1),e(o["a"],{staticClass:"justify-center pt-0"},[e(i["a"],{attrs:{text:"",color:"primary"},on:{click:function(e){return t.onSave()}}},[t._v("Save")])],1)],1)},cr=[];function ur(t){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(t)}function dr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function hr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dr(Object(r),!0).forEach((function(e){fr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function fr(t,e,r){return(e=pr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pr(t){var e=mr(t,"string");return"symbol"==ur(e)?e:e+""}function mr(t,e){if("object"!=ur(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var vr={name:"",props:["value","image","tags"],components:{},data:function(){return{selectedTag:null,rec:{severity:0,description:null}}},beforeMount:function(){},computed:hr({},Object(S["c"])(["getUser"])),methods:{onClose:function(){this.$emit("close")},onSave:function(){this.$emit("save",this.rec)}},watch:{selectedTag:function(t,e){this.rec.label=t.label,this.rec[t.type]=t.value},value:{handler:function(t,e){if(this.rec=JSON.parse(JSON.stringify(t)),t.ag_nutrientDeficiencySymptom_id){for(var r=0;r<this.tags.length;r++)if("ag_nutrientDeficiencySymptom_id"==this.tags[r].type&&this.tags[r].value==t.ag_nutrientDeficiencySymptom_id){this.selectedTag=this.tags[r];break}}else if(t.imageTag_id)for(var n=0;n<this.tags.length;n++)if("imageTag_id"==this.tags[n].type&&this.tags[n].value==t.imageTag_id){this.selectedTag=this.tags[n];break}},immediate:!0}}},yr=vr,gr=Object(lt["a"])(yr,lr,cr,!1,null,null,null),br=gr.exports;function wr(t){return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wr(t)}function xr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Sr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xr(Object(r),!0).forEach((function(e){_r(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _r(t,e,r){return(e=Cr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cr(t){var e=Or(t,"string");return"symbol"==wr(e)?e:e+""}function Or(t,e){if("object"!=wr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=wr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function Pr(t,e){return Er(t)||jr(t,e)||kr(t,e)||Dr()}function Dr(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kr(t,e){if(t){if("string"==typeof t)return Tr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tr(t,e):void 0}}function Tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function jr(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Er(t){if(Array.isArray(t))return t}var Ir={name:"",props:["value"],components:{Magnifier:We,DrawArea:or,HotspotEditor:br},beforeMount:function(){var t=this,e=[E["a"].get("ag_nutrientDeficiencySymptoms",this.getUser.apitoken,{filter:{fields:["id","label"],order:"label"}}),E["a"].get("imageTags",this.getUser.apitoken,{filter:{sort:"label"}})];Promise.all(e).then((function(e){for(var r=Pr(e,2),n=Pr(r[0],2),i=n[0],a=(n[1],Pr(r[1],2)),o=a[0],s=(a[1],[]),l=0;l<i.length;l++)s.push({label:i[l].label,type:"ag_nutrientDeficiencySymptom_id",value:i[l].id,id:"NDS:"+i[l].id});for(var c=0;c<o.length;c++)s.push({label:o[c].label,type:"imageTag_id",value:o[c].id,id:"IT:"+o[c].id});s.sort((function(t,e){return t.label>e.label?1:-1})),t.tags=s}))},mounted:function(){},data:function(){return{mode:"",showEditor:!1,ratingValue:1,tags:[],addHotspot:!1,showOriginal:!0,manipulatedImage:null,selectedTags:[],isLoading:!1,isAnalyzed:!1,showMagnifier:!0,hotspots:[],autoHotspots:[],selectedTag:null,boxSize:1,selectedHotspot:null}},computed:Sr({},Object(S["c"])(["getUser"])),watch:{mode:function(t,e){switch(t){case"Analyze":this.onAnalyze();break;case"Magnify":this.onHideAnalysis();break;case"Tag":this.onTag();break}},value:{handler:function(t,e){this.isAnalyzed=!1,this.refresh(!0)},immediate:!0}},methods:{onImport:function(){var t=this;E["a"].post("ag_photoTags/importHotspotsFromPriorImage",this.getUser.apitoken,{photo_id:this.value.id}).then((function(e){var r=Pr(e,2),n=r[0];r[1];n?t.refresh(!1):j["a"].error("An error occurred. Please try again later.")}))},saveHotspotEdits:function(t){var e=this;E["a"].patch("ag_photoTags",this.getUser.apitoken,{id:t.id,facility_id:t.facility_id,severity:t.severity,description:t.description,ag_nutrientDeficiencySymptom_id:t.ag_nutrientDeficiencySymptom_id,imageTag_id:t.imageTag_id,photo_id:t.photo_id}).then((function(t){var r=Pr(t,2),n=(r[0],r[1]);n?j["a"].error("An error occurred. Please try again later."):(e.showEditor=!1,e.refresh(!1))}))},onEditHotspot:function(t){this.selectedHotspot=t,this.showEditor=!0},onDelete:function(t){var e=this.hotspots[t].id;E["a"].destroy("ag_photoTags",e,this.getUser.apitoken).then((function(t){var e=Pr(t,2),r=(e[0],e[1]);r&&j["a"].error("An error occurred. Please try again later.")})),this.hotspots.splice(t,1)},onHotspotAdd:function(t){this.selectedTag&&(t.label=this.selectedTag.label,t[this.selectedTag.type]=this.selectedTag.value),t.severity=this.boxSize,t.photo_id=this.value.id,t.facility_id=this.getUser.facility_id,E["a"].post("ag_photoTags",this.getUser.apitoken,{facility_id:this.getUser.facility_id,photo_id:t.photo_id,top:Math.round(t.top),left:Math.round(t.left),width:Math.round(t.width),height:Math.round(t.height),severity:t.severity,ag_nutrientDeficiencySymptom_id:t.ag_nutrientDeficiencySymptom_id,imageTag_id:t.imageTag_id}).then((function(e){var r=Pr(e,2),n=r[0],i=r[1];i?j["a"].error("An error occurred. Please try again later."):t.id=n.id}))},onClose:function(){this.$emit("close")},onShowMarkerDefaults:function(){},onHideAnalysis:function(){this.showOriginal=!0,this.showMagnifier=!0},onAnalyze:function(){var t=this;this.isAnalyzed?t.showOriginal=!1:(this.isLoading=!0,E["a"].get("photos/analyze",this.getUser.apitoken,{id:this.value.id}).then((function(e){var r=Pr(e,2),n=r[0];r[1];t.isLoading=!1,t.manipulatedImage=n.data.transformedImage,t.showOriginal=!1,t.isAnalyzed=!0,t.autoHotspots=n.data.problems}))),this.showMagnifier=!0},onTag:function(){this.showMagnifier=!1},save:B()((function(){this.isLoading||E["a"].post("photoTags/updatetags",this.getUser.apitoken,{photo_id:this.value.id,label:this.selectedTags}).then((function(t){var e=Pr(t,2),r=(e[0],e[1]);r&&j["a"].error("An error occurred. Please try again later.")}))}),250),refresh:function(t){var e=this;this.isLoading=!0,E["a"].get("ag_photoTags",this.getUser.apitoken,{filter:{include:[{relation:"agNutrientdeficiencysymptom"},{relation:"imageTag"}],where:{photo_id:this.value.id}}}).then((function(r){for(var n=Pr(r,2),i=n[0],a=(n[1],0);a<i.length;a++)i[a].agNutrientdeficiencysymptom?i[a].label=i[a].agNutrientdeficiencysymptom.label:i[a].imageTag&&(i[a].label=i[a].imageTag.label);e.hotspots=i,e.isLoading=!1;var o=e.$refs.drawArea;o&&e.$nextTick((function(){o.redrawBoxes()})),t&&(e.mode="Tag")}))}}},Lr=Ir,Ar=(r("afdd1"),Object(lt["a"])(Lr,$e,He,!1,null,"198673e2",null)),Mr=Ar.exports,Ur=r("9c4f");function Nr(t){return Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nr(t)}function Fr(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Fr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Nr(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Nr(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Gr(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Rr(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){Gr(a,n,i,o,s,"next",t)}function s(t){Gr(a,n,i,o,s,"throw",t)}o(void 0)}))}}function $r(t,e){return Yr(t)||zr(t,e)||Vr(t,e)||Hr()}function Hr(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Vr(t,e){if(t){if("string"==typeof t)return Br(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Br(t,e):void 0}}function Br(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function zr(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Yr(t){if(Array.isArray(t))return t}function qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qr(Object(r),!0).forEach((function(e){Jr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Jr(t,e,r){return(e=Zr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zr(t){var e=Xr(t,"string");return"symbol"==Nr(e)?e:e+""}function Xr(t,e){if("object"!=Nr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Nr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Kr={name:"",props:["controller_id","device_id","lastEventReceived"],mixins:[M["a"],Ur["a"]],components:{Photo:me,VuetifyTimepicker:ye["a"],VuetifyDatepicker:ve["a"],PhotoViewer:Ce,CreateMovie:Ne,TagPhoto:Mr},beforeMount:function(){this.getDevices()},mounted:function(){},data:function(){var t=this.nowInTZPref().subtract(2,"hour"),e=this.nowInTZPref(),r=t.clone().format("YYYY-MM-DD"),n=t.clone().format("HH:mm"),i=e.clone().format("YYYY-MM-DD"),a=e.clone().format("HH:mm");return{fullscreenAnalysis:!1,showTagger:!1,isValidName:!1,limit:6,cameraName:"",showRename:!1,selectedDeviceId:null,isAutoCapturingChanging:!1,isAutoCapturing:null,isLoading:!1,showViewer:!1,showCreateMovie:!1,selectedImages:[],selectedImage:null,waitingForImage:!1,selectedCameras:[],images:[],selectedStartDate:r,selectedEndDate:i,selectedStartTime:n,selectedEndTime:a,selectedFrequency:1,imagesToView:[],sendingCommand:!1,limitItems:[{id:0,text:"All"},{id:6,text:"6 Photos"},{id:12,text:"12 Photos"},{id:24,text:"24 Photos"}],frequency:[{id:1,text:"All Photos"},{id:2,text:"2 photos per hour"},{id:4,text:"1 photo per hour"},{id:16,text:"1 photo every 4 hours"},{id:24,text:"1 photo every 6 hours"},{id:48,text:"1 photo every 12 hours"},{id:96,text:"1 photo every day"}],cameras:[]}},computed:Wr(Wr({},Object(S["c"])(["getUser"])),{},{allSelectedCameras:function(){var t=this;return this.cameras.filter((function(e){return t.selectedCameras.includes(e.id)}))}}),watch:{lastEventReceived:function(t,e){setTimeout(this.onResetRefresh,3e3)},isAutoCapturing:function(t,e){if(null!==e){var r=this;this.isAutoCapturingChanging=!0,E["a"].post("controllerCommands",this.getUser.apitoken,{controller_id:this.controller_id,virtualDevice_id:this.device_id,action_id:t?129:130,value:900}).then((function(t){var e=$r(t,2);e[0],e[1];r.isAutoCapturingChanging=!1}))}},controller_id:{handler:function(t,e){if(t){var r=this;E["a"].get("controllers/"+this.controller_id,this.getUser.apitoken).then((function(t){var e=$r(t,2),n=e[0];e[1];r.isAutoCapturing=!0===n.autoSnapPhotos})),this.refresh()}},immediate:!0},selectedStartDate:function(t,e){this.refresh()},selectedStartTime:function(t,e){this.refresh()},selectedEndDate:function(t,e){this.refresh()},selectedEndTime:function(t,e){this.refresh()},selectedFrequency:function(t,e){this.refresh()},selectedCameras:function(t,e){this.refresh()},limit:function(t,e){this.refresh()}},methods:{getDevices:function(){var t=this;E["a"].get("ag_platformGroups",this.getUser.apitoken,{filter:{where:{controller_id:this.controller_id},include:{relation:"cameras",scope:{sort:"label",include:{relation:"camera",scope:{sort:"label",include:["cameraType"],fields:["id","label","ip","streamUrl"]}}}},sort:"label"}}).then((function(e){for(var r=$r(e,2),n=r[0],i=(r[1],n[0].cameras),a=[],o=0;o<i.length;o++)i[o].camera?a.push(i[o].camera):console.log("no camera relation found",i[o]);t.cameras=a,t.selectedCameras=t.cameras.map((function(t){return t.id})),t.refresh()}))},onChangeDeviceName:function(){var t=this;this.isLoading=!0,E["a"].patch("cameras",this.getUser.apitoken,{id:this.selectedDeviceId,label:this.cameraName}).then((function(e){var r=$r(e,2),n=r[0];r[1];t.isLoading=!1,n?(j["a"].success("Camera name changed"),t.showRename=!1,t.getDevices()):j["a"].error("An error occurred. Please try again later")}))},onRename:function(t){this.selectedDeviceId=t;var e=this.cameras.find((function(e){return e.id==t}));this.cameraName=e.label,this.showRename=!0},onTag:function(t){this.selectedImage=t,this.showTagger=!0},onCreateTimeLapse:function(t){var e=this.allSelectedCameras.find((function(e){return e.id==t}));this.selectedImages=e.images.map((function(t){return t.url})).reverse(),this.showCreateMovie=!0},onResetRefresh:function(t,e){var r=this.nowInTZPref();this.selectedEndDate=r.format("YYYY-MM-DD"),this.selectedEndTime=r.add(2,"minutes").format("HH:mm"),this.waitingForImage=!1},onTakePhoto:function(){var t=this;this.sendingCommand=!0,this.waitingForImage=!0,E["a"].post("controllerCommands",this.getUser.apitoken,{controller_id:this.controller_id,virtualDevice_id:this.device_id,action_id:128}).then((function(e){var r=$r(e,2),n=r[0];r[1];n?j["a"].success("Request submitted."):j["a"].error("Request failed. Please try again later."),t.sendingCommand=!1}))},onShow:function(t){this.imagesToView=[t]},refresh:B()(Rr(Fr().mark((function t(){var e,r,n,i,a,o,s,l,c;return Fr().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(this.isLoading){t.next=17;break}if(this.isLoading=!0,e=T()(this.selectedStartDate+" "+this.selectedStartTime).utc(),r=T()(this.selectedEndDate+" "+this.selectedEndTime).utc(),!this.allSelectedCameras.length){t.next=15;break}for(n={},i=0;i<this.allSelectedCameras.length;i++)this.allSelectedCameras[i].images=[],n[this.allSelectedCameras[i].id]=this.allSelectedCameras[i];return t.next=9,E["a"].get("photos/search",this.getUser.apitoken,{camera_id:this.selectedCameras,controller_id:this.controller_id,startdate:e.format("YYYY-MM-DD HH:mm"),enddate:r.format("YYYY-MM-DD HH:mm"),skip:this.selectedFrequency});case 9:for(a=t.sent,o=$r(a,2),s=o[0],o[1],l=0;l<s.data.length;l++)n[s.data[l].camera_id].images.push(s.data[l]);if(this.limit>0)for(c=0;c<this.allSelectedCameras.length;c++)this.allSelectedCameras[c].images=this.allSelectedCameras[c].images.slice(0,this.limit);case 15:this.waitingForImage=!1,this.isLoading=!1;case 17:case"end":return t.stop()}}),t,this)}))),250)}},Qr=Kr,tn=(r("738e"),Object(lt["a"])(Qr,Qt,te,!1,null,null,null)),en=tn.exports,rn=r("81f6"),nn=r("5e66"),an=r("3e35"),on=function(){var t=this,e=t._self._c;return e(nn["a"],{attrs:{cycle:!1,"hide-delimiters":"",light:"",height:"100%","show-arrows-on-hover":"",touchless:""},model:{value:t.carouselTab,callback:function(e){t.carouselTab=e},expression:"carouselTab"}},[e(an["a"],[e(qt["a"],{attrs:{height:"100%"}},[t.devices.length>0?e("environment-graph",{attrs:{platformGroup_id:t.platformGroup_id,platformGroup_name:t.platformGroup_name,device_id:t.deviceId,controllerId:t.controllerId,devices:t.devices,sDate:t.selectedStartDate,sTime:t.selectedStartTime,eDate:t.selectedEndDate,eTime:t.selectedEndTime},on:{datechange:t.onChangeDate}}):t._e()],1)],1),e(an["a"],[e(qt["a"],{attrs:{height:"100%"}},[e("environment-sparklines",{attrs:{platformGroup_id:t.platformGroup_id,platformGroup_name:t.platformGroup_name,device_id:t.deviceId,controllerId:t.controllerId,devices:t.devices,sDate:t.selectedStartDate,sTime:t.selectedStartTime,eDate:t.selectedEndDate,eTime:t.selectedEndTime},on:{datechange:t.onChangeDate}})],1)],1),t.device.lifecyclesRaw&&t.device.lifecyclesRaw.length>0?e(an["a"],[e(qt["a"],{attrs:{height:"100%"}},[e("environment-gauges",{attrs:{iconSize:30,facility:t.facility,device:t.device,lifecyclePhase:t.device.lifecyclesRaw[0],controller_id:t.controllerId,platformGroup_id:t.platformGroup_id,lastEventReceived:t.lastEventReceived},on:{"emit-action":t.emitAction}})],1)],1):t._e(),t.complianceData.length>0?e(an["a"],[e(qt["a"],{attrs:{height:"100%"}},[e("environment-compliance",{model:{value:t.complianceData,callback:function(e){t.complianceData=e},expression:"complianceData"}})],1)],1):t._e(),t.soilsensors.length?e(an["a"],[e(qt["a"],{attrs:{height:"100%"}},[e(h["a"],{attrs:{justify:"center","no-gutters":""}},[e(s["a"],{staticClass:"pl-1 pr-1 pb-0",attrs:{cols:"2",lg:"2"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate"),noIcon:!0},on:{change:t.loadSoilSensoring},model:{value:t.selectedStartDate,callback:function(e){t.selectedStartDate=e},expression:"selectedStartDate"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",attrs:{cols:"2",lg:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime"),noIcon:!0},on:{change:t.loadSoilSensoring},model:{value:t.selectedStartTime,callback:function(e){t.selectedStartTime=e},expression:"selectedStartTime"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",attrs:{cols:"2",lg:"2"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.endDate"),noIcon:!0},on:{change:t.loadSoilSensoring},model:{value:t.selectedEndDate,callback:function(e){t.selectedEndDate=e},expression:"selectedEndDate"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",attrs:{cols:"2",lg:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.endTime"),noIcon:!0},on:{change:t.loadSoilSensoring},model:{value:t.selectedEndTime,callback:function(e){t.selectedEndTime=e},expression:"selectedEndTime"}})],1)],1),e(h["a"],{staticClass:"xiaomi-chart",attrs:{justify:"center","no-gutters":""}},[e("xiaomi-chart",{model:{value:t.soilsensors,callback:function(e){t.soilsensors=e},expression:"soilsensors"}})],1)],1)],1):t._e()],1)},sn=[],ln=function(){var t=this,e=t._self._c;return e(a["a"],{staticClass:"screen-height-container d-flex flex-column",attrs:{flat:"",id:"environmentSparklineGraph"}},[e(re["a"],{staticClass:"hidden-sm-and-down pb-0 text-center"},[e(h["a"],{staticClass:"justify-center",attrs:{"no-gutters":""}},[e(s["a"],{staticClass:"pl-1 pr-1 pb-0",class:{"sm9 md2":t.isMaximized,"sm4 md2":!t.isMaximized},attrs:{cols:"2",lg:"1"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate"),noIcon:!0},model:{value:t.selectedStartDate,callback:function(e){t.selectedStartDate=e},expression:"selectedStartDate"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",class:{md3:t.isMaximized,md2:!t.isMaximized},attrs:{cols:"2",lg:"1",md:"1"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime"),noIcon:!0},model:{value:t.selectedStartTime,callback:function(e){t.selectedStartTime=e},expression:"selectedStartTime"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",class:{"sm9 md2":t.isMaximized,"sm4 md2":!t.isMaximized},attrs:{cols:"2",lg:"1"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.endDate"),noIcon:!0},model:{value:t.selectedEndDate,callback:function(e){t.selectedEndDate=e},expression:"selectedEndDate"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",class:{"sm9 md3":t.isMaximized,"sm6 md2":!t.isMaximized},attrs:{cols:"2",lg:"1",md:"1"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.endTime"),noIcon:!0},model:{value:t.selectedEndTime,callback:function(e){t.selectedEndTime=e},expression:"selectedEndTime"}})],1),e(s["a"],{staticClass:"pl-1 pb-0",class:{"sm9 md3":t.isMaximized,"sm6 md2":!t.isMaximized},attrs:{cols:"2",lg:"1"}},[e(f["a"],{attrs:{items:t.chartUnits,label:t.$t("common.precision")},model:{value:t.selectedUnit,callback:function(e){t.selectedUnit=e},expression:"selectedUnit"}})],1),e(s["a"],{staticClass:"pl-1 pb-0",class:{"sm9 md3":t.isMaximized,"sm6 md2":!t.isMaximized},attrs:{cols:"2",lg:"2"}},[e(f["a"],{attrs:{disabled:!(t.Trimaster.isAdmin(t.getUser)||t.Trimaster.isUserInRole(t.getUser,"Maintenance")||t.Trimaster.isUserInRole(t.getUser,"Technician")),items:t.datasetTypes,label:t.$t("common.series")},model:{value:t.datasetType,callback:function(e){t.datasetType=e},expression:"datasetType"}})],1),e(s["a"],{staticClass:"d-flex align-center pl-2 pb-2",attrs:{lg:"1",cols:"1"}},[e("span",{staticClass:"densebuttons",staticStyle:{"white-space":"nowrap"}},["table"==t.displayMode&&t.platformGroup_id>0&&!t.selectedZone?e(Kt["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(i["a"],t._g({staticClass:"iconOnly",attrs:{outlined:"",color:"primary"},on:{click:t.toggleDisplayMode}},n),[e(c["a"],[t._v("multiline_chart")])],1)]}}],null,!1,757846599)},[e("span",[t._v("View Chart")])]):t._e(),e(Kt["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(i["a"],t._g({staticClass:"iconOnly",attrs:{outlined:"",color:"primary"},on:{click:t.doChartRefresh}},n),[e(c["a"],[t._v("refresh")])],1)]}}])},[e("span",[t._v("Refresh")])])],1)])],1)],1),0!=t.chartData.dataset.length||t.isLoading?t._e():e("div",{staticClass:"text-center p-xl",staticStyle:{height:"100%"}},[e("h3",{staticClass:"justify-center",staticStyle:{"margin-top":"130px"}},[t._v("\n      No data to display.\n    ")])]),e("div",{staticClass:"flex-grow-auto"},[e("full-screen-chart",{staticStyle:{height:"100% !important"},attrs:{chartTypeOverride:t.chartsToPlot,title:t.platformGroup_name,chartData:t.chartData,tz:t.getUser.facility_timezone,annotationData:t.annotationData,annotationDevices:t.annotationDevices,date:t.startDate,startDate:t.startDateStr,endDate:t.endDateStr,ecuData:t.ecuChartData}})],1)],1)},cn=[],un=r("98b0"),dn=r("3488");function hn(t){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(t)}function fn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function pn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fn(Object(r),!0).forEach((function(e){mn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mn(t,e,r){return(e=vn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vn(t){var e=yn(t,"string");return"symbol"==hn(e)?e:e+""}function yn(t,e){if("object"!=hn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var gn={name:"zone-devices",props:["device_id","platformGroup_id","platformGroup_name","controller_id","selectedZone","devices","sDate","sTime","eDate","eTime"],mixins:[M["a"],dn["a"]],components:{VuetifyDatepicker:ve["a"],VuetifyTimepicker:ye["a"],ChartDataTable:C["a"],FullScreenChart:un["a"]},data:function(){var t=this.nowInTZPref().subtract(2,"hour"),e=this.nowInTZPref();return{chartsToPlot:[1,3,2,5,8,4],isMaximized:!1,keyIndex:0,displayMode:"chart",datasetTypes:["Minimums","Averages","Maximums","Latest"],datasetType:"Averages",datasetTypePropertiesMap:{Minimums:"minReading",Averages:"avgReading",Maximums:"maxReading",Latest:"reading"},datasetTypeProperties:["minReading","avgReading","maxReading","reading"],datasetTypeProperty:"avgReading",device:null,Trimaster:E["a"],isLoading:!0,selectedUnit:"minute",platformGroupId:0,deviceId:0,controllerId:0,vpdChartData:[],chartUnits:[{text:this.$t("time.minute"),value:"minute"},{text:this.$t("time.hour"),value:"hour"},{text:this.$t("time.day"),value:"day"},{text:this.$t("time.month"),value:"month"}],vpdData:{},startDate:t,endDate:e,selectedStartDate:null,selectedEndDate:null,selectedStartTime:null,selectedEndTime:null,item:null,ecuStateColors:{HEAT:"rgba(255, 138, 128)",HEATING2:"rgba(179, 0, 0)",HEATING3:"rgba(102, 0, 0)",DEHUMIDIFYING:"rgba(159, 90, 253, 1)",COOLING:"rgba(82, 179, 217, 1)",COOLING2:"rgba(0, 0, 255, 1)",CIRCULATING:"rgba(255, 167, 38, 1)",OFF:"white",FAN:"rgba(217, 217, 217, 1)",LOW_CIRCULATE:"rgba(255, 204, 128, 1)",DEHUMHEATING:"rgba(255, 0, 255, 1)"},annotationDevices:[],maxRecordsLimit:2e3,maxRecordsHit:!1}},beforeMount:function(){this.chartSetup(),window.localStorage.getItem("environmentChart_datasetType")&&(this.datasetType=window.localStorage.getItem("environmentChart_datasetType")),this.refresh()},mounted:function(){var t=this;this.$root.$on("isMaximized",(function(e){t.isMaximized=!e})),window.addEventListener("resize",this.checkScreen,{passive:!0}),this.checkScreen()},computed:pn(pn({},Object(S["c"])(["getUser"])),{},{canFetch:function(){return"number"==typeof this.chartDevice.temperature&&this.chartDevice.temperature>0||"object"==hn(this.chartDevice.temperature)&&this.chartDevice.temperature.length>0||("number"==typeof this.chartDevice.humidity&&this.chartDevice.humidity>0||"object"==hn(this.chartDevice.humidity)&&this.chartDevice.humidity.length>0||("number"==typeof this.chartDevice.co2&&this.chartDevice.co2>0||"object"==hn(this.chartDevice.co2)&&this.chartDevice.co2.length>0||(this.chartDevice.ecu>0||this.chartDevice.irr.length>0)))}}),methods:pn(pn({},Object(S["b"])(["getPlatformGroupDevices","getZoneDevice"])),{},{refresh:function(){var t=this,e=this.devices;t.temperatureDevices=[],t.co2Devices=[],t.humidityDevices=[],t.chartDevice.curtains=[],t.chartDevice.lights=[],e.forEach((function(e){e.device.toUpperCase().indexOf("ECU")>=0&&(t.chartDevice.ecu=e.id),e.device.toUpperCase().indexOf("BARD")>=0&&(t.chartDevice.bard=e.id,t.chartDevice.ecu=e.id),e.device.toUpperCase().indexOf("HEATERSTRIP")>=0&&(t.chartDevice.heaterStrip=e.id),(e.device.toUpperCase().indexOf("VFUDEHUMIDIFIER")>=0||e.device.toUpperCase().indexOf("TWOSTAGEDEHUMIDIFIER")>=0)&&(t.chartDevice.dehumidifier=e.id),e.device.toUpperCase().indexOf("VFUHUMIDIFIER")>=0&&(t.chartDevice.humidifier=e.id),e.device.toUpperCase().indexOf("CO2 VALVE")>=0&&(t.chartDevice.co2Valve=e.id),"Sensor"==e.deviceType&&(e.device.toUpperCase().indexOf("TEMPERATURE")>=0&&(t.chartDevice.temperature=e.id,t.temperatureDevices.push(e)),e.device.toUpperCase().indexOf("HUMIDITY")>=0&&(t.chartDevice.humidity=e.id,t.humidityDevices.push(e)),e.device.toUpperCase().indexOf("CO2")>=0&&(t.chartDevice.co2=e.id,t.co2Devices.push(e))),"Valve"==e.deviceType&&(e.device.toUpperCase().indexOf("FLOWERMIX")>=0&&t.chartDevice.irr.push(e.id),e.device.toUpperCase().indexOf("VEGMIX")>=0&&t.chartDevice.irr.push(e.id),e.device.toUpperCase().indexOf("PAA")>=0&&t.chartDevice.irr.push(e.id)),"Curtain"==e.deviceType&&t.chartDevice.curtains.push(e.id),"Light"==e.deviceType&&t.chartDevice.lights.push(e.id)})),0==t.chartDevice.curtains.length&&t.chartsToPlot.splice(t.chartsToPlot.indexOf(5),1),t.chartDevice.ecu||t.chartDevice.bard||t.chartsToPlot.splice(t.chartsToPlot.indexOf(8),1),0==t.chartDevice.lights.length&&t.chartsToPlot.splice(t.chartsToPlot.indexOf(4),1)},doChartRefresh:function(){this.endDate=this.nowInTZPref(),this.selectedEndTime=this.endDate.clone().format("HH:mm")},checkScreen:function(){window.innerWidth<768?this.isMaximized=!1:this.isMaximized=!0},processHeaterAnnotations:function(t){for(var e={labelOptions:{shape:"connector",align:"right",justify:!1,crop:!0,style:{fontSize:"0.8em",textOutline:"1px white"}},labels:[]},r=E["a"].displayMetric(this.getUser),n=0;n<t.length;n++)for(var i=0;i<this.temperatureChartData.length;i++)if(t[n].dbtime>=this.temperatureChartData[i].date&&i+1<this.temperatureChartData.length-1&&t[n].dbtime<=this.temperatureChartData[i+1].date){var a=this.temperatureChartData[i][this.datasetTypePropertiesMap[this.datasetType]];r||(a=9*a/5+32),e.labels.push({point:{xAxis:0,yAxis:1,x:T.a.utc(t[n].dbtime).valueOf(),y:a},text:"Heat "+t[n].stateName});break}return e},processDehumidifierAnnotations:function(t,e){for(var r={labelOptions:{shape:"connector",align:"right",justify:!1,crop:!0,style:{fontSize:"0.8em",textOutline:"1px white"}},labels:[]},n=0;n<t.length;n++)for(var i=0;i<this.humidityChartData.length;i++)if(t[n].dbtime>=this.humidityChartData[i].date&&i+1<this.humidityChartData.length-1&&t[n].dbtime<=this.humidityChartData[i+1].date){var a=this.humidityChartData[i][this.datasetTypePropertiesMap[this.datasetType]],o={xAxis:0,yAxis:2,x:T.a.utc(t[n].dbtime).valueOf()-6e4,y:Math.round(100*a)+2};console.log(t[n].dbtime,o),r.labels.push({point:o,text:e+" "+t[n].stateName});break}return r},processCo2ValveAnnotations:function(t){var e=[],r=[],n="OFF";this.co2ChartData.sort((function(t,e){return t.date>e.date?1:-1}));for(var i=0;i<t.length;i++)for(var a=0;a<this.co2ChartData.length;a++){if(t[i].dbtime>=this.co2ChartData[a].date&&a+1<this.co2ChartData.length-1&&t[i].dbtime<=this.co2ChartData[a+1].date){var o={point:{xAxis:0,yAxis:0,x:T.a.utc(t[i].dbtime).valueOf(),y:this.co2ChartData[a][this.datasetTypePropertiesMap[this.datasetType]]}};o.text=t[i].stateName,"ON"==t[i].stateName&&(e.push(o),n="ON"),"ON"!=t[i].stateName&&"ON"==n&&(o.text="OFF",r.push(o),n="OFF");break}console.log("could not plot point",t[i])}return[{labelOptions:{backgroundColor:"rgba(0,255,0,0.5)",verticalAlign:"top",y:2,allowOverlap:!1},labels:e},{labels:r,labelOptions:{backgroundColor:"rgba(0,255,0,0.5)",allowOverlap:!1}}]},processOtherAnnotations:function(t,e,r){for(var n=[],i=0;i<t.length;i++)n.push({point:{xAxis:0,yAxis:2,x:T.a.utc(t[i].dbtime).valueOf(),y:r},text:e+t[i].stateName});return n},processIrrData:function(t){if(t&&t.length){this.sortValsByTime(t,"dbtime");var e=t.map((function(t){return{x:T.a.utc(t.dbtime).valueOf(),y:null,state:t.stateName}})).reduce((function(t,e){return"ON"==e.state&&t.push(e),t}),[]);this.chartData.plotLines.push({label:"IRR",type:"line",width:2,color:"#1261A0",yAxisID:"irr-ecu",showLine:!1,data:e})}},replotData:function(){this.processTemperatureData(this.temperatureChartData),this.processHumidityData(this.humidityChartData),this.processCO2Data(this.co2ChartData),this.platformGroup_id>0&&!this.selectedZone&&this.processVpdData(this.vpdData),this.processAnnotationData(this.annotationData),this.redrawChart()},redrawChart:function(){var t=[];null!=this.chartData.tempSeries&&t.push(this.chartData.tempSeries),null!=this.chartData.humiditySeries&&t.push(this.chartData.humiditySeries),null!=this.chartData.co2Series&&t.push(this.chartData.co2Series),null!=this.chartData.vpdSeries&&t.push(this.chartData.vpdSeries),this.$set(this.chartData,"dataset",t),this.keyIndex++},chartSetup:function(){this.selectedStartDate=this.sDate,this.selectedStartTime=this.sTime,this.selectedEndDate=this.eDate,this.selectedEndTime=this.eTime},dispatchServices:function(){this.chartDevice.temperature=[],this.chartDevice.humidity=[],this.chartDevice.co2=[];var t=this;this.platformGroup_id&&this.getPlatformGroupDevices({apitoken:this.getUser.apitoken,platformGroup_id:this.platformGroup_id}),this.temperatureDevices&&this.temperatureDevices.length&&this.temperatureDevices.forEach((function(e){e.device.toUpperCase().indexOf("TEMP")>=0&&t.chartDevice.temperature.push(e.id)})),this.co2Devices&&this.co2Devices.length&&this.co2Devices.forEach((function(e){e.device.toUpperCase().indexOf("CO2")>=0&&t.chartDevice.co2.push(e.id)})),this.humidityDevices&&this.humidityDevices.length&&this.humidityDevices.forEach((function(e){e.device.toUpperCase().indexOf("HUMIDITY")>=0&&t.chartDevice.humidity.push(e.id)}))},getTimeDifferenceByUnit:function(){var t=T.a.duration(T()(this.endDate).diff(this.startDate)),e=1;return"day"===this.selectedUnit?e=t.asDays():"hour"===this.selectedUnit?e=t.asHours():"minute"===this.selectedUnit?e=t.asMinutes():"month"===this.selectedUnit&&(e=t.asMonths()),e<1&&(e=2),Math.round(e)>this.maxRecordsLimit?this.maxRecordsLimit:Math.round(e)},getChartData:B()((function(){var t=this;t.isLoading=!0,this.fetchChartData(this.getTimeDifferenceByUnit(),(function(){t.redrawChart(),t.isLoading=!1}))}),100),onDatesChanged:function(){this.$emit("datechange",{selectedStartDate:this.selectedStartDate,selectedStartTime:this.selectedStartTime,selectedEndDate:this.selectedEndDate,selectedEndTime:this.selectedEndTime}),this.startDate=T.a.tz("".concat(this.selectedStartDate," ").concat(this.selectedStartTime),this.tzPref()),this.endDate=T.a.tz("".concat(this.selectedEndDate," ").concat(this.selectedEndTime),this.tzPref()),this.getChartData()}}),watch:{sDate:function(t){this.selectedStartDate=t},sTime:function(t){this.selectedStartTime=t},eDate:function(t){this.selectedEndDate=t},eTime:function(t){this.selectedEndTime=t},devices:function(t){this.refresh()},maxRecordsHit:function(t){t&&j["a"].error("WARNING - Maximum number of data points reached. You may need shorten the date range or decrease the data resolution.",-1)},datasetType:function(t){window.localStorage.setItem("environmentChart_datasetType",t);for(var e=0;e<this.datasetTypes.length;e++)if(this.datasetTypes[e]==t){this.datasetTypeProperty=this.datasetTypeProperties[e];break}this.replotData()},platformGroup_id:function(t){this.dispatchServices(),this.$root.$emit("platformGroup_id",t)},selectedStartDate:function(t){this.onDatesChanged()},selectedEndDate:function(t){this.onDatesChanged()},selectedStartTime:function(t){this.onDatesChanged()},selectedEndTime:function(t){this.onDatesChanged()},selectedUnit:function(t){this.getChartData()},selectedZone:function(){this.dispatchServices()}}},bn=gn,wn=(r("d84d"),Object(lt["a"])(bn,ln,cn,!1,null,null,null)),xn=wn.exports,Sn=r("b574"),_n=r("a6e5"),Cn=r("e6b0"),On=r("15e6"),Pn=r("12a1");function Dn(t){return Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(t)}function kn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */kn=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Dn(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Dn(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Tn(t,e){return An(t)||Ln(t,e)||En(t,e)||jn()}function jn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function En(t,e){if(t){if("string"==typeof t)return In(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?In(t,e):void 0}}function In(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ln(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function An(t){if(Array.isArray(t))return t}function Mn(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Un(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){Mn(a,n,i,o,s,"next",t)}function s(t){Mn(a,n,i,o,s,"throw",t)}o(void 0)}))}}function Nn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Fn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Nn(Object(r),!0).forEach((function(e){Gn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Gn(t,e,r){return(e=Rn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rn(t){var e=$n(t,"string");return"symbol"==Dn(e)?e:e+""}function $n(t,e){if("object"!=Dn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Hn={name:"charts",props:["facility","platformGroup_id","platformGroup_name","deviceId","controllerId","device","options","lastEventReceived"],mixins:[M["a"],A["a"]],components:{EnvironmentGraph:_n["a"],EnvironmentSparklines:xn,EnvironmentGauges:Sn["a"],EnvironmentCompliance:Cn["a"],XiaomiChart:On["a"],VuetifyDatepicker:ve["a"],VuetifyTimepicker:ye["a"]},beforeMount:function(){this.displayMetric=E["a"].displayMetric(this.getUser),this.refresh()},data:function(){var t=this.nowInTZPref().subtract(2,"hour"),e=this.nowInTZPref();return{carouselTab:0,temperatureDevices:[],co2Devices:[],humidityDevices:[],devices:[],complianceData:[],soilsensors:[],selectedStartDate:t.clone().format("YYYY-MM-DD"),selectedStartTime:t.clone().format("HH:mm"),selectedEndDate:e.clone().format("YYYY-MM-DD"),selectedEndTime:e.clone().format("HH:mm"),displayMetric:!1}},computed:Fn(Fn({},Object(S["c"])(["getUser"])),{},{lifecycleId:function(){return this.device.lifecyclesRaw&&this.device.lifecyclesRaw.length?this.device.lifecyclesRaw[0].lifecycle_id:-1}}),methods:{onChangeDate:function(t){this.selectedStartDate=t.selectedStartDate,this.selectedStartTime=t.selectedStartTime,this.selectedEndDate=t.selectedEndDate,this.selectedEndTime=t.selectedEndTime},loadCompliance:function(t){var e=this;if(t&&t.data){var r=[];for(var n in t.data){var i=function(){var i=t.data[n][a],o=String(a).padStart(2,"0"),s=T.a.utc(n+" "+o+":00","YYYY-MM-DD HH:mm"),l=s.clone().local().format("YYYY-MM-DD"),c=s.clone().local().format("YYYY-MM-DD (ha)"),u=t.lifecyclePhases.filter((function(t){if(!t.starttime)return!1;t.starttime&&!t.endtime&&(t.endtime=T.a.utc().format("YYYY-MM-DDTHH:mm"));var e=T.a.utc(t.starttime.split("T")[0]+" "+t.starttime.split("T")[1].substring(0,5),"YYYY-MM-DD hh:mm"),r=T.a.utc(t.endtime.split("T")[0]+" "+t.endtime.split("T")[1].substring(0,5),"YYYY-MM-DD hh:mm");return s.isBetween(e,r)}));u=u.filter((function(t){var e=T.a.utc(l).set("hour",parseInt(t.photoperiodStarttime.substring(0,2))).set("minute",parseInt(t.photoperiodStarttime.substring(2,4)-1)),r=e.clone().add(t.photoperiod,"hours");return"Lights On"==t.lightState?s.isBetween(e,r):!s.isBetween(e,r)}));var d={sortDate:n+"-"+a.padStart(2,"0"),localDate:c,rh:i.h,co2:i.c,temp:e.calculateTemperatureDisplay(i.t)};1==u.length?(d.co2Setpoint=u[0].CO2Setpoint,d.rhSetpoint=u[0].humiditySetpoint,d.tempSetpoint=e.calculateTemperatureDisplay(u[0].tempSetpoint),d.lightState=u[0].lightState,d.lifecyclePhase=u[0]):(d.co2Setpoint=null,d.rhSetpoint=null,d.tempSetpoint=null,d.lightState=null),r.push(d)};for(var a in t.data[n])i()}r.shift(),this.complianceData=r}},loadSoilSensoring:function(){var t=this;return Un(kn().mark((function e(){var r,n,i,a,o,s,l,c;return kn().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=T()("".concat(t.selectedStartDate," ").concat(t.selectedStartTime)).utc().format("YYYY-MM-DD HH:mm"),n=T()("".concat(t.selectedEndDate," ").concat(t.selectedEndTime)).utc().format("YYYY-MM-DD HH:mm"),i={controller_id:t.controllerId,and:[{begintime:{gte:r}},{begintime:{lte:n}}]},e.next=5,E["a"].get("ag_xiaomiSensorHistories",t.getUser.apitoken,{filter:{where:i}});case 5:if(a=e.sent,o=Tn(a,2),s=o[0],l=o[1],!l){e.next=12;break}return t.soilsensors=[],e.abrupt("return");case 12:for(c=0;c<s.length;c++)isNaN(parseFloat(s[c].temperature))||(t.displayMetric?s[c].temperature=s[c].temperature+" C":s[c].temperature=Object(Pn["toFahrenheit"])(s[c].temperature)+" F");t.soilsensors=s;case 14:case"end":return e.stop()}}),e)})))()},refresh:function(){var t=this;return Un(kn().mark((function e(){var r,n;return kn().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t,n=[E["a"].get("devices/getPlatformGroupDevices",t.getUser.apitoken,{platformGroup_id:t.platformGroup_id}),E["a"].get("vUserPreferences",t.getUser.apitoken,{filter:{where:{users_id:t.getUser.id,ag_preferences_id:3}}})],t.device.lifecyclesRaw&&t.device.lifecyclesRaw.length>0&&E["a"].get("ag_lifecycles/validateEnvironment",t.getUser.apitoken,{controller_id:t.controllerId,facility_id:t.facility.id,lifecycle_id:t.lifecycleId}).then((function(t){var e=Tn(t,2),n=e[0];e[1];r.loadCompliance(n)})),Promise.all(n).then((function(t){var e=Tn(t,2),n=Tn(e[0],2),i=n[0],a=n[1],o=Tn(e[1],2),s=o[0],l=o[1];if(a||(r.devices=i),!l){var c=s[0].setting||s[0].defaultSetting;r.$nextTick((function(){switch(c){case"Sparklines":r.carouselTab=1;break;case"Gagues":r.carouselTab=2;break}}))}})),e.next=6,t.loadSoilSensoring();case 6:case"end":return e.stop()}}),e)})))()},emitAction:function(t,e){this.$emit("emit-action",t,e)}}},Vn=Hn,Bn=(r("304d"),Object(lt["a"])(Vn,on,sn,!1,null,"ed8d4d7c",null)),zn=Bn.exports,Yn=r("ac7c"),qn=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100",attrs:{id:"unitActivityLog"}},[e(a["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:""}},[e(o["c"],{staticClass:"d-flex flex-column"},[e("div",{staticClass:"mb-2 d-flex flex-row align-center justify-center"},[e("div",{staticClass:"col-4"},[e("vuetify-datepicker",{attrs:{label:"Start Date","auto-close":!0},model:{value:t.startTime,callback:function(e){t.startTime=e},expression:"startTime"}})],1),e("div",{staticClass:"col-4"},[e("vuetify-datepicker",{attrs:{label:"End Date","auto-close":!0},model:{value:t.endTime,callback:function(e){t.endTime=e},expression:"endTime"}})],1),e("div",{staticClass:"col-4 d-flex justify-space-between align-center"},[e(i["a"],{attrs:{icon:"",color:"primary",outlined:""},on:{click:t.refresh}},[e(c["a"],{attrs:{color:"primary"}},[t._v("search")])],1),e(Yn["a"],{attrs:{label:"Only User Actions"},model:{value:t.onlyUserActivity,callback:function(e){t.onlyUserActivity=e},expression:"onlyUserActivity"}})],1)]),e("div",{staticClass:"flex-grow-auto h-100"},[e(R["a"],{staticStyle:{border:"1px solid silver"},attrs:{options:t.pagination,headers:t.headers,items:t.filteredActivityLogs,"hide-default-footer":"",loading:t.isLoading,"fixed-header":"",height:"100%"},on:{"update:options":function(e){t.pagination=e}},scopedSlots:t._u([{key:"item",fn:function(r){var n=r.item;return[e("tr",{staticClass:"text-left",class:{"user-action":n.user_id&&!t.onlyUserActivity,reconnection:n.isConnected,disconnection:0===n.isConnected}},[e("td",[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.timestamp,"MM/DD/YYYY h:mm:ss a"))}})]),e("td",{staticClass:"text-left"},[t._v(t._s(n.currentMode))]),e("td",{staticClass:"text-left"},[t._v(t._s(n.action))]),e("td",{staticClass:"text-left"},[t._v(t._s(n.description))]),e("td",{staticClass:"text-center"},[e("span",[t._v(t._s("null"===n.value?"--":n.value))])]),e("td",{staticClass:"text-center"},[n.deviceId?[n.stateMachineData?e(i["a"],{attrs:{outlined:"",color:"primary",small:""},on:{click:function(e){return t.onShowStateMachine(n.stateMachineData,n.timestamp)}}},[t._v("Show Reason")]):e("span",[t._v(t._s(n.reason))])]:n.userName?[t._v(t._s(n.userName))]:[t._v(t._s(n.reason))]],2)])]}}])})],1)])],1),e(l["a"],{attrs:{width:"1024"},model:{value:t.showStateMachine,callback:function(e){t.showStateMachine=e},expression:"showStateMachine"}},[t.stateMachine.ag_controlLoopDiagram_version||t.stateMachine.id?e("display-fsa-decision-details",{attrs:{ag_controlLoopDiagramType_id:t.stateMachine.ag_controlLoopDiagramType_id,message:t.stateMachine.message,ag_controlLoopDiagram_version:t.stateMachine.ag_controlLoopDiagram_version,ruleNumber:t.stateMachine.ruleNumber,timestamp:t.stateMachine.timestamp,platformGroupName:t.platformGroupName},on:{close:function(e){t.showStateMachine=!1}},model:{value:t.stateMachine.details,callback:function(e){t.$set(t.stateMachine,"details",e)},expression:"stateMachine.details"}}):t._e()],1)],1)},Wn=[],Jn=r("b4e3");function Zn(t){return Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(t)}function Xn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Kn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xn(Object(r),!0).forEach((function(e){Qn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Qn(t,e,r){return(e=ti(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ti(t){var e=ei(t,"string");return"symbol"==Zn(e)?e:e+""}function ei(t,e){if("object"!=Zn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Zn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function ri(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ri=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Zn(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Zn(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ni(t,e){return li(t)||si(t,e)||ai(t,e)||ii()}function ii(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ai(t,e){if(t){if("string"==typeof t)return oi(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oi(t,e):void 0}}function oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function si(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function li(t){if(Array.isArray(t))return t}function ci(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function ui(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){ci(a,n,i,o,s,"next",t)}function s(t){ci(a,n,i,o,s,"throw",t)}o(void 0)}))}}var di={name:"UnitActivityLog",props:["platformGroupId","platformGroupName","controller_id","modeDetails"],mixins:[M["a"]],components:{DisplayFsaDecisionDetails:Jn["a"],VuetifyDatepicker:ve["a"],VuetifyTimepicker:ye["a"]},beforeMount:function(){this.isLoading=!0,this.refresh()},data:function(){return{isAdmin:!1,limitItems:[100,250,500,1e3],limit:250,Trimaster:E["a"],index:0,activityLogs:[],onlyUserActivity:!1,stateMachine:{ag_controlLoopDiagramType_id:null,message:null,ag_controlLoopDiagram_version:null,ruleNumber:null},showStateMachine:!1,startTime:T()().subtract(1,"day").format("YYYY-MM-DD"),endTime:T()().endOf("day").format("YYYY-MM-DD"),isLoading:!1,pagination:{sortDesc:[!0],sortBy:["timestamp"],itemsPerPage:-1},headers:[{text:"Time Stamp",align:"left",value:"timestamp",sortable:!0},{text:"Mode",align:"left",sortable:!1,value:"currentMode"},{text:"Action",align:"left",sortable:!1,value:"action"},{text:"Description",align:"left",sortable:!1,value:"description"},{text:"Value",align:"center",sortable:!1,value:"value"},{text:"User / Reason",align:"center",sortable:!1,value:"userName"}]}},methods:{refresh:function(){var t=this;return ui(ri().mark((function e(){var r,n,i,a;return ri().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,E["a"].get("ag_userHistories/controllerReport",t.getUser.apitoken,{controllerId:t.controller_id,startTime:T()(t.startTime).startOf("day").utc().format(),endTime:T()(t.endTime).endOf("day").utc().format()});case 3:r=e.sent,n=ni(r,2),i=n[0],n[1],i&&i.success&&(i.data.sort((function(t,e){return t.timestamp<e.timestamp||t.timestamp===e.timestamp&&t.userName?1:-1})),a=t.modeDetails.textValue,t.activityLogs=i.data.map((function(t){if(t.reason&&"{"==t.reason.trim().charAt(0))try{t.stateMachineData=JSON.parse(t.reason),t.reason=t.stateMachineData.reason}catch(e){}return t.deviceId?(t.id=t.deviceId+":"+t.stateId+":"+t.timestamp,t.action="DeviceStateChange",t.description=t.deviceName,t.value=t.stateName,"CortexVFU"===t.deviceTypeName?-1!==t.reason.indexOf("MANUAL -> AUTO")?(t.currentMode=a,a="MANUAL"):-1!==t.reason.indexOf("AUTO -> MANUAL")?(t.currentMode=a,a="AUTOMATIC"):t.currentMode=a:t.currentMode=a):t.currentMode=a,"undefined"!==typeof t.isConnected&&(t.action="Controller ".concat(t.isConnected?"Reconnected":"Disconnected"),t.description="--",t.value="--",t.reason="--"),t}))),t.isLoading=!1;case 9:case"end":return e.stop()}}),e)})))()},onShowStateMachine:function(t,e){t.id=t.stateMachineId,this.stateMachine={id:t.stateMachineId,ag_controlLoopDiagramType_id:t.ag_controlLoopDiagramType_id,message:t.reason,ag_controlLoopDiagram_version:t.ag_controlLoopDiagram_version,ruleNumber:t.ruleNumber,details:t,timestamp:e},this.stateMachine.details.currentState=t.environment.ecuState.current,this.showStateMachine=!0}},computed:Kn(Kn({},Object(S["c"])(["getUser"])),{},{filteredActivityLogs:function(){var t=this;return this.activityLogs.filter((function(e){return!t.onlyUserActivity||!!e.user_id}))}}),watch:{}},hi=di,fi=(r("6ee8"),Object(lt["a"])(hi,qn,Wn,!1,null,null,null)),pi=fi.exports;function mi(t){return mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mi(t)}function vi(t,e){return xi(t)||wi(t,e)||gi(t,e)||yi()}function yi(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gi(t,e){if(t){if("string"==typeof t)return bi(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bi(t,e):void 0}}function bi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function wi(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function xi(t){if(Array.isArray(t))return t}function Si(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Si(Object(r),!0).forEach((function(e){Ci(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Si(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ci(t,e,r){return(e=Oi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oi(t){var e=Pi(t,"string");return"symbol"==mi(e)?e:e+""}function Pi(t,e){if("object"!=mi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Di=20,ki={name:"zone-devices",props:{device_id:{type:Number,required:!0},platformGroup_id:{type:Number},presetTab:{type:Number},currentDevice:{type:Object},isSse:{type:Boolean},lastEventReceived:{type:Object},device:{type:Object}},mixins:[M["a"],A["a"]],components:{UnitActivityLog:pi,HelpButton:G["a"],ServiceHistory:_["a"],ManualControlOptions:O["a"],Lifecycles:P["a"],DeviceHistoryViewer:D["a"],ChartDataTable:C["a"],ZoneParameters:I["a"],DeviceLifecycles:L["a"],IpmScoutingReports:U["a"],Lgu:N["a"],LifecycleReport:F["a"],ControlLoops:zt,VfuPhotos:en,Charts:zn},data:function(){return{isDnD:!1,moment:T.a,newStateSelection:null,showPhotos:!1,showStateMenu:!1,localCurrentDevice:null,tabHeightStyle:{overflow:"auto"},showFsm:!1,tabHeight:550,isPolling:!1,pollingService:null,disableServiceHistory:!1,inTransition:!1,pctComplete:0,nextFetchTime:"",newState:null,changeState:!1,tabmodel:0,isMaximized:!1,displayMode:"chart",datasetTypes:["Minimums","Averages","Maximums","Latest"],datasetType:"Averages",datasetTypeProperties:["minReading","avgReading","maxReading","reading"],datasetTypeProperty:"avgReading",inStateTransition:!1,workZone:"",growZone:"",co2Zone:"",irrigationZone:"",Trimaster:E["a"],isLoading:!1,selectedUnit:"minute",platformGroupId:0,deviceId:0,controllerId:0,automatic_mode:null,control_state_items:["LIGHT","DARK"],lifecycle_number:"",item:null,options:[],autoModeDetails:{},headers:[],zonesParameters:[],zones:[],zoneIds:[],automaticModeInTransition:!1,tabHelpTopicKey:"dashboards-vfu-igr-environment-chart",facility:null,lastCameraMessageReceived:null}},beforeMount:function(){var t=this;t.loading=!0,window.innerHeight<650&&(this.tabHeight=window.innerHeight-180,this.tabmodel=1),this.showFsm=E["a"].isAdmin(this.getUser)||E["a"].isUserInRole(this.getUser,"Integrator")||E["a"].isUserInRole(this.getUser,"Maintenance"),rn["a"].$on("facility-websocket-message",this.handleSocketMessage),this.localCurrentDevice=null,this.refresh()},mounted:function(){var t,e=this;this.localCurrentDevice=null!==(t=this.currentDevice)&&void 0!==t?t:this.selectedContextMenuItem,this.$root.$on("isMaximized",(function(t){e.isMaximized=!t})),window.addEventListener("resize",this.checkScreen,{passive:!0})},computed:_i(_i(_i({},Object(S["c"])(["getUser","platformGroupDevicesList","zoneDeviceItemVal","irrigationZoneItemVal","co2ZoneItemVal","workZoneItemVal","growZoneItemVal","facilityData"])),Object(S["c"])("universalDashboard",["selectedContextMenuItem"])),{},{abbrevPlatformGroupName:function(){var t=this.item.platformGroupName.split("-");return 3==t.length?t[1]+"-"+t[2]:this.item.platformGroupName},showManualScheduler:function(){return!(!this.item||"PGU"!=this.item.deviceType&&"LGU"!=this.item.deviceType)},systemId:function(){return this.item.device+"-"+this.item.device_id},groupId:function(){return this.platformGroup_id},id:function(){return this.device_id},transitionClass:function(){return this.inTransition&&this.isPolling},nextFetch:function(){return this.inTransition?""==this.nextFetchTime?"Next update within 2 minutes":this.nextFetchTime:""}}),methods:_i(_i({},Object(S["b"])(["getPlatformGroupDevices","getZoneDevice","storeControllerCommand"])),{},{emitAction:function(t,e){this.$emit(t,e)},handleSocketMessage:function(t){if("reportState"===t.type||"reportReading"===t.type||"setDeviceParameter"===t.type){var e=t.payload;"setDeviceParameter"===t.type&&"CortexVFU"===e.deviceType&&e.data.parameter&&"mode"===e.data.parameter&&this.getDeviceParameters()}},onShowStateMenu:function(){var t=this,e=this.options.find((function(e){return e.action.toUpperCase().indexOf(t.item.state.toUpperCase())>=0}));e&&(this.newStateSelection=e.action_id),this.showStateMenu=!0},onSetMode:function(){this.newState=this.newStateSelection,this.showStateMenu=!1,this.onVfuStateChange()},refreshPhotos:function(t,e){if(this.$refs.vfuPhotos){var r=this;setTimeout((function(){r.$refs.vfuPhotos.onResetRefresh(t,e)}),1e3)}},onShowAlerts:function(){this.$emit("showalerts"),this.$store.dispatch("universalDashboard/setShowAlerts",!0)},onAddLifecycleReport:function(){this.$emit("showlifecyclereport")},onDisableServiceHistory:function(t){this.disableServiceHistory=t},onAutomaticModeChange:function(t){this.automaticModeInTransition=!0;var e=this,r=0;this.inTransition=!0,t?("AUTOMATIC",r=83):("MANUAL",r=84);var n={controller_id:this.controllerId,action_id:r,virtualDevice_id:this.deviceId};E["a"].post("controllerCommands",this.getUser.apitoken,n).then((function(t){var r=vi(t,2),n=r[0];r[1];n&&e.startPolling()}))},refreshZoneDevices:function(){this.$emit("refresh")},getZones:function(){var t=this;this.device_id?(t.isLoading=!0,E["a"].get("deviceParametersView",t.getUser.apitoken,{filter:{where:{device_id:this.device_id,parameterType:"zone_id"}}}).then((function(e){var r=vi(e,2),n=r[0];r[1];t.zones=n;for(var i=t.zones.length-1;i>=0;i--)t.zones[i].numericValue&&(t.zoneIds.push(t.zones[i].numericValue),t.zones[i].co2Parameters=[],t.zones[i].humidityParameters=[],t.zones[i].lightParameters=[],t.zones[i].tempParameters=[],t.zones[i].otherParameters=[]);t.getParameters(),t.mainDevice=null,t.devices=[];var a={facility_id:t.getUser.facility_id};t.selectedZone&&""!==t.selectedZone&&(a.zone_id=t.selectedZone),t.zoneIds&&(a.zone_id=t.zoneIds[0]),E["a"].get("zoneDevices/getZoneDevices",t.getUser.apitoken,a).then((function(e){var r=vi(e,2),n=r[0];r[1];t.loading=!1,n.forEach((function(t,e){t.key=e})),t.devices=n}))}))):j["a"].error("ERROR - No device id specified")},getParameters:function(){var t=this;t.isLoading=!0,E["a"].get("zoneParameters",t.getUser.apitoken,{filter:{where:{zone_id:{inq:t.zoneIds}}}}).then((function(e){var r=vi(e,2),n=r[0];r[1];t.zonesParameters=n,t.isLoading=!1}))},isDeviceDisabled:function(t){return!(!t||+t.state_id!==+Di)},checkScreen:function(){window.innerWidth<768?this.isMaximized=!1:this.isMaximized=!0},getVfuDeviceInfo:function(){var t=this;this.device_id&&E["a"].get("zoneDevices/"+this.device_id,this.getUser.apitoken,{filter:{include:{relation:"controller",scope:{fields:["deployed"]}}}}).then((function(e){var r=vi(e,2),n=r[0];r[1];t.inStateTransition=!1,n&&(t.item=n,t.platformGroupId=n.platformGroup_id,t.deviceId=n.device_id,t.controllerId=n.controller_id,E["a"].get("cameras/count",t.getUser.apitoken,{where:{controller_id:t.controllerId}}).then((function(e){var r=vi(e,2),n=r[0];r[1];t.showPhotos=n.count>0})))}))},refresh:function(){this.isLoading=!0,this.facility=this.facilityData,this.presetTab&&Number(this.presetTab)&&(this.tabmodel=this.presetTab);var t=this;this.platformGroup_id&&(E["a"].get("devices/getPlatformGroupDevices",this.getUser.apitoken,{platformGroup_id:this.platformGroup_id}).then((function(e){var r=vi(e,2),n=r[0],i=(r[1],n.filter((function(e){return e.device_id==t.device_id})));i[0].actions?t.options=i[0].actions:t.options=[]})),this.getVfuDeviceInfo(),this.getDeviceParameters(),this.localCurrentDevice||E["a"].get("ag_platformGroups/searchStatusByDisplayType",this.getUser.apitoken,{facility_id:t.getUser.facility_id,platformGroup_id:this.platformGroup_id}).then((function(e){var r=vi(e,2),n=r[0],i=r[1];i||(t.localCurrentDevice=t.createDisplayRecord(n.data.platformGroups[0],"VFU"),t.localCurrentDevice.dndExpiration&&t.localCurrentDevice.isDnD&&T.a.utc(t.localCurrentDevice.dndExpiration).isAfter(T.a.utc())&&(t.isDnD=!0))})))},getDeviceParameters:function(){var t=this;this.device_id&&E["a"].get("deviceParametersView/getDeviceParameters",this.getUser.apitoken,{device_id:this.device_id}).then((function(e){var r=vi(e,2),n=r[0];r[1];n=n.getDeviceParameters;for(var i=0;i<n.length;i++)switch(n[i].parameterName){case"mode":t.autoModeDetails=n[i],t.automaticModeInTransition||("AUTOMATIC"==n[i].textValue?t.automatic_mode=!0:t.automatic_mode=!1);break;case"WorkZone":t.workZone=n[i].zonename;break;case"IrrigationZone":t.irrigationZone=n[i].zonename;break;case"GrowZone":t.growZone=n[i].zonename;break;case"CO2Zone":t.co2Zone=n[i].zonename;break}t.isLoading=!1}))},onVfuStateChange:function(){var t=this.newState;this.inStateTransition=!0;for(var e=0;e<this.options.length;e++)if(this.options[e].action_id==t){this.item.state=this.options[e].action;break}var r={controller_id:this.item.controller_id,action_id:t,virtualDevice_id:this.item.device_id,user_id:this.getUser.id};this.storeControllerCommand({payload:r,apitoken:this.getUser.apitoken}),setTimeout(this.vfuStatusPoll,500),this.changeState=!1},vfuStatusPoll:function(){var t=this;E["a"].get("controllerCommands",this.getUser.apitoken,{filter:{where:{virtualDevice_id:this.item.device_id},include:{relation:"controller",scope:{fields:["lastCommandFetch"]}}}}).then((function(e){var r=vi(e,2),n=r[0];r[1];0==n.length?setTimeout(t.getVfuDeviceInfo,4e3):setTimeout(t.vfuStatusPoll,3e3)}))},startPolling:function(){this.isSse||this.isPolling||(this.isPolling=!0,this.doPolling(),this.pollingService=setInterval(this.doPolling,1e4))},killPolling:function(){this.pollingService&&(clearInterval(this.pollingService),this.pctComplete=0,this.pollingService=null,this.isPolling=!1,this.nextFetchTime="",this.automaticModeInTransition=!1)},doPolling:function(){var t=this,e=!1;E["a"].get("controllerCommands",t.getUser.apitoken,{filter:{where:{controller_id:this.controllerId,device_id:this.device_id},fields:["action_id","controller_id","id","virtualDevice_id"],include:{relation:"controller",scope:{fields:["lastCommandFetch"]}}}}).then((function(r){var n=vi(r,2),i=n[0];n[1];if(0==i.length)setTimeout(t.killPolling,1500);else{var a=i;if(a.forEach((function(t){42!=t.action_id&&83!=t.action_id&&84!=t.action_id||(e=!0)})),e){T()(i[0].controller.lastCommandFetch);var o=T()(i[0].controller.lastCommandFetch).add(2,"m"),s=T.a.duration(T()().diff(o)),l=-1*Math.round(s.as("seconds"));t.pctComplete=Math.round((120-l)/120*100),t.nextFetchTime="Next update in about "+l+" seconds "}else t.inTransition=!1,t.killPolling()}}))},onStateChange:function(t){var e=t.id,r=t.action_id,n={controller_id:this.item.controller_id,action_id:r,virtualDevice_id:e,user_id:this.getUser.id};this.storeControllerCommand({payload:n,apitoken:this.getUser.apitoken})}}),watch:{lastEventReceived:function(t,e){t.camera_id&&(this.lastCameraMessageReceived=t)},currentDevice:function(t){t&&(this.localCurrentDevice=_i({},t))},selectedContextMenuItem:{handler:function(t){this.localCurrentDevice=_i({},t)},immediate:!0},zonesParameters:function(t){this.zones.map((function(e){t.map((function(t){e.numericValue==t.zone_id&&(e.parameters=t,t.zoneParameterName.includes("co2")||t.zoneParameterName.includes("CO2")?e.co2Parameters.push(t):t.zoneParameterName.includes("humidity")?e.humidityParameters.push(t):t.zoneParameterName.includes("light")?e.lightParameters.push(t):t.zoneParameterName.includes("temp")?e.tempParameters.push(t):e.otherParameters.push(t))}))}))},isPolling:function(t){t||(this.inTransition=!1)},platformGroup_id:function(t){this.dispatchServices()},automatic_mode:function(t,e){},tabmodel:function(t){switch(t){case 0:this.tabHelpTopicKey="dashboards-vfu-igr-environment-chart";break;case 1:this.tabHelpTopicKey="dashboards-vfu-igr-manual-control";break;case 2:this.tabHelpTopicKey="dashboards-vfu-igr-device-log";break;case 3:this.tabHelpTopicKey="dashboards-vfu-igr-lifecycles";break;case 4:this.tabHelpTopicKey="dashboards-vfu-igr-lifecycle-tasks";break;case 5:this.tabHelpTopicKey="dashboards-vfu-igr-ipm-scouting";break;case 7:this.tabHelpTopicKey="dashboards-vfu-igr-zones";break;case 8:this.tabHelpTopicKey="dashboards-vfu-igr-service-history";break;default:this.tabHelpTopicKey="dashboards-vfu-igr-control-overview";break}}}},Ti=ki,ji=(r("ffc9"),Object(lt["a"])(Ti,w,x,!1,null,null,null));e["default"]=ji.exports},"6b5e":function(t,e,r){"use strict";r("2ed8")},"6bff":function(t,e,r){},"6dd6":function(t,e,r){},"6e25":function(t,e,r){},"6ee8":function(t,e,r){"use strict";r("5b57")},"70d9":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("132d"),s=r("b974"),l=r("2fa4"),c=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{id:"batchCommandExecute"}},[e(a["d"],[e("h2",[t._v("Execute Bash Command")]),e(l["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(o["a"],[t._v("close")])],1)],1),e(a["c"],[e(s["a"],{attrs:{"return-object":"",items:t.commands,"item-text":"label",label:"Command"},model:{value:t.selectedCommand,callback:function(e){t.selectedCommand=e},expression:"selectedCommand"}}),t.selectedCommand?e("fieldset",[e("legend",{staticClass:"v-label v-label--active"},[t._v("Description")]),t._v("\n      "+t._s(t.selectedCommand.description)+"\n    ")]):t._e()],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",disabled:!t.selectedCommand,color:"primary"},on:{click:t.onExecute}},[t._v("Confirm")])],1)],1)},u=[],d=r("d0eb"),h=(r("c1df"),r("d67f"),r("2f62"));r("ea10");function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){return b(t)||g(t,e)||v(t,e)||m()}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function b(t){if(Array.isArray(t))return t}function w(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */w=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",p="suspendedYield",m="executing",v="completed",y={};function g(){}function b(){}function x(){}var S={};c(S,o,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,o)&&(S=C);var O=x.prototype=g.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==f(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===m)throw Error("Generator is already running");if(i===v){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:p,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(f(e)+" is not iterable")}return b.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function x(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function S(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){x(a,n,i,o,s,"next",t)}function s(t){x(a,n,i,o,s,"throw",t)}o(void 0)}))}}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=P(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(t){var e=D(t,"string");return"symbol"==f(e)?e:e+""}function D(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var k={name:"BashCommandExecute",components:{},beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{commands:[],selectedCommand:null}},computed:C(C({},Object(h["c"])(["getUser"])),Object(h["c"])("universalDashboard",["isPerformingContextMenuAction"])),watch:{},methods:{onClose:function(){this.$store.dispatch("universalDashboard/setShowBashCommands",!1),this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1),this.$store.dispatch("universalDashboard/setBashSettings",null),this.$store.dispatch("universalDashboard/setSelectedBatchAction",null)},onExecute:function(){var t=this;return S(w().mark((function e(){return w().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("universalDashboard/setShowBashCommands",!1);case 2:return e.next=4,t.$store.dispatch("batchActions/setBatchActionLabel",{id:145,label:"Execute: "+t.selectedCommand.label});case 4:return e.next=6,t.$store.dispatch("universalDashboard/setBashSettings",t.selectedCommand);case 6:if(!t.isPerformingContextMenuAction){e.next=9;break}return e.next=9,t.$store.dispatch("batchActions/runBatchAction");case 9:case"end":return e.stop()}}),e)})))()},refresh:function(){var t=this;return S(w().mark((function e(){var r,n,i;return w().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,d["a"].get("adminCommands",t.getUser.apitoken,{filter:{order:"label"}});case 3:r=e.sent,n=p(r,2),i=n[0],n[1],t.isLoading=!1,t.commands=i;case 9:case"end":return e.stop()}}),e)})))()}}},T=k,j=(r("e96a"),r("2877")),E=Object(j["a"])(T,c,u,!1,null,null,null);e["a"]=E.exports},"70e2":function(t,e,r){},7168:function(t,e,r){"use strict";r("38b0")},"738e":function(t,e,r){"use strict";r("a9fd")},"739e":function(t,e,r){"use strict";r("f03e")},"743e":function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return e("tiptap-vuetify",{attrs:{extensions:t.extensions,placeholder:t.placeholder,"max-height":t.height},on:{input:function(e){return t.$emit("input",t.editableContent)}},model:{value:t.editableContent,callback:function(e){t.editableContent=e},expression:"editableContent"}})},i=[],a=r("3f38"),o={props:{value:{required:!0},placeholder:{type:String,default:"Text goes here"},height:{type:String,default:"350px"},showControls:{type:Boolean,default:!0}},components:{TiptapVuetify:a["o"]},beforeMount:function(){this.editableContent=this.value,this.showControls&&(this.extensions=this.totalExtensions)},watch:{value:function(t,e){this.editableContent=t}},data:function(){return{editableContent:null,extensions:[],totalExtensions:[[a["g"],{options:{levels:[1,2,3]}}],a["b"],a["j"],a["n"],a["q"],a["d"],a["e"],a["m"],a["c"],a["l"],a["k"],a["a"],a["f"],a["i"],a["h"]]}}},s=o,l=(r("d1ad"),r("2877")),c=Object(l["a"])(s,n,i,!1,null,null,null);e["a"]=c.exports},7679:function(t,e,r){"use strict";r("c79c");var n=r("e4d3"),i=r("7560"),a=r("80d2"),o=r("afdd"),s=r("326d"),l=r("58df");e["a"]=Object(l["a"])(n["a"],i["a"]).extend({name:"v-edit-dialog",props:{cancelText:{default:"Cancel"},large:Boolean,eager:Boolean,persistent:Boolean,saveText:{default:"Save"},transition:{type:String,default:"slide-x-reverse-transition"}},data(){return{isActive:!1}},watch:{isActive(t){t?(this.$emit("open"),setTimeout(this.focus,50)):this.$emit("close")}},methods:{cancel(){this.isActive=!1,this.$emit("cancel")},focus(){const t=this.$refs.content.querySelector("input");t&&t.focus()},genButton(t,e){return this.$createElement(o["a"],{props:{text:!0,color:"primary",light:!0},on:{click:t}},e)},genActions(){return this.$createElement("div",{class:"v-small-dialog__actions"},[this.genButton(this.cancel,this.cancelText),this.genButton(()=>{this.save(this.returnValue),this.$emit("save")},this.saveText)])},genContent(){return this.$createElement("div",{staticClass:"v-small-dialog__content",on:{keydown:t=>{t.keyCode===a["A"].esc&&this.cancel(),t.keyCode===a["A"].enter&&(this.save(this.returnValue),this.$emit("save"))}},ref:"content"},[this.$slots.input])}},render(t){return t(s["a"],{staticClass:"v-small-dialog",class:this.themeClasses,props:{contentClass:"v-small-dialog__menu-content",transition:this.transition,origin:"top right",right:!0,value:this.isActive,closeOnClick:!this.persistent,closeOnContentClick:!1,eager:this.eager,light:this.light,dark:this.dark},on:{input:t=>this.isActive=t},scopedSlots:{activator:({on:e})=>t("div",{staticClass:"v-small-dialog__activator",on:e},[t("span",{staticClass:"v-small-dialog__activator__content"},this.$slots.default)])}},[this.genContent(),this.large?this.genActions():null])}})},7794:function(t,e,r){"use strict";r("8e49")},"791f":function(t,e,r){},"7c3e":function(t,e,r){"use strict";var n=r("0798"),i=r("b0af"),a=r("99d9"),o=r("ac7c"),s=r("62ad"),l=r("5963"),c=r("0fd9"),u=r("ba0d"),d=r("2fa4"),h=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{id:"editPhotoPeriod"}},[e(a["d"],[t.title?e("h2",[t._v(t._s(t.title))]):e("span",{staticClass:"timelinecardtitle"},[t._v("Lights")]),e(d["a"]),t.isException?e(o["a"],{staticClass:"titlefield",attrs:{label:"Inherit from active phase"},model:{value:t.phase.inheritLightSchedule,callback:function(e){t.$set(t.phase,"inheritLightSchedule",e)},expression:"phase.inheritLightSchedule"}}):t._e(),e("help-button",{class:{"mr-2":t.isException||t.invertable,"mx-0":!t.isException&&!t.invertable},attrs:{"help-topic-key":"cultivation-grow-plans-phases-light-schedule"}})],1),e(a["c"],{directives:[{name:"show",rawName:"v-show",value:!t.phase.inheritLightSchedule,expression:"!phase.inheritLightSchedule"}],class:{"mt-5":""==t.title}},[e(c["a"],{staticClass:"justify-center pb-1",attrs:{"no-gutters":""}},[e(s["a"],{attrs:{cols:"3"}},[e(o["a"],{staticClass:"titlefield pb-0 mt-0",attrs:{label:"Auto-Increment","hide-details":""},model:{value:t.photoperiodAutoIncrement,callback:function(e){t.photoperiodAutoIncrement=e},expression:"photoperiodAutoIncrement"}})],1),e(s["a"],{attrs:{cols:"3"}},[e(o["a"],{staticClass:"titlefield pb-0 mt-0",attrs:{label:"Sync All Lights","hide-details":"",disabled:t.noInterlights||t.photoperiodAutoIncrement},model:{value:t.syncDownlightInterlight,callback:function(e){t.syncDownlightInterlight=e},expression:"syncDownlightInterlight"}})],1),0!=t.currentTime[0]||24!=t.currentTime[1]?e(s["a"],{attrs:{cols:"3"}},[e(o["a"],{staticClass:"titlefield pb-0 mt-0",attrs:{label:"Sunrise/Sunset","hide-details":""},model:{value:t.phase.photoperiodSimulateSunriseSunset,callback:function(e){t.$set(t.phase,"photoperiodSimulateSunriseSunset",e)},expression:"phase.photoperiodSimulateSunriseSunset"}})],1):t._e(),!t.invertable||0==t.currentTime[0]&&24==t.currentTime[1]?t._e():e(s["a"],{staticStyle:{"text-align":"right"},attrs:{cols:"3"}},[e(o["a"],{staticClass:"titlefield pb-0 mt-0",staticStyle:{display:"inline-block"},attrs:{label:"Invert Schedule","hide-details":""},model:{value:t.inverted,callback:function(e){t.inverted=e},expression:"inverted"}})],1)],1),e(c["a"],{staticClass:"mb-3"},[e(s["a"],[e("vuetify-timepicker",{attrs:{label:"Lights ".concat(t.inverted?"Off":"On")},on:{change:t.onLightsStartTimeChange},model:{value:t.lightsStartTime,callback:function(e){t.lightsStartTime=e},expression:"lightsStartTime"}})],1),e(s["a"],[e("vuetify-timepicker",{attrs:{label:"Lights ".concat(t.inverted?"On":"Off")},on:{change:t.onLightsEndTimeChange},model:{value:t.lightsEndTime,callback:function(e){t.lightsEndTime=e},expression:"lightsEndTime"}})],1)],1),t.title&&0==t.currentTime[0]&&24==t.currentTime[1]?e("div",{staticStyle:{"padding-top":"35px"}}):t._e(),e("div",{staticStyle:{width:"calc(100% - 50px)","padding-top":"30px",margin:"auto"}},[e(l["a"],{staticClass:"rangeSlider1",attrs:{label:"On/Off Times",value:t.currentTime,max:24,min:0,step:.25,"thumb-label":"always","thumb-size":50,"thumb-color":t.intensityColor,color:t.activeTrackColor,"tick-size":"1","track-color":t.trackColor,readonly:t.disabled},on:{change:t.rangeSliderChanged},scopedSlots:t._u([{key:"thumb-label",fn:function(r){return[e("span",[t._v(t._s(t.convertNumberToDisplayTime(r.value)))])]}}])}),e(u["a"],{directives:[{name:"show",rawName:"v-show",value:!t.photoperiodAutoIncrement,expression:"!photoperiodAutoIncrement"}],staticClass:"pt-6",class:t.syncDownlightInterlight?"rangeSlider2":"rangeSlider4",attrs:{max:100,min:0,step:1,color:t.downlightIntensitySliderColor,"thumb-size":45,"thumb-label":"always",label:t.syncDownlightInterlight||t.noInterlights?"Intensity":"Downlights"},scopedSlots:t._u([{key:"thumb-label",fn:function(e){return[t._v("\n          "+t._s(e.value)+"%\n       ")]}}]),model:{value:t.currentDownlightIntensity,callback:function(e){t.currentDownlightIntensity=e},expression:"currentDownlightIntensity"}}),e(u["a"],{directives:[{name:"show",rawName:"v-show",value:!t.syncDownlightInterlight&&!t.noInterlights&&!t.photoperiodAutoIncrement,expression:"\n          !syncDownlightInterlight &&\n          !noInterlights &&\n          !photoperiodAutoIncrement\n        "}],staticClass:"pt-6 rangeSlider3",attrs:{max:100,min:0,step:1,color:t.interlightIntensitySliderColor,"thumb-size":45,"thumb-label":"always",label:"Interlights"},scopedSlots:t._u([{key:"thumb-label",fn:function(e){return[t._v("\n          "+t._s(e.value)+"%\n       ")]}}]),model:{value:t.currentInterlightIntensity,callback:function(e){t.currentInterlightIntensity=e},expression:"currentInterlightIntensity"}}),e(l["a"],{directives:[{name:"show",rawName:"v-show",value:t.photoperiodAutoIncrement,expression:"photoperiodAutoIncrement"}],staticClass:"pt-6",attrs:{label:"Intensity Range",value:t.intensityRange,max:100,min:0,step:1,"thumb-label":"always","thumb-size":45,"thumb-color":"rgb(255,0,255)",color:"rgb(255,0,255)","tick-size":"1","track-color":"black"},on:{change:t.autoIncrementRangeSliderChanged},scopedSlots:t._u([{key:"thumb-label",fn:function(e){return[t._v(" "+t._s(e.value)+"% ")]}}])}),e(u["a"],{directives:[{name:"show",rawName:"v-show",value:t.photoperiodAutoIncrement,expression:"photoperiodAutoIncrement"}],staticClass:"pt-6",attrs:{max:100,min:1,step:1,"thumb-color":"rgb(255,0,255)","thumb-size":45,"thumb-label":"always",label:"Daily Increment","track-color":"black"},scopedSlots:t._u([{key:"thumb-label",fn:function(e){return[t._v(" "+t._s(e.value)+"% ")]}}]),model:{value:t.photoperiodAutoIncrementDailyStep,callback:function(e){t.photoperiodAutoIncrementDailyStep=e},expression:"photoperiodAutoIncrementDailyStep"}}),t.changeDetected?e(n["a"],{attrs:{type:"info"}},[t._v("\n        Changing the On/Off Times affects the irrigation schedule."),e("br"),t._v("\n        Please review irrigation.\n      ")]):t._e(),e("div",{staticClass:"text-center"},[e("strong",[t._v(t._s(t.getPhotoPeriodAsString(t.phase,t.noInterlights)))])])],1)],1)],1)},f=[],p=r("c1df"),m=r.n(p),v=r("b047"),y=r.n(v),g=r("372a"),b=r("7ce3"),w=r("9c4f"),x=r("2f62"),S=r("dd20");function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function C(t,e){return T(t)||k(t,e)||P(t,e)||O()}function O(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function k(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function T(t){if(Array.isArray(t))return t}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){I(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function I(t,e,r){return(e=L(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L(t){var e=A(t,"string");return"symbol"==_(e)?e:e+""}function A(t,e){if("object"!=_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var M={name:"photoperiod",components:{VuetifyTimepicker:S["a"],HelpButton:b["a"]},props:["disabled","value","isException","title","invertable","noInterlights"],mixins:[g["a"],w["a"]],data:function(){return{phase:{},inverted:!1,lightsStartTime:0,lightsEndTime:24,currentTime:[0,24],currentIntensity:100,currentDownlightIntensity:100,currentInterlightIntensity:100,syncDownlightInterlight:!1,intensityRange:[0,100],photoperiodAutoIncrement:!1,photoperiodAutoIncrementStartIntensity:0,photoperiodAutoIncrementEndIntensity:100,photoperiodAutoIncrementDailyStep:2,isInitialChange:!1,changeDetected:!1}},beforeMount:function(){this.phase=E({},this.value),this.currentDownlightIntensity=Math.round(100*parseFloat(this.phase.photoPeriodIntensity)),this.currentInterlightIntensity=Math.round(100*parseFloat(this.phase.photoPeriodInterlightIntensity)),this.syncDownlightInterlight=this.currentDownlightIntensity===this.currentInterlightIntensity,this.photoperiodAutoIncrement=this.phase.photoperiodAutoIncrement,this.photoperiodAutoIncrementStartIntensity=this.phase.photoperiodAutoIncrementStartIntensity,this.photoperiodAutoIncrementEndIntensity=this.phase.photoperiodAutoIncrementEndIntensity,this.intensityRange=[this.photoperiodAutoIncrementStartIntensity,this.photoperiodAutoIncrementEndIntensity],this.photoperiodAutoIncrementDailyStep=this.phase.photoperiodAutoIncrementDailyStep,this.phase&&this.phase.photoperiod&&this.onPhotoPeriodChange(this.phase.photoperiod)},computed:E(E({},Object(x["c"])(["timePreference24Hour"])),{},{breakTitleLines:function(){return this.invertable&&(this.isException||!this.noInterlights||0!=this.currentTime[0]||24!=this.currentTime[1])},activeTrackColor:function(){if(this.inverted)return"black";parseInt(this.currentDownlightIntensity);return"rgb(255,0,255)"},downlightIntensitySliderColor:function(){var t=parseInt(this.currentDownlightIntensity),e=t/100+.1;return"rgba(255,0,255,"+e+")"},interlightIntensitySliderColor:function(){var t=parseInt(this.currentInterlightIntensity),e=t/100+.1;return"rgba(255,0,255,"+e+")"},autoIncrementStartIntensitySliderColor:function(){var t=parseInt(this.photoperiodAutoIncrementStartIntensity),e=t/100+.1;return"rgba(255,0,255,"+e+")"},autoIncrementEndIntensitySliderColor:function(){var t=parseInt(this.photoperiodAutoIncrementEndIntensity),e=t/100+.1;return"rgba(255,0,255,"+e+")"},autoIncrementDailyStepSliderColor:function(){var t=parseInt(this.photoperiodAutoIncrementDailyStep),e=t/100+.1;return"rgba(255,0,255,"+e+")"},intensityColor:function(){if(this.inverted)return"black";var t=parseInt(this.currentDownlightIntensity),e=t/100+.1;return"rgba(255,0,255,"+e+")"},trackColor:function(){if(this.inverted){var t=parseInt(this.currentDownlightIntensity),e=t/100+.1;return"rgb(255,0,255,"+e+")"}return"black"}}),methods:{onInvertSchedule:function(){var t=JSON.parse(JSON.stringify(this.phase));t.photoperiod.inverted=this.inverted,this.$emit("input",t),this.$emit("revalidate",t)},onPhotoPeriodChange:function(t){var e=this;if(this.isInitialChange=!0,24==t.photoperiod)this.currentTime=[0,24],this.lightsStartTime="00:00",this.lightsEndTime="24:00";else{var r=parseInt(t.photoperiodStarttime.substring(0,2)),n=parseInt(t.photoperiodStarttime.substring(2,4))/60,i=r+n,a=i+t.photoperiod;this.lightsStartTime="".concat(r,":").concat(t.photoperiodStarttime.substring(2,4));var o=Math.floor(a),s=60*a-60*o;this.lightsEndTime="".concat(o,":").concat(s),this.currentTime=[i,a],this.inverted=t.inverted}setTimeout((function(){e.isInitialChange=!1}),100)},convertNumberToTimeMoment:function(t){var e=m()();if(e.set("hour",t),t%1===0)e.set("minutes",0);else{var r="0."+String(t).split(".")[1];e.set("minutes",60*r)}return e},onLightsStartTimeChange:function(t){var e=t.split(":"),r=C(e,2),n=r[0],i=r[1];this.$set(this.currentTime,0,parseInt(n)+i/60),this.rangeSliderChanged(this.currentTime)},onLightsEndTimeChange:function(t){var e=t.split(":"),r=C(e,2),n=r[0],i=r[1];this.$set(this.currentTime,1,parseInt(n)+i/60),this.rangeSliderChanged(this.currentTime)},rangeSliderChanged:function(t){t[0],t[1];var e=this.convertNumberToTimeMoment(t[0]),r=this.convertNumberToTimeMoment(t[1]),n={photoperiod:t[1]-t[0],photoperiodStarttime:e.format("HHmm"),photoperiodEndtime:r.format("HHmm"),inverted:this.inverted};this.phase.photoperiod=n,this.isInitialChange||this.value.noIrrigation||(this.changeDetected=!0),this.$emit("input",this.phase)},autoIncrementRangeSliderChanged:function(t){this.photoperiodAutoIncrementStartIntensity=t[0],this.photoperiodAutoIncrementEndIntensity=t[1]},convertNumberToDisplayTime:function(t){var e=14==this.timePreference24Hour?Math.floor(t):Math.floor((t+11)%12+1);if((t+"").indexOf(".")>-1){var r=String(String(t).split(".")[1]/100*60);1==r.length&&(r+="0"),e=e+":"+r}var n=t>=12&&24!=t?"pm":"am";return n=14==this.timePreference24Hour?"":n,e+n}},watch:{inverted:function(t){this.onInvertSchedule()},syncDownlightInterlight:function(t){t&&this.phase.photoPeriodIntensity!==this.phase.photoPeriodInterlightIntensity&&(this.currentInterlightIntensity=this.currentDownlightIntensity)},currentDownlightIntensity:function(t){this.phase.photoPeriodIntensity=(parseFloat(t)/100).toFixed(2),this.syncDownlightInterlight&&(this.currentInterlightIntensity=t)},currentInterlightIntensity:function(t){this.phase.photoPeriodInterlightIntensity=(parseFloat(t)/100).toFixed(2)},photoperiodAutoIncrement:function(t){t&&(this.syncDownlightInterlight=!0),this.phase.photoperiodAutoIncrement=t},photoperiodAutoIncrementStartIntensity:function(t){this.phase.photoperiodAutoIncrementStartIntensity=t},photoperiodAutoIncrementEndIntensity:function(t){this.phase.photoperiodAutoIncrementEndIntensity=t},photoperiodAutoIncrementDailyStep:function(t){this.phase.photoperiodAutoIncrementDailyStep=t},"phase.photoperiodSimulateSunriseSunset":function(t){this.$emit("input",this.phase)},"phase.photoperiodUseInterlights":function(t){this.$emit("input",this.phase)},"phase.inheritLightSchedule":function(t){this.$emit("input",this.phase)},"phase.photoPeriodIntensity":y()((function(){this.$emit("input",this.phase),this.$emit("revalidate",this.phase)}),250),"phase.photoPeriodInterlightIntensity":y()((function(){this.$emit("input",this.phase),this.$emit("revalidate",this.phase)}),250),"phase.photoperiodAutoIncrement":function(){this.$emit("input",this.phase),this.$emit("revalidate",this.phase)},"phase.photoperiodAutoIncrementStartIntensity":y()((function(){this.$emit("input",this.phase),this.$emit("revalidate",this.phase)}),250),"phase.photoperiodAutoIncrementEndIntensity":y()((function(){this.$emit("input",this.phase),this.$emit("revalidate",this.phase)}),250),"phase.photoperiodAutoIncrementDailyStep":function(){this.$emit("input",this.phase),this.$emit("revalidate",this.phase)},"value.inheritIrrigationSchedule":function(t){this.phase.inheritIrrigationSchedule=t},"value.noIrrigation":function(t){this.phase.noIrrigation=t},value:function(t){var e=this;this.phase=E({},this.value),this.phase&&this.phase.photoperiod&&(this.onPhotoPeriodChange(this.phase.photoperiod),this.currentDownlightIntensity=Math.round(100*parseFloat(this.phase.photoPeriodIntensity)),this.currentInterlightIntensity=Math.round(100*parseFloat(this.phase.photoPeriodInterlightIntensity)),this.photoperiodAutoIncrement=this.phase.photoperiodAutoIncrement,this.photoperiodAutoIncrementStartIntensity=this.phase.photoperiodAutoIncrementStartIntensity,this.photoperiodAutoIncrementEndIntensity=this.phase.photoperiodAutoIncrementEndIntensity,this.intensityRange=[this.photoperiodAutoIncrementStartIntensity,this.photoperiodAutoIncrementEndIntensity],this.photoperiodAutoIncrementDailyStep=this.phase.photoperiodAutoIncrementDailyStep,this.inverted=this.phase.photoperiod.inverted,setTimeout((function(){e.$emit("revalidate",e.phase)}),50))}}},U=M,N=(r("a62e"),r("2877")),F=Object(N["a"])(U,h,f,!1,null,null,null);e["a"]=F.exports},"7c8a":function(t,e,r){"use strict";r("5490")},"7deb":function(t,e,r){"use strict";r("0ebe")},"7e58":function(t,e,r){},"7e85":function(t,e,r){"use strict";r("8836");var n=r("10d2"),i=r("3206"),a=r("a452"),o=r("58df"),s=r("d9bd");const l=Object(o["a"])(n["a"],Object(i["b"])("stepper"),a["a"]);e["a"]=l.extend({name:"v-stepper",provide(){return{stepClick:this.stepClick,isVertical:this.vertical}},props:{altLabels:Boolean,nonLinear:Boolean,flat:Boolean,vertical:Boolean},data(){const t={isBooted:!1,steps:[],content:[],isReverse:!1};return t.internalLazyValue=null!=this.value?this.value:(t[0]||{}).step||1,t},computed:{classes(){return{"v-stepper--flat":this.flat,"v-stepper--is-booted":this.isBooted,"v-stepper--vertical":this.vertical,"v-stepper--alt-labels":this.altLabels,"v-stepper--non-linear":this.nonLinear,...n["a"].options.computed.classes.call(this)}},styles(){return{...n["a"].options.computed.styles.call(this)}}},watch:{internalValue(t,e){this.isReverse=Number(t)<Number(e),e&&(this.isBooted=!0),this.updateView()}},created(){this.$listeners.input&&Object(s["a"])("@input","@change",this)},mounted(){this.updateView()},methods:{register(t){"v-stepper-step"===t.$options.name?this.steps.push(t):"v-stepper-content"===t.$options.name&&(t.isVertical=this.vertical,this.content.push(t))},unregister(t){"v-stepper-step"===t.$options.name?this.steps=this.steps.filter(e=>e!==t):"v-stepper-content"===t.$options.name&&(t.isVertical=this.vertical,this.content=this.content.filter(e=>e!==t))},stepClick(t){this.$nextTick(()=>this.internalValue=t)},updateView(){for(let t=this.steps.length;--t>=0;)this.steps[t].toggle(this.internalValue);for(let t=this.content.length;--t>=0;)this.content[t].toggle(this.internalValue,this.isReverse)}},render(t){return t(this.tag,{staticClass:"v-stepper",class:this.classes,style:this.styles},this.$slots.default)}})},"805d":function(t,e,r){"use strict";r("3d69")},"81d2":function(t,e,r){},8403:function(t,e,r){},8537:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("4bd4"),l=r("132d"),c=r("0fd9"),u=r("b974"),d=r("2fa4"),h=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v("Select ECU State")]),e(d["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],[e(s["a"],{ref:"form",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(c["a"],[e(o["a"],{staticClass:"pr-1",attrs:{cols:"12"}},[e(u["a"],{attrs:{items:t.actions,"item-value":"id","item-text":"label",label:"Select ECU State","return-object":"",rules:[function(){return!!t.selectedOption||"This field is required"}]},model:{value:t.selectedOption,callback:function(e){t.selectedOption=e},expression:"selectedOption"}})],1)],1)],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.valid},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},f=[],p={props:["actions"],data:function(){return{valid:!1,selectedOption:null}},methods:{onCancel:function(){this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",null),this.$store.dispatch("universalDashboard/setShowEcuOptions",!1),this.selectedOption=null,this.$refs.form.resetValidation()},onConfirm:function(){this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!0),this.$store.dispatch("batchActions/changeBatchAction",this.selectedOption.id),this.$store.dispatch("universalDashboard/setShowEcuOptions",!1),this.selectedOption=null,this.$refs.form.resetValidation()}}},m=p,v=r("2877"),y=Object(v["a"])(m,h,f,!1,null,null,null);e["a"]=y.exports},"856a":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("8fea"),s=r("169a"),l=r("132d"),c=r("3a2f"),u=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{id:"controllerCameras"}},[e(a["c"],[e(o["a"],{staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,items:t.platformGroupCameras,"fixed-header":"",options:t.pagination,"hide-default-footer":"",height:"100%",loading:t.isLoading},scopedSlots:t._u([{key:"item.actions",fn:function(r){var i=r.item;return[e("span",{staticStyle:{"white-space":"nowrap",width:"50px","text-align":"center"}},[e(c["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(n["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onEdit(i)}}},a),[e(l["a"],[t._v("edit")])],1)]}}],null,!0)},[e("span",[t._v("Edit")])]),e(c["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(n["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onShowPlayer(i)}}},a),[e(l["a"],[t._v("camera")])],1)]}}],null,!0)},[e("span",[t._v("Take Photo")])]),e(c["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(l["a"],t._g({on:{click:function(e){return t.setDefaultCamera(i)}}},n),[t._v("\n                "+t._s(i.isDefault?"mdi-check-circle-outline":"mdi-checkbox-blank-circle-outline")+"\n              ")])]}}],null,!0)},[e("span",[t._v(t._s(i.isDefault?"Default Camera":"Set As Default"))])]),e(c["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(n["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onDelete(i)}}},a),[e(l["a"],[t._v("delete")])],1)]}}],null,!0)},[e("span",[t._v("Delete")])])],1)]}}])})],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.onAddNew}},[t._v("Add New")]),e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.associateExisting}},[t._v("Associate Existing")]),e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.refresh}},[t._v("Refresh")])],1),e(s["a"],{attrs:{persistent:"",width:"400"},model:{value:t.showEditor,callback:function(e){t.showEditor=e},expression:"showEditor"}},[e("controller-camera-edit",{attrs:{"platform-group":t.platformGroup},on:{close:function(e){t.showEditor=!1},save:t.refresh},model:{value:t.rec,callback:function(e){t.rec=e},expression:"rec"}})],1),e(s["a"],{attrs:{width:"800"},model:{value:t.showCameraPicker,callback:function(e){t.showCameraPicker=e},expression:"showCameraPicker"}},[t.showCameraPicker?e("facility-camera-selector",{attrs:{"facility-cameras":t.facilityCameras,"platform-group-cameras":t.platformGroupCameras},on:{saved:t.onSaveCameraSelection,closed:function(e){t.showCameraPicker=!1}}}):t._e()],1),t.showViewer?e("viewer",{ref:"viewer",staticClass:"images clearfix",attrs:{images:t.images,options:t.imageViewerOptions},on:{inited:t.inited},scopedSlots:t._u([{key:"default",fn:function(r){return t._l(r.images,(function(n,i){return e("img",{key:n,staticClass:"image",attrs:{alt:i+1+" of "+r.images.length,src:n},on:{load:t.onImageLoad}})}))}}],null,!1,882874965)}):t._e()],1)},d=[],h=r("2f62"),f=(r("c1df"),r("d67f")),p=r("d0eb"),m=r("4c1e"),v=r("ea10"),y=r("172a"),g=r("03a4"),b=(r("8e07"),r("2fa4")),w=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{id:"facilityCameras"}},[e(a["d"],[e("h2",[t._v("Facility Cameras")]),e(b["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],[e(o["a"],{staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,items:t.facilityCameras,"fixed-header":"",options:t.pagination,"hide-default-footer":"",height:"100%",loading:t.isLoading,"show-select":""},model:{value:t.selected,callback:function(e){t.selected=e},expression:"selected"}})],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.onSave}},[t._v("Save")])],1)],1)},x=[];function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=P(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(t){var e=D(t,"string");return"symbol"==S(e)?e:e+""}function D(t,e){if("object"!=S(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var k={name:"FacilityCameraSelector",props:{facilityCameras:{type:Array,required:!0},platformGroupCameras:{type:Array,required:!1,default:function(){return[]}}},data:function(){return{isLoading:!1,selected:[],pagination:{itemsPerPage:-1},headers:[{text:"Label",value:"label"},{text:"Type",value:"cameraType.label"},{text:"IP Address",value:"ip"},{text:"MAC Address",value:"macAddr"}]}},beforeMount:function(){this.buildSelected()},computed:C({},Object(h["c"])(["getUser"])),methods:{buildSelected:function(){var t=this;this.selected=this.facilityCameras.filter((function(e){return t.platformGroupCameras.find((function(t){return t.camera_id===e.id}))}))},onSave:function(){this.$emit("saved",this.selected.map((function(t){return t.id})))},onClose:function(){this.$emit("closed")}},watch:{platformGroupCameras:function(){this.buildSelected()}}},T=k,j=(r("805d"),r("2877")),E=Object(j["a"])(T,w,x,!1,null,null,null),I=E.exports;function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function A(t){return N(t)||U(t)||R(t)||M()}function M(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function N(t){if(Array.isArray(t))return $(t)}function F(t,e){return V(t)||H(t,e)||R(t,e)||G()}function G(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function R(t,e){if(t){if("string"==typeof t)return $(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(t,e):void 0}}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function H(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function V(t){if(Array.isArray(t))return t}function B(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B(Object(r),!0).forEach((function(e){Y(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Y(t,e,r){return(e=q(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q(t){var e=W(t,"string");return"symbol"==L(e)?e:e+""}function W(t,e){if("object"!=L(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var J={name:"",props:["controller"],mixins:[g["a"]],components:{FacilityCameraSelector:I,ControllerCameraEdit:m["a"],Viewer:y["a"]},data:function(){return{images:[],rec:null,src:null,isLoading:!1,showEditor:!1,imageViewerOptions:{inline:!1,button:!1,navbar:!1,title:[1,function(t,e){return"".concat(t.alt," (").concat(e.naturalWidth," × ").concat(e.naturalHeight,")")}],toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!1},facilityCameras:[],platformGroupCameras:[],platformGroup:{},showViewer:!1,showCameraPicker:!1,pagination:{itemsPerPage:-1},headers:[{text:"Actions",value:"actions",align:"center"},{text:"Label",value:"camera.label"},{text:"Type",value:"camera.cameraType.label"},{text:"IP Address",value:"camera.ip"},{text:"MAC Address",value:"camera.macAddr"}]}},beforeMount:function(){this.refresh()},computed:z({},Object(h["c"])(["getUser"])),methods:{onShowPlayer:function(t){var e=this;this.showViewer=!1,this.images=[],this.$nextTick((function(){e.images[0]="http://".concat(t.ip,"/cgi-bin/api.cgi?cmd=Snap&user=admin&password=Thefuture0fgrowth!"),e.showViewer=!0}))},setDefaultCamera:function(t){p["a"].post("cameras/setDefault",this.getUser.apitoken,{camera_id:t.camera_id,ag_platformGroup_id:this.platformGroup.id}),this.platformGroupCameras=this.platformGroupCameras.map((function(e){return e.camera_id===t.camera_id?e.isDefault=1:e.isDefault=0,e}))},onClosePlayer:function(){},onEdit:function(t){this.rec=t.camera,this.showEditor=!0},onDelete:function(t){var e=this;v["a"].confirm("Confirm Delete","Are you sure that you want to delete "+t.label+"?",(function(r){r&&(e.isLoading=!0,p["a"].destroy("cameras",t.id,e.getUser.apitoken).then((function(t){var r=F(t,2),n=r[0];r[1];e.isLoading=!1,n?(e.refresh(),f["a"].success("Record deleted")):f["a"].error("An error occurred. Please try again later.")})))}))},associateExisting:function(){this.showCameraPicker=!0},onAddNew:function(){this.rec={controller_id:this.controller.id,facility_id:this.getUser.facility_id,label:null,cameraType_id:null,cameraUrl:null,cameraUsername:"admin",cameraPassword:null,ip:null,macAddr:null,streamUrl:null},this.showEditor=!0},onSaveCameraSelection:function(t){var e=this;this.isLoading=!0,this.showCameraPicker=!1,p["a"].post("cameras/updatePlatformGroupCameras",this.getUser.apitoken,{ag_platformGroup_id:this.platformGroup.id,camera_ids:t}).then((function(t){e.refresh()}))},refresh:function(){var t=this;this.isLoading=!0,Promise.all([p["a"].get("cameras",this.getUser.apitoken,{filter:{include:["cameraType"],where:{facility_id:this.getUser.facility_id}}}),p["a"].get("ag_platformGroups",this.getUser.apitoken,{filter:{where:{controller_id:this.controller.id},include:{relation:"cameras",scope:{include:{relation:"camera",scope:{include:["cameraType"]}}}},limit:500}})]).then((function(e){var r=F(e,2),n=F(r[0],2),i=n[0],a=(n[1],F(r[1],2)),o=a[0];a[1];t.platformGroup=o[0],t.facilityCameras=i,t.platformGroupCameras=A(t.platformGroup.cameras),t.isLoading=!1}))}},watch:{controller:function(t){this.platformGroup={},this.facilityCameras=[],this.platformGroupCameras=[],this.refresh()}}},Z=J,X=(r("f92f"),Object(j["a"])(Z,u,d,!1,null,null,null));e["a"]=X.exports},8836:function(t,e,r){},"888e":function(t,e,r){"use strict";r("70e2")},"8aae":function(t,e,r){},"8ac5":function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=r("62ad"),o=r("0fd9"),s=function(){var t=this,e=t._self._c;return e(n["a"],{attrs:{flat:"",loading:t.isLoading}},[e(i["c"],[t.lifecyclesPlatforms.platforms&&t.lifecyclesPlatforms.platforms.length>0?e("div",{staticClass:"px-3"},[e(o["a"],{staticClass:"row-eq-height",attrs:{justify:"center"}},t._l(t.lifecyclesPlatforms.platforms,(function(r,n){return e(a["a"],{key:n,attrs:{md:t.cols,sm:"12",cols:"12"}},[e("platform",{ref:"platform-".concat(r.platform_id),refInFor:!0,attrs:{name:"".concat(r.platformGroupName," - ").concat(r.platformName),lifecycleId:t.lifecycleId,platform:r,side:"left","selected-platform-positions":[],"selected-empty-positions":[]}})],1)})),1)],1):t._e()])],1)},l=[],c=r("5900"),u=r("2f62"),d=r("d0eb");function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(t,e){return g(t)||y(t,e)||m(t,e)||p()}function p(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(t,e){if(t){if("string"==typeof t)return v(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function y(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function g(t){if(Array.isArray(t))return t}function b(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */b=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",m="executing",v="completed",y={};function g(){}function w(){}function x(){}var S={};c(S,o,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,o)&&(S=C);var O=x.prototype=g.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==h(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=f;return function(a,o){if(i===m)throw Error("Generator is already running");if(i===v){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:p,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(h(e)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function w(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){w(a,n,i,o,s,"next",t)}function s(t){w(a,n,i,o,s,"throw",t)}o(void 0)}))}}function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){C(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function C(t,e,r){return(e=O(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function O(t){var e=P(t,"string");return"symbol"==h(e)?e:e+""}function P(t,e){if("object"!=h(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var D={name:"LifecyclePlatforms",components:{Platform:c["a"]},props:{lifecycleId:{type:Number,required:!0}},data:function(){return{isLoading:!1,lifecyclesPlatforms:[]}},computed:_(_({},Object(u["c"])(["getUser","platformGroups"])),{},{cols:function(){if(this.lifecyclesPlatforms&&this.lifecyclesPlatforms.platforms.length){switch(this.lifecyclesPlatforms.platforms.length){case 4:return 6;case 6:return 12}return 3}return 4}}),mounted:function(){var t=this;return x(b().mark((function e(){return b().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getLifecyclePlatforms();case 2:case"end":return e.stop()}}),e)})))()},methods:{getLifecyclePlatforms:function(){var t=this;return x(b().mark((function e(){var r,n,i;return b().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,d["a"].get("ag_lifecycles/getLifecyclePlatforms",t.getUser.apitoken,{lifecycle_id:t.lifecycleId});case 3:r=e.sent,n=f(r,2),i=n[0],n[1],t.lifecyclesPlatforms=i.getLifecyclePlatforms,t.isLoading=!1;case 9:case"end":return e.stop()}}),e)})))()}}},k=D,T=r("2877"),j=Object(T["a"])(k,s,l,!1,null,null,null);e["a"]=j.exports},"8af8":function(t,e,r){"use strict";r("6bff")},"8b0d":function(t,e,r){},"8cca":function(t,e,r){"use strict";r("196d")},"8d4d":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("132d"),s=r("67b6"),l=r("43a6"),c=r("b974"),u=r("2fa4"),d=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{loading:t.isLoading}},[e(a["d"],[e("h2",[t._v("Select State")]),e(u["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(o["a"],[t._v("close")])],1)],1),e(a["c"],[e(c["a"],{attrs:{label:"Set Control State","item-text":"action","item-value":"action_id",items:t.options,"single-line":""},model:{value:t.selectedState,callback:function(e){t.selectedState=e},expression:"selectedState"}}),e("div",{staticClass:"d-flex justify-center"},[e(l["a"],{staticClass:"mt-0",attrs:{row:"",label:"Preferred VFU State Interaction"},on:{change:t.saveCustomPreference},model:{value:t.preference,callback:function(e){t.preference=e},expression:"preference"}},[e(s["a"],{attrs:{label:"Pop-up",value:"Pop-up"}}),e(s["a"],{attrs:{label:"Menu",value:"Menu"}})],1)],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.selectedState},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},h=[],f=r("2f62"),p=r("d0eb"),m=r("d67f");function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function y(t){return w(t)||b(t)||_(t)||g()}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function w(t){if(Array.isArray(t))return C(t)}function x(t,e){return P(t)||O(t,e)||_(t,e)||S()}function S(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(t,e){if(t){if("string"==typeof t)return C(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(t,e):void 0}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function O(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function P(t){if(Array.isArray(t))return t}function D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function k(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?D(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return(e=j(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j(t){var e=E(t,"string");return"symbol"==v(e)?e:e+""}function E(t,e){if("object"!=v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var I={name:"StateOptions",props:["item"],data:function(){return{options:[],isLoading:!1,selectedState:null,preference:null}},computed:k(k({},Object(f["c"])(["getUser"])),{},{userPreference:function(){return this.getUser.preferences.find((function(t){return"Preferred VFU State Interaction"===t.preference}))}}),mounted:function(){this.preference=this.userPreference.setting,this.loadStates()},methods:k(k({},Object(f["b"])(["locallyUpdateProfileSettings"])),{},{loadStates:function(){var t=this;this.isLoading=!0,p["a"].get("devices/getPlatformGroupDevices",this.getUser.apitoken,{platformGroup_id:this.item.platformGroup_id}).then((function(e){var r=x(e,2),n=r[0];r[1];t.isLoading=!1;var i=n.filter((function(e){return e.device_id===t.item.id}));i[0].actions?t.options=i[0].actions:t.options=[]}))},onCancel:function(){this.$emit("cancel")},onConfirm:function(){this.$emit("save",this.selectedState)},saveCustomPreference:function(){var t=this;p["a"].post("ag_userPreferences/save",this.getUser.apitoken,{user_id:this.getUser.id,preference_id:5,setting:this.preference}).then((function(e){var r=x(e,2),n=(r[0],r[1]);if(n)m["a"].error("An error occurred saving your preference. Please try again later");else{var i=y(t.getUser.preferences),a=i.find((function(t){return"Preferred VFU State Interaction"===t.preference}));a.setting=t.preference,t.locallyUpdateProfileSettings(i)}}))}}),watch:{item:function(t,e){t&&(this.selectedState=null,this.loadStates())}}},L=I,A=r("2877"),M=Object(A["a"])(L,d,h,!1,null,null,null);e["a"]=M.exports},"8ddd":function(t,e,r){},"8e49":function(t,e,r){},"8f0b":function(t,e,r){"use strict";var n=r("8fea"),i=r("4bd4"),a=r("132d"),o=r("8654"),s=function(){var t=this,e=t._self._c;return e("div",[e(i["a"],{ref:"form",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(n["a"],{attrs:{headers:t.headers,"hide-default-footer":!0,items:t.rec,flat:"",options:t.pagination,height:"100%"},on:{"update:options":function(e){t.pagination=e}},scopedSlots:t._u([{key:"item",fn:function(r){var n=r.item;r.select;return["Lights On"==n.lightState||"Zone"==n.lightState||t.showDarkPhase?e("tr",[e("td",{staticStyle:{width:"120px"}},["Lights On"==n.lightState?e(a["a"],{attrs:{color:"rgb(255,0,255)"}},[t._v("highlight")]):e(a["a"],{attrs:{color:"silver"}},[t._v("highlight")]),e("span",{staticStyle:{"font-size":"13px"}},[t._v(t._s(n.lightState))])],1),e("td",[e("div",{staticClass:"env-set"},[e(o["a"],{attrs:{type:"number",suffix:t.unit,rules:[t.requiredNumber],disabled:t.disabled},on:{change:function(e){return t.save(n)}},model:{value:n.WarnMin,callback:function(e){t.$set(n,"WarnMin",e)},expression:"item.WarnMin"}})],1)]),e("td",[e("div",{staticClass:"env-set"},[e(o["a"],{attrs:{type:"number",suffix:t.unit,rules:[t.requiredNumber],disabled:t.disabled},on:{change:function(e){return t.save(n)}},model:{value:n.Min,callback:function(e){t.$set(n,"Min",e)},expression:"item.Min"}})],1)]),e("td",[e(o["a"],{attrs:{type:"number",suffix:t.unit,rules:[t.requiredNumber],disabled:t.disabled},on:{change:function(e){n.setPoint=parseFloat(n.SetPoint),t.save(n)}},model:{value:n.SetPoint,callback:function(e){t.$set(n,"SetPoint",e)},expression:"item.SetPoint"}})],1),e("td",[e(o["a"],{attrs:{type:"number",suffix:t.unit,rules:[t.requiredNumber],disabled:t.disabled},on:{change:function(e){return t.save(n)}},model:{value:n.Max,callback:function(e){t.$set(n,"Max",e)},expression:"item.Max"}})],1),e("td",[e(o["a"],{attrs:{type:"number",suffix:t.unit,rules:[t.requiredNumber],disabled:t.disabled},on:{change:function(e){return t.save(n)}},model:{value:n.WarnMax,callback:function(e){t.$set(n,"WarnMax",e)},expression:"item.WarnMax"}})],1)]):t._e()]}}])})],1)],1)},l=[],c=r("d67f"),u={name:"environment-table",props:["type","value","unit","min","max","showDarkPhase","disabled"],data:function(){return{pagination:{sortDesc:[!0],sortBy:["lightState"]},rec:[],valid:!0,headers:[{text:"State",value:"lightState",width:100},{text:"Warn Min",value:"WarnMin",sortable:!1},{text:"Min",value:"Min",sortable:!1},{text:"Envelope",value:"SetPoint",sortable:!1},{text:"Max",value:"Max",sortable:!1},{text:"Warn Max",value:"WarnMax",sortable:!1}]}},beforeMount:function(){this.copyArray(this.value)},methods:{requiredNumber:function(t){var e=!isNaN(parseFloat(t))&&parseFloat(t)>=parseFloat(this.min)&&parseFloat(t)<=parseFloat(this.max);return e||"Invalid input."},editMode:function(t){t.edit=!0},save:function(t){this.valid?(this.$emit("input",this.rec),this.$emit("save",this.rec,this.type),t.edit=!1):(this.$refs.form.validate(),c["a"].error("Invalid Input"))},copyArray:function(t){this.rec=JSON.parse(JSON.stringify(t))}},watch:{value:function(){this.copyArray(this.value)}}},d=u,h=r("2877"),f=Object(h["a"])(d,s,l,!1,null,null,null);e["a"]=f.exports},"90b2":function(t,e,r){},9170:function(t,e,r){"use strict";r("4d4d")},"92f1":function(t,e,r){"use strict";var n=r("c6a6"),i=r("8212"),a=r("8336"),o=r("b0af"),s=r("99d9"),l=r("ac7c"),c=r("62ad"),u=r("169a"),d=r("4bd4"),h=r("132d"),f=r("adda"),p=r("67b6"),m=r("43a6"),v=r("0fd9"),y=r("b974"),g=r("8dd9"),b=r("2fa4"),w=r("71a3"),x=r("c671"),S=r("fe57"),_=r("aac8"),C=r("8654"),O=r("a844"),P=r("8414"),D=r("1e06"),k=r("3a2f"),T=function(){var t=this,e=t._self._c;return e(o["a"],{staticClass:"screen-height-container flex-content",staticStyle:{"max-height":"680px"},attrs:{id:"ticket-details-modal",loading:t.isLoading}},[t.ticket?e(s["d"],{staticClass:"d-flex align-start"},[t.hardwareItem?[e("div",{staticClass:"d-flex flex-column",staticStyle:{width:"calc(100% - 120px)"}},[e("h2",{staticClass:"nowrap"},[t._v("\n          Ticket "+t._s(t.ticket.id)+": "+t._s(t.hardwareItem)+" - "+t._s(t.ticket.hardwareTypeCategoryLabel)+"\n          "+t._s(t.ticket.hardwareItemTicketProblemTypeLabel)+" on\n          "+t._s(t.formatDate(t.ticket.failureDate))+"\n        ")]),e("div",{staticClass:"text-subtitle-1"},[t._v(t._s(t.ticket.label))])])]:[e("div",{staticClass:"title-text",staticStyle:{width:"calc(100% - 120px)"}},[e("h2",{staticClass:"nowrap"},[t._v("\n          Software:\n          "+t._s(t.ticket.label&&""!==t.ticket.label?t.ticket.label:t.ticket.description)+"\n        ")]),e(k["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(a["a"],t._g({attrs:{icon:""},on:{click:t.onEditDetails}},n),[e(h["a"],[t._v("edit")])],1)]}}],null,!1,2124904396)},[e("span",[t._v("Edit Ticket Details")])])],1)],e(b["a"]),e(a["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(h["a"],[t._v("close")])],1)],2):t._e(),t.ticket?e(s["c"],{staticClass:"flex-tabs-container"},[e(S["a"],{attrs:{centered:""},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e(w["a"],{key:"0"},[t._v("Update Progress")]),e(w["a"],{key:"1"},[t._v("Details")]),t.ticket.imageUrl?e(w["a"],{key:"2"},[t._v("Photo/Video")]):t._e(),e(w["a"],{key:"3"},[t._v("History")])],1),e(_["a"],{model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e(x["a"],{key:"0"},[e(g["a"],[e(d["a"],{ref:"updateForm",staticClass:"pt-5 h-100 overflow-auto px-3",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(v["a"],[e(c["a"],{attrs:{md:"3"}},[e(y["a"],{attrs:{dense:"",items:t.ticketStatuses,"item-text":"label","item-value":"id",label:"Status",Standard:"",rules:[t.rules.required]},model:{value:t.selectedStatus,callback:function(e){t.selectedStatus=e},expression:"selectedStatus"}})],1),e(c["a"],{attrs:{md:"6"}},[e(n["a"],{attrs:{dense:"",items:t.hardwareItemTicketProblemTypes,"item-text":"label","item-value":"id",label:"Type of Problem",rules:[t.rules.required]},model:{value:t.selectedProblemTypeId,callback:function(e){t.selectedProblemTypeId=e},expression:"selectedProblemTypeId"}})],1),e(c["a"],{attrs:{md:"3"}},[e(y["a"],{attrs:{dense:"",items:t.ticketPriorities,"item-text":"label","item-value":"id",label:"Priority",Standard:""},model:{value:t.selectedPriority,callback:function(e){t.selectedPriority=e},expression:"selectedPriority"}})],1)],1),e(v["a"],[e(c["a"],{attrs:{md:"6"}},[e(n["a"],{attrs:{dense:"",items:t.filteredAssignableUsers,"item-text":"name","item-value":"id",label:"Assigned To",multiple:"","small-chips":"","deletable-chips":""},model:{value:t.userAssignments,callback:function(e){t.userAssignments=e},expression:"userAssignments"}})],1),(t.Trimaster.isSoftwareDev(t.getUser)||t.Trimaster.isAdmin(t.getUser))&&t.isSoftwareTicket&&t.isHardwareProblemType?e(c["a"],{attrs:{cols:"6"}},[e(y["a"],{attrs:{dense:"",items:t.allFacilities,"item-text":"name","item-value":"id",label:"Reporting Facility",rules:[t.rules.required]},model:{value:t.selectedFacilityId,callback:function(e){t.selectedFacilityId=e},expression:"selectedFacilityId"}})],1):t._e()],1),e(v["a"],{attrs:{"no-gutters":""}},[e(c["a"],{attrs:{md:"9"}},[t.isDescriptionRequired?t._e():e(O["a"],{staticClass:"description-input",attrs:{label:"Description",rows:6,outlined:""},model:{value:t.description,callback:function(e){t.description=e},expression:"description"}}),t.isDescriptionRequired?e(O["a"],{staticClass:"description-input",attrs:{label:"Description",rows:6,outlined:"",rules:[t.rules.requiredNoBlanks]},model:{value:t.description,callback:function(e){t.description=e},expression:"description"}}):t._e()],1),e(c["a"],{staticClass:"pt-4",attrs:{md:"3"}},[e("upload-image",{attrs:{imageUploadInfo:t.imageUploadInfo},model:{value:t.imageUrl,callback:function(e){t.imageUrl=e},expression:"imageUrl"}})],1)],1),t.Trimaster.isAdmin(t.user)||t.Trimaster.isUserInRole(t.user,"Maintenance")?e("fieldset",{staticStyle:{padding:"10px"}},[e("legend",[t._v("For Internal Use Only")]),t.subcomponents.length?e(y["a"],{attrs:{dense:"",items:t.subcomponents,"item-text":"label","item-value":"id",label:"Components Replaced",chips:"","deletable-chips":"",multiple:""},model:{value:t.selectedSubcomponents,callback:function(e){t.selectedSubcomponents=e},expression:"selectedSubcomponents"}}):t._e(),e("label",[t._v("Time Spent On This Action")]),e("div",{staticClass:"d-flex justify-space-between"},[e(m["a"],{staticClass:"mt-0",attrs:{row:""},model:{value:t.timeEntryMode,callback:function(e){t.timeEntryMode=e},expression:"timeEntryMode"}},[e(p["a"],{attrs:{label:"Manual Entry",value:"manual"}}),e(p["a"],{attrs:{label:"Timer",value:"timer"}})],1),t.ticketAction&&"undefined"!==typeof t.ticketAction.elapsedTime?e("div",{staticClass:"mt-1"},[t._v("\n                  ("+t._s(t.ticketAction.elapsedTime)+"m elapsed)\n                ")]):t._e()],1),"manual"===t.timeEntryMode?e("div",{staticClass:"d-flex flex-column"},[e("div",{staticClass:"d-flex"},[e(C["a"],{attrs:{label:"Hours Spent",rules:[t.rules.integer,t.rules.positiveNumber]},model:{value:t.hoursSpent,callback:function(e){t.hoursSpent=e},expression:"hoursSpent"}}),e(C["a"],{staticClass:"ml-2",attrs:{label:"Minutes Spent",rules:[t.rules.integer,t.rules.positiveNumber]},model:{value:t.minutesSpent,callback:function(e){t.minutesSpent=e},expression:"minutesSpent"}})],1)]):e("div",{staticClass:"d-flex justify-space-between align-content-center"},[t.ticketAction&&t.getUnfinishedLog(t.ticketAction)?t._e():e(a["a"],{attrs:{disabled:!t.valid||!t.description||t.loadingTimer,loading:t.loadingTimer},on:{click:t.startActivityLog}},[t._v("\n                  Start Action\n                  "),e(h["a"],{attrs:{right:"",color:"green"}},[t._v("play_arrow")])],1),t.ticketAction&&t.getUnfinishedLog(t.ticketAction)?e(a["a"],{attrs:{disabled:!t.valid||!t.description||t.loadingTimer,loading:t.loadingTimer},on:{click:function(e){return t.stopActivityLog(!1)}}},[t._v("\n                  Stop Action\n                  "),e(h["a"],{attrs:{right:"",color:"red"}},[t._v("stop")])],1):t._e()],1),e(l["a"],{attrs:{label:"Only show comment to Agrify employees"},model:{value:t.adminOnly,callback:function(e){t.adminOnly=e},expression:"adminOnly"}})],1):t._e(),e(l["a"],{attrs:{label:"Resolved"},model:{value:t.isResolved,callback:function(e){t.isResolved=e},expression:"isResolved"}}),t.isResolved&&t.availableJobTickets.length?e(y["a"],{attrs:{dense:"",items:t.availableJobTickets,"item-text":"label","item-value":"id",label:"Associated Job Ticket"},model:{value:t.selectedJobTicketId,callback:function(e){t.selectedJobTicketId=e},expression:"selectedJobTicketId"}}):t._e()],1)],1)],1),e(x["a"],{key:"1"},[e(g["a"],[e("div",{staticClass:"details h-100 d-flex flex-column overflow-auto"},[e("div",{staticClass:"d-flex flex-column"},[e("label",[e("span",{staticStyle:{"font-weight":"bold"}},[t._v("Ticket ID: ")]),e("span",[t._v(t._s(t.ticket.id))])]),e("span")]),t.hardwareItem?e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Hardware Item:")]),e("span",[t._v(t._s(t.hardwareItem))])]):t._e(),t.ticket.standardOperatingProcedure?e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("SOP:")]),e("span",[t._v("\n                "+t._s(t.ticket.standardOperatingProcedure.label)+"\n              ")])]):t._e(),e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Ticket Status:")]),t.ticket.hardwareItemTicketStatusLabel?e("span",[t._v(t._s(t.ticket.hardwareItemTicketStatusLabel))]):e("span",[t._v(t._s(t.ticket.status.label))])]),e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Failure Date:")]),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.ticket.failureDate))}})]),e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Problem Type:")]),t.ticket.hardwareItemTicketProblemTypeLabel?e("span",[t._v(t._s(t.ticket.hardwareItemTicketProblemTypeLabel))]):e("span",[t._v(t._s(t.ticket.problemType.label))])]),t.hardwareItem?e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Subcomponent:")]),e("span",{directives:[{name:"show",rawName:"v-show",value:t.ticket.hardwareTypeCategoryLabel,expression:"ticket.hardwareTypeCategoryLabel"}]},[t._v(t._s(t.ticket.hardwareTypeCategoryLabel))]),e("span",{directives:[{name:"show",rawName:"v-show",value:!t.ticket.hardwareTypeCategoryLabel,expression:"!ticket.hardwareTypeCategoryLabel"}]},[t._v("Not specified")])]):t._e(),e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Description:")]),e("span",{staticStyle:{"white-space":"pre-line"}},[t._v(t._s(t.ticket.description))])]),e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Last Updated By:")]),e("span",[t._v(t._s(t.ticket.updateuser))])]),e("div",{staticClass:"d-flex flex-column"},[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Updated At:")]),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.ticket.updatedate))}})])])])],1),t.ticketUrls.length>0?e(x["a"],{key:"2"},[e(g["a"],{staticClass:"overflow-auto"},[e("div",{staticStyle:{"margin-top":"10px"}},[t.urlIsImage(t.ticketUrls[0])?e("div",[e("viewer",{staticClass:"d-flex",attrs:{images:t.ticketUrls}},t._l(t.ticketUrls,(function(t){return e("div",{staticClass:"thumb-wrapper"},[e("img",{key:t,staticClass:"thumb",attrs:{src:t}})])})),0)],1):e("div",[e("video",{attrs:{width:"500",controls:""}},[e("source",{attrs:{src:t.ticket.imageUrl}}),t._v("\n                Your browser does not support the video tag.\n              ")])])])])],1):t._e(),e(x["a"],{key:"3"},[e(g["a"],{staticClass:"overflow-auto"},[e("div",{staticClass:"ticket-timeline"},[e(P["a"],{attrs:{"align-top":"",dense:""}},t._l(t.actions,(function(r,n){return r.user?e(D["a"],{key:r.id,attrs:{color:"primary"},scopedSlots:t._u([{key:"icon",fn:function(){return[r.user&&r.user.profileImg?e(i["a"],[e("img",{attrs:{src:r.user.profileImg}})]):e(i["a"],{attrs:{color:"primary"}},[e("span",{staticClass:"white--text"},[t._v(t._s(r.user.firstname.charAt(0))+"\n                      "+t._s(r.user.lastname.charAt(0)))])])]},proxy:!0}],null,!0)},[e("div",{staticClass:"d-flex justify-space-between align-content-center"},[e("div",[e("strong",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.updatedate))}}),t._v("\n                    - "),e("strong",[t._v(t._s(r.status.label))])]),n===t.actions.length-1?e(k["a"],{scopedSlots:t._u([{key:"activator",fn:function(n){var i=n.on;return[e(a["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.loadTicketAction(r.id)}}},i),[e(h["a"],[t._v("edit")])],1)]}}],null,!0)},[e("span",[t._v("Edit this action")])]):t._e()],1),e("div",{staticClass:"caption"},[t._v(t._s(r.description))]),r.replacedContainerItems.length?e("div",[e("strong",[t._v("Replaced Components")]),e("ul",t._l(r.replacedContainerItems,(function(r){return e("li",[t._v("\n                      "+t._s(r.containerItem.hardwareCategory.label)+"\n                    ")])})),0)]):t._e(),r.imageUrl?e("div",{staticStyle:{width:"100%",margin:"5px 0px"}},[e(f["a"],{attrs:{src:r.imageUrl,contain:"",cover:""}})],1):t._e(),"undefined"!==typeof r.elapsedTime?e("span",[t._v("\n                  ("+t._s(r.elapsedTime)+"m elapsed)\n                ")]):t._e(),r.user?e("div",[t._v("\n                  Submitted by: "+t._s(r.user.firstname)+"\n                  "+t._s(r.user.lastname)+"\n                ")]):t._e()]):t._e()})),1)],1)])],1)],1)],1):t._e(),0==t.activeTab?e(s["a"],{staticClass:"justify-center"},[e(a["a"],{attrs:{loading:t.isLoading,disabled:!t.valid||!t.canSaveUpdate,color:"primary"},on:{click:function(e){return t.updateTicket()}}},[t._v("Save Update")])],1):t._e(),e(u["a"],{attrs:{width:"600",persistent:""},model:{value:t.editTicketDetails,callback:function(e){t.editTicketDetails=e},expression:"editTicketDetails"}},[e("ticket-details-edit",{attrs:{ticket:t.ticket,user:t.user},on:{close:t.onCloseEditDetails}})],1)],1)},j=[],E=r("d0eb"),I=r("c1df"),L=r.n(I),A=r("a9b3"),M=r("d67f"),U=r("24e5"),N=(r("0808"),r("172a")),F=r("9c4f"),G=function(){var t=this,e=t._self._c;return e(o["a"],{staticClass:"ticket-details-edit"},[t.ticket?e(s["d"],[t._v("\n    Edit Ticket Details\n    "),e(b["a"]),e(a["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(h["a"],[t._v("close")])],1)],1):t._e(),t.ticket?e(s["c"],{staticClass:"flex-tabs-container"},[e(d["a"],{model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(C["a"],{attrs:{label:"Label",counter:"255",rules:[t.rules.required]},model:{value:t.ticketLabel,callback:function(e){t.ticketLabel=e},expression:"ticketLabel"}}),e(O["a"],{staticClass:"mt-3",attrs:{label:"Description",rules:[t.rules.required],outlined:!0},model:{value:t.ticketDescription,callback:function(e){t.ticketDescription=e},expression:"ticketDescription"}})],1)],1):t._e(),e(s["a"],{staticClass:"justify-center"},[e(a["a"],{attrs:{loading:t.isLoading,disabled:!t.valid,color:"primary"},on:{click:t.onSubmit}},[t._v("\n      Update\n    ")])],1)],1)},R=[];function $(t){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function H(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==$(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError($(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function V(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function B(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){V(a,n,i,o,s,"next",t)}function s(t){V(a,n,i,o,s,"throw",t)}o(void 0)}))}}var z={name:"TicketDetailsEdit",mixins:[F["a"]],props:{ticket:{type:Object,required:!0},user:{type:Object,required:!0}},components:{},beforeMount:function(){this.ticket&&(this.ticketLabel=this.ticket.label,this.ticketDescription=this.ticket.description)},data:function(){return{ticketLabel:"",ticketDescription:"",valid:!1,isLoading:!1}},methods:{onClose:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$emit("close",t)},onSubmit:function(){var t=this;return B(H().mark((function e(){var r;return H().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.valid){e.next=7;break}return t.isLoading=!0,e.next=4,E["a"].patch("hardware_item_tickets",t.user.apitoken,{id:t.ticket.id,label:t.ticketLabel,description:t.ticketDescription});case 4:r=e.sent,t.isLoading=!1,r?(M["a"].success("Ticket details updated."),t.onClose(!0)):M["a"].error("An error ocurred. Please try again later");case 7:case"end":return e.stop()}}),e)})))()}}},Y=z,q=r("2877"),W=Object(q["a"])(Y,G,R,!1,null,null,null),J=W.exports;function Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function X(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function K(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?X(Object(r),!0).forEach((function(e){Q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Q(t,e,r){return(e=tt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tt(t){var e=et(t,"string");return"symbol"==Z(e)?e:e+""}function et(t,e){if("object"!=Z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function rt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */rt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Z(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Z(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function nt(t,e){return ot(t)||at(t,e)||dt(t,e)||it()}function it(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function at(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function ot(t){if(Array.isArray(t))return t}function st(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function lt(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){st(a,n,i,o,s,"next",t)}function s(t){st(a,n,i,o,s,"throw",t)}o(void 0)}))}}function ct(t){return ft(t)||ht(t)||dt(t)||ut()}function ut(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function dt(t,e){if(t){if("string"==typeof t)return pt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pt(t,e):void 0}}function ht(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function ft(t){if(Array.isArray(t))return pt(t)}function pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var mt={name:"TicketDetails",mixins:[A["a"],F["a"]],props:{ticketStatuses:{type:Array,required:!0},ticket:{type:Object,required:!0},user:{type:Object,required:!0},hardwareItem:{type:String,required:!1,default:""},jobTickets:{type:Array,required:!1,default:function(){return[]}}},components:{UploadImage:U["a"],Viewer:N["a"],TicketDetailsEdit:J},mounted:function(){this.loadHistory(),this.loadTicketHardware(),this.loadAssignableUsers(),this.loadTicketPriorities(),this.loadHardwareItemTicketProblemTypes(),this.loadFacilities(),this.selectedJobTicketId=this.ticket.jobTicket_id},data:function(){return{Trimaster:E["a"],isResolved:!1,adminOnly:!1,editTicketDetails:!1,description:null,actions:[],selectedStatus:null,selectedPriority:null,selectedProblemTypeId:null,selectedJobTicketId:null,activeTab:null,isLoading:!1,imageUrl:"",valid:null,imageUploadInfo:{name:"hardware-item-ticket",uploadUrl:"hardware_item_tickets/s3Upload",bucketName:"hardware-item-tickets"},subcomponents:[],selectedSubcomponents:[],alreadyReplacedComponentIds:[],ticketAction:null,timeEntryMode:"manual",hoursSpent:"",minutesSpent:"",timer:null,loadingTimer:!1,ticketPriorities:[],assignableUsers:[],originalUserAssignments:[],userAssignments:[],hardwareItemTicketProblemTypes:[],allFacilities:[],selectedFacilityId:null}},computed:{isDescriptionRequired:function(){var t=this,e=this.ticketStatuses.find((function(e){return e.id===t.selectedStatus}));return this.selectedStatus!==this.ticket.hardware_item_ticket_status_id&&"Waiting On Client"===e.label},canSaveUpdate:function(){var t,e={};this.userAssignments.forEach((function(t){e[t]=!0}));var r={};this.originalUserAssignments.forEach((function(t){r[t]=!0}));var n=null!==(t=this.ticket.ticket_priority_id)&&void 0!==t?t:this.ticket.ticketPriority_id;return""!==this.imageUrl||""!==this.description||this.selectedStatus!==this.ticket.hardware_item_ticket_status_id||this.selectedPriority!==n||this.selectedProblemTypeId!==this.ticket.hardware_item_ticket_problemType_id||JSON.stringify(e)!==JSON.stringify(r)},updateDescription:function(){var t,e=this,r=[],n=this.ticketStatuses.find((function(t){return t.id===e.selectedStatus}));if(""===this.description||this.selectedStatus!==this.ticket.hardware_item_ticket_status_id&&"Waiting On Client"===n.label||r.push(this.description),this.selectedStatus!==this.ticket.hardware_item_ticket_status_id){var i=this.ticketStatuses.find((function(t){return e.selectedStatus===t.id}));r.push("Set status to ".concat(i.label))}var a=null!==(t=this.ticket.ticket_priority_id)&&void 0!==t?t:this.ticket.ticketPriority_id;if(this.selectedPriority!==a){var o=this.ticketPriorities.find((function(t){return e.selectedPriority===t.id}));r.push("Set priority to ".concat(o.label))}if(this.selectedProblemTypeId!==this.ticket.hardware_item_ticket_problemType_id){var s=this.hardwareItemTicketProblemTypes.find((function(t){return e.selectedProblemTypeId===t.id}));r.push("Set problem type to ".concat(s.label))}return r.join("\n")},ticketUrls:function(){var t=[];return this.ticket.imageUrl&&t.push(this.ticket.imageUrl),this.ticket.imageUrl2&&t.push(this.ticket.imageUrl2),this.ticket.imageUrl3&&t.push(this.ticket.imageUrl3),this.ticket.imageUrl4&&t.push(this.ticket.imageUrl4),t},availableJobTickets:function(){var t=this,e=ct(this.jobTickets);if(this.ticketAction){var r=this.jobTickets.find((function(e){return e.id===t.ticketAction.ticket.jobTicket_id}));!r&&this.ticketAction.ticket.jobTicket&&e.push(this.ticketAction.ticket.jobTicket)}else this.ticket.jobTicket&&e.push(this.ticket.jobTicket);return e},isHardwareProblemType:function(){var t=this,e=this.hardwareItemTicketProblemTypes.find((function(e){return e.id===t.selectedProblemTypeId}));return e&&!e.isSoftware},isSoftwareTicket:function(){var t=this,e=this.hardwareItemTicketProblemTypes.find((function(e){return e.id===t.ticket.hardware_item_ticket_problemType_id}));return e&&e.isSoftware},softwareDevUsers:function(){return this.assignableUsers},nonSoftwareDevUsers:function(){return this.assignableUsers},filteredAssignableUsers:function(){return this.assignableUsers}},watch:{"ticket.id":{immediate:!0,handler:function(t,e){var r;t&&(this.loadHistory(),this.loadTicketHardware(),this.selectedStatus=this.ticket.hardware_item_ticket_status_id,this.selectedPriority=null!==(r=this.ticket.ticket_priority_id)&&void 0!==r?r:this.ticket.ticketPriority_id,this.selectedProblemTypeId=this.ticket.hardware_item_ticket_problemType_id,this.description="",this.isResolved=this.ticket.isResolved,this.selectedJobTicketId=this.ticket.jobTicket_id,this.originalUserAssignments=this.ticket.assignments?this.ticket.assignments.map((function(t){return t.user_id})):[],this.userAssignments=ct(this.originalUserAssignments))}},ticketAction:function(t){t&&t.unfinished&&(this.timeEntryMode="timer")},selectedProblemTypeId:function(t,e){var r=this.hardwareItemTicketProblemTypes.find((function(t){return t.id===e})),n=this.hardwareItemTicketProblemTypes.find((function(e){return e.id===t}));r.isSoftware!==n.isSoftware&&(this.userAssignments=[],M["a"].warning("Changing the problem type requires changing the assigned user"))},selectedStatus:function(){this.$refs.updateForm.validate()}},methods:{onClose:function(){this.stopActivityLog(!0),this.$emit("close")},urlIsImage:function(t){return null!=t.match(/\.(jpeg|jpg|gif|png)$/i)},loadFacilities:function(){var t=this;return lt(rt().mark((function e(){var r,n,i;return rt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,E["a"].get("facilities",t.getUser.apitoken,{filter:{order:"name",where:{active:1}}});case 2:r=e.sent,n=nt(r,2),i=n[0],n[1],t.allFacilities=i;case 7:case"end":return e.stop()}}),e)})))()},loadHardwareItemTicketProblemTypes:function(){var t=this;return lt(rt().mark((function e(){var r,n,i;return rt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,E["a"].get("hardware_item_ticket_problemTypes",t.getUser.apitoken,{filter:{order:"label ASC"}});case 2:r=e.sent,n=nt(r,2),i=n[0],n[1],t.hardwareItemTicketProblemTypes=i;case 7:case"end":return e.stop()}}),e)})))()},loadHistory:function(){var t=this;t.ticket&&(this.isLoading=!0,E["a"].get("hardware_item_ticket_actions",t.user.apitoken,{filter:{include:[{ticket:["jobTicket"]},"status","user","activityLog",{relation:"replacedContainerItems",scope:{include:[{relation:"containerItem",scope:{include:{relation:"hardwareCategory"}}}]}}],where:{hardware_item_ticket_id:t.ticket.id},order:"begintime DESC"}}).then((function(e){var r=nt(e,1),n=r[0];t.isLoading=!1,t.actions=n,t.buildTimers()})))},loadTicketPriorities:function(){var t=this;return lt(rt().mark((function e(){var r,n,i;return rt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,E["a"].get("ticket_priorities",t.getUser.apitoken);case 2:r=e.sent,n=nt(r,2),i=n[0],n[1],t.ticketPriorities=i.sort((function(t,e){return t.seq<e.seq?-1:1}));case 7:case"end":return e.stop()}}),e)})))()},loadAssignableUsers:function(){var t=this;return lt(rt().mark((function e(){var r,n,i;return rt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,E["a"].get("vFacilityUsers",t.getUser.apitoken,{filter:{order:"firstname",where:{facility_id:t.ticket.facility_id?t.ticket.facility_id:t.getUser.facility_id,email:{like:"%agrify.com"},disabled:0},include:["roles"]}});case 2:r=e.sent,n=nt(r,2),i=n[0],n[1],t.assignableUsers=i;case 7:case"end":return e.stop()}}),e)})))()},loadTicketHardware:function(){var t=this;E["a"].get("hardware_item_tickets/"+this.ticket.id,this.getUser.apitoken,{filter:{include:["hardware"]}}).then((function(e){var r=nt(e,2),n=r[0];r[1];n.hardware&&E["a"].get("hardware_items/getContainerItemsByProductId",t.getUser.apitoken,{productId:n.hardware.hardware_product_id}).then((function(e){var r=nt(e,2),n=r[0];r[1];n.sort((function(t,e){return t.label>e.label?1:-1})),t.subcomponents=n}))}))},loadTicketAction:function(t){var e=this;return this.activeTab=0,this.isLoading=!0,E["a"].get("hardware_item_ticket_actions/"+t,this.getUser.apitoken,{filter:{include:["activityLog",{ticket:["jobTicket"]},{relation:"replacedContainerItems",scope:{include:[{relation:"containerItem",scope:{include:{relation:"hardwareCategory"}}}]}}]}}).then((function(t){e.ticketAction=t[0],e.selectedStatus=t[0].hardware_item_ticket_status_id,e.selectedPriority=t[0].ticket_priority_id,e.description=t[0].description,e.isResolved=t[0].ticket.isResolved,e.selectedJobTicketId=t[0].ticket.jobTicket_id,e.imageUrl=t[0].imageUrl,e.selectedSubcomponents=t[0].replacedContainerItems.map((function(t){return t.hardware_type_container_item_id})),e.adminOnly=t[0].adminOnly,e.isLoading=!1,e.buildTimers(),e.updateTimer()}))},getUnfinishedLog:function(t){return t&&t.activityLog?t.activityLog.find((function(t){return!t.timeOut})):null},buildTimers:function(){var t=this;this.actions=this.actions.map((function(e){return t.calculateElapsedTime(e)})),this.ticketAction&&(this.ticketAction=this.calculateElapsedTime(this.ticketAction))},calculateElapsedTime:function(t){if(t.activityLog&&t.activityLog.length){t.elapsedTime=t.activityLog.filter((function(t){return!!t.timeOut})).reduce((function(t,e){var r=L()(e.timeIn),n=L()(e.timeOut);return t+n.diff(r,"minutes")}),0);var e=this.getUnfinishedLog(t);if(e){var r=L.a.utc(),n=L.a.utc(e.timeIn);t.elapsedTime+=r.diff(n,"minutes"),t.unfinished=!0}else t.unfinished=!1}return t},updateTimer:function(){var t=this;this.timer&&(clearInterval(this.timer),this.timer=null),this.timer=setInterval((function(){t.ticketAction.unfinished&&t.ticketAction.elapsedTime++}),6e4)},updateTicket:function(){var t=this;return lt(rt().mark((function e(){var r,n,i;return rt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=t,r.isLoading=!0,n=t.ticketStatuses.find((function(e){return e.id===t.selectedStatus})),i={id:t.ticket.id,hardware_item_ticket_status_id:t.selectedStatus,ticket_priority_id:t.selectedPriority,hardware_item_ticket_problemType_id:t.selectedProblemTypeId,isResolved:t.isResolved},t.isHardwareProblemType&&t.isSoftwareTicket&&t.selectedFacilityId&&(i.facility_id=t.selectedFacilityId),t.isResolved&&t.selectedJobTicketId&&(i.jobTicket_id=t.selectedJobTicketId),t.selectedStatus===t.ticket.hardware_item_ticket_status_id||"Waiting On Client"!==n.label){e.next=9;break}return e.next=9,E["a"].post("hardware_item_tickets/changeTicketStatus",t.getUser.apitoken,{id:t.ticket.id,hardware_item_ticket_status_id:t.selectedStatus,isResolved:!1,reason:t.description});case 9:return e.abrupt("return",E["a"].patch("hardware_item_tickets",r.getUser.apitoken,i).then((function(t){var e=nt(t,2),n=e[0],i=e[1];if(!i&&!n.error){var a=null;a=r.ticketAction?E["a"].patch("hardware_item_ticket_actions",r.getUser.apitoken,{id:r.ticketAction.id,hardware_item_ticket_status_id:n.hardware_item_ticket_status_id,hardware_item_ticket_problemType_id:n.hardware_item_ticket_problemType_id,ticket_priority_id:n.ticket_priority_id,imageUrl:r.imageUrl,actionPerformedBy_user_id:r.getUser.id,description:r.updateDescription}):E["a"].post("hardware_item_ticket_actions",r.getUser.apitoken,{hardware_item_ticket_id:n.id,hardware_item_ticket_status_id:n.hardware_item_ticket_status_id,hardware_item_ticket_problemType_id:n.hardware_item_ticket_problemType_id,ticket_priority_id:n.ticket_priority_id,imageUrl:r.imageUrl,actionPerformedBy_user_id:r.getUser.id,description:r.updateDescription});var o={};r.userAssignments.forEach((function(t){o[t]=!0}));var s={};r.originalUserAssignments.forEach((function(t){s[t]=!0}));var l=[a];return JSON.stringify(o)!==JSON.stringify(s)&&l.push(E["a"].post("hardware_item_ticket_assignments/updateAssignments",r.getUser.apitoken,{hardware_item_ticket_id:r.ticket.id,user_ids:Object.keys(o)})),Promise.all(l).then((function(t){var e=t[0];if(e=Array.isArray(e)?e[0]:e,!e.error){r.ticketAction=e;var n=[];if(r.selectedSubcomponents&&r.selectedSubcomponents.length&&n.push(E["a"].post("hardware_item_ticket_action_replaced_container_items/updateReplacedComponents",r.getUser.apitoken,{hardware_item_ticket_action_id:e.id,hardware_type_container_item_ids:r.selectedSubcomponents})),"manual"===r.timeEntryMode&&(""!==r.hoursSpent||""!==r.minutesSpent)){var i=L()(),a=""!==r.hoursSpent?parseInt(r.hoursSpent):0,o=""!==r.minutesSpent?parseInt(r.minutesSpent):0,s=60*a+o,l=L()(i).subtract(s,"minutes");n.push(E["a"].post("hardware_item_ticket_action_activity_logs/manualEntry",r.getUser.apitoken,{hardware_item_ticket_action_id:e.id,time_in:l.utc(),time_out:i.utc()}))}return Promise.all(n).then((function(){r.hoursSpent="",r.minutesSpent="",M["a"].success("Ticket updated successfully"),r.loadTicketAction(e.id).then((function(){r.loadHistory(),r.$emit("saved"),r.isLoading=!1}))}))}M["a"].error("Something went wrong, please try again."),r.isLoading=!1}))}M["a"].error("Something went wrong, please try again"),r.isLoading=!1})));case 10:case"end":return e.stop()}}),e)})))()},startActivityLog:function(){var t=this;this.loadingTimer=!0,this.ticketAction?this.createActivityLog():this.updateTicket().then((function(){t.ticketAction?t.createActivityLog():t.loadingTimer=!1}))},stopActivityLog:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.getUnfinishedLog(this.ticketAction);e&&(this.loadingTimer=!0,this.updateActivityLog(e,t))},updateActivityLog:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=K({},t);return n.timeOut=L.a.utc(),E["a"].patch("hardware_item_ticket_action_activity_logs",this.getUser.apitoken,n).then((function(n){var i=nt(n,2),a=i[0];i[1];a?r||(e.loadTicketAction(t.hardware_item_ticket_action_id).then((function(){e.loadingTimer=!1,M["a"].success("Task Stopped")})),e.loadHistory()):(M["a"].error("An error occurred. Please try again later."),e.loadingTimer=!1)}))},createActivityLog:function(){var t=this;E["a"].post("hardware_item_ticket_action_activity_logs",this.getUser.apitoken,{hardware_item_ticket_action_id:this.ticketAction.id,user_id:this.getUser.id,timeIn:L.a.utc()}).then((function(e){var r=nt(e,2),n=r[0];r[1];n?(t.ticketAction.activityLog=[n],M["a"].success("Task Started")):M["a"].error("An error occurred. Please try again later."),t.loadingTimer=!1}))},onEditDetails:function(){this.editTicketDetails=!0},onCloseEditDetails:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.editTicketDetails=!1,t&&this.$emit("saved")}}},vt=mt,yt=(r("7794"),Object(q["a"])(vt,T,j,!1,null,null,null));e["a"]=yt.exports},9391:function(t,e,r){"use strict";r("fcb6")},"943b":function(t,e,r){"use strict";r("b05f")},9640:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("4bd4"),l=r("0fd9"),c=r("8654"),u=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v("CO2 Sensor Calibration Options")])]),e(a["c"],[e(s["a"],{model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(l["a"],{attrs:{justify:"center"}},[e(o["a"],{attrs:{cols:"3"}},[e(c["a"],{attrs:{autofocus:"",type:"number",label:"Ambient CO2",suffix:"ppm",rules:[function(){return t.ppm>=0&&t.ppm<=3e3||"Permitted range: 0 - 3000"}]},model:{value:t.ppm,callback:function(e){t.ppm=e},expression:"ppm"}})],1)],1)],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:""},on:{click:t.onCancel}},[t._v("Cancel")]),e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.valid},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},d=[],h=r("2f62");r("d0eb"),r("c1df"),r("d67f");function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t){var e=g(t,"string");return"symbol"==f(e)?e:e+""}function g(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var b={name:"BatchCo2CalibrationOptions",components:{},beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{valid:!1,ppm:420}},computed:m({},Object(h["c"])("universalDashboard",["isPerformingContextMenuAction","co2CalibrationSettings"])),watch:{},methods:{refresh:function(){this.co2CalibrationSettings&&this.co2CalibrationSettings.ppm&&(this.ppm=this.co2CalibrationSettings.ppm)},onCancel:function(){this.$store.dispatch("universalDashboard/setShowBatchCo2CalibrationOptions",!1),this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1),this.co2CalibrationSettings.ppm||this.$store.dispatch("universalDashboard/setSelectedBatchAction",null)},onConfirm:function(){var t={ppm:this.ppm};this.$store.dispatch("universalDashboard/setShowBatchCo2CalibrationOptions",!1),this.$store.dispatch("batchActions/setBatchActionLabel",{id:92,label:"Calibrate CO2 Sensor to "+this.ppm+" ppm"}),this.$store.dispatch("universalDashboard/setCo2CalibrationSettings",t),this.isPerformingContextMenuAction&&this.$store.dispatch("batchActions/runBatchAction")}}},w=b,x=r("2877"),S=Object(x["a"])(w,u,d,!1,null,null,null);e["a"]=S.exports},9697:function(t,e,r){"use strict";r("efa3")},"96eb":function(t,e,r){},"978f":function(t,e,r){"use strict";r("2896")},"98b0":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("132d"),l=r("0fd9"),c=r("b974"),u=r("2fa4"),d=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100",attrs:{id:"fullscreencharts"}},[e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:t.compact}},[t.compact||t.chartTypeOverride?t._e():e(a["d"],[e("h2",[t._v(t._s(t.title)+" Charts")]),e(u["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(s["a"],[t._v("close")])],1)],1),t.compact||t.chartTypeOverride?[e(a["c"],{staticClass:"overflow-auto"},[e("div",{attrs:{id:t.chartId}},[t.chartTypeOverride?[e(l["a"],t._l(t.chartTypeOverride,(function(t){return e(o["a"],{key:"chart_"+t,attrs:{md:"6"}},[e(i["a"],{key:"card_"+t,attrs:{height:"145"}},[e(a["c"],{staticClass:"pt-0 pb-0"},[e("div",{staticClass:"multiChartEmbedded",attrs:{id:"chartDiv_"+t}})])],1)],1)})),1)]:t._e()],2)])]:[e(a["c"],{staticClass:"overflow-auto"},[e(c["a"],{attrs:{items:t.chartTypes,label:"Select Charts to Display",multiple:"","item-value":"id","item-text":"text",chips:"","deletable-chips":""},model:{value:t.chartsToDisplay,callback:function(e){t.chartsToDisplay=e},expression:"chartsToDisplay"}}),e("div",{attrs:{id:t.chartId}})],1)]],2)],1)},h=[],f=r("d0eb"),p=r("c1df"),m=r.n(p),v=(r("d67f"),r("2f62")),y=r("ea7f"),g=r.n(y),b=r("ee40"),w=r.n(b),x=r("a9b3");function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function _(t,e){return k(t)||D(t,e)||O(t,e)||C()}function C(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(t,e){if(t){if("string"==typeof t)return P(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(t,e):void 0}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function D(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function k(t){if(Array.isArray(t))return t}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function j(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){E(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function E(t,e,r){return(e=I(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I(t){var e=L(t,"string");return"symbol"==S(e)?e:e+""}function L(t,e){if("object"!=S(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var A=r("c64e");w()(g.a);var M={name:"",props:["value","title","chartData","tz","annotationData","date","startDate","endDate","annotationDevices","ecuData","compact","chartTypeOverride"],mixins:[x["a"]],components:{},beforeMount:function(){this.chartId=A(),window.moment=m.a,g.a.setOptions({time:{timezone:this.tzPref()}}),g.a.Pointer.prototype.reset=function(){},g.a.Point.prototype.highlight=function(t){t=this.series.chart.pointer.normalize(t),this.onMouseOver(),this.series.chart.tooltip.refresh(this),this.series.chart.xAxis[0].drawCrosshair(t,this)},this.compact&&(this.chartsToDisplay=[1,2,8,3,7,4,5]),this.chartTypeOverride&&(this.chartsToDisplay=this.chartTypeOverride)},mounted:function(){this.chartData.tempSeries&&this.refresh()},data:function(){return{keyIndex:100,chartId:"chart",lightSeries:[],charts:[],chartsToDisplay:[1,2],chartTitleStyle:{fontSize:".875rem",font:"Source Sans Pro",fontWeight:"bold"},priorStates:null,dehumidifierType:"",booleanYAxis:{title:{text:"Status"}},xRangeDataSummary:null,chartTypes:[{id:1,text:"Temperature"},{id:2,text:"Humidity"},{id:3,text:"CO2"},{id:4,text:"Lights"},{id:5,text:"Curtains"},{id:6,text:"Heater"},{id:7,text:"CO2 Valve"},{id:8,text:"ECU"},{id:9,text:"Dehumidifier"},{id:10,text:"Humidifier"}]}},computed:j({},Object(v["c"])(["getUser","userData"])),watch:{"chartData.tempSeries":function(t,e){this.refresh()},chartsToDisplay:function(t,e){this.chartData.tempSeries&&(this.removeEventListeners(),this.destroyCharts(),this.generateChart(!0))}},beforeDestroy:function(){this.removeEventListeners(),this.destroyCharts()},methods:{onClose:function(){this.$emit("close")},getBooleanSeries:function(t,e,r){var n=this.annotationData.filter((function(e){return e.dtLabel==t})),i=[];n.sort((function(t,e){return t.timestamp>e.timestamp?1:-1}));for(var a=0;a<n.length;a++){var o=n[a].stateName.indexOf(e)>=0;r?i.push({x:m.a.utc(n[a].timestamp).valueOf(),y:o?0:1,datestring:n[a].timestamp}):i.push({x:m.a.utc(n[a].timestamp).valueOf(),y:o?1:0,datestring:n[a].timestamp})}var s=this.priorStates.find((function(e){return e.typename==t})),l=i[0];return l&&i.unshift({x:l.x-1,y:l.y,datestring:l.datestring}),s&&(r?i.unshift({x:m.a.utc(this.startDate).valueOf(),y:s.stateName.indexOf(e)>=0?0:1,datestring:this.startDate}):i.unshift({x:m.a.utc(this.startDate).valueOf(),y:s.stateName.indexOf(e)>=0?1:0,datestring:this.startDate})),i.push({x:m.a.utc(this.endDate).valueOf(),y:i[i.length-1].y,datestring:this.endDate}),i},get2StageSeries:function(t,e){var r=_(e,4),n=r[0],i=r[1],a=r[2],o=r[3],s=this.annotationData.filter((function(e){return e.dtLabel==t})),l=[];s.sort((function(t,e){return t.timestamp>e.timestamp?1:-1}));for(var c=0;c<s.length;c++){var u=s[c].stateName.indexOf(n)>=0,d=s[c].stateName.trim()==i.trim();s[c].stateName.trim()==a.trim()||(s[c].stateName.trim(),o.trim());console.log(s[c].stateName.trim()),u?l.push({x:m.a.utc(s[c].timestamp).valueOf(),y:0,datestring:s[c].timestamp}):d?l.push({x:m.a.utc(s[c].timestamp).valueOf(),y:2,datestring:s[c].timestamp}):l.push({x:m.a.utc(s[c].timestamp).valueOf(),y:1,datestring:s[c].timestamp})}var h=this.priorStates.find((function(e){return e.typename==t})),f=l[0];if(f&&l.unshift({x:f.x-1,y:f.y,datestring:f.datestring}),h){var p=h.stateName.trim()==n.trim(),v=h.stateName.indexOf(i)>=0;h.stateName.trim()==a.trim()||(h.stateName.trim(),o.trim());p?l.push({x:m.a.utc(this.startDate).valueOf(),y:0,datestring:this.startDate}):v?l.push({x:m.a.utc(this.startDate).valueOf(),y:2,datestring:this.startDate}):l.push({x:m.a.utc(this.startDate).valueOf(),y:1,datestring:this.startDate})}return l.push({x:m.a.utc(this.endDate).valueOf(),y:l[l.length-1].y,datestring:this.endDate}),l.sort((function(t,e){return t.datestring>e.datestring?1:-1})),l},getCo2ValveSeries:function(){for(var t=this.annotationData.filter((function(t){return"CO2Valve"==t.dtLabel})),e=[],r=0;r<t.length;r++)e.push({x:m.a.utc(t[r].timestamp).valueOf(),y:t[r].stateName.indexOf("ON")>=0?1:0});var n=this.priorStates.find((function(t){return"CO2Valve"==t.typename}));return n&&e.push({x:m.a.utc(this.startDate).valueOf(),y:"OFF"==n.stateName?0:1}),1==e.length&&e.push({x:m.a.utc(this.endDate).valueOf(),y:"OFF"==n.stateName?0:1}),e},syncExtremes:function(t){var e=this.chart;"syncExtremes"!==t.trigger&&g.a.each(g.a.charts,(function(r){r!==e&&r.xAxis[0].setExtremes&&r.xAxis[0].setExtremes(t.min,t.max,void 0,!1,{trigger:"syncExtremes"})}))},syncChartHandler:function(t){var e,r,n,i,a=this,o=a.charts.length;for(n=0;n<o;n+=1)e=a.charts[n],i=e.pointer.normalize(t),r=e.series[0].searchPoint(i,!0),r&&r.highlight(t)},destroyCharts:function(){for(var t=this.charts.length,e=0;e<t;e++)this.charts[e].destroy();document.getElementById(this.chartId)&&(document.getElementById(this.chartId).innerHTML=""),this.charts=[]},removeEventListeners:function(){var t=this,e=document.getElementById(this.chartId);e&&["mousemove","touchmove","touchstart"].forEach((function(r){e.removeEventListener(r,t.syncChartHandler)}))},attachEventListeners:function(){var t=this,e=this.chartId;["mousemove","touchmove","touchstart"].forEach((function(r){document.getElementById(e).addEventListener(r,t.syncChartHandler)}))},syncData:function(){for(var t=this,e=this,r=[],n=0,i=function(i){var a=e.chartTypes.find((function(t){return t.id==e.chartsToDisplay[i]}));if(!a)return 1;switch(a.id){case 1:r.push(t.chartData.tempSeries.data);break;case 2:r.push(t.chartData.humiditySeries.data);break;case 3:r.push(t.chartData.co2Series.data);break;case 4:r.push(t.getBooleanSeries("Light","OFF",!0));break;case 5:r.push(t.getBooleanSeries("Curtain","OPEN",!0));break;case 6:r.push(t.getBooleanSeries("HeaterStrip","OFF",!0));break;case 7:r.push(t.getCo2ValveSeries());break;case 8:r.push(t.ecuData);break;case 9:if("TwoStageDehumidifier"==t.dehumidifierType){var o=t.get2StageSeries(t.dehumidifierType,["OFF","ON","ON1","ON2"]);r.push(o)}else r.push(t.getBooleanSeries("VFUDehumidifier","OFF",!0));break;case 10:r.push(t.getBooleanSeries("VFUHumidifier","OFF",!0));break}r[i].length>n&&(n=r[i].length,i)},a=0;a<this.chartsToDisplay.length;a++)i(a);return r},generateChart:function(){for(var t=this,e=this,r=this.syncData(),n=[],i=function(i){var a=e.chartTypes.find((function(t){return t.id==e.chartsToDisplay[i]})),o=null;n=r[i];var s="",l="",c=!1,u="";switch(a.id){case 1:u="line",s="red",l="F";break;case 2:u="line",s="blue",l="%";break;case 3:u="line",s="green",l="ppm";break;case 4:u="line",s="magenta",l="",c=!0;break;case 5:u="line",s="silver",l="",c=!0;break;case 6:u="line",s="brown",l="",c=!0;break;case 7:u="line",s="lightGreen",l="",c=!0;break;case 8:u="xrange",s="purple",l="";break;case 9:u="line",s="orange",l="",c=!0;break;case 10:u="line",s="cyan",l="",c=!0;break}var d=null;if(t.chartTypeOverride?d=document.getElementById("chartDiv_"+a.id):(d=document.createElement("div"),d.className=c?"multichartBoolean":"multichart",document.getElementById(e.chartId).appendChild(d)),"line"==u||"area"==u)o={exporting:{enabled:!1},credits:{enabled:!1},chart:{marginLeft:40,spacingTop:20,spacingBottom:20,backgroundColor:null},title:{text:a.text,align:"left",margin:0,x:30,style:t.chartTitleStyle},legend:{enabled:!1},xAxis:{crosshair:!0,type:"datetime",min:m.a.utc(t.startDate).valueOf(),max:m.a.utc(t.endDate).valueOf(),dateTimeLabelFormats:{minute:"%I:%M %P",hour:"%I:%M %P"},events:{setExtremes:t.syncExtremes}},yAxis:{title:{text:null}},tooltip:{positioner:function(){return{x:this.chart.chartWidth-this.label.width,y:10}},borderWidth:0,backgroundColor:"none",pointFormat:"{point.y}",headerFormat:"",shadow:!1,style:t.chartTitleStyle,valueDecimals:!1},series:[{data:n,name:a.text,type:u,color:s,fillOpacity:.3,tooltip:{valueSuffix:" "+l}}]},c&&(o.yAxis.tickInterval=1,o.yAxis.ceiling=1,9==a.id&&(o.yAxis.ceiling=2),o.plotOptions={series:{step:"left"}});else if("xrange"==u){for(var h=[],f={CO:"lightblue",CI:"silver",DE:"purple"},p=[],v={},y=0;y<n.length;y++){var b=n[y].stateName.substring(0,2),w=n[y].stateName;if(b in v||(p.push(b),v[b]=p.length-1),y+1<n.length){var x=m.a.utc(n[y].timestamp),S=m.a.utc(n[y+1].timestamp);h.push({y:v[b],x:x.valueOf(),x2:S.valueOf(),label:w,timeDiff:x.diff(S,"minutes")})}}for(var _={},C=0;C<h.length;C++){var O=h[C];_[O.label]||(_[O.label]={count:0,time:0}),_[h[C].label].time+=O.x2-O.x,_[h[C].label].count++}for(var P in _)_[P].time=(_[P].time/1e3/60/60).toFixed(2);t.xRangeDataSummary=_;var D=a.text;if("ECU"==a.text){D+=" : ";var k=[];for(var T in _)k.push(T+" ("+_[T].count+"x), "+_[T].time+"h");D+=k.join(" | ")}o={exporting:{enabled:!1},credits:{enabled:!1},chart:{type:"xrange",backgroundColor:null},legend:!1,colors:j,title:{text:D,align:"left",margin:0,x:30,style:t.chartTitleStyle},tooltip:{positioner:function(){return{x:this.chart.chartWidth-this.label.width,y:10}},borderWidth:0,backgroundColor:"none",pointFormat:"",headerFormat:"",shadow:!1,style:t.chartTitleStyle,valueDecimals:!1},xAxis:{crosshair:!0,type:"datetime",min:m.a.utc(t.startDate).valueOf(),max:m.a.utc(t.endDate).valueOf(),dateTimeLabelFormats:{minute:"%I:%M %P",hour:"%I:%M %P"},events:{setExtremes:t.syncExtremes}},yAxis:{title:{text:""},categories:p,reversed:!0},series:[{borderColor:"gray",pointWidth:20,data:h}],dataLabels:{enabled:!0}};for(var j=[],E=0;E<p.length;E++)f[p[E]]&&j.push(f[p[E]]);j.length>0&&(o.colors=j)}e.charts.push(g.a.chart(d,o))},a=0;a<this.chartsToDisplay.length;a++)i(a);this.attachEventListeners()},refresh:function(){var t=this;t.chartTypes=[{id:1,text:"Temperature"},{id:2,text:"Humidity"},{id:3,text:"CO2"}],this.annotationDevices.length>0?f["a"].get("virtualDevices/getPriorStates",this.getUser.apitoken,{device_ids:this.annotationDevices,date:this.startDate}).then((function(e){var r=_(e,2),n=r[0];r[1];t.priorStates=n;var i=n.find((function(t){return"Light"==t.typename}));i&&t.chartTypes.push({id:4,text:"Lights"});var a=n.find((function(t){return"Curtain"==t.typename}));a&&t.chartTypes.push({id:5,text:"Curtains"});var o=n.find((function(t){return"HeaterStrip"==t.typename}));o&&t.chartTypes.push({id:6,text:"Heater"}),t.chartTypes.push({id:7,text:"CO2 Valve"}),t.ecuData&&t.ecuData.length>0&&t.chartTypes.push({id:8,text:"ECU"});var s=n.find((function(t){return"VFUHumidifier"==t.typename}));s&&t.chartTypes.push({id:10,text:"Humidifier"});var l=n.find((function(t){return"VFUDehumidifier"==t.typename}));l&&(t.dehumidifierType="VFUDehumidifier",t.chartTypes.push({id:9,text:"Dehumidifier"}));var c=n.find((function(t){return"TwoStageDehumidifier"==t.typename}));c&&(t.dehumidifierType="TwoStageDehumidifier",t.chartTypes.push({id:9,text:"Two-Stage Dehumidifier"})),t.chartTypes.sort((function(t,e){return t.text>e.text?1:-1})),t.generateChart()})):t.generateChart();for(var e=0;e<this.chartData.tempSeries.data.length;e++)this.chartData.tempSeries.data[e].y=parseFloat(this.chartData.tempSeries.data[e].y.toFixed(1));for(var r=0;r<this.chartData.humiditySeries.data.length;r++)this.chartData.humiditySeries.data[r].y=parseFloat(this.chartData.humiditySeries.data[r].y.toFixed(1));for(var n=0;n<this.chartData.co2Series.data.length;n++)this.chartData.co2Series.data[n].y=parseFloat(this.chartData.co2Series.data[n].y.toFixed(1))}}},U=M,N=(r("7c8a"),r("2877")),F=Object(N["a"])(U,d,h,!1,null,null,null);e["a"]=F.exports},9908:function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=r("169a"),o=r("8e36"),s=function(){var t=this,e=t._self._c;return e(a["a"],{attrs:{"hide-overlay":"",persistent:"",width:"300"},model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[e(n["a"],{attrs:{color:"primary",dark:""}},[e(i["c"],[e("div",{staticStyle:{"padding-top":"15px"}},[t._v("Loading... Please wait.")]),e(o["a"],{staticClass:"mb-0",attrs:{indeterminate:"",color:"white"}})],1)],1)],1)},l=[],c={name:"loading-modal",props:["show"],data:function(){return{}},computed:{showDialog:{get:function(){return this.show},set:function(t){this.$emit("closed")}}}},u=c,d=r("2877"),h=Object(d["a"])(u,s,l,!1,null,null,null);e["a"]=h.exports},9943:function(t,e,r){"use strict";r("196c")},"9b25":function(t,e,r){"use strict";r("2bdd")},"9be9":function(t,e,r){},"9c54":function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return l}));var n=r("80d2"),i=r("7e85"),a=r("56a4"),o=r("e516");const s=Object(n["k"])("v-stepper__header"),l=Object(n["k"])("v-stepper__items");i["a"],o["a"],a["a"]},"9c9c":function(t,e,r){"use strict";var n=r("cd55"),i=r("49e2"),a=r("c865"),o=function(){var t=this,e=t._self._c;return e(n["a"],{directives:[{name:"show",rawName:"v-show",value:t.isVisibleDisplayUnitType,expression:"isVisibleDisplayUnitType"}],staticClass:"flex-grow-auto flex-column",class:{"d-flex":t.isVisibleDisplayUnitType}},[e(a["a"],{staticClass:"d-flex justify-between"},[e("span",{staticClass:"flex-grow-auto"},[t._v(t._s(t.displayUnits.length)+" Curing Units")])]),e(i["a"],{staticClass:"flex-grow-auto"},[e("unit-results",{attrs:{"display-units":t.displayUnits}})],1),e("edit-phase-modal",{on:{refresh:t.refresh},model:{value:t.growPhase_id,callback:function(e){t.growPhase_id=e},expression:"growPhase_id"}})],1)},s=[],l=r("c1df"),c=r.n(l),u=r("ab66"),d=r("b3c5"),h=r("ea10"),f=r("d0eb"),p=r("d67f"),m=r("2f62"),v=r("a9b3"),y=r("8ac5"),g=r("12ad");function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){return O(t)||C(t,e)||S(t,e)||x()}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function O(t){if(Array.isArray(t))return t}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=j(t,"string");return"symbol"==b(e)?e:e+""}function j(t,e){if("object"!=b(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var E={name:"CuringUnitExpansionPanel",mixins:[v["a"]],components:{UnitResults:g["a"],LifecyclePlatforms:y["a"],LockedColumnDatatable:u["a"],EditPhaseModal:d["a"]},props:{selectedDisplayTypes:{type:Array,required:!1,default:function(){return[]}},displayUnits:{type:Array,required:!1,default:function(){return[]}},maximizedDisplayType:{type:Number,required:!1,default:function(){return null}},isLockingEnabled:{type:Boolean,required:!1,default:function(){return!1}},isLockingColumns:{type:Boolean,required:!1,default:function(){return!1}},displayUnitsLoading:{type:Boolean,required:!1,default:function(){return!1}},searchText:{type:String,required:!1,default:function(){return""}}},data:function(){return{moment:c.a,pagination:{itemsPerPage:250},footerprops:{"items-per-page-options":[25,50,75,100,250]},displayUnitsHeaders:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],displayUnitsExpanded:[],growPhase_id:null,isAdmin:!1}},computed:D(D({},Object(m["c"])(["getUser"])),{},{isVisibleDisplayUnitType:function(){return this.selectedDisplayTypes.find((function(t){return 5===t.id}))&&this.displayUnits&&this.displayUnits.length&&(!this.maximizedDisplayType||5===this.maximizedDisplayType)},filteredDisplayUnits:function(){var t=this;return""!==this.searchText&&this.searchText?this.displayUnits.filter((function(e){return e.platformGroupName.toLowerCase().includes(t.searchText.toLowerCase())})):this.displayUnits}}),beforeMount:function(){this.isAdmin=f["a"].isAdmin(this.getUser)||f["a"].isUserInRole(this.getUser,"Maintenance")},watch:{filteredDisplayUnits:function(){""!==this.searchText&&this.$emit("searched-length",this.filteredDisplayUnits.length)}},methods:{isExpanded:function(t){var e=this.displayUnitsExpanded.find((function(e){return e.id===t.id}));return!!e},fullscreenPanel:function(){this.$emit("fullscreen-panel",5)},minimizePanel:function(){this.$emit("minimize-panel")},refresh:function(){this.$emit("refresh")},goToDevice:function(){},onShowDisplayUnitLifecycle:function(t){var e=this.displayUnitsExpanded.findIndex((function(e){return e.platformGroup_id===t.platformGroup_id}));-1===e?this.displayUnitsExpanded.push(t):this.displayUnitsExpanded.splice(e,1)},createOperationalTask2:function(t,e){this.$router.push({name:"operational-task",params:{growplanId:t,lifecycleId:e}})},onEditPhase:function(t){this.growPhase_id=t.id},onToggleLifecycle:function(t){var e=this,r="";r=t.isSuspended?"Resume Lifecycle  "+t.lifecycle_id+"?":"Suspend Lifecycle  "+t.lifecycle_id+"?",h["a"].confirm("Please Confirm",r,(function(r){r&&f["a"].post("ag_lifecycles/toggleSuspend",e.getUser.apitoken,{lifecycle_id:t.lifecycle_id}).then((function(e){var r=w(e,2),n=r[0];r[1];n?(p["a"].success("Function Complete"),t.isSuspended=!t.isSuspended):p["a"].error("An error occurred. Please try again later")}))}))},getPhotoPeriodText:function(t){var e="Photo period: "+t.currentPhase.photoperiod+" hours at ";return t.currentPhase.photoPeriodIntensity!==t.currentPhase.photoPeriodInterlightIntensity?(e+=100*t.currentPhase.photoPeriodIntensity+"% Downlight, ",e+=Math.round(100*t.currentPhase.photoPeriodInterlightIntensity)+"% Interlight intensity, "):e+=Math.round(100*t.currentPhase.photoPeriodIntensity)+"% intensity, ",e+="starting at "+this.convertTime(t.currentPhase.photoperiodStartTime)+".",e},convertTime:function(t){return 12===+this.$root.timePreference?c.a.utc(t,"HH:mm").add(this.getUser.facility_UTCOffset,"hours").format("h:mm a"):c.a.utc(t,"HH:mm").local().format("h:mm a")}}},I=E,L=r("2877"),A=Object(L["a"])(I,o,s,!1,null,null,null);e["a"]=A.exports},"9cf2":function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("132d"),s=r("ba0d"),l=r("2fa4"),c=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v("Select Light Intensity")]),e(l["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(o["a"],[t._v("close")])],1)],1),e(a["c"],[e("div",{staticStyle:{width:"calc(100% - 50px)","padding-top":"30px",margin:"auto"}},[e(s["a"],{staticClass:"pt-6",attrs:{max:100,min:0,step:1,color:t.intensitySliderColor,"thumb-size":45,"thumb-label":"always",label:"Intensity"},model:{value:t.currentIntensity,callback:function(e){t.currentIntensity=e},expression:"currentIntensity"}})],1)]),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},u=[],d=r("2f62"),h=(r("d67f"),r("7ce3")),f=r("4216");function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){y(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function y(t,e,r){return(e=g(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g(t){var e=b(t,"string");return"symbol"==p(e)?e:e+""}function b(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var w={name:"batch-intensity-options",mixins:[f["a"]],components:{HelpButton:h["a"]},data:function(){return{currentIntensity:100}},beforeMount:function(){this.selectedContextMenuItem?this.currentIntensity=this.selectedContextMenuItem.lightIntensityAverage:this.currentIntensity=100},computed:v(v(v({},Object(d["c"])(["getUser"])),Object(d["c"])("universalDashboard",["selectedContextMenuItem","showBatchIntensityOptions"])),{},{intensitySliderColor:function(){var t=parseInt(this.currentIntensity),e=t/100+.1;return"rgba(255,0,255,"+e+")"}}),methods:{onCancel:function(){this.$store.dispatch("universalDashboard/setShowBatchIntensityOptions",!1),this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1),this.$store.dispatch("universalDashboard/setSelectedBatchAction",null)},onConfirm:function(){var t=(parseFloat(this.currentIntensity)/100).toFixed(2);this.$store.dispatch("universalDashboard/setShowBatchIntensityOptions",!1),this.$store.dispatch("batchActions/setBatchActionLabel",{id:90,label:"Set Intensity to "+Math.round(100*t)}),this.$store.dispatch("universalDashboard/setIntensitySettings",parseFloat(t)),this.isPerformingContextMenuAction&&this.$store.dispatch("batchActions/runBatchAction")}},watch:{selectedContextMenuItem:function(t,e){this.currentIntensity=t?t.lightIntensityAverage:100}}},x=w,S=r("2877"),_=Object(S["a"])(x,c,u,!1,null,null,null);e["a"]=_.exports},"9d01":function(t,e,r){},"9e96":function(t,e,r){"use strict";r("486c")},"9ea0":function(t,e,r){"use strict";r("1074")},"9ecb":function(t,e,r){},a2fb:function(t,e,r){"use strict";var n=r("5e66"),i=r("3e35"),a=r("62ad"),o=r("490a"),s=r("0fd9"),l=function(){var t=this,e=t._self._c;return e(s["a"],{staticClass:"h-100",attrs:{"no-gutters":"",id:"sMap"}},[e(a["a"],{staticStyle:{height:"100vh","max-height":"calc(100vh - 240px)",overflow:"auto"},attrs:{cols:"8",lg:"8"}},[e("div",{style:{backgroundImage:"url('".concat(t.image,"')")},attrs:{id:"statemachine"}},[t.isLoading?[e("div",{staticStyle:{width:"100%","max-height":"700px",height:"600px",display:"flex","justify-content":"center","align-items":"center"}},[e(o["a"],{attrs:{size:50,color:"primary",indeterminate:""}})],1)]:t._e(),t.facilityMap&&!t.isLoading?t._l(t.facilityMap.agFacilitymaphotspots,(function(r,n){return e("div",{key:"hotspot:"+n,staticClass:"hotspot",class:[t.selectedPlatformGroupId&&r.platformGroup_id==t.selectedPlatformGroupId?t.activeClass:""],style:{top:r.top+"px",left:r.left+"px",width:r.width+"px",height:r.height+"px"},on:{click:function(e){return t.onHotspotClick(r)}}},[e("current-conditions-card",{attrs:{hotspot:r,"platform-group-display-records":t.platformGroupDisplayRecords}})],1)})):t._e()],2)]),e(a["a"],{staticClass:"h-100 pl-2",staticStyle:{"border-left":"1px solid silver"},attrs:{cols:"4",lg:"4"}},[t.selectedPlatformGroup&&!t.isLoading?[e("h2",{staticStyle:{"text-align":"center"}},[t._v("\n        "+t._s(t.selectedPlatformGroup.platformGroupName.toUpperCase())+"\n        "),t.selectedPlatformGroup.controller_id?t._e():e("span",{staticStyle:{"font-weight":"bold"}},[t._v("(Unmanaged)")])]),e(n["a"],{attrs:{light:"",height:"calc(100% - 20px)","show-arrows-on-hover":"","hide-delimiter-background":""}},[e(i["a"],[t.selectedPlatformGroup?e("environment-gauges",{key:"gauges"+t.refreshKey,attrs:{smallDisplay:!0,device:t.selectedPlatformGroup,facility:t.facility,lifecyclePhase:t.selectedPlatformGroup.lifecyclesRaw?t.selectedPlatformGroup.lifecyclesRaw[0]:null,controller_id:t.selectedPlatformGroup.controller_id,platformGroup_id:t.selectedPlatformGroupId,lastEventReceived:t.lastEventReceived,vertical:!0},on:{"emit-action":t.emitAction}}):t._e()],1),e(i["a"],[e("device-lifecycles",{key:"plantlocations"+t.refreshKey,attrs:{currentDevice:t.selectedPlatformGroup,"platform-group-id":t.selectedPlatformGroupId,mode:"small"}})],1)],1)]:t._e(),t.selectedCamera&&!t.isLoading?e("div",{staticClass:"h-100 d-flex flex-column align-center"},[e("h3",{staticClass:"text-center pb-3"},[t._v("\n        "+t._s(t.selectedCamera.label)),e("br"),t._v("Live View\n      ")]),e("img",{staticClass:"stream-viewer",attrs:{src:t.streamUrl}})]):t._e()],2)],1)},c=[],u=r("d0eb"),d=(r("c1df"),r("d67f"),r("2f62")),h=r("a9b3"),f=r("6ce0"),p=r("4b5c"),m=(r("12a1"),r("b574")),v=r("d15d");function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){return _(t)||S(t,e)||w(t,e)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function _(t){if(Array.isArray(t))return t}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return(e=D(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D(t){var e=k(t,"string");return"symbol"==y(e)?e:e+""}function k(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var T={name:"DisplayFacilityMap",props:["facilityMap","facility","lastEventReceived","platformGroupDisplayRecords"],mixins:[h["a"],f["a"]],components:{CurrentConditionsCard:v["a"],DeviceLifecycles:p["a"],EnvironmentGauges:m["a"]},mounted:function(){},data:function(){return{activeClass:"activeClass",image:null,selectedPlatformGroupId:null,selectedPlatformGroup:null,selectedCamera:null,streamUrl:"",currentDevice:null,refreshKey:1,isLoading:!1,platformGroupCurrentConditions:{}}},computed:O({},Object(d["c"])(["getUser"])),watch:{facilityMap:{immediate:!0,handler:function(t,e){this.image=t.fileUrl}}},beforeMount:function(){this.refresh()},methods:{getCurrentConditions:function(){var t=this;t.platformGroupDisplayRecords?t.platformGroupCurrentConditions=t.platformGroupDisplayRecords:(t.isLoading=!0,u["a"].get("ag_platformGroups/getFullStatus",this.getUser.apitoken,{facility_id:this.getUser.facility_id}).then((function(e){var r=g(e,2),n=r[0];r[1];for(var i in t.platformGroupCurrentConditions=n.reduce((function(t,e){return Object.assign(t,P({},e.platformGroup_id,e))}),{}),t.platformGroupCurrentConditions)t.platformGroupCurrentConditions[i]=t.onVfuDataChange(t.createDisplayRecord(t.platformGroupCurrentConditions[i],"VFU"));t.isLoading=!1})))},onHotspotClick:function(t){var e=this;t.platformGroup_id?(this.selectedCamera=null,this.selectedPlatformGroupId=t.platformGroup_id,this.selectedPlatformGroup=this.platformGroupCurrentConditions[t.platformGroup_id],this.refreshKey++):t.camera_id&&(this.isLoading=!0,this.selectedPlatformGroupId=null,this.selectedPlatformGroup=null,this.selectedCamera=t,u["a"].get("AWSCloudfront/getCameraStreamUrl",this.getUser.apitoken,{camera_id:t.camera_id}).then((function(t){var r=g(t,2),n=r[0];r[1];e.isLoading=!1,e.streamUrl=n})))},refresh:function(){var t=this;t.getCurrentConditions()},emitAction:function(t,e){this.$emit(t,e)}}},j=T,E=(r("f23e"),r("2877")),I=Object(E["a"])(j,l,c,!1,null,null,null);e["a"]=I.exports},a511:function(t,e,r){"use strict";r("d2a8")},a523:function(t,e,r){"use strict";r("20f6"),r("4b85");var n=r("a026");function i(t){return n["default"].extend({name:"v-"+t,functional:!0,props:{id:String,tag:{type:String,default:"div"}},render(e,{props:r,data:n,children:i}){n.staticClass=`${t} ${n.staticClass||""}`.trim();const{attrs:a}=n;if(a){n.attrs={};const t=Object.keys(a).filter(t=>{if("slot"===t)return!1;const e=a[t];return t.startsWith("data-")?(n.attrs[t]=e,!1):e||"string"===typeof e});t.length&&(n.staticClass+=" "+t.join(" "))}return r.id&&(n.domProps=n.domProps||{},n.domProps.id=r.id),e(r.tag,n,i)}})}var a=r("d9f7");e["a"]=i("container").extend({name:"v-container",functional:!0,props:{id:String,tag:{type:String,default:"div"},fluid:{type:Boolean,default:!1}},render(t,{props:e,data:r,children:n}){let i;const{attrs:o}=r;return o&&(r.attrs={},i=Object.keys(o).filter(t=>{if("slot"===t)return!1;const e=o[t];return t.startsWith("data-")?(r.attrs[t]=e,!1):e||"string"===typeof e})),e.id&&(r.domProps=r.domProps||{},r.domProps.id=e.id),t(e.tag,Object(a["a"])(r,{staticClass:"container",class:Array({"container--fluid":e.fluid}).concat(i||[])}),n)}})},a52e:function(t,e,r){},a609:function(t,e,r){"use strict";r("7e58");var n=r("3860"),i=r("a9ad"),a=r("58df");e["a"]=Object(a["a"])(n["a"],i["a"]).extend({name:"v-btn-toggle",props:{backgroundColor:String,borderless:Boolean,dense:Boolean,group:Boolean,rounded:Boolean,shaped:Boolean,tile:Boolean},computed:{classes(){return{...n["a"].options.computed.classes.call(this),"v-btn-toggle":!0,"v-btn-toggle--borderless":this.borderless,"v-btn-toggle--dense":this.dense,"v-btn-toggle--group":this.group,"v-btn-toggle--rounded":this.rounded,"v-btn-toggle--shaped":this.shaped,"v-btn-toggle--tile":this.tile,...this.themeClasses}}},methods:{genData(){const t=this.setTextColor(this.color,{...n["a"].options.methods.genData.call(this)});return this.group?t:this.setBackgroundColor(this.backgroundColor,t)}}})},a62e:function(t,e,r){"use strict";r("d51e")},a6e5:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("ac7c"),s=r("62ad"),l=r("a523"),c=r("169a"),u=r("4bd4"),d=r("132d"),h=r("0fd9"),f=r("b974"),p=r("8dd9"),m=r("3a2f"),v=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:"",id:"environmentGraph"}},[e(u["a"],[e(l["a"],{staticClass:"hidden-sm-and-down pb-0 text-center"},[e(h["a"],{attrs:{"no-gutters":"",align:"center"}},[e(s["a"],{staticClass:"pb-0",attrs:{cols:"12",lg:"8"}},[e(h["a"],{attrs:{justify:"center"}},[e(s["a"],{staticClass:"pl-1 pr-1 pb-0",class:{"sm9 md2":t.isMaximized,"sm4 md2":!t.isMaximized},attrs:{cols:"2",lg:"2"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate"),noIcon:!0},model:{value:t.selectedStartDate,callback:function(e){t.selectedStartDate=e},expression:"selectedStartDate"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",class:{md3:t.isMaximized,md2:!t.isMaximized},attrs:{cols:"2",lg:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime"),noIcon:!0},model:{value:t.selectedStartTime,callback:function(e){t.selectedStartTime=e},expression:"selectedStartTime"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",class:{"sm9 md2":t.isMaximized,"sm4 md2":!t.isMaximized},attrs:{cols:"2",lg:"2"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.endDate"),noIcon:!0},model:{value:t.selectedEndDate,callback:function(e){t.selectedEndDate=e},expression:"selectedEndDate"}})],1),e(s["a"],{staticClass:"pl-1 pr-1 pb-0",class:{"sm9 md3":t.isMaximized,"sm6 md2":!t.isMaximized},attrs:{cols:"2",lg:"2"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.endTime"),noIcon:!0},model:{value:t.selectedEndTime,callback:function(e){t.selectedEndTime=e},expression:"selectedEndTime"}})],1),e(s["a"],{staticClass:"pl-1 pb-0",class:{"sm9 md3":t.isMaximized,"sm6 md2":!t.isMaximized},attrs:{cols:"2",lg:"2"}},[e(f["a"],{attrs:{items:t.chartUnits,label:t.$t("common.precision")},model:{value:t.selectedUnit,callback:function(e){t.selectedUnit=e},expression:"selectedUnit"}})],1),e(s["a"],{staticClass:"pl-1 pb-0",class:{"sm9 md3":t.isMaximized,"sm6 md2":!t.isMaximized},attrs:{cols:"2",lg:"2"}},[e(f["a"],{attrs:{disabled:!(t.Trimaster.isAdmin(t.getUser)||t.Trimaster.isUserInRole(t.getUser,"Maintenance")||t.Trimaster.isUserInRole(t.getUser,"Technician")),items:t.datasetTypes,label:t.$t("common.series")},model:{value:t.datasetType,callback:function(e){t.datasetType=e},expression:"datasetType"}})],1)],1)],1),e(s["a"],{staticClass:"justify-start pl-2 pb-2",attrs:{lg:"4"}},[e("span",{staticClass:"densebuttons",staticStyle:{"white-space":"nowrap"}},[e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{outlined:""},on:{click:function(e){t.showEcuLegend=!t.showEcuLegend}}},i),[e(d["a"],{attrs:{color:t.showEcuLegend?"primary":"black"}},[t._v("info")])],1)]}}])},[e("span",[t._v("Toggle Env Legend")])]),e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{outlined:""},on:{click:function(e){t.selectAnnotations=!0}}},i),[e(d["a"],{attrs:{color:"primary"}},[t._v("announcement")])],1)]}}])},[e("span",[t._v("Select Annotations")])]),e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{outlined:""},on:{click:t.onToggleEcuStates}},i),[e(d["a"],{attrs:{color:t.chartData.showPlotBands?"primary":"black"}},[t._v("waves")])],1)]}}])},[e("span",[t._v("Toggle Display of ECU States")])]),e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{outlined:""},on:{click:t.onToggleYAxis}},i),[e(d["a"],{attrs:{color:t.yAxisFixedRanges?"primary":"black"}},[t._v("straighten")])],1)]}}])},[e("span",[t._v("Toggle Y Axis Fixed Ranges")])]),"table"==t.displayMode&&t.platformGroup_id>0&&!t.selectedZone?e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{outlined:"",color:"primary"},on:{click:t.toggleDisplayMode}},i),[e(d["a"],[t._v("multiline_chart")])],1)]}}],null,!1,757846599)},[e("span",[t._v("View Chart")])]):t._e(),"chart"==t.displayMode&&t.platformGroup_id>0&&!t.selectedZone?e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{color:"primary",outlined:""},on:{click:t.toggleDisplayMode}},i),[e(d["a"],[t._v("grid_on")])],1)]}}],null,!1,2506828021)},[e("span",[t._v("View Table")])]):t._e(),e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{color:"primary",outlined:""},on:{click:t.downloadCsv}},i),[e(d["a"],[t._v("cloud_download")])],1)]}}])},[e("span",[t._v("Download Data as CSV")])]),e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{outlined:"",color:"primary"},on:{click:t.doChartRefresh}},i),[e(d["a"],[t._v("refresh")])],1)]}}])},[e("span",[t._v("Refresh")])]),e(m["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"iconOnly",attrs:{outlined:"",color:"primary"},on:{click:t.doChartFullScreen}},i),[e(d["a"],[t._v("open_in_new")])],1)]}}])},[e("span",[t._v("Open in large window")])])],1)])],1),e(h["a"],{directives:[{name:"show",rawName:"v-show",value:t.showEcuLegend&&t.chartData.plotBands.length>0&&t.chartData.showPlotBands,expression:"\n          showEcuLegend &&\n          chartData.plotBands.length > 0 &&\n          chartData.showPlotBands\n        "}],staticClass:"align-top",attrs:{justify:"center","no-gutters":""}},[e(s["a"],{attrs:{cols:"12"}},[t._l(t.ecuStateColors,(function(r,n){return[e("div",{key:n+"-a",staticClass:"ecu-legend-color-region",style:{"background-color":r}}),e("span",{key:n+"-b",staticStyle:{"padding-left":"2px"}},[t._v(t._s(n))])]})),e("div",{staticClass:"ecu-legend-color-region dotted"}),e("span",{staticStyle:{"padding-left":"2px"}},[t._v("Manual Mode")])],2)],1)],1)],1),0!=t.chartData.dataset.length||t.isLoading?e("div",{staticClass:"chartcontainer flex-grow-auto"},[t.isMaximized?e("div",{directives:[{name:"show",rawName:"v-show",value:"chart"==t.displayMode,expression:"displayMode == 'chart'"}],staticClass:"pb-2 px-3 overflow-auto",staticStyle:{height:"100%"}},[e("h-c-status-chart",{key:t.keyIndex,attrs:{type:t.chartData.type,title:t.chartData.title,datasets:t.chartData.dataset,yAxes:t.chartData.yAxes,xAxes:t.chartData.xAxes,plotBandsData:t.chartData.plotBands,plotLinesData:t.chartData.plotLines,showPlotBands:t.chartData.showPlotBands,showPlotLines:t.chartData.showPlotLines,annotations:t.chartData.annotations,tz:t.getUser.facility_timezone}})],1):e("div",{staticClass:"pb-2 px-3 overflow-auto",staticStyle:{height:"100%"}},[e("full-screen-chart",{attrs:{title:t.platformGroup_name,chartData:t.chartData,tz:t.getUser.facility_timezone,annotationData:t.annotationData,annotationDevices:t.annotationDevices,date:t.startDate,compact:!0,startDate:t.startDateStr,endDate:t.endDateStr,ecuData:t.ecuChartData}})],1),e("chart-data-table",{directives:[{name:"show",rawName:"v-show",value:"chart"!=t.displayMode&&!t.selectedZone,expression:"displayMode != 'chart' && !selectedZone"}],ref:"chartDataTable",attrs:{humidity:t.humidityChartData,temperature:t.temperatureChartData,co2:t.co2ChartData},on:{"set-vpd-data":t.setVPDData}}),e("div",{directives:[{name:"show",rawName:"v-show",value:"chart"!=t.displayMode&&t.selectedZone,expression:"displayMode != 'chart' && selectedZone"}]},[e(p["a"],{staticStyle:{overflow:"auto"},attrs:{height:"90%"}},[e("DeviceHistoryViewer",{attrs:{platformGroupId:t.platformGroupId,selectedZone:t.selectedZone,passedStartDate:t.selectedStartDate,passedStartTime:t.selectedStartTime,passedEndDate:t.selectedEndDate,passedEndTime:t.selectedEndTime},on:{chosen:function(e){t.devicePicker=!1}}})],1)],1)],1):e("div",{staticClass:"text-center p-xl",staticStyle:{height:"100%"}},[e("h3",{staticClass:"justify-center",staticStyle:{"margin-top":"130px"}},[t._v("\n      No data to display.\n    ")])]),e(c["a"],{attrs:{width:"90%","max-width":"600px"},model:{value:t.fullscreen,callback:function(e){t.fullscreen=e},expression:"fullscreen"}},[t.fullscreen?e("full-screen-chart",{staticStyle:{height:"90vh !important"},attrs:{title:t.platformGroup_name,chartData:t.chartData,tz:t.getUser.facility_timezone,annotationData:t.annotationData,annotationDevices:t.annotationDevices,date:t.startDate,startDate:t.startDateStr,endDate:t.endDateStr,ecuData:t.ecuChartData},on:{close:function(e){t.fullscreen=!1}}}):t._e()],1),e(c["a"],{attrs:{persistent:"",width:"500"},model:{value:t.selectAnnotations,callback:function(e){t.selectAnnotations=e},expression:"selectAnnotations"}},[e(i["a"],[e(a["d"],[e("h2",[t._v("Select Annotations to Place on Chart")])]),e(a["c"],[e(o["a"],{attrs:{label:"CO2 Valve Open/Closed"},model:{value:t.showAnnotations.co2,callback:function(e){t.$set(t.showAnnotations,"co2",e)},expression:"showAnnotations.co2"}}),e(o["a"],{attrs:{label:"Humidifier On/Off"},model:{value:t.showAnnotations.humidifier,callback:function(e){t.$set(t.showAnnotations,"humidifier",e)},expression:"showAnnotations.humidifier"}}),e(o["a"],{attrs:{label:"Dehumidifier On/Off"},model:{value:t.showAnnotations.dehumidifier,callback:function(e){t.$set(t.showAnnotations,"dehumidifier",e)},expression:"showAnnotations.dehumidifier"}}),e(o["a"],{attrs:{label:"Heater On/Off"},model:{value:t.showAnnotations.heater,callback:function(e){t.$set(t.showAnnotations,"heater",e)},expression:"showAnnotations.heater"}}),e(o["a"],{attrs:{label:"Other/Lights/Curtains/Irrigation"},model:{value:t.showAnnotations.other,callback:function(e){t.$set(t.showAnnotations,"other",e)},expression:"showAnnotations.other"}})],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{color:"primary",text:""},on:{click:t.onSelectAnnotations}},[t._v("Close")])],1)],1)],1),e("loading",{attrs:{show:t.isLoading}})],1)},y=[],g=r("dd56"),b=r("f941"),w=r("2f62"),x=r("b047"),S=r.n(x),_=r("da52"),C=r("4458"),O=r("dd20"),P=r("e2cd"),D=r("c1df"),k=r.n(D),T=r("9908"),j=r("d67f"),E=r("d0eb"),I=r("a9b3"),L=r("98b0"),A=r("3488");function M(t,e){return R(t)||G(t,e)||N(t,e)||U()}function U(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function G(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function R(t){if(Array.isArray(t))return t}function $(t){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function H(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function V(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?H(Object(r),!0).forEach((function(e){B(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function B(t,e,r){return(e=z(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z(t){var e=Y(t,"string");return"symbol"==$(e)?e:e+""}function Y(t,e){if("object"!=$(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var q={name:"zone-devices",props:["device_id","platformGroup_id","platformGroup_name","controller_id","selectedZone","devices","sDate","sTime","eDate","eTime"],mixins:[I["a"],A["a"]],components:{HCStatusChart:b["a"],VuetifyDatepicker:C["a"],VuetifyTimepicker:O["a"],DeviceHistoryViewer:P["a"],Loading:T["a"],ChartDataTable:_["a"],FullScreenChart:L["a"]},data:function(){var t=this.nowInTZPref().subtract(2,"hour"),e=this.nowInTZPref();return{fullscreen:!1,refreshChart1:1,isMaximized:!1,selectAnnotations:!1,keyIndex:0,showEcuLegend:!1,displayMode:"chart",datasetTypes:["Minimums","Averages","Maximums","Latest"],datasetType:"Averages",datasetTypePropertiesMap:{Minimums:"minReading",Averages:"avgReading",Maximums:"maxReading",Latest:"reading"},datasetTypeProperties:["minReading","avgReading","maxReading","reading"],datasetTypeProperty:"avgReading",inStateTransition:!1,device:null,Trimaster:E["a"],isLoading:!1,selectedUnit:"minute",platformGroupId:0,deviceId:0,controllerId:0,vpdSensors:[],vpdChartData:[],yAxisFixedRanges:!0,chartUnits:[{text:this.$t("time.minute"),value:"minute"},{text:this.$t("time.hour"),value:"hour"},{text:this.$t("time.day"),value:"day"},{text:this.$t("time.month"),value:"month"}],vpdData:{},startDate:t,endDate:e,selectedStartDate:null,selectedEndDate:null,selectedStartTime:null,selectedEndTime:null,item:null,options:[],autoModeDetails:{},ecuStateColors:{HEAT:"rgba(255, 138, 128)",HEATING2:"rgba(179, 0, 0)",HEATING3:"rgba(102, 0, 0)",DEHUMIDIFYING:"rgba(159, 90, 253, 1)",COOLING:"rgba(82, 179, 217, 1)",COOLING2:"rgba(0, 0, 255, 1)",CIRCULATING:"rgba(255, 167, 38, 1)",OFF:"white",FAN:"rgba(217, 217, 217, 1)",LOW_CIRCULATE:"rgba(255, 204, 128, 1)",DEHUMHEATING:"rgba(255, 0, 255, 1)"},annotationDevices:[],maxRecordsLimit:2e3,maxRecordsHit:!1}},beforeMount:function(){this.chartSetup(),window.localStorage.getItem("environmentChart_datasetType")&&(this.datasetType=window.localStorage.getItem("environmentChart_datasetType")),this.refresh()},mounted:function(){var t=this;this.$root.$on("isMaximized",(function(e){t.isMaximized=!e})),window.addEventListener("resize",this.checkScreen,{passive:!0}),this.checkScreen()},computed:V(V({},Object(w["c"])(["getUser"])),{},{systemId:function(){return this.item.device+"-"+this.item.device_id},groupId:function(){return this.platformGroup_id},itemState:function(){return this.item&&this.item.state?this.item.state[0].toUpperCase()+this.item.state.substr(1).toLowerCase():""},ecuStartDateStr:function(){return this.startDate.subtract(1,"day").utc().format()},canFetch:function(){return"number"==typeof this.chartDevice.temperature&&this.chartDevice.temperature>0||"object"==$(this.chartDevice.temperature)&&this.chartDevice.temperature.length>0||("number"==typeof this.chartDevice.humidity&&this.chartDevice.humidity>0||"object"==$(this.chartDevice.humidity)&&this.chartDevice.humidity.length>0||("number"==typeof this.chartDevice.co2&&this.chartDevice.co2>0||"object"==$(this.chartDevice.co2)&&this.chartDevice.co2.length>0||(this.chartDevice.ecu>0||this.chartDevice.irr.length>0)))}}),methods:V(V({},Object(w["b"])(["getZoneDevice"])),{},{onToggleEcuStates:function(){this.chartData.showPlotBands=!this.chartData.showPlotBands},onSelectAnnotations:function(){this.selectAnnotations=!1,this.replotData()},downloadCsv:function(){this.$refs.chartDataTable.downloadCsv()},doChartFullScreen:function(){this.fullscreen=!0},onToggleYAxis:function(){this.yAxisFixedRanges?this.setFloatingYAxes():this.setFixedYAxes(),this.yAxisFixedRanges=!this.yAxisFixedRanges,this.keyIndex++},doChartRefresh:function(){this.endDate=this.nowInTZPref(),this.selectedEndTime=this.endDate.clone().format("HH:mm")},toggleDisplayMode:function(){"chart"==this.displayMode?this.displayMode="table":this.displayMode="chart"},checkScreen:function(){window.innerWidth<768?this.isMaximized=!1:this.isMaximized=!0},processHeaterAnnotations:function(t){for(var e={labelOptions:{shape:"connector",align:"right",justify:!1,crop:!0,style:{fontSize:"0.8em",textOutline:"1px white"}},labels:[]},r=E["a"].displayMetric(this.getUser),n=0;n<t.length;n++)for(var i=0;i<this.temperatureChartData.length;i++)if(t[n].dbtime>=this.temperatureChartData[i].date&&i+1<this.temperatureChartData.length-1&&t[n].dbtime<=this.temperatureChartData[i+1].date){var a=this.temperatureChartData[i][this.datasetTypePropertiesMap[this.datasetType]];r||(a=9*a/5+32),e.labels.push({point:{xAxis:0,yAxis:1,x:k.a.utc(t[n].dbtime).valueOf(),y:a},text:"Heat "+t[n].stateName});break}return e},processDehumidifierAnnotations:function(t,e){for(var r={labelOptions:{shape:"connector",align:"right",justify:!1,crop:!0,style:{fontSize:"0.8em",textOutline:"1px white"}},labels:[]},n=0;n<t.length;n++)for(var i=0;i<this.humidityChartData.length;i++)if(t[n].dbtime>=this.humidityChartData[i].date&&i+1<this.humidityChartData.length-1&&t[n].dbtime<=this.humidityChartData[i+1].date){var a=this.humidityChartData[i][this.datasetTypePropertiesMap[this.datasetType]],o={xAxis:0,yAxis:2,x:k.a.utc(t[n].dbtime).valueOf()-6e4,y:Math.round(100*a)+2};console.log(t[n].dbtime,o),r.labels.push({point:o,text:e+" "+t[n].stateName});break}return r},processCo2ValveAnnotations:function(t){var e=[],r=[],n="OFF";this.co2ChartData.sort((function(t,e){return t.date>e.date?1:-1}));for(var i=0;i<t.length;i++)for(var a=0;a<this.co2ChartData.length;a++){if(t[i].dbtime>=this.co2ChartData[a].date&&a+1<this.co2ChartData.length-1&&t[i].dbtime<=this.co2ChartData[a+1].date){var o={point:{xAxis:0,yAxis:0,x:k.a.utc(t[i].dbtime).valueOf(),y:this.co2ChartData[a][this.datasetTypePropertiesMap[this.datasetType]]}};o.text=t[i].stateName,"ON"==t[i].stateName&&(e.push(o),n="ON"),"ON"!=t[i].stateName&&"ON"==n&&(o.text="OFF",r.push(o),n="OFF");break}console.log("could not plot point",t[i])}return[{labelOptions:{backgroundColor:"rgba(0,255,0,0.5)",verticalAlign:"top",y:2,allowOverlap:!1},labels:e},{labels:r,labelOptions:{backgroundColor:"rgba(0,255,0,0.5)",allowOverlap:!1}}]},processOtherAnnotations:function(t,e,r){for(var n=[],i=0;i<t.length;i++)n.push({point:{xAxis:0,yAxis:2,x:k.a.utc(t[i].dbtime).valueOf(),y:r},text:e+t[i].stateName});return n},processIrrData:function(t){if(t&&t.length){this.sortValsByTime(t,"dbtime");var e=t.map((function(t){return{x:k.a.utc(t.dbtime).valueOf(),y:null,state:t.stateName}})).reduce((function(t,e){return"ON"==e.state&&t.push(e),t}),[]);this.chartData.plotLines.push({label:"IRR",type:"line",width:2,color:"#1261A0",yAxisID:"irr-ecu",showLine:!1,data:e})}},replotData:function(){this.processTemperatureData(this.temperatureChartData),this.processHumidityData(this.humidityChartData),this.processCO2Data(this.co2ChartData),this.platformGroup_id>0&&!this.selectedZone&&this.processVpdData(this.vpdData),this.processAnnotationData(this.annotationData),this.redrawChart()},redrawChart:function(){var t=[];null!=this.chartData.tempSeries&&t.push(this.chartData.tempSeries),null!=this.chartData.humiditySeries&&t.push(this.chartData.humiditySeries),null!=this.chartData.co2Series&&t.push(this.chartData.co2Series),null!=this.chartData.vpdSeries&&t.push(this.chartData.vpdSeries),this.$set(this.chartData,"dataset",t),this.keyIndex++},setFixedYAxes:function(){this.chartData.yAxes=[{title:{text:"CO₂ (ppm)"},type:"linear",min:200,max:1800,gridLineWidth:0},{type:"linear",title:{text:"Temperature ".concat("metric"===this.userUnitPreference.setting?"(°C)":"(°F)")},min:"metric"===this.userUnitPreference.setting?10:Object(g["a"])(10),max:"metric"===this.userUnitPreference.setting?38:Object(g["a"])(38),gridLineWidth:0},{title:{text:"Humidity (%)"},type:"linear",min:25,max:99,gridLineWidth:0,opposite:!0},{title:{text:"VPD"},min:0,max:3,gridLineWidth:0,opposite:!0}]},setFloatingYAxes:function(){this.chartData.yAxes=[{title:{text:"CO₂ (ppm)"},type:"linear",gridLineWidth:0},{type:"linear",title:{text:"Temperature ".concat("metric"===this.userUnitPreference.setting?"(°C)":"(°F)")},gridLineWidth:0},{title:{text:"Humidity (%)"},type:"linear",gridLineWidth:0,opposite:!0},{title:{text:"VPD"},gridLineWidth:0,opposite:!0}]},chartSetup:function(){this.selectedStartDate=this.sDate,this.selectedStartTime=this.sTime,this.selectedEndDate=this.eDate,this.selectedEndTime=this.eTime,this.chartData.xAxes=[{type:"datetime",crosshair:!0,plotLines:[],plotBands:[],dateTimeLabelFormats:{minute:"%I:%M %P",hour:"%I:%M %P"}}],this.setFixedYAxes()},getVfuDeviceInfo:function(){var t=this;this.device_id&&E["a"].get("zoneDevices/"+this.device_id,this.getUser.apitoken).then((function(e){var r=M(e,2),n=r[0];r[1];t.item=n,t.platformGroupId=n.platformGroup_id,t.deviceId=n.device_id,t.controllerId=n.controller_id}))},dispatchServices:function(){this.chartDevice.temperature=[],this.chartDevice.humidity=[],this.chartDevice.co2=[];var t=this;this.temperatureDevices&&this.temperatureDevices.length&&this.temperatureDevices.forEach((function(e){e.device.toUpperCase().indexOf("TEMP")>=0&&t.chartDevice.temperature.push(e.id)})),this.co2Devices&&this.co2Devices.length&&this.co2Devices.forEach((function(e){e.device.toUpperCase().indexOf("CO2")>=0&&t.chartDevice.co2.push(e.id)})),this.humidityDevices&&this.humidityDevices.length&&this.humidityDevices.forEach((function(e){e.device.toUpperCase().indexOf("HUMIDITY")>=0&&t.chartDevice.humidity.push(e.id)}))},getTimeDifferenceByUnit:function(){var t=k.a.duration(k()(this.endDate).diff(this.startDate)),e=1;return"day"===this.selectedUnit?e=t.asDays():"hour"===this.selectedUnit?e=t.asHours():"minute"===this.selectedUnit?e=t.asMinutes():"month"===this.selectedUnit&&(e=t.asMonths()),e<1&&(e=2),Math.round(e)>this.maxRecordsLimit?this.maxRecordsLimit:Math.round(e)},getChartData:function(){var t=this;t.isLoading=!0,this.fetchChartData(this.getTimeDifferenceByUnit(),(function(){t.redrawChart(),t.isLoading=!1}))},onDatesChanged:S()((function(){this.$emit("datechange",{selectedStartDate:this.selectedStartDate,selectedStartTime:this.selectedStartTime,selectedEndDate:this.selectedEndDate,selectedEndTime:this.selectedEndTime}),this.startDate=k.a.tz("".concat(this.selectedStartDate," ").concat(this.selectedStartTime),this.tzPref()),this.endDate=k.a.tz("".concat(this.selectedEndDate," ").concat(this.selectedEndTime),this.tzPref()),this.getChartData()}),50),setVPDData:function(t){this.vpdData=t,this.processVpdData(t)},refresh:function(){var t=this,e=this.devices;t.temperatureDevices=[],t.co2Devices=[],t.humidityDevices=[],t.chartDevice.curtains=[],t.chartDevice.lights=[],e.forEach((function(e){e.device.toUpperCase().indexOf("ECU")>=0&&(t.chartDevice.ecu=e.id),e.device.toUpperCase().indexOf("CORTEXVFU")>=0&&(t.chartDevice.cortexVfu=e.id),e.device.toUpperCase().indexOf("BARD")>=0&&(t.chartDevice.bard=e.id,t.chartDevice.ecu=e.id),e.device.toUpperCase().indexOf("HEATERSTRIP")>=0&&(t.chartDevice.heaterStrip=e.id),(e.device.toUpperCase().indexOf("VFUDEHUMIDIFIER")>=0||e.device.toUpperCase().indexOf("TWOSTAGEDEHUMIDIFIER")>=0)&&(t.chartDevice.dehumidifier=e.id),e.device.toUpperCase().indexOf("VFUHUMIDIFIER")>=0&&(t.chartDevice.humidifier=e.id),e.device.toUpperCase().indexOf("CO2 VALVE")>=0&&(t.chartDevice.co2Valve=e.id),"Sensor"==e.deviceType&&(e.device.toUpperCase().indexOf("TEMPERATURE")>=0&&(t.chartDevice.temperature=e.id,t.temperatureDevices.push(e)),e.device.toUpperCase().indexOf("HUMIDITY")>=0&&(t.chartDevice.humidity=e.id,t.humidityDevices.push(e)),e.device.toUpperCase().indexOf("CO2")>=0&&(t.chartDevice.co2=e.id,t.co2Devices.push(e))),"Valve"==e.deviceType&&(e.device.toUpperCase().indexOf("FLOWERMIX")>=0&&t.chartDevice.irr.push(e.id),e.device.toUpperCase().indexOf("VEGMIX")>=0&&t.chartDevice.irr.push(e.id),e.device.toUpperCase().indexOf("PAA")>=0&&t.chartDevice.irr.push(e.id)),"Curtain"==e.deviceType&&t.chartDevice.curtains.push(e.id),"Light"==e.deviceType&&t.chartDevice.lights.push(e.id)}))}}),watch:{sDate:function(t){this.selectedStartDate=t},sTime:function(t){this.selectedStartTime=t},eDate:function(t){this.selectedEndDate=t},eTime:function(t){this.selectedEndTime=t},showEcuLegend:function(t){var e=this;this.$nextTick((function(){e.keyIndex++}))},maxRecordsHit:function(t){t&&j["a"].error("WARNING - Maximum number of data points reached. You may need shorten the date range or decrease the data resolution.",-1)},datasetType:function(t){window.localStorage.setItem("environmentChart_datasetType",t);for(var e=0;e<this.datasetTypes.length;e++)if(this.datasetTypes[e]==t){this.datasetTypeProperty=this.datasetTypeProperties[e];break}this.replotData()},platformGroup_id:function(t){this.dispatchServices(),this.$root.$emit("platformGroup_id",t)},selectedStartDate:function(t){this.onDatesChanged()},selectedEndDate:function(t){this.onDatesChanged()},selectedStartTime:function(t){this.onDatesChanged()},selectedEndTime:function(t){this.onDatesChanged()},selectedUnit:function(t){this.getChartData()},devices:function(t){this.refresh()},selectedZone:function(){this.dispatchServices()}}},W=q,J=(r("4f68"),r("2877")),Z=Object(J["a"])(W,v,y,!1,null,null,null);e["a"]=Z.exports},a6fc:function(t,e,r){"use strict";r("b24d")},a74b:function(t,e,r){"use strict";r("8ddd")},a9fd:function(t,e,r){},a9fe:function(t,e,r){"use strict";r.r(e);var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("0393"),s=r("132d"),l=r("8654"),c=function(){var t=this,e=t._self._c;return e("enterprise-dashboard-base",[e(i["a"],{staticClass:"h-100"},[t.currentFacility?e(a["d"],{staticClass:"d-flex justify-between align-center"},[e("span",{staticClass:"flex-grow-auto"},[t._v(t._s(t.currentFacility.facility))]),e(l["a"],{directives:[{name:"show",rawName:"v-show",value:"facility"===t.activeSearch.activeSearchLevel&&t.activeSearch.activeSearchId===t.facilityId,expression:"activeSearch.activeSearchLevel === 'facility' && activeSearch.activeSearchId === facilityId"}],ref:"facilitySearch",staticClass:"col-6 col-sm-4",staticStyle:{"padding-bottom":"3px"},attrs:{"append-icon":"search","single-line":"","hide-details":"",clearable:"",dense:""},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),e(n["a"],{directives:[{name:"show",rawName:"v-show",value:"facility"!==t.activeSearch.activeSearchLevel||t.activeSearch.activeSearchId!==t.facilityId,expression:"activeSearch.activeSearchLevel !== 'facility' || activeSearch.activeSearchId !== facilityId"}],attrs:{icon:""},on:{click:t.showFacilitySearch}},[e(s["a"],[t._v("search")])],1),e(n["a"],{staticClass:"flex-shrink-1 flex-grow-0",attrs:{text:""},on:{click:function(e){return e.stopPropagation(),t.minimizePanel.apply(null,arguments)}}},[e(s["a"],[t._v("fullscreen_exit")])],1)],1):t._e(),e(a["c"],{staticClass:"px-0"},[e("unit-search-results",{directives:[{name:"show",rawName:"v-show",value:t.search&&""!==t.search,expression:"search && search !== ''"}],attrs:{"display-units":t.searchResultUnits,"search-text":t.search}}),e(o["a"],{directives:[{name:"show",rawName:"v-show",value:(!t.search||""===t.search)&&t.showAreas,expression:"(!search || search === '') && showAreas"}],staticClass:"dashboard-panels",attrs:{accordion:""},model:{value:t.openPanel,callback:function(e){t.openPanel=e},expression:"openPanel"}},t._l(t.areas,(function(r,n){return e("area-expansion-panel",{key:r.id,attrs:{"facility-id":t.facilityId,area:r,"is-active-panel":t.openPanel===n}})})),1)],1)],1)],1)},u=[],d=r("2f62"),h=r("d0eb"),f=r("a9b3"),p=r("29fd"),m=r("b047"),v=r.n(m),y=r("faef"),g=r("81f6"),b=r("169a"),w=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100"},[t._t("default"),e(b["a"],{attrs:{width:"600"},model:{value:t.$store.state.universalDashboard.showAlerts,callback:function(e){t.$set(t.$store.state.universalDashboard,"showAlerts",e)},expression:"$store.state.universalDashboard.showAlerts"}},[t.selectedContextMenuItem?e("alerts",{attrs:{title:t.selectedContextMenuItem.platformGroupName,controller_id:t.selectedContextMenuItem.controller_id}}):t._e()],1)],2)},x=[],S=r("9cf2"),_=r("33d8"),C=r("f721"),O=r("d054"),P=r("afa9"),D=r("f749"),k=r("ad5a"),T=r("14c4"),j=r("70d9"),E=r("1cc5"),I=r("c122"),L=(r("d67f"),r("2ec3")),A=r("31e3"),M=r("d7f2"),U=r("8537"),N=r("9640"),F=r("e387"),G=r("06b7"),R=r("567b");function $(t){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function H(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function V(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?H(Object(r),!0).forEach((function(e){B(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function B(t,e,r){return(e=z(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z(t){var e=Y(t,"string");return"symbol"==$(e)?e:e+""}function Y(t,e){if("object"!=$(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var q={name:"EnterpriseDashboardBase",components:{IrrigationSummary:R["a"],ActiveXiaomiSoilSensors:G["a"],ReviewMicroclimatePerformance:F["a"],BatchCo2CalibrationOptions:N["a"],BatchEcuOptions:U["a"],BatchCurtainConfirm:M["a"],BatchDehumidifierOptions:A["a"],EditFirmware:L["a"],MovePlatformGroup:I["a"],EditHostname:E["a"],BashCommandExecute:j["a"],BatchIrrigationOptions:T["a"],BatchControlLoopOptions:k["a"],Alerts:D["default"],DoNotDisturb:P["a"],AssemblyTests:O["a"],DeviceHistoryViewerModal:C["a"],DeviceConfigurationViewer:_["a"],BatchIntensityOptions:S["a"]},data:function(){return{}},computed:V(V(V(V({},Object(d["c"])(["getUser"])),Object(d["c"])("batchActions",["batchActions"])),Object(d["c"])("universalDashboard",["selectedContextMenuItem","showBatchIntensityOptions","showDeviceConfigurationViewer","showDeviceHistory","showAssemblyTests","showSetDnD","showAlerts","selectedUnits"])),{},{filteredEcuActions:function(){return this.batchActions?this.batchActions.filter((function(t){return t.deviceType&&"ECU"===t.deviceType})):[]}}),beforeMount:function(){this.$store.dispatch("batchActions/loadBatchActions")},methods:{}},W=q,J=r("2877"),Z=Object(J["a"])(W,w,x,!1,null,null,null),X=Z.exports;function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Q(t,e){return it(t)||nt(t,e)||et(t,e)||tt()}function tt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function et(t,e){if(t){if("string"==typeof t)return rt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rt(t,e):void 0}}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function nt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function it(t){if(Array.isArray(t))return t}function at(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */at=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==K(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(K(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ot(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function st(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){ot(a,n,i,o,s,"next",t)}function s(t){ot(a,n,i,o,s,"throw",t)}o(void 0)}))}}function lt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?lt(Object(r),!0).forEach((function(e){ut(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ut(t,e,r){return(e=dt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dt(t){var e=ht(t,"string");return"symbol"==K(e)?e:e+""}function ht(t,e){if("object"!=K(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var ft={name:"FacilityDashboard",mixins:[f["a"]],components:{EnterpriseDashboardBase:X,UnitSearchResults:y["a"],AreaExpansionPanel:p["a"]},data:function(){return{showAreas:!0,facilityId:null,isLoading:!1,areas:[],openPanel:0,maximizedDisplayType:null,search:""}},computed:ct(ct(ct({},Object(d["c"])(["getUser","userFacilities"])),Object(d["c"])("universalDashboard",["searchResultUnits","activeSearch"])),{},{userIsAdmin:function(){return h["a"].isAdmin(this.getUser)},currentFacility:function(){var t=this;return this.userFacilities.find((function(e){return e.facility_id===t.facilityId}))}}),watch:{"$route.params.facilityId":function(){var t=st(at().mark((function t(){return at().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.facilityId=parseInt(this.$route.params.facilityId),this.showAreas=!1,t.next=4,this.refresh();case 4:this.showAreas=!0;case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),search:v()((function(t){t||this.$store.dispatch("universalDashboard/setActiveSearch",{activeSearchLevel:null,activeSearchId:null}),this.$store.dispatch("universalDashboard/searchUnits",{facility_id:this.facilityId,page:1,search:"%".concat(t,"%")})}),500),activeSearch:{handler:function(t){var e=this;"facility"===t.activeSearchLevel&&t.activeSearchId===this.facilityId&&this.$nextTick((function(){e.$refs.facilitySearch.focus()})),"area"===t.activeSearchLevel&&(console.log("newVal",t),this.areas.forEach((function(r,n){r.id===t.activeSearchId&&(e.openPanel=n)})))},deep:!0}},beforeMount:function(){this.facilityId=parseInt(this.$route.params.facilityId),g["a"].$on("universal-dashboard-refresh",this.dashboardRefresh),this.refresh()},unmounted:function(){g["a"].$off("universal-dashboard-refresh",this.dashboardRefresh)},methods:{dashboardRefresh:function(){this.search&&""!==this.search?this.$store.dispatch("universalDashboard/searchUnits",{facility_id:this.facilityId,page:1,search:"%".concat(this.search,"%")}):this.refresh()},minimizePanel:function(){this.$router.push({name:"enterprise-dashboard"})},refresh:function(){var t=this;return st(at().mark((function e(){var r,n,i;return at().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,h["a"].get("areas",t.getUser.apitoken,{filter:{where:{facility_id:t.facilityId}}});case 2:r=e.sent,n=Q(r,2),i=n[0],n[1],t.areas=i;case 7:case"end":return e.stop()}}),e)})))()},showFacilitySearch:function(){this.$store.dispatch("universalDashboard/setActiveSearch",{activeSearchLevel:"facility",activeSearchId:this.facilityId})}}},pt=ft,mt=Object(J["a"])(pt,c,u,!1,null,"7791ff0e",null);e["default"]=mt.exports},aa82:function(t,e,r){"use strict";r("454d")},ab43:function(t,e,r){},ab5f:function(t,e,r){},ab66:function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"locked-column-datatable-component h-100"},[t._t("default",null,{updated:t.applyStyles})],2)},i=[],a={name:"locked-column-datatable",props:{maxLockedIndex:{type:Number,required:!0},items:{type:Array,required:!1,default:[]},xs:{type:Boolean,required:!1,default:!1},sm:{type:Boolean,required:!1,default:!1},md:{type:Boolean,required:!1,default:!1},lg:{type:Boolean,required:!1,default:!1},xl:{type:Boolean,required:!1,default:!1},isLockingEnabled:{type:Boolean,required:!1,default:!0}},components:{},mounted:function(){var t=this;this.observer=new IntersectionObserver((function(e){e[0].isIntersecting&&(t.isVisible=!0)})),this.observer.observe(this.$el),window.addEventListener("resize",this.debounceStyles)},beforeDestroy:function(){window.removeEventListener("resize",this.debounceStyles)},data:function(){return{timeout:null,observer:null,isVisible:!1,breakpoints:{xs:{min:null,max:600},sm:{min:600,max:960},md:{min:960,max:1264},lg:{min:1264,max:1904},xl:{min:1904,max:null}}}},computed:{},watch:{items:function(){this.applyStyles()},isVisible:function(){this.applyStyles()},isLockingEnabled:function(t,e){t&&!e&&this.applyStyles()}},methods:{debounceStyles:function(){var t=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){t.applyStyles()}),500)},applyStyles:function(){var t=this;if(this.isVisible&&this.isLockingEnabled){var e=!this.xs&&!this.sm&&!this.md&&!this.lg&&!this.xl,r=this.$vuetify.breakpoint.name;this[r]&&(e=!0),this.$nextTick((function(){var r=t.$refs.container,n=r.getElementsByTagName("tbody")[0].childNodes;n=Array.from(n),n.filter((function(t){return!t.classList.contains("v-data-table__expanded__content")})).forEach((function(r){var n=r.getElementsByTagName("td");n.forEach((function(r,i){if(e){if(0===i)r.style.left=0;else if(i<=t.maxLockedIndex){var a=n[i-1],o=a.currentStyle||window.getComputedStyle(a),s=o.left.replace("px",""),l=o.width.replace("px","");r.style.left=parseInt(s)+parseInt(l)+"px"}i<t.maxLockedIndex&&(r.classList="fixed-column"),i===t.maxLockedIndex&&(r.classList="fixed-column fixed-column-max")}else r.classList=""}))}));var i=r.getElementsByTagName("thead")[0].getElementsByTagName("tr");i.forEach((function(r){var n=r.getElementsByTagName("th");n.forEach((function(r,i){if(e){if(0===i)r.style.left=0;else if(i<=t.maxLockedIndex){var a=n[i-1],o=a.currentStyle||window.getComputedStyle(a),s=o.left.replace("px",""),l=o.width.replace("px","");r.style.left=parseInt(s)+parseInt(l)+"px"}i<t.maxLockedIndex&&(r.classList="fixed-column"),i===t.maxLockedIndex&&(r.classList="fixed-column fixed-column-max")}else r.classList=""}))})),t.$emit("finishedLockingColumns")}))}}}},o=a,s=(r("943b"),r("2877")),l=Object(s["a"])(o,n,i,!1,null,null,null);e["a"]=l.exports},ad4e:function(t,e,r){},ad5a:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("132d"),s=r("2fa4"),l=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v("Apply Control Loop Overrides")]),e(s["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(o["a"],[t._v("close")])],1)],1),e(a["c"],{staticStyle:{height:"300px"}},[e("vuetify-datatable",{staticStyle:{border:"1px solid silver",height:"100%"},attrs:{options:t.pagination,headers:t.headers,items:t.data,"hide-default-footer":"","show-select":!0,loading:t.isLoading,"fixed-header":!0,height:"100%","show-group-by":!0,"show-expand":!0},on:{"update:options":function(e){t.pagination=e}},scopedSlots:t._u([{key:"item.updatedate",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.updatedate))}})]}},{key:"expanded-item",fn:function(r){var n=r.headers,i=r.item;return[e("td",{attrs:{colspan:n.length}},[t._v(t._s(i.description))])]}}]),model:{value:t.selectedOverrides,callback:function(e){t.selectedOverrides=e},expression:"selectedOverrides"}})],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",disabled:!t.selectedOverrides.length,color:"primary"},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},c=[],u=r("2f62"),d=r("d0eb"),h=r("ed53"),f=r("a9b3");function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function m(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",v="executing",y="completed",g={};function b(){}function w(){}function x(){}var S={};c(S,o,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,o)&&(S=C);var O=x.prototype=b.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==p(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===v)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?y:f,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=y,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(p(e)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function v(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function y(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){v(a,n,i,o,s,"next",t)}function s(t){v(a,n,i,o,s,"throw",t)}o(void 0)}))}}function g(t,e){return _(t)||S(t,e)||w(t,e)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function _(t){if(Array.isArray(t))return t}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return(e=D(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D(t){var e=k(t,"string");return"symbol"==p(e)?e:e+""}function k(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var T={name:"batch-control-loop-options",mixins:[f["a"]],components:{VuetifyDatatable:h["a"]},data:function(){return{isLoading:!1,data:[],selectedOverrides:[],pagination:{sortBy:["label"],itemsPerPage:-1,groupBy:["typename"]},headers:[{text:"Label",value:"label",sortable:!0,groupable:!1},{text:"Type",value:"typename",sortable:!0},{text:"State",value:"statename",sortable:!0},{text:"Version",value:"versionNumber",align:"center",groupable:!1},{text:"Updated",value:"updatedate",align:"center",groupable:!1},{text:"",value:"data-table-expand",groupable:!1,sortable:!1}]}},mounted:function(){this.refresh()},computed:O(O(O({},Object(u["c"])(["getUser"])),Object(u["c"])("universalDashboard",["selectedUnits","selectedContextMenuItem"])),{},{controllerIds:function(){return this.selectedUnits.length?this.selectedUnits.map((function(t){return t.controller_id})):[this.selectedContextMenuItem.controller_id]}}),methods:{refresh:function(){var t=this;this.isLoading=!0;var e=this.controllerIds.map((function(e){return d["a"].get("ControllerFsaOverrides/getFsas",t.getUser.apitoken,{controller_id:e})})),r={};Promise.all(e).then((function(e){e.forEach((function(t){var e=g(t,2),n=e[0];e[1];r[n.devices[0].controller_id]=n.devices.map((function(t){return t.deviceType_id}))}));var n=[];Object.keys(r).forEach((function(t,e){n=0===e?r[t]:n.filter((function(e){return r[t].includes(e)}))})),d["a"].get("VirtualDeviceTypeFsas",t.getUser.apitoken,{filter:{include:["state","virtualDeviceType"],where:{isDeployed:!0,isDefault:!1,virtualDeviceType_id:{inq:n}}}}).then((function(e){var r=g(e,2),n=r[0];r[1];t.isLoading=!1;for(var i=[],a=0;a<n.length;a++){var o=n[a];i.push({id:o.id,label:o.label,versionNumber:o.versionNumber,description:o.description,statename:o.state?o.state.stateName:"All",typename:o.virtualDeviceType.typename,updatedate:o.updatedate})}t.data=i}))}))},onCancel:function(){this.$store.dispatch("universalDashboard/setShowBatchControlLoopOptions",!1),this.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!1),this.$store.dispatch("universalDashboard/setSelectedBatchAction",null)},onConfirm:function(){var t=this;return y(m().mark((function e(){return m().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("universalDashboard/setShowBatchControlLoopOptions",!1);case 2:return e.next=4,t.$store.dispatch("universalDashboard/setControlLoopSettings",t.selectedOverrides);case 4:return e.next=6,t.$store.dispatch("batchActions/runBatchAction");case 6:case"end":return e.stop()}}),e)})))()}},watch:{controllerIds:function(){this.refresh()}}},j=T,E=r("2877"),I=Object(E["a"])(j,l,c,!1,null,null,null);e["a"]=I.exports},aec4:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("8fea"),s=r("169a"),l=r("132d"),c=r("3a2f"),u=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["c"],[e(o["a"],{staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,items:t.soilsensors,"fixed-header":"",options:t.pagination,"hide-default-footer":"",height:"100%",loading:t.isLoading},scopedSlots:t._u([{key:"item.actions",fn:function(r){var i=r.item;return[e("span",{staticStyle:{"white-space":"nowrap",width:"50px","text-align":"center"}},[e(c["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(n["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onEdit(i)}}},a),[e(l["a"],[t._v("edit")])],1)]}}],null,!0)},[e("span",[t._v("Edit")])]),e(c["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(n["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onDelete(i)}}},a),[e(l["a"],[t._v("delete")])],1)]}}],null,!0)},[e("span",[t._v("Delete")])])],1)]}},{key:"item.lastBatteryReplacement",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.lastBatteryReplacement))}})]}},{key:"item.lastReading",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.lastReading))}})]}}])})],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.refresh}},[t._v("Refresh")]),e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.onAddNew}},[t._v("Add New")]),e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.onDiscover}},[t._v("Discover")])],1),e(s["a"],{attrs:{persistent:"",width:"400"},model:{value:t.showEditor,callback:function(e){t.showEditor=e},expression:"showEditor"}},[e("xiaomi-soil-sensor-edit",{ref:"editor",on:{close:function(e){t.showEditor=!1},save:t.refresh},model:{value:t.rec,callback:function(e){t.rec=e},expression:"rec"}})],1),e(s["a"],{attrs:{persistent:"",width:"800"},model:{value:t.showDiscoverEditor,callback:function(e){t.showDiscoverEditor=e},expression:"showDiscoverEditor"}},[e("discover-editor",{ref:"discoverEditor",staticClass:"vh80",attrs:{controller:t.controller},on:{close:function(e){t.showDiscoverEditor=!1},save:t.onSelectSensors}})],1)],1)},d=[],h=r("2f62"),f=r("c1df"),p=r.n(f),m=r("d67f"),v=r("d0eb"),y=r("4bd4"),g=r("2fa4"),b=r("8654"),w=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v(t._s(t.value.id?"Edit":"Add")+" Soil Sensor Registration")]),e(g["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],[e(y["a"],{ref:"form",model:{value:t.isValid,callback:function(e){t.isValid=e},expression:"isValid"}},[e(b["a"],{attrs:{label:"Label",counter:"45",rules:[t.rules.requiredNoBlanks]},model:{value:t.rec.label,callback:function(e){t.$set(t.rec,"label",e)},expression:"rec.label"}}),e(b["a"],{attrs:{label:"MAC Address",counter:"17",rules:[t.rules.requiredNoBlanks]},model:{value:t.rec.macaddress,callback:function(e){t.$set(t.rec,"macaddress",e)},expression:"rec.macaddress"}}),e("vuetify-datepicker",{attrs:{label:"Last Battery Replacement"},model:{value:t.lastBattReplacement,callback:function(e){t.lastBattReplacement=e},expression:"lastBattReplacement"}})],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{loading:t.isLoading,text:"",color:"primary",disabled:!t.isValid},on:{click:t.onSave}},[t._v("Save")])],1)],1)},x=[],S=r("9c4f"),_=r("4458");function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function O(t,e){return j(t)||T(t,e)||D(t,e)||P()}function P(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function T(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function j(t){if(Array.isArray(t))return t}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){L(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function L(t,e,r){return(e=A(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A(t){var e=M(t,"string");return"symbol"==C(e)?e:e+""}function M(t,e){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var U={name:"",props:["value"],mixins:[S["a"]],components:{VuetifyDatepicker:_["a"]},data:function(){return{rec:null,isLoading:!0,isValid:!0,lastBattReplacement:null}},beforeMount:function(){this.init(),this.refresh()},computed:I({},Object(h["c"])(["getUser"])),methods:{init:function(){var t=this;this.isLoading=!0,this.rec=I({},this.value),this.lastBattReplacement=p()(this.rec.lastBatteryReplacement).format("YYYY-MM-DD"),v["a"].get("cameraTypes",this.getUser.apitoken,{filter:{sort:"label"}}).then((function(e){var r=O(e,2),n=r[0];r[1];t.cameraTypes=n,t.isLoading=!1}))},resetValidation:function(){this.$refs.form.resetValidation()},onClose:function(){this.$emit("close")},onSave:function(){var t=this;t.isLoading=!0,this.rec.lastBatteryReplacement=this.lastBattReplacement;var e=I({},this.rec);e.temperature=e.temperature&&""!==e.temperature?e.temperature.split(" ")[0]:e.temperature,v["a"].patch("ag_xiaomiSensors",this.getUser.apitoken,e).then((function(e){var r=O(e,2),n=r[0];r[1];n?(m["a"].success("Record Saved."),t.$emit("save",t.rec),t.$emit("edit",t.rec),t.onClose()):m["a"].error("An error occurred. Please try again later."),t.isLoading=!1}))},refresh:function(){}},watch:{value:function(t,e){this.rec=I({},t),this.lastBattReplacement=p()(t.lastBattReplacement).format("YYYY-MM-DD"),this.$refs.form.resetValidation()}}},N=U,F=r("2877"),G=Object(F["a"])(N,w,x,!1,null,null,null),R=G.exports,$=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content"},[e(a["d"],[e("h2",[t._v("Discover Soil Sensors")]),e(g["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],{staticClass:"flex-grow-auto"},[e(o["a"],{staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,items:t.macAddresses,"fixed-header":"",options:t.pagination,"show-select":!0,"hide-default-footer":"",height:"100%","item-key":"macaddress",loading:t.isRefreshing,"return-object":""},scopedSlots:t._u([{key:"item.label",fn:function(r){var n=r.item;return[e(b["a"],{model:{value:n.label,callback:function(e){t.$set(n,"label",e)},expression:"item.label"}})]}}]),model:{value:t.selected,callback:function(e){t.selected=e},expression:"selected"}})],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{loading:t.isRefreshing,text:"",color:"primary"},on:{click:t.onRefresh}},[t._v("Refresh")]),e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.canSave},on:{click:t.onSave}},[t._v("Save")])],1)],1)},H=[],V=r("81f6");function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?z(Object(r),!0).forEach((function(e){q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function q(t,e,r){return(e=W(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function W(t){var e=J(t,"string");return"symbol"==B(e)?e:e+""}function J(t,e){if("object"!=B(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=B(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Z={name:"",props:["controller"],mixins:[S["a"]],data:function(){return{isRefreshing:!0,isValid:!0,macAddresses:[],selected:[],pagination:{itemsPerPage:-1},headers:[{text:"Label",value:"label"},{text:"MAC Address",value:"macaddress"}]}},mounted:function(){V["a"].$on("facility-websocket-message",this.handleSocketMessage)},computed:Y(Y({},Object(h["c"])(["getUser"])),{},{canSave:function(){if(this.selected.length){var t=!0;return this.selected.forEach((function(e){""===e.label&&(t=!1)})),t}return!1}}),methods:{handleSocketMessage:function(t){var e=this;if("reportSensorRegistration"===t.type){var r=t.payload.data;this.isRefreshing=!1,this.macAddresses=r.sensors.map((function(t){return{label:"",macaddress:t,controller_id:e.controller.id}}))}},onClose:function(){this.$emit("close")},onSave:function(){this.$emit("save",this.selected),this.onClose()},onRefresh:function(){this.isRefreshing=!0,v["a"].post("controllerCommands",this.getUser.apitoken,{controller_id:this.controller.id,action_id:142})}}},X=Z,K=Object(F["a"])(X,$,H,!1,null,null,null),Q=K.exports,tt=r("ea10"),et=r("a9b3"),rt=r("12a1");function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function it(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */it=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==nt(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(nt(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function at(t,e){return ut(t)||ct(t,e)||st(t,e)||ot()}function ot(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function st(t,e){if(t){if("string"==typeof t)return lt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lt(t,e):void 0}}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ct(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function ut(t){if(Array.isArray(t))return t}function dt(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function ht(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){dt(a,n,i,o,s,"next",t)}function s(t){dt(a,n,i,o,s,"throw",t)}o(void 0)}))}}function ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function pt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(r),!0).forEach((function(e){mt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mt(t,e,r){return(e=vt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vt(t){var e=yt(t,"string");return"symbol"==nt(e)?e:e+""}function yt(t,e){if("object"!=nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var gt={name:"",props:["controller"],mixins:[et["a"]],components:{XiaomiSoilSensorEdit:R,DiscoverEditor:Q},data:function(){return{rec:null,isLoading:!1,soilsensors:[],showEditor:!1,showDiscoverEditor:!1,pagination:{itemsPerPage:-1},displayMetric:!1,headers:[{text:"Actions",value:"actions",align:"center"},{text:"Label",value:"label"},{text:"MAC Address",value:"macaddress"},{text:"Battery Replacement",value:"lastBatteryReplacement"},{text:"Temp",value:"temperature",align:"right"},{text:"Moisture",value:"moisture",align:"right"},{text:"EC",value:"fertility",align:"right"},{text:"Light (lx)",value:"lux",align:"right"},{text:"Last Reading",value:"lastReading",align:"left"}]}},beforeMount:function(){this.displayMetric=v["a"].displayMetric(this.getUser),this.refresh()},computed:pt({},Object(h["c"])(["getUser"])),methods:{onDiscover:function(){v["a"].post("controllerCommands",this.getUser.apitoken,{controller_id:this.controller.id,action_id:142}),this.showDiscoverEditor=!0},onSelectSensors:function(t){var e=this;return ht(it().mark((function r(){var n,i,a,o,s,l,c,u;return it().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.isLoading=!0,n=t.map((function(t){return t.macaddress})),r.next=4,v["a"].get("ag_xiaomiSensors",e.getUser.apitoken,{filter:{where:{macaddress:{inq:n}}}});case 4:i=r.sent,a=at(i,2),o=a[0],a[1],s=[],l=[],c=it().mark((function r(){var n,i;return it().wrap((function(r){while(1)switch(r.prev=r.next){case 0:n=o[u],s.push(n.macaddress),i=t.find((function(t){return t.macaddress.toUpperCase()===n.macaddress.toUpperCase()})),l.push(v["a"].patch("ag_xiaomiSensors",e.getUser.apitoken,{id:n.id,label:i.label,controller_id:i.controller_id}));case 4:case"end":return r.stop()}}),r)})),u=0;case 12:if(!(u<o.length)){r.next=17;break}return r.delegateYield(c(),"t0",14);case 14:u++,r.next=12;break;case 17:return t.filter((function(t){var e=s.find((function(e){return e.toUpperCase()===t.macaddress.toUpperCase()}));return!e})).forEach((function(t){l.push(v["a"].post("ag_xiaomiSensors",e.getUser.apitoken,t))})),r.next=20,Promise.all(l);case 20:r.sent,m["a"].success("Records Saved."),e.refresh();case 23:case"end":return r.stop()}}),r)})))()},onEdit:function(t){this.rec=t,this.showEditor=!0},onDelete:function(t){var e=this;tt["a"].confirm("Confirm Delete","Are you sure that you want to delete "+t.label+"?",(function(r){r&&(e.isLoading=!0,v["a"].destroy("ag_xiaomiSensors",t.id,e.getUser.apitoken).then((function(t){var r=at(t,2),n=r[0];r[1];e.isLoading=!1,n?(e.refresh(),m["a"].success("Record deleted")):m["a"].error("An error occurred. Please try again later.")})))}))},onAddNew:function(){this.rec={controller_id:this.controller.id,label:null,macaddress:null,lastBatteryReplacement:p()().format("YYYY-MM-DD"),temperature:null,lux:null,moisture:null,fertility:null},this.showEditor=!0,this.$refs.editor.resetValidation()},refresh:function(){var t=this;t.isLoading=!0,v["a"].post("controllerCommands",this.getUser.apitoken,{action_id:141,controller_id:this.controller.id}),v["a"].get("ag_xiaomiSensors",this.getUser.apitoken,{filter:{where:{controller_id:this.controller.id}}}).then((function(e){for(var r=at(e,2),n=r[0],i=(r[1],0);i<n.length;i++)isNaN(parseFloat(n[i].temperature))||(t.displayMetric?n[i].temperature=n[i].temperature+" C":n[i].temperature=Object(rt["toFahrenheit"])(n[i].temperature)+" F");t.soilsensors=n,t.isLoading=!1}))}},watch:{}},bt=gt,wt=Object(F["a"])(bt,u,d,!1,null,null,null);e["a"]=wt.exports},afa9:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("ac7c"),s=r("62ad"),l=r("4bd4"),c=r("132d"),u=r("0fd9"),d=r("2fa4"),h=r("a844"),f=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{loading:t.isLoading}},[e(a["d"],[e("h2",[t._v("Do Not Disturb - "+t._s(t.controller.name))]),e(d["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(c["a"],[t._v("close")])],1)],1),e(a["c"],[e(l["a"],{ref:"dndForm",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(o["a"],{attrs:{label:t.enableLabel},model:{value:t.rec.isDND,callback:function(e){t.$set(t.rec,"isDND",e)},expression:"rec.isDND"}}),e(u["a"],[e(s["a"],{staticClass:"pr-3",attrs:{md:"6"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.endDate"),rules:[t.rules.required]},model:{value:t.endDate,callback:function(e){t.endDate=e},expression:"endDate"}})],1),e(s["a"],{staticClass:"pl-3 pr-3",attrs:{md:"6"}},[e("vuetify-timepicker",{attrs:{label:t.$t("common.endTime"),rules:[t.rules.required]},model:{value:t.endTime,callback:function(e){t.endTime=e},expression:"endTime"}})],1)],1),e(h["a"],{attrs:{outlined:"",label:"Reason",maxlength:"255",counter:"255",rules:[t.rules.required]},model:{value:t.rec.dndComment,callback:function(e){t.$set(t.rec,"dndComment",e)},expression:"rec.dndComment"}})],1)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary",disabled:!t.valid,loading:t.isLoading},on:{click:t.onSave}},[t._v("Save")])],1)],1)},p=[],m=r("d0eb"),v=r("c1df"),y=r.n(v),g=r("d67f"),b=r("2f62"),w=r("4458"),x=r("dd20"),S=r("9c4f"),_=r("81f6");function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function O(t,e){return j(t)||T(t,e)||D(t,e)||P()}function P(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function T(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function j(t){if(Array.isArray(t))return t}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){L(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function L(t,e,r){return(e=A(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A(t){var e=M(t,"string");return"symbol"==C(e)?e:e+""}function M(t,e){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var U={name:"DoNotDisturb",components:{VuetifyDatepicker:w["a"],VuetifyTimepicker:x["a"]},mixins:[S["a"]],beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{controller:{name:""},reservationName:"",enableLabel:"Enable",rec:{isDND:!1,dndComment:null,dndExpiration:y()().format("YYYY-MM-DD HH:mm")},valid:!1,isLoading:!1,endDate:y()().add(4,"hours").format("YYYY-MM-DD"),endTime:y()().add(4,"hours").format("HH:mm")}},computed:I(I({},Object(b["c"])(["getUser"])),Object(b["c"])("universalDashboard",["selectedContextMenuItem"])),watch:{"selectedContextMenuItem.controller_id":function(){this.resetValues(),this.refresh()}},methods:{refresh:function(){var t=this;t.isLoading=!0,m["a"].get("controllers/"+this.selectedContextMenuItem.controller_id,this.getUser.apitoken).then((function(e){var r=O(e,2),n=r[0];r[1];if(t.controller=n,n.dndExpiration){var i=y.a.utc(n.dndExpiration);n.isDnD&&i.isAfter(y.a.utc())?(t.rec.isDND=n.isDnD,t.rec.dndComment=n.dndComment,t.endDate=i.local().format("YYYY-MM-DD"),t.endTime=i.local().format("HH:mm"),m["a"].get("users/"+n.dndUserId,t.getUser.apitoken,{filters:{fields:["firstname","lastname"]}}).then((function(e){var r=O(e,2),n=r[0];r[1];t.reservationName=n.firstname+" "+n.lastname,t.enableLabel="Enabled by "+t.reservationName}))):(t.enableLabel="Enable",t.rec.dndComment=null,t.endDate=y()().add(4,"hours").format("YYYY-MM-DD"),t.endTime=y()().add(4,"hours").format("HH:mm"))}t.isLoading=!1}))},onSave:function(){var t=this,e=y()(this.endDate+" "+this.endTime).utc().format("YYYY-MM-DD HH:mm");t.isLoading=!0,m["a"].patch("controllers",this.getUser.apitoken,{id:this.selectedContextMenuItem.controller_id,isDnD:this.rec.isDND,dndComment:this.rec.dndComment,dndExpiration:e,dndUserId:this.getUser.id}).then((function(e){var r=O(e,2),n=r[0];r[1];t.isLoading=!1,n?(g["a"].success("Save Complete"),_["a"].$emit("universal-dashboard-refresh"),t.onClose()):g["a"].error("An error occurred. Please try again later.")}))},resetValues:function(){this.endDate=y()().add(4,"hours").format("YYYY-MM-DD"),this.endTime=y()().add(4,"hours").format("HH:mm"),this.rec={isDND:!1,dndComment:null,dndExpiration:y()().format("YYYY-MM-DD HH:mm")},this.$refs.dndForm.resetValidation()},onClose:function(){this.$store.dispatch("universalDashboard/setShowSetDnD",!1)}}},N=U,F=r("2877"),G=Object(F["a"])(N,f,p,!1,null,null,null);e["a"]=G.exports},afda:function(t,e,r){},afdd1:function(t,e,r){"use strict";r("9ecb")},b05f:function(t,e,r){},b09b:function(t,e,r){"use strict";var n=r("cd55"),i=r("49e2"),a=r("c865"),o=function(){var t=this,e=t._self._c;return e(n["a"],{directives:[{name:"show",rawName:"v-show",value:t.isVisibleDisplayUnitType,expression:"isVisibleDisplayUnitType"}],staticClass:"flex-grow-auto flex-column",class:{"d-flex":t.isVisibleDisplayUnitType}},[e(a["a"],{staticClass:"d-flex justify-between"},[e("span",{staticClass:"flex-grow-auto"},[t._v(t._s(t.displayUnits.length)+" Drying Units")])]),e(i["a"],{staticClass:"flex-grow-auto"},[e("unit-results",{attrs:{"display-units":t.displayUnits}})],1),e("edit-phase-modal",{on:{refresh:t.refresh},model:{value:t.growPhase_id,callback:function(e){t.growPhase_id=e},expression:"growPhase_id"}})],1)},s=[],l=r("c1df"),c=r.n(l),u=r("ab66"),d=r("b3c5"),h=r("ea10"),f=r("d0eb"),p=r("d67f"),m=r("2f62"),v=r("a9b3"),y=r("8ac5"),g=r("12ad");function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){return O(t)||C(t,e)||S(t,e)||x()}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function O(t){if(Array.isArray(t))return t}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=j(t,"string");return"symbol"==b(e)?e:e+""}function j(t,e){if("object"!=b(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var E={name:"DryingUnitExpansionPanel",mixins:[v["a"]],components:{UnitResults:g["a"],LifecyclePlatforms:y["a"],LockedColumnDatatable:u["a"],EditPhaseModal:d["a"]},props:{selectedDisplayTypes:{type:Array,required:!1,default:function(){return[]}},displayUnits:{type:Array,required:!1,default:function(){return[]}},maximizedDisplayType:{type:Number,required:!1,default:function(){return null}},isLockingEnabled:{type:Boolean,required:!1,default:function(){return!1}},isLockingColumns:{type:Boolean,required:!1,default:function(){return!1}},displayUnitsLoading:{type:Boolean,required:!1,default:function(){return!1}},searchText:{type:String,required:!1,default:function(){return""}}},data:function(){return{moment:c.a,pagination:{itemsPerPage:250},footerprops:{"items-per-page-options":[25,50,75,100,250]},displayUnitsHeaders:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],displayUnitsExpanded:[],growPhase_id:null,isAdmin:!1}},computed:D(D({},Object(m["c"])(["getUser"])),{},{isVisibleDisplayUnitType:function(){return this.selectedDisplayTypes.find((function(t){return 4===t.id}))&&this.displayUnits&&this.displayUnits.length&&(!this.maximizedDisplayType||4===this.maximizedDisplayType)},filteredDisplayUnits:function(){var t=this;return""!==this.searchText&&this.searchText?this.displayUnits.filter((function(e){return e.platformGroupName.toLowerCase().includes(t.searchText.toLowerCase())})):this.displayUnits}}),beforeMount:function(){this.isAdmin=f["a"].isAdmin(this.getUser)||f["a"].isUserInRole(this.getUser,"Maintenance")},watch:{filteredDisplayUnits:function(){""!==this.searchText&&this.$emit("searched-length",this.filteredDisplayUnits.length)}},methods:{isExpanded:function(t){var e=this.displayUnitsExpanded.find((function(e){return e.id===t.id}));return!!e},fullscreenPanel:function(){this.$emit("fullscreen-panel",4)},minimizePanel:function(){this.$emit("minimize-panel")},refresh:function(){this.$emit("refresh")},goToDevice:function(){},onShowDisplayUnitLifecycle:function(t){var e=this.displayUnitsExpanded.findIndex((function(e){return e.platformGroup_id===t.platformGroup_id}));-1===e?this.displayUnitsExpanded.push(t):this.displayUnitsExpanded.splice(e,1)},createOperationalTask2:function(t,e){this.$router.push({name:"operational-task",params:{growplanId:t,lifecycleId:e}})},onEditPhase:function(t){this.growPhase_id=t.id},onToggleLifecycle:function(t){var e=this,r="";r=t.isSuspended?"Resume Lifecycle  "+t.lifecycle_id+"?":"Suspend Lifecycle  "+t.lifecycle_id+"?",h["a"].confirm("Please Confirm",r,(function(r){r&&f["a"].post("ag_lifecycles/toggleSuspend",e.getUser.apitoken,{lifecycle_id:t.lifecycle_id}).then((function(e){var r=w(e,2),n=r[0];r[1];n?(p["a"].success("Function Complete"),t.isSuspended=!t.isSuspended):p["a"].error("An error occurred. Please try again later")}))}))},getPhotoPeriodText:function(t){var e="Photo period: "+t.currentPhase.photoperiod+" hours at ";return t.currentPhase.photoPeriodIntensity!==t.currentPhase.photoPeriodInterlightIntensity?(e+=100*t.currentPhase.photoPeriodIntensity+"% Downlight, ",e+=Math.round(100*t.currentPhase.photoPeriodInterlightIntensity)+"% Interlight intensity, "):e+=Math.round(100*t.currentPhase.photoPeriodIntensity)+"% intensity, ",e+="starting at "+this.convertTime(t.currentPhase.photoperiodStartTime)+".",e},convertTime:function(t){return 12===+this.$root.timePreference?c.a.utc(t,"HH:mm").add(this.getUser.facility_UTCOffset,"hours").format("h:mm a"):c.a.utc(t,"HH:mm").local().format("h:mm a")}}},I=E,L=r("2877"),A=Object(L["a"])(I,o,s,!1,null,null,null);e["a"]=A.exports},b24d:function(t,e,r){},b2ba:function(t,e,r){"use strict";var n=r("ac7c"),i=r("62ad"),a=r("8fea"),o=r("7679"),s=r("0fd9"),l=r("b974"),c=r("8654"),u=r("3a2f"),d=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100 d-flex flex-column",class:{"consumable-phase":"phase"===t.mode},attrs:{id:"consumablesgrid"}},[e(s["a"],{staticClass:"pb-1 flex-shrink-1 flex-grow-0",attrs:{justify:"center","no-gutters":""}},[e(i["a"],{staticClass:"pr-3",attrs:{md:"4"}},[e(c["a"],{staticClass:"pt-0 mt-0",attrs:{"append-icon":"search",label:"Search","single-line":"","hide-details":"",clearable:""},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1),e(i["a"],{staticClass:"pl-3",attrs:{md:"4"}},[e(n["a"],{staticStyle:{"margin-top":"0px","padding-top":"4px"},attrs:{label:"Hide Unused","single-line":"","hide-details":""},model:{value:t.hideUnused,callback:function(e){t.hideUnused=e},expression:"hideUnused"}})],1)],1),e(a["a"],{staticClass:"flex-grow-auto",attrs:{headers:t.filteredHeaders,items:t.filteredItems,"hide-default-footer":"",loading:t.isLoading,search:t.search,"fixed-header":"","must-sort":"","sort-by":"label",options:t.pagination,height:"100%"},scopedSlots:t._u([{key:"item",fn:function(r){var n=r.item;r.select;return[e("tr",[e("td",[e(u["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e("span",t._g({},i),[t._v(t._s(n.label))])]}}],null,!0)},[e("span",[t._v(t._s(n.brand))])])],1),e("td",{staticStyle:{"min-width":"70px"}},[t.readonly?e("span",[t._v(t._s(n.qty))]):e(o["a"],{attrs:{"return-value":n.qty,large:""},on:{"update:returnValue":function(e){return t.$set(n,"qty",e)},"update:return-value":function(e){return t.$set(n,"qty",e)},save:function(e){return t.onChangeRec(n)}}},[t._v("\n            "+t._s(n.qty)+"\n            "),e(c["a"],{attrs:{slot:"input",type:"number",label:"Quantity","single-line":"",readonly:t.readonly,counter:"8",suffix:n.unitOfMeasureLabel?n.unitOfMeasureLabel:""},slot:"input",model:{value:n.qty,callback:function(e){t.$set(n,"qty",e)},expression:"item.qty"}})],1)],1),e("td",[t.readonly?e("span",[t._v(t._s(n.unitOfMeasure.label))]):e(o["a"],{attrs:{"return-value":n.unitOfMeasure.id,large:"",lazy:""},on:{"update:returnValue":function(e){return t.$set(n.unitOfMeasure,"id",e)},"update:return-value":function(e){return t.$set(n.unitOfMeasure,"id",e)},save:function(e){return t.onChangeUnitOfMeasure(n)},cancel:function(e){return t.onCancelUnitOfMeasure(n)}}},[t._v("\n            "+t._s(n.unitOfMeasure.label)+"\n            "),e(l["a"],{attrs:{slot:"input",items:n.unitsOfMeasure,label:"Unit of Measure","item-text":"label","item-value":"id"},slot:"input",model:{value:n.unitOfMeasureIdSelected,callback:function(e){t.$set(n,"unitOfMeasureIdSelected",e)},expression:"item.unitOfMeasureIdSelected"}})],1)],1),"extractionStep"!==t.mode&&"postHarvestStep"!==t.mode?e("td",{staticClass:"text-md-center",staticStyle:{"min-width":"120px"}},[t.readonly?e("span",[t._v(t._s(n.consumableCalculationType.label))]):e(o["a"],{attrs:{large:"",lazy:"","return-value":n.consumableCalculationType.id},on:{save:function(e){return t.onChangeRec(n)},"update:returnValue":function(e){return t.$set(n.consumableCalculationType,"id",e)},"update:return-value":function(e){return t.$set(n.consumableCalculationType,"id",e)}}},[t._v("\n            "+t._s(n.consumableCalculationType.label)+"\n            "),e(l["a"],{attrs:{slot:"input",items:t.calculationTypes,readonly:t.readonly,label:"Cal. Type","item-text":"label","item-value":"id",autofocus:""},slot:"input",model:{value:n.consumableCalculationType.id,callback:function(e){t.$set(n.consumableCalculationType,"id",e)},expression:"item.consumableCalculationType.id"}})],1)],1):t._e()])]}}])})],1)},h=[],f=r("d0eb"),p=r("d67f"),m=r("2f62"),v=r("a026");function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){return _(t)||S(t,e)||w(t,e)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function _(t){if(Array.isArray(t))return t}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return(e=D(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D(t){var e=k(t,"string");return"symbol"==y(e)?e:e+""}function k(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var T={name:"consumables-usage",props:["value","phaseId","taskId","mode","onRefresh","readonly"],beforeMount:function(){this.refresh()},data:function(){return{UM:{},pagination:{itemsPerPage:-1,sortBy:["label"]},search:"",hideUnused:!1,isLoading:!1,Trimaster:f["a"],confirmDelete:!1,doUpdate:!0,selectedRec:null,items:[],calculationTypes:[],calculationTypesObj:{},headers:[{text:"Name",align:"left",sortable:!0,value:"label"},{text:"Qty",align:"left",sortable:!0,value:"qty"},{text:"Unit",align:"left",sortable:!1,value:"unitOfMeasure"},{text:"Calc. Type",align:"center",sortable:!0,value:"consumableCalculationType.label"}]}},computed:O(O({},Object(m["c"])(["getUser"])),{},{filteredItems:function(){var t=this.items;return this.hideUnused&&(t=t.filter((function(t){return t.qty>0}))),"extractionStep"===this.mode?t=t.filter((function(t){return!!t.ag_consumable.isForExtraction})):"task"===this.mode?t=t.filter((function(t){return!!t.ag_consumable.isForCultivation})):"postHarvestStep"===this.mode&&(t=t.filter((function(t){return!!t.ag_consumable.isForPostHarvest}))),t},filteredHeaders:function(){return"extractionStep"===this.mode||"postHarvestStep"===this.mode?this.headers.filter((function(t){return"Calc. Type"!==t.text})):this.headers}}),methods:{onCancelUnitOfMeasure:function(t){t.unitOfMeasureIdSelected=t.unitOfMeasure.id},onChangeUnitOfMeasure:function(t){v["default"].set(t,"unitOfMeasure",this.UM[t.unitOfMeasureIdSelected]),this.onChangeRec(t)},refresh:function(){var t=this;this.isLoading=!0;var e={facility_id:this.getUser.facility_id};switch(this.mode){case"task":e.context={like:"%task%"};break;case"phase":e.context={like:"%phase%"};break;case"facility":e.context={like:"%facility%"};break;case"extractionStep":e.context={like:"%extractionStep%"};break;case"postHarvestStep":e.context={like:"%postHarvestStep%"};break}var r=[f["a"].get("ag_consumableCalculationTypes",t.getUser.apitoken,{filter:{fields:["id","label","context"],where:e}}),f["a"].get("ag_facilityConsumables",t.getUser.apitoken,{filter:{limit:100,include:{relation:"ag_consumable",scope:{fields:["id","brand","name","unitOfMeasure_id_use","unitOfMeasure_id_storage","isForCultivation","isForExtraction","isForPostHarvest"],include:{relation:"type"}}},where:{facility_id:this.getUser.facility_id}}}),f["a"].get("unitsOfMeasure",t.getUser.apitoken,{filter:{fields:["id","label","conversionRate"],include:["convertTo","convertFrom"]}})],n=this.value;Promise.all(r).then((function(e){var r=g(e,3),i=g(r[0],1),a=i[0],o=g(r[1],1),s=o[0],l=g(r[2],1),c=l[0];s=s.filter((function(t){return t.ag_consumable}));for(var u=0;u<c.length;u++)t.UM[c[u].id]=c[u];a&&a.length&&(t.calculationTypes=a);var d={};if(n&&n.length)for(var h=0;h<n.length;h++)d[n[h].ag_consumable_id]=n[h];for(var f=0;f<s.length;f++){var p=d[s[f].ag_consumable.id];s[f].brand=s[f].ag_consumable.brand,s[f].label=s[f].ag_consumable.name,s[f].unitOfMeasure||(s[f].unitOfMeasure={label:"unknown",id:0});var m=null;if(p&&p.unitOfMeasure?m=t.UM[p.unitOfMeasure.id]:t.UM[s[f].ag_consumable.unitOfMeasure_id_use]&&(m=t.UM[s[f].ag_consumable.unitOfMeasure_id_use],s[f].unitOfMeasure=m),m){var v=new Set,y=t.UM[s[f].ag_consumable.unitOfMeasure_id_use];v.add(y.id);for(var b=0;b<y.convertFrom.length;b++)v.add(y.convertFrom[b].fromUom_id);for(var w=0;w<y.convertTo.length;w++)v.add(y.convertTo[w].toUom_id);v=Array.from(v),s[f].unitsOfMeasure=[];for(var x=0;x<v.length;x++)s[f].unitsOfMeasure.push(t.UM[v[x]]);s[f].unitsOfMeasure.sort((function(t,e){return t.label>e.label?1:-1}))}else s[f].unitOfMeasureLabel="unknown";p?(s[f].qty=p.qty,s[f].consumableCalculationType=p.consumableCalculationType,s[f].growPhaseConsumable_id=p.id,p.unitOfMeasure&&(s[f].unitOfMeasure=p.unitOfMeasure,s[f].unitOfMeasureIdSelected=p.unitOfMeasure.id)):(s[f].qty=0,s[f].consumableCalculationType=O({},a[0]))}t.readonly?t.items=s.filter((function(t){return t.qty>0})):t.items=s,t.isLoading=!1}))},calcStorageQty:function(t){var e=this,r=t.qty;if(t.unitOfMeasure.id!=t.ag_consumable.unitOfMeasure_id_storage){for(var n=e.UM[t.ag_consumable.unitOfMeasure_id_storage],i=1,a=0;a<n.convertFrom.length;a++)if(n.convertFrom[a].fromUofm_id==t.unitOfMeasure.id){i=n.convertFrom[a].conversionRate;break}if(1==i)for(var o=0;o<n.convertTo.length;o++)if(n.convertTo[o].toUom_id==t.unitOfMeasure.id){i=1/n.convertTo[o].conversionRate;break}r*=i}return r},onChangeRec:function(t){var e=t;if(t.qty>=0){t||(t=this.selectedRec);var r=this;if(this.doUpdate)if(this.doUpdate=!1,setTimeout((function(){r.doUpdate=!0}),500),this.phaseId&&"phase"===this.mode||"task"===this.mode&&this.taskId&&this.taskId>0||"facility"===this.mode){this.isLoading=!0;var n={unitOfMeasure_id:t.unitOfMeasure.id,ag_consumableCalculationType_id:t.consumableCalculationType.id,ag_consumable_id:t.consumable_id,ag_facilityConsumable_id:t.id,ag_growPhases_id:this.phaseId,ag_growTasks_id:this.taskId,qty:t.qty,storageUnitOfMeasure_id:t.ag_consumable.unitOfMeasure_id_storage,storageQty:this.calcStorageQty(t)};t.growPhaseConsumable_id&&(n.id=t.growPhaseConsumable_id),f["a"].patch("ag_growPhaseConsumables",r.getUser.apitoken,n).then((function(t){var n=g(t,2),i=n[0];n[1];i?(r.isLoading=!1,p["a"].success("Record updated"),r.addNew=!1,e.growPhaseConsumable_id=i.id,e.consumableCalculationType=r.calculationTypes.find((function(t){return t.id==i.ag_consumableCalculationType_id})),r.$emit("on-refresh")):p["a"].error("Error - "+i[1].message)}))}else t.consumableCalculationType=this.calculationTypes.find((function(e){return e.id===t.consumableCalculationType.id})),this.$emit("input",r.createList())}else p["a"].error("Invalid input."),this.refresh()},saveAllRecs:function(t,e,r){var n=this.createList();n.length>0&&this.postBatch(n)},createList:function(){var t=this,e=[];return this.items.length&&this.items.forEach((function(r){r.qty&&e.push({label:r.label,ag_consumableCalculationType_id:r.consumableCalculationType.id,ag_consumable_id:r.consumable_id,ag_facilityConsumable_id:r.id,qty:r.qty,consumable:r.ag_consumable,consumableCalculationType:r.consumableCalculationType,unitOfMeasure_id:r.unitOfMeasure.id,storageUnitOfMeasure_id:r.ag_consumable.unitOfMeasure_id_storage,storageQty:t.calcStorageQty(r)})})),e},postBatch:function(t){var e=this;f["a"].post("ag_growPhaseConsumables",e.getUser.apitoken,t).then((function(t){1==t.length?(e.refresh(),p["a"].success("Records added"),e.addNew=!1):p["a"].error("Error - "+t[1].message)}))}},watch:{}},j=T,E=(r("9170"),r("2877")),I=Object(E["a"])(j,d,h,!1,null,null,null);e["a"]=I.exports},b3c5:function(t,e,r){"use strict";var n=r("169a"),i=function(){var t=this,e=t._self._c;return t.showEditPhaseModal?e(n["a"],{attrs:{scrollable:!0,width:"80%","max-width":"825",persistent:""},model:{value:t.showEditPhaseModal,callback:function(e){t.showEditPhaseModal=e},expression:"showEditPhaseModal"}},[e("edit-phase",{attrs:{isViewing:t.isViewing,growplan:t.growplan,"controller-id":t.controllerId},on:{"create-task":t.onEditTask,"edit-task":t.onEditTask,"reload-data":t.onReloadData,close:t.onClose},model:{value:t.phase,callback:function(e){t.phase=e},expression:"phase"}})],1):t._e()},a=[],o=r("d0eb"),s=r("c1df"),l=r.n(s),c=r("d67f"),u=r("2f62"),d=r("4766"),h=r("372a");function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){return b(t)||g(t,e)||v(t,e)||m()}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function b(t){if(Array.isArray(t))return t}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t,e,r){return(e=_(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t){var e=C(t,"string");return"symbol"==f(e)?e:e+""}function C(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var O={name:"EditPhaseModal",props:["value","controllerId"],mixins:[h["a"]],components:{EditPhase:d["a"]},beforeMount:function(){},mounted:function(){},data:function(){return{showEditPhaseModal:!1,phase:null,isViewing:!1,growplan:null}},computed:x({},Object(u["c"])(["getUser"])),watch:{value:function(t,e){this.refresh(t)}},methods:{onEditTask:function(){},onClose:function(){this.showEditPhaseModal=!1,this.$emit("input",null)},onReloadData:function(){this.showEditPhaseModal=!1,this.$emit("input",null),this.$emit("refresh")},refresh:function(t){if(t){var e=this;this.getGrowPhases(this.getUser.apitoken,{id:t},(function(t){var r=p(t,2),n=r[0],i=(r[1],n[0]);if(i.appliedExceptionHandler)c["a"].error("Appled lifecycle remediations may not be edited.");else{i.growPhase_id=i.id;var a=l()(i.photoperiodStarttime,"HHmm");a.add(e.getUser.facility_UTCOffset,"hours"),i.photoperiodStarttime=a.format("HHmm"),i.growTasks=i.ag_growTasks,i.photoperiod={photoperiod:i.photoperiod,photoperiodStarttime:i.photoperiodStarttime},i.phaseDuration=i.endSeconds-i.startSeconds,e.phase=i,e.showEditPhaseModal=!0,o["a"].get("ag_growplans/"+e.phase.growplan_id,e.getUser.apitoken).then((function(t){var r=p(t,2),n=r[0];r[1];e.growplan=n,e.isViewing=1===e.growplan.growPlanType_id}))}}))}}}},P=O,D=r("2877"),k=Object(D["a"])(P,i,a,!1,null,null,null);e["a"]=k.exports},b3f4:function(t,e,r){"use strict";r("63f9")},b4e3:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("8fea"),l=r("132d"),c=r("0fd9"),u=r("2fa4"),d=function(){var t=this,e=t._self._c;return e(i["a"],{staticStyle:{height:"700px"},attrs:{id:"controlLoopVisualization"}},[e(a["d"],[e("h2",[t._v("\n      "+t._s(t.title)+" on "+t._s(t.platformGroupName)+" at\n      "),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.timestamp))}})]),e(u["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],[e(c["a"],{attrs:{"no-gutters":""}},[e(o["a"],{staticClass:"container--fluid",staticStyle:{"margin-right":"10px"}},[e("div",{staticClass:"d-flex flex-column",staticStyle:{width:"800px",height:"300px"}},[e("div",{attrs:{id:"fsadisplay"},domProps:{innerHTML:t._s(t.svg)}})]),e("div",{staticClass:"d-flex flex-column",staticStyle:{width:"800px"}},[e(s["a"],{staticStyle:{border:"1px solid silver"},attrs:{headers:t.ruleHeaders,items:t.rules,"hide-default-footer":"","fixed-header":"",options:t.pagination,height:"275"},scopedSlots:t._u([{key:"item.id",fn:function(r){return[e("span",{class:[r.item.isActive?"changed":""]},[t._v(t._s(r.item.id))])]}},{key:"item.transition",fn:function(r){return[e("div",{staticStyle:{"white-space":"nowrap"}},[e("span",{class:[r.item.isActive?"changed":""]},[t._v(t._s(r.item.transition))])])]}},{key:"item.text",fn:function(r){return[e("span",{class:[r.item.isActive?"changed":""]},[t._v(t._s(r.item.text))])]}}])})],1)]),e(o["a"],[e("div",{staticClass:"sectionheader"},[t._v("Environment")]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("Temp")]),e("span",[t._v(t._s(t.calculateTemperatureDisplay(t.value.environment.temp)))])]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("Humidity")]),e("span",[t._v(t._s(t.value.environment.hum)+"%")])]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("\n            CO\n            "),e("sub",[t._v("2")])]),e("span",[t._v(t._s(t.value.environment.co2)+" ppm")])]),e("br"),e("div",{staticClass:"sectionheader"},[t._v("Grow Plan")]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("Min Temp")]),e("span",[t._v(t._s(t.calculateTemperatureDisplay(t.value.growplan.minTemp)))])]),t.value.growplan.targetTemp?e("div",{staticClass:"clvInfo"},[e("label",[t._v("Target")]),e("span",[t._v(t._s(t.calculateTemperatureDisplay(t.value.growplan.targetTemp)))])]):t._e(),e("div",{staticClass:"clvInfo",staticStyle:{"margin-bottom":"10px"}},[e("label",[t._v("Max Temp")]),e("span",[t._v(t._s(t.calculateTemperatureDisplay(t.value.growplan.maxTemp)))])]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("Min Hum")]),e("span",[t._v(t._s(t.value.growplan.minHum)+" %")])]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("Target")]),e("span",[t._v(t._s(t.value.growplan.targetHum)+" %")])]),e("div",{staticClass:"clvInfo",staticStyle:{"margin-bottom":"10px"}},[e("label",[t._v("Max Hum")]),e("span",[t._v(t._s(t.value.growplan.maxHum)+" %")])]),e("div",{staticClass:"clvInfo"},[e("label",[t._v(" Min CO"),e("sub",[t._v("2")])]),e("span",[t._v(t._s(t.value.growplan.minCo2)+" ppm")])]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("Target")]),e("span",[t._v(t._s(t.value.growplan.co2Target)+" ppm")])]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("Max CO"),e("sub",[t._v("2")])]),e("span",[t._v(t._s(t.value.growplan.maxCo2)+" ppm")])]),e("br"),e("div",{staticClass:"sectionheader"},[t._v("States")]),e("div",{staticClass:"clvInfo pb-2"},[e("label",[t._v("Previous")]),e("br"),e("span",[t._v(t._s(t.value.environment.ecuState.previous))])]),e("div",{staticClass:"clvInfo pb-2"},[e("label",[t._v("Current")]),e("br"),e("span",[t._v(t._s(t.value.environment.ecuState.current))])]),e("div",{staticClass:"clvInfo"},[e("label",[t._v("Rack State")]),e("br"),e("span",[t._v(t._s(t.value.environment.vfuState))])])])],1)],1)],1)},h=[],f=r("d0eb"),p=(r("c1df"),r("d67f"),r("2f62")),m=r("a9b3"),v=r("6ce0"),y=r("1d93");function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function b(t,e){return C(t)||_(t,e)||x(t,e)||w()}function w(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){if(t){if("string"==typeof t)return S(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function C(t){if(Array.isArray(t))return t}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return(e=k(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k(t){var e=T(t,"string");return"symbol"==g(e)?e:e+""}function T(t,e){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var j={name:"DisplayFsaDecisionDetails",props:["ag_controlLoopDiagramType_id","ag_controlLoopDiagram_version","ruleNumber","message","value","timestamp","platformGroupName"],mixins:[m["a"],v["a"],y["a"]],components:{},mounted:function(){},data:function(){return{rules:[],title:"",ag_controlLoopDiagramType_label:null,pagination:{itemsPerPage:-1,sortBy:["id"]},version:null,unitName:null,image:null,top:0,left:0,width:0,height:0,svg:null,ruleHeaders:[{text:"#",value:"id",sortable:!1,width:50},{text:"Transition",sortable:!0,value:"transition"},{text:"Rule",value:"text",sortable:!1}]}},computed:P(P({},Object(p["c"])(["getUser"])),{},{positioning:function(){var t="top: ".concat(this.top,"px; left: ").concat(this.left,"px; width: ").concat(this.width,"px; height: ").concat(this.height,"px");return t}}),watch:{ag_controlLoopDiagramType_id:function(){this.refresh()},ag_controlLoopDiagram_version:function(){this.refresh()},"value.stateMachine":function(){this.refresh()},"value.id":function(){this.refresh()}},beforeMount:function(){this.refresh()},methods:{onClose:function(){this.image=null,this.$emit("close")},refresh:function(){var t=this;f["a"].get("VirtualDeviceTypeFsas/get",this.getUser.apitoken,{id:this.value.id}).then((function(e){var r=b(e,2),n=r[0],i=(r[1],JSON.parse(n.jsonRepresentation));t.title=n.label+" (v. "+n.versionNumber+")",t.onJsonChange(i,t.value.currentState,(function(e,r){for(var n=0;n<r.length;n++)r[n].isActive=r[n].id==t.value.ruleNumber;t.rules=r,t.svg=e}))}))}}},E=j,I=(r("e4b4"),r("2877")),L=Object(I["a"])(E,d,h,!1,null,null,null);e["a"]=L.exports},b574:function(t,e,r){"use strict";var n=r("62ad"),i=r("132d"),a=r("0fd9"),o=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{height:"100%",overflow:"auto"}},[t.smallDisplay?e("div",{staticClass:"env-gauges-icons-small"},[e("device-status-icons",{attrs:{iconSize:t.iconSize,item:t.device,facility:t.facility},on:{"batch-action":function(e){t.emitAction("batch-action",e)},"intensity-action":function(e){t.emitAction("intensity-action",e)},"dehumidifier2-action":function(e){t.emitAction("dehumidifier2-action",e)},"curtains-action":function(e){t.emitAction("curtains-action",e)},"ecu-action":function(e){t.emitAction("ecu-action",e)}}})],1):t._e(),e("div",{staticClass:"env-gauges-header"},[t.lifecyclePhase?e("h3",{staticClass:"text-center"},[t._v("\n      "+t._s(t.lifecyclePhase.strainName)+" :: "+t._s(t.lifecyclePhase.growplanName)+" ::\n      "+t._s(t.lifecyclePhase.currentPhase.growPhaseName)+"\n    ")]):e("div",[e("h3",{staticClass:"text-center pt-4"},[t._v("No Lifecycles Present")])]),e("div",{staticClass:"text-center",staticStyle:{padding:"5px"}},[t.smallDisplay?t._e():e("device-status-icons",{attrs:{iconSize:t.iconSize,item:t.device,facility:t.facility},on:{"batch-action":function(e){t.emitAction("batch-action",e)},"intensity-action":function(e){t.emitAction("intensity-action",e)},"dehumidifier2-action":function(e){t.emitAction("dehumidifier2-action",e)},"curtains-action":function(e){t.emitAction("curtains-action",e)},"ecu-action":function(e){t.emitAction("ecu-action",e)}}})],1)]),t.lifecyclePhase?e(a["a"],{staticClass:"justify-center pt-2",attrs:{"no-gutters":""}},[e(n["a"],{attrs:{cols:t.vertical?6:4}},[e("highcharts",{attrs:{options:t.temperatureChart}}),e("div",{staticClass:"text-center"},[e(i["a"],{directives:[{name:"show",rawName:"v-show",value:t.tempChange>0,expression:"tempChange > 0"}]},[t._v("trending_up")]),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:t.tempChange<0,expression:"tempChange < 0"}]},[t._v("trending_down")]),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:0==t.tempChange,expression:"tempChange == 0"}]},[t._v("trending_flat")]),e("br"),e("span",{directives:[{name:"show",rawName:"v-show",value:0!=t.tempChange,expression:"tempChange != 0"}]},[t._v("\n          "+t._s(t.tempChange)+" "),e("span",{directives:[{name:"show",rawName:"v-show",value:t.isMetric,expression:"isMetric"}]},[t._v("C")]),e("span",{directives:[{name:"show",rawName:"v-show",value:!t.isMetric,expression:"!isMetric"}]},[t._v("F")])])],1),e("div",{staticClass:"text-center"},[t._v(t._s(t.tempReceived))])],1),e(n["a"],{attrs:{cols:t.vertical?6:4}},[e("highcharts",{attrs:{options:t.humidityChart}}),e("div",{staticClass:"text-center"},[e(i["a"],{directives:[{name:"show",rawName:"v-show",value:t.rhChange>0,expression:"rhChange > 0"}]},[t._v("trending_up")]),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:t.rhChange<0,expression:"rhChange < 0"}]},[t._v("trending_down")]),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:0==t.rhChange,expression:"rhChange == 0"}]},[t._v("trending_flat")]),e("br"),e("span",{directives:[{name:"show",rawName:"v-show",value:0!=t.rhChange,expression:"rhChange != 0"}]},[t._v(t._s(t.rhChange)+" %")])],1),e("div",{staticClass:"text-center"},[t._v(t._s(t.rhReceived))])],1),e(n["a"],{attrs:{cols:t.vertical?6:4}},[e("highcharts",{attrs:{options:t.co2Chart}}),e("div",{staticClass:"text-center"},[e(i["a"],{directives:[{name:"show",rawName:"v-show",value:t.co2Change>0,expression:"co2Change > 0"}]},[t._v("trending_up")]),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:t.co2Change<0,expression:"co2Change < 0"}]},[t._v("trending_down")]),e(i["a"],{directives:[{name:"show",rawName:"v-show",value:0==t.co2Change,expression:"co2Change == 0"}]},[t._v("trending_flat")]),e("br"),e("span",{directives:[{name:"show",rawName:"v-show",value:0!=t.co2Change,expression:"co2Change != 0"}]},[t._v(t._s(t.co2Change)+" ppm")]),e("div",{staticClass:"text-center"},[t._v(t._s(t.co2Received))])],1)],1)],1):t._e()],1)},s=[],l=r("d0eb"),c=r("c1df"),u=r.n(c),d=r("2f62"),h=r("4452"),f=r("c242"),p=r.n(f),m=r("12a1"),v=r("ea7f"),y=r.n(v),g=r("2c0d");function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){return O(t)||C(t,e)||S(t,e)||x()}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function O(t){if(Array.isArray(t))return t}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=j(t,"string");return"symbol"==b(e)?e:e+""}function j(t,e){if("object"!=b(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var E={name:"environment-gauges",props:["facility","device","controller_id","platformGroup_id","lifecyclePhase","lastEventReceived","vertical","smallDisplay","iconSize"],components:{highcharts:h["Chart"],DeviceStatusIcons:g["a"]},beforeMount:function(){this.isMetric=l["a"].displayMetric(this.getUser),"dark"===this.userData.theme&&p()(y.a),this.vertical&&(this.defaultSettings.chart.height=220,this.defaultSettings.pane.startAngle=-90,this.defaultSettings.pane.endAngle=90),this.refresh()},mounted:function(){},data:function(){return{tempChange:0,rhChange:0,co2Change:0,isMetric:!1,tempReceived:"",co2Received:"",rhReceived:"",lastTemp:0,lastRh:0,lastCo2:0,temperatureChart:null,co2Chart:null,humidityChart:null,currentEnvironmentSettings:null,currentDailyCycle:"Lights On",defaultSettings:{exporting:{enabled:!1},credits:{enabled:!1},chart:{type:"gauge",plotBackgroundColor:null,plotBackgroundImage:null,plotBorderWidth:0,plotShadow:!1,height:"100%"},title:{text:"Temperature",style:{fontSize:".875rem",font:"Source Sans Pro",fontWeight:"bold"}},pane:{startAngle:-150,endAngle:150,background:[{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#FFF"],[1,"#333"]]},borderWidth:0,outerRadius:"109%"},{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#333"],[1,"#FFF"]]},borderWidth:1,outerRadius:"107%"},{},{backgroundColor:"#DDD",borderWidth:0,outerRadius:"105%",innerRadius:"103%"}]},yAxis:{min:0,max:200,minorTickInterval:"auto",minorTickWidth:1,minorTickLength:10,minorTickPosition:"inside",minorTickColor:"#666",tickPixelInterval:30,tickWidth:2,tickPosition:"inside",tickLength:10,tickColor:"#666",labels:{step:2,rotation:"auto"},title:{text:"km/h"},plotBands:[]},series:[{name:"Speed",data:[80],tooltip:{valueSuffix:" km/h"}}]}}},computed:D({},Object(d["c"])(["getUser","userData"])),watch:{lastEventReceived:function(t,e){if("Sensor"==t.deviceType&&t.controllerId==this.controller_id){var r=0;switch(t.sensorType){case"temperature":r=parseFloat(t.reading),this.lastTemp=this.temperatureChart.series[0].data[0],this.isMetric||(r=Object(m["toFahrenheit"])(r)),this.temperatureChart.series[0].data=[r],this.tempChange=r-this.lastTemp,this.tempReceived=u()().format("h:mm a"),r>this.temperatureChart.yAxis.max&&(this.temperatureChart.yAxis.max=r,this.temperatureChart.yAxis.plotBands[4].to=r);break;case"humidity":r=100*parseFloat(t.reading),this.lastRh=this.humidityChart.series[0].data[0],this.humidityChart.series[0].data=[r],r>this.humidityChart.yAxis.max&&(this.humidityChart.yAxis.max=r,this.humidityChart.yAxis.plotBands[4].to=r),this.rhChange=100*parseFloat(t.reading)-this.lastRh,this.rhReceived=u()().format("h:mm a");break;case"co2":r=parseInt(t.reading),this.lastCo2=this.co2Chart.series[0].data[0],this.co2Chart.series[0].data=[r],r>this.co2Chart.yAxis.max&&(this.co2Chart.yAxis.max=r,this.humidityChart.yAxis.plotBands[4].to=r),this.co2Change=parseInt(t.reading)-this.lastCo2,this.co2Received=u()().format("h:mm a");break}}}},methods:{emitAction:function(t,e){this.$emit("emit-action",t,e)},configureTemperatureChart:function(){var t=JSON.parse(JSON.stringify(this.defaultSettings)),e=this.currentEnvironmentSettings.temp;l["a"].displayMetric(this.getUser)?(t.yAxis.plotBands[0]={from:e.warnMin-5,to:e.warnMin,color:"#DF5353"},t.yAxis.plotBands[1]={from:e.warnMin,to:e.min,color:"#DDDF0D"},t.yAxis.plotBands[2]={from:e.min,to:e.max,color:"#55BF3B"},t.yAxis.plotBands[3]={from:e.max,to:e.warnMax,color:"#DDDF0D"},t.yAxis.plotBands[4]={from:e.warnMax,to:e.warnMax+5,color:"#DF5353"},t.yAxis.title.text="Celsius",t.yAxis.min=e.warnMin-5,t.yAxis.max=e.warnMax+5,t.series[0].name="Temperature",t.series[0].data=[e.setpoint],t.series[0].tooltip.valueSuffix="Celsius"):(t.yAxis.plotBands[0]={from:Object(m["toFahrenheit"])(e.warnMin-5),to:Object(m["toFahrenheit"])(e.warnMin),color:"#DF5353"},t.yAxis.plotBands[1]={from:Object(m["toFahrenheit"])(e.warnMin),to:Object(m["toFahrenheit"])(e.min),color:"#DDDF0D"},t.yAxis.plotBands[2]={from:Object(m["toFahrenheit"])(e.min),to:Object(m["toFahrenheit"])(e.max),color:"#55BF3B"},t.yAxis.plotBands[3]={from:Object(m["toFahrenheit"])(e.max),to:Object(m["toFahrenheit"])(e.warnMax),color:"#DDDF0D"},t.yAxis.plotBands[4]={from:Object(m["toFahrenheit"])(e.warnMax),to:Object(m["toFahrenheit"])(e.warnMax+5),color:"#DF5353"},t.yAxis.title.text="°F",t.yAxis.min=Object(m["toFahrenheit"])(e.warnMin-5),t.yAxis.max=Object(m["toFahrenheit"])(e.warnMax+5),t.series[0].name="Temperature",t.series[0].data=[Object(m["toFahrenheit"])(e.setpoint)],t.series[0].tooltip.valueSuffix="F"),this.temperatureChart=t},configureHumidityChart:function(){var t=JSON.parse(JSON.stringify(this.defaultSettings)),e=this.currentEnvironmentSettings.humidity;t.yAxis.plotBands[0]={from:e.warnMin-10,to:e.warnMin,color:"#DF5353"},t.yAxis.plotBands[1]={from:e.warnMin,to:e.min,color:"#DDDF0D"},t.yAxis.plotBands[2]={from:e.min,to:e.max,color:"#55BF3B"},t.yAxis.plotBands[3]={from:e.max,to:e.warnMax,color:"#DDDF0D"},t.yAxis.plotBands[4]={from:e.warnMax,to:e.warnMax+10,color:"#DF5353"},t.yAxis.title.text="%",t.yAxis.min=e.warnMin-5,t.yAxis.max=e.warnMax+5,t.series[0].name="Humidity",t.series[0].data=[e.setpoint],t.series[0].tooltip.valueSuffix="% RH",t.title.text="Humidity",this.humidityChart=t},configureCo2Chart:function(){var t=JSON.parse(JSON.stringify(this.defaultSettings)),e=this.currentEnvironmentSettings.co2;t.yAxis.plotBands[0]={from:0,to:e.warnMin,color:"#DF5353"},t.yAxis.plotBands[1]={from:e.warnMin,to:e.min,color:"#DDDF0D"},t.yAxis.plotBands[2]={from:e.min,to:e.max,color:"#55BF3B"},t.yAxis.plotBands[3]={from:e.max,to:e.warnMax,color:"#DDDF0D"},t.yAxis.plotBands[4]={from:e.warnMax,to:5e3,color:"#DF5353"},t.yAxis.title.text="ppm",e.warnMin-500>0?t.yAxis.min=e.warnMin-500:t.yAxis.min=0,t.yAxis.max=e.warnMax+500,t.series[0].name="CO2",t.series[0].data=[e.setpoint],t.series[0].tooltip.valueSuffix="ppm",t.title.text="CO<sub>2</sub>",this.co2Chart=t},setEnvironmentSettings:function(){for(var t=0;t<this.lifecyclePhase.currentPhase.environments.length;t++){var e=this.lifecyclePhase.currentPhase.environments[t];if(e.lightState==this.currentDailyCycle){this.currentEnvironmentSettings=e;break}}this.currentEnvironmentSettings||(this.currentEnvironmentSettings=this.lifecyclePhase.currentPhase.environments[0])},determinePhaseOfDay:function(){var t=this.lifecyclePhase.currentPhase;if(24==t.photoperiod)this.currentDailyCycle="Lights On";else{var e=u.a.utc(u()().format("YYYY-MM-DD")),r=parseInt(t.photoperiodStartTime.substring(0,2)),n=parseInt(t.photoperiodStartTime.substring(2,4));e.hour(r),e.minute(n);var i=e.clone().add("hours",t.photoperiod);u.a.utc().isBetween(e,i)?this.currentDailyCycle="Lights On":this.currentDailyCycle="Lights Off"}},getCurrentSensorReadings:function(){var t=this;l["a"].get("controllerSensors",this.getUser.apitoken,{filter:{where:{controller_id:this.controller_id}}}).then((function(e){for(var r=w(e,2),n=r[0],i=(r[1],0);i<n.length;i++){var a=u.a.utc(n[i].lastUpdate),o=u.a.utc(),s=o.diff(a,"minutes"),c=0;switch(n[i].sensorType){case"temperature":c=parseFloat(n[i].reading),s<16?(l["a"].displayMetric(t.getUser)||(c=Object(m["toFahrenheit"])(n[i].reading)),t.temperatureChart.series[0].data=[c],c>t.temperatureChart.yAxis.max&&(t.temperatureChart.yAxis.max=c,t.temperatureChart.yAxis.plotBands[4].to=c)):t.temperatureChart.series[0].data=null,t.tempReceived=a.local().format("h:mm a");break;case"humidity":c=parseFloat(Math.round(100*parseFloat(n[i].reading))),t.humidityChart.series[0].data=[c],t.rhReceived=a.local().format("h:mm a"),c>t.humidityChart.yAxis.max&&(t.humidityChart.yAxis.max=c,t.humidityChart.yAxis.plotBands[4].to=c);break;case"co2":c=parseInt(n[i].reading),t.co2Chart.series[0].data=[c],c>t.co2Chart.yAxis.max&&(t.co2Chart.yAxis.max=c,t.co2Chart.yAxis.plotBands[4].to=c),c<t.co2Chart.yAxis.min&&(t.co2Chart.yAxis.min=c-50,t.co2Chart.yAxis.min<0&&(t.co2Chart.yAxis.min=0)),t.co2Received=a.local().format("h:mm a");break}}}))},refresh:function(){this.getCurrentSensorReadings(),this.determinePhaseOfDay(),this.setEnvironmentSettings(),this.configureTemperatureChart(),this.configureHumidityChart(),this.configureCo2Chart()}}},I=E,L=(r("e580"),r("2877")),A=Object(L["a"])(I,o,s,!1,null,"6f3107fb",null);e["a"]=A.exports},b647:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("ce7e"),s=r("132d"),l=r("2fa4"),c=r("7e85"),u=r("e516"),d=r("9c54"),h=r("56a4"),f=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{id:"growplanTaskEditor"}},[e(a["d"],[e("h2",{staticStyle:{"white-space":"nowrap",display:"inline-block",overflow:"hidden","text-overflow":"ellipsis",width:"calc(100% - 120px)"}},[t._v("\n      "+t._s(t.task&&t.task.id?"".concat(t.disabled?"":"Edit ","'").concat(t.task.growTaskName,"' Task"):"New Grow Task")+"\n    ")]),e(l["a"]),t.stepHelpTopicKey?e("help-button",{staticClass:"mr-2",attrs:{"help-topic-key":t.stepHelpTopicKey}}):t._e(),e(n["a"],{attrs:{icon:""},on:{click:t.onCancelBtnClick}},[e(s["a"],[t._v("close")])],1)],1),e(a["c"],{staticClass:"pt-1",attrs:{id:"create-growplan-modal-content"}},[e(c["a"],{model:{value:t.step,callback:function(e){t.step=e},expression:"step"}},[e(d["a"],[e(h["a"],{attrs:{editable:"",step:"1"}},[t._v("Attributes")]),e(o["a"]),e(h["a"],{attrs:{editable:"",step:"2"}},[t._v("Consumables")]),e(o["a"]),e(h["a"],{attrs:{editable:"",step:"3"}},[t._v("Notes")])],1),e(d["b"],[e(u["a"],{staticClass:"pt-1",attrs:{step:"1"}},[e("div",{staticStyle:{height:"calc(100% - 10px)"}},[e("task-attributes",{ref:"taskInfo",attrs:{disabled:t.disabled,phase:t.phase},on:{validated:t.attributesValidated},model:{value:t.task,callback:function(e){t.task=e},expression:"task"}})],1)]),e(u["a"],{staticClass:"pt-0",attrs:{step:"2"}},[e("div",{staticStyle:{height:"calc(100% - 10px)"}},[e("consumables-usage",{ref:"consumableModal",attrs:{phaseId:t.phase.id,taskId:t.task.id,mode:"task",readonly:t.disabled},model:{value:t.task.consumables,callback:function(e){t.$set(t.task,"consumables",e)},expression:"task.consumables"}})],1)]),e(u["a"],{attrs:{step:"3"}},[e("div",{staticClass:"h-100 px-3 overflow-auto"},[e("notes",{attrs:{disabled:t.disabled},model:{value:t.task,callback:function(e){t.task=e},expression:"task"}})],1)])],1)],1)],1),e(a["a"],[t.step>1?e(n["a"],{attrs:{color:"primary"},on:{left:!0,click:t.previousStep}},[t._v("Back")]):t._e(),e(l["a"]),t.step<3?e(n["a"],{attrs:{color:"primary",disabled:!t.allowNext},on:{right:!0,click:t.nextStep}},[t._v("Next")]):t._e(),t.disabled||3!=t.step?t._e():e(n["a"],{attrs:{color:"primary"},on:{click:t.onSaveTask}},[t._v(t._s("create"==isNaN(t.task.id)?"Create":"Save"))])],1)],1)},p=[],m=r("2f62"),v=r("d67f"),y=r("d0eb"),g=r("ac7c"),b=r("62ad"),w=r("4bd4"),x=r("604c"),S=r("0fd9"),_=r("b974"),C=r("8654"),O=function(){var t=this,e=t._self._c;return e(w["a"],{staticClass:"h-100 px-3 overflow-auto",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(C["a"],{attrs:{label:"Name",readonly:t.disabled,rules:[t.rules.requiredNoblanks],counter:"50"},model:{value:t.task.growTaskName,callback:function(e){t.$set(t.task,"growTaskName",e)},expression:"task.growTaskName"}}),e(_["a"],{attrs:{label:"Type of Operation (optional)",items:t.growTaskTypes,"item-value":"id","item-text":"label",readonly:t.disabled,clearable:""},model:{value:t.task.ag_growTaskType_id,callback:function(e){t.$set(t.task,"ag_growTaskType_id",e)},expression:"task.ag_growTaskType_id"}}),e(_["a"],{attrs:{label:"Standard Operating Procedure",items:t.trainingResources,"item-value":"id","item-text":"label",clearable:""},model:{value:t.task.TrainingResource_id,callback:function(e){t.$set(t.task,"TrainingResource_id",e)},expression:"task.TrainingResource_id"}}),e(S["a"],{attrs:{"no-gutters":""}},[e(b["a"],[e(_["a"],{attrs:{label:"Schedule Type",items:t.scheduleTypes,"item-value":"id","item-text":"name"},model:{value:t.task.frequencyType,callback:function(e){t.$set(t.task,"frequencyType",e)},expression:"task.frequencyType"}})],1),3!=t.task.frequencyType?e(b["a"],{staticClass:"pl-1",attrs:{md:"4"}},[0==t.task.frequencyType?e(g["a"],{attrs:{label:"Autocomplete"},model:{value:t.task.autocomplete,callback:function(e){t.$set(t.task,"autocomplete",e)},expression:"task.autocomplete"}}):t._e(),0!=t.task.frequencyType&&3!=t.task.frequencyType?e(C["a"],{attrs:{disabled:4!=t.task.frequencyType,type:"number",min:"1",max:"4",rules:[t.rules.gt0],label:"Time between cycles",suffix:"days"},model:{value:t.task.timeBetweenCycles,callback:function(e){t.$set(t.task,"timeBetweenCycles",e)},expression:"task.timeBetweenCycles"}}):t._e()],1):t._e()],1),e(S["a"],{attrs:{"no-gutters":""}},[e(b["a"],{attrs:{md:"3"}},[e(C["a"],{attrs:{type:"number",label:"Target Day",readonly:t.disabled,placeholder:t.targetDayPlaceholder,rules:[t.rules.requiredTargetDate]},model:{value:t.targetDay,callback:function(e){t.targetDay=e},expression:"targetDay"}})],1),e(b["a"],{staticClass:"pl-1"},[e(_["a"],{attrs:{label:"Role",items:t.rolesList,"item-text":"rolename","item-value":"id",readonly:t.disabled},model:{value:t.task.assignedToRole_id,callback:function(e){t.$set(t.task,"assignedToRole_id",e)},expression:"task.assignedToRole_id"}})],1),0==t.task.frequencyType&&t.task.ag_growTaskType_id?e(b["a"],{staticClass:"pl-1",attrs:{md:"4"}},[e(g["a"],{attrs:{label:"Transition Phase"},model:{value:t.task.startsLifecyclePhase,callback:function(e){t.$set(t.task,"startsLifecyclePhase",e)},expression:"task.startsLifecyclePhase"}})],1):t._e()],1),e(x["b"],[e("span",[t._v("Estimated Level of Effort")]),e(S["a"],{attrs:{"no-gutters":""}},[e(b["a"],{attrs:{md:"4"}},[e(C["a"],{attrs:{label:"hours",type:"number",readonly:t.disabled,rules:[t.rules.requiredHours]},model:{value:t.hours,callback:function(e){t.hours=e},expression:"hours"}})],1),e(b["a"],{staticClass:"pl-1",attrs:{md:"4"}},[e(C["a"],{attrs:{label:"mins",type:"number",readonly:t.disabled,rules:[t.rules.requiredMinutes]},model:{value:t.minutes,callback:function(e){t.minutes=e},expression:"minutes"}})],1),e(b["a"],{staticClass:"text-center pl-1",attrs:{md:"4"}},[e(g["a"],{attrs:{label:"Per Plant"},model:{value:t.task.timeEstimatePerPlant,callback:function(e){t.$set(t.task,"timeEstimatePerPlant",e)},expression:"task.timeEstimatePerPlant"}})],1)],1)],1)],1)},P=[],D=r("38e4"),k=r("dd20");function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function j(t,e){return M(t)||A(t,e)||I(t,e)||E()}function E(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(t,e){if(t){if("string"==typeof t)return L(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(t,e):void 0}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function A(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function M(t){if(Array.isArray(t))return t}function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function N(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(Object(r),!0).forEach((function(e){F(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function F(t,e,r){return(e=G(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t){var e=R(t,"string");return"symbol"==T(e)?e:e+""}function R(t,e){if("object"!=T(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var $={name:"task-attributes",props:["value","disabled","phase"],data:function(){var t=this;return{scheduleTypes:[{id:0,name:"One Time"},{id:1,name:"Daily"},{id:2,name:"Weekly"},{id:3,name:"Monthly"},{id:4,name:"Other"}],task:{},rolesList:[],growTaskTypes:[],targetDay:0,targetDayObj:{days:0,residueSeconds:0},valid:!1,beginTime:"00:00",selectedRole:1,hours:0,minutes:30,rules:{requiredNoblanks:function(t){return!!t&&null!=t.match(/^(?!\s*$).+/g)||"Required."},gt0:function(t){return parseInt(t)>0||"Greater than 0"},requiredTargetDate:function(e){return!isNaN(parseInt(e))&&Number(e)>0&&Number(e)>=Number(Object(D["e"])(t.phase.startSeconds))&&Number(e)<=Number(Object(D["e"])(t.phase.endSeconds))||"Invalid input."},requiredHours:function(t){return!isNaN(parseInt(t))&&Number(t)>=0&&Number(t)<=23||"Invalid input."},requiredMinutes:function(t){return!isNaN(parseInt(t))&&Number(t)>=0&&Number(t)<=59||"Invalid input."}},trainingResources:[]}},beforeMount:function(){this.refresh(),this.init()},computed:N(N({},Object(m["c"])(["getUser"])),{},{targetDayPlaceholder:function(){return this.phase?"".concat(Object(D["e"])(this.phase.startSeconds)+1," - ").concat(Object(D["e"])(this.phase.endSeconds)):""}}),methods:{init:function(){var t=this,e=this;y["a"].get("ag_roles",this.getUser.apitoken,{filter:{order:"rolename"}}).then((function(t){var r=j(t,2),n=r[0];r[1];e.rolesList=n})),y["a"].get("vTrainingResources",this.getUser.apitoken,{filter:{order:"label ASC",where:{or:[{facility_id:e.getUser.facility_id},{systemResource:!0}],trainingResourceType_id:5,isTrimaster:y["a"].isCannabisFacility(),isResearch:!1}}}).then((function(e){var r=j(e,2),n=r[0];r[1];t.trainingResources=n}));var r={endtime:null};y["a"].isCannabisFacility()?r.isCannabis=!0:y["a"].isLeafyGreensFacility()?r.isLeafyGreensFacility=!0:y["a"].isHempFacility()&&(r.isHemp=!0),y["a"].get("ag_growTaskTypes",this.getUser.apitoken,{filter:{order:"sortOrder",where:r}}).then((function(t){var r=j(t,2),n=r[0];r[1];e.growTaskTypes=n}))},onOperationTypeChange:function(t,e){for(var r=0;r<this.growTaskTypes.length;r++)if(this.growTaskTypes[r].id==t){this.task.growTaskName=this.growTaskTypes[r].label;break}},refresh:function(){this.task=N({},this.value),this.targetDayObj=Object(D["f"])(this.task.startSeconds),this.targetDay=this.targetDayObj.days+1,this.beginTime=this.task.beginTime,this.minutes=Math.floor(this.task.timeEstimateSeconds%3600/60),this.hours=Math.floor(this.task.timeEstimateSeconds/3600)}},watch:{valid:function(t){this.$emit("validated",t)},"task.frequencyType":function(t){switch(t){case 1:this.task.timeBetweenCycles=1;break;case 2:this.task.timeBetweenCycles=7;break;case 3:this.task.timeBetweenCycles=30;break;case 4:break;case 0:this.task.timeBetweenCycles=0}this.$emit("input",this.task)},value:function(t){this.refresh()},"task.growTaskName":function(t){this.$emit("input",this.task)},"task.timeBetweenCycles":function(t){this.$emit("input",this.task)},"task.ag_growTaskType_id":function(t){if(t){var e=this.growTaskTypes.find((function(e){return e.id===t}));!this.task.TrainingResource_id&&e&&(this.task.TrainingResource_id=e.TrainingResource_id)}this.$emit("input",this.task)},"task.timeEstimatePerPlant":function(t){this.$emit("input",this.task)},"task.autocomplete":function(t){this.$emit("input",this.task)},"task.startsLifecyclePhase":function(t){this.$emit("input",this.task)},"task.assignedToRole_id":function(t){this.$emit("input",this.task)},"task.TrainingResource_id":function(t){var e=this;if(!t&&this.task.ag_growTaskType_id){var r=this.growTaskTypes.find((function(t){return t.id===e.task.ag_growTaskType_id}));r&&(this.task.TrainingResource_id=r.TrainingResource_id)}this.$emit("input",this.task)},targetDay:function(t){""!==t&&(this.targetDayObj.days=t,this.task.startSeconds=Object(D["b"])(this.targetDayObj.days-1)+this.targetDayObj.residueSeconds,this.$emit("input",this.task))},beginTime:function(t){this.task.beginTime=this.beginTime,this.$emit("input",this.task)},hours:function(t){this.task.timeEstimateSeconds=3600*t+60*this.minutes,this.$emit("input",this.task)},minutes:function(t){this.task.timeEstimateSeconds=3600*this.hours+60*t,this.$emit("input",this.task)}},components:{VuetifyTimepicker:k["a"]}},H=$,V=r("2877"),B=Object(V["a"])(H,O,P,!1,null,null,null),z=B.exports,Y=r("a844"),q=function(){var t=this,e=t._self._c;return e("div",{staticClass:"pt-1"},[e(Y["a"],{attrs:{label:"Notes",counter:"250",outlined:"",height:"290",readonly:t.disabled},model:{value:t.task.notes,callback:function(e){t.$set(t.task,"notes",e)},expression:"task.notes"}})],1)},W=[];function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function Z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function X(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(r),!0).forEach((function(e){K(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function K(t,e,r){return(e=Q(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t){var e=tt(t,"string");return"symbol"==J(e)?e:e+""}function tt(t,e){if("object"!=J(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var et={name:"notes",props:["value","disabled"],data:function(){return{task:{}}},beforeMount:function(){this.refresh()},methods:{refresh:function(){this.task=X({},this.value)}},watch:{value:function(t){this.refresh()},"task.notes":function(){this.$emit("input",this.task)}}},rt=et,nt=Object(V["a"])(rt,q,W,!1,null,null,null),it=nt.exports,at=r("b2ba"),ot=r("7ce3");function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function lt(t,e){return ft(t)||ht(t,e)||ut(t,e)||ct()}function ct(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ut(t,e){if(t){if("string"==typeof t)return dt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dt(t,e):void 0}}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ht(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function ft(t){if(Array.isArray(t))return t}function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(r),!0).forEach((function(e){vt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function vt(t,e,r){return(e=yt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yt(t){var e=gt(t,"string");return"symbol"==st(e)?e:e+""}function gt(t,e){if("object"!=st(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var bt={name:"grow-task-modal",props:["value","phase","disabled","reload-data","mode"],data:function(){return{task:{},step:1,taskConsumables:[],stepHelpTopicKey:null,attributesAreValid:!1}},beforeMount:function(){this.step=1,this.task=mt({},this.value)},mounted:function(){},computed:mt(mt({},Object(m["c"])(["getUser"])),{},{allowNext:function(){return 1===this.step&&this.attributesAreValid||1!==this.step}}),methods:{attributesValidated:function(t){this.attributesAreValid=t},previousStep:function(){this.step>1&&this.step--},nextStep:function(){this.step<3&&this.step++},onCancelBtnClick:function(){this.$emit("close")},onSaveTask:function(){if(this.$refs.taskInfo.valid)if(this.phase.growPhase_id&&"deferredsave"!=this.mode){var t=this;t.task.growPhase_id=t.phase.growPhase_id,y["a"].upsert("ag_growTasks",t.getUser.apitoken,t.task).then((function(e){var r=lt(e,1),n=r[0];t.task.id=n.id,t.$refs.consumableModal.saveAllRecs(t.taskConsumables,n.growPhase_id,n.id),v["a"].success("Task updated"),t.$emit("reload-data",t.task)}))}else this.$emit("input",this.task),this.$emit("save",this.task);else v["a"].error("The grow task is invalid")}},watch:{value:function(t){this.step=1,this.task=mt({},t)},step:function(t){switch(t){case 2:this.stepHelpTopicKey="cultivation-grow-plans-phases-tasks-consumables";break;default:this.stepHelpTopicKey=null;break}}},components:{HelpButton:ot["a"],TaskAttributes:z,Notes:it,ConsumablesUsage:at["a"]}},wt=bt,xt=(r("53da"),Object(V["a"])(wt,f,p,!1,null,null,null));e["a"]=xt.exports},b6cc:function(t,e,r){"use strict";r("4b2e")},b73d:function(t,e,r){"use strict";r("ec29"),r("9d01");var n=r("fe09"),i=r("c37a"),a=r("c3f0"),o=r("0789"),s=r("490a"),l=r("80d2");e["a"]=n["a"].extend({name:"v-switch",directives:{Touch:a["a"]},props:{inset:Boolean,loading:{type:[Boolean,String],default:!1},flat:{type:Boolean,default:!1}},computed:{classes(){return{...i["a"].options.computed.classes.call(this),"v-input--selection-controls v-input--switch":!0,"v-input--switch--flat":this.flat,"v-input--switch--inset":this.inset}},attrs(){return{"aria-checked":String(this.isActive),"aria-disabled":String(this.isDisabled),role:"switch"}},validationState(){return this.hasError&&this.shouldValidate?"error":this.hasSuccess?"success":null!==this.hasColor?this.computedColor:void 0},switchData(){return this.setTextColor(this.loading?void 0:this.validationState,{class:this.themeClasses})}},methods:{genDefaultSlot(){return[this.genSwitch(),this.genLabel()]},genSwitch(){const{title:t,...e}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.genInput("checkbox",{...this.attrs,...e}),this.genRipple(this.setTextColor(this.validationState,{directives:[{name:"touch",value:{left:this.onSwipeLeft,right:this.onSwipeRight}}]})),this.$createElement("div",{staticClass:"v-input--switch__track",...this.switchData}),this.$createElement("div",{staticClass:"v-input--switch__thumb",...this.switchData},[this.genProgress()])])},genProgress(){return this.$createElement(o["c"],{},[!1===this.loading?null:this.$slots.progress||this.$createElement(s["a"],{props:{color:!0===this.loading||""===this.loading?this.color||"primary":this.loading,size:16,width:2,indeterminate:!0}})])},onSwipeLeft(){this.isActive&&this.onChange()},onSwipeRight(){this.isActive||this.onChange()},onKeydown(t){(t.keyCode===l["A"].left&&this.isActive||t.keyCode===l["A"].right&&!this.isActive)&&this.onChange()}}})},b74e:function(t,e,r){},b7dd:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("8fea"),s=r("132d"),l=r("3a2f"),c=function(){var t=this,e=t._self._c;return e("div",{staticClass:"lifecyclereportviewer h-100"},[e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:""}},[e(a["c"],[e(o["a"],{staticStyle:{border:"1px solid silver"},attrs:{height:"100%","fixed-header":"",headers:t.headers,items:t.items,"hide-default-footer":"",loading:t.isLoading,options:t.pagination,"show-expand":"","must-sort":""},scopedSlots:t._u([{key:"item.begintime",fn:function(r){var n=r.item;return[e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(n.begintime,"MM/DD/YYYY"))}})]}},{key:"item.rating",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},t._l(n.rating,(function(r){return e(s["a"],{key:n.id+"-"+r,attrs:{small:""}},[t._v("star")])})),1)]}},{key:"item.rootLength",fn:function(e){var r=e.item;return[t._v(t._s(r.rootLength?"".concat(r.rootLength," ").concat(r.rootLengthMeasurement):"-"))]}},{key:"item.averagePlantHeight",fn:function(e){var r=e.item;return[t._v(t._s(r.averagePlantHeight?"".concat(r.averagePlantHeight," ").concat(r.averagePlantHeightMeasurement):"-"))]}},{key:"item.plantColor",fn:function(e){var r=e.item;return[t._v(t._s(r.plantColor?r.plantColor.label:"-"))]}},{key:"item.rootColor",fn:function(e){var r=e.item;return[t._v(t._s(r.rootColor?r.rootColor.label:"-"))]}},{key:"item.plantDisease",fn:function(e){var r=e.item;return[t._v(t._s(r.plantDisease?r.plantDisease.label:"-"))]}},{key:"item.unwantedPlant",fn:function(e){var r=e.item;return[t._v(t._s(r.unwantedPlant?r.unwantedPlant.label:"-"))]}},{key:"item.images",fn:function(r){var n=r.item;return[n.fileUploadUrl1||n.fileUploadUrl2||n.fileUploadUrl3?e(l["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(s["a"],t._g({on:{click:function(e){return t.onDisplayImages(n)}}},i),[t._v("collections")])]}}],null,!0)},[e("span",[t._v("Click to view images")])]):t._e()]}},{key:"expanded-item",fn:function(r){var n=r.headers,i=r.item;return[e("td",{staticStyle:{padding:"10px"},attrs:{colspan:n.length},domProps:{innerHTML:t._s(t.possibleNutrientDeficiencies(i))}})]}}])})],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{color:"primary"},on:{click:t.addNew}},[t._v("Create")]),e(n["a"],{attrs:{color:"primary",loading:t.isLoading},on:{click:t.refresh}},[t._v("Refresh")])],1)],1),t.showViewer?e("viewer",{ref:"viewer",staticClass:"images clearfix",attrs:{images:t.images,options:t.imageViewerOptions},on:{inited:t.inited},scopedSlots:t._u([{key:"default",fn:function(r){return t._l(r.images,(function(n,i){return e("img",{key:n,staticClass:"image",attrs:{alt:i+1+" of "+r.images.length,src:n},on:{load:t.onImageLoad}})}))}}],null,!1,3010154228)}):t._e()],1)},u=[],d=r("d0eb"),h=(r("c1df"),r("d67f")),f=r("2f62"),p=r("a9b3"),m=r("03a4"),v=(r("0808"),r("172a")),y=r("9908"),g=r("81f6");function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){return O(t)||C(t,e)||S(t,e)||x()}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function O(t){if(Array.isArray(t))return t}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=j(t,"string");return"symbol"==b(e)?e:e+""}function j(t,e){if("object"!=b(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var E={name:"PlatformgroupLifecycleReport",props:["platformGroup_id","lifecycleId"],mixins:[p["a"],m["a"]],components:{Viewer:v["a"],Loading:y["a"]},mounted:function(){g["a"].$on("lifecyclestatusreportsaved",this.refresh),this.refresh()},beforeDestroy:function(){g["a"].$off("lifecyclestatusreportsaved",this.refresh)},data:function(){return{showImages:!1,items:[],diagnoses:[],nutrientDeficiencySymptoms:[],images:[],isLoading:!1,showViewer:!1,imageViewerOptions:{inline:!1,button:!1,navbar:!1,title:[1,function(t,e){return"".concat(t.alt," (").concat(e.naturalWidth," × ").concat(e.naturalHeight,")")}],toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!1,keyboard:!1},pagination:{sortBy:["begintime"],sortDesc:[!0],rowsPerPage:-1},headers:[{text:"Date",value:"begintime",align:"center",sortable:!0,width:100},{text:"Health Rating",value:"rating",align:"center",sortable:!1,width:100},{text:"Root Length",value:"rootLength",align:"center",sortable:!1},{text:"Plant Height",value:"averagePlantHeight",align:"center",sortable:!1},{text:"Leaf Color",value:"plantColor.label",align:"center",sortable:!1},{text:"Root Color",value:"rootColor",align:"center",sortable:!1},{text:"Plant Disease",value:"plantDisease",align:"center",sortable:!1,width:100},{text:"Unwanted Plant",value:"unwantedPlant",align:"center",sortable:!1,width:100},{text:"Images",value:"images",align:"center",sortable:!0}]}},computed:D({},Object(f["c"])(["getUser"])),watch:{platformGroup_id:function(t,e){this.refresh()},lifecycleId:function(t,e){this.refresh()}},methods:{addNew:function(){this.$emit("add")},refresh:function(){var t=this;t.isLoading=!0,Promise.all([this.getNutrientDeficiencyDiagnoses(),this.getNutrientDeficiencySymptoms(),this.getLifecycleReports()]).then((function(e){t.isLoading=!1})).catch((function(e){h["a"].error("Something went wrong. Please try again later."),t.isLoading=!1}))},getLifecycleReports:function(){var t=this,e=null;this.platformGroup_id?e={ag_platformGroup_id:this.platformGroup_id}:this.lifecycleId&&(e={ag_lifecycle_id:this.lifecycleId}),e?d["a"].get("ag_lifecycleReports",this.getUser.apitoken,{filter:{sort:"begintime desc",include:[{relation:"unwantedPlant",scope:{filter:{fields:"label"}}},{relation:"plantColor",scope:{filter:{fields:"label"}}},{relation:"plantDisease",scope:{filter:{fields:"label"}}},{relation:"rootColor",scope:{filter:{fields:"label"}}},{relation:"nutrientDeficiencySymptoms",scope:{filter:{fields:"ag_nutrientDeficiencySymptom_id"}}}],where:e}}).then((function(e){var r=w(e,2),n=r[0];r[1];t.items=n||[]})):this.items=[]}}},I=E,L=(r("63b3"),r("2877")),A=Object(L["a"])(I,c,u,!1,null,null,null);e["a"]=A.exports},bba9:function(t,e,r){"use strict";r("6e25")},bc3c:function(t,e,r){"use strict";r("81d2")},bcf9:function(t,e,r){"use strict";r("5a2f")},be66:function(t,e,r){"use strict";r("09b7")},c122:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("4bd4"),s=r("132d"),l=r("b974"),c=r("2fa4"),u=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:""}},[e(a["d"],[e("h2",[t._v("Move Rack")]),e(c["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(s["a"],[t._v("close")])],1)],1),e(a["c"],[t.rec?e(o["a"],{staticClass:"h-100",staticStyle:{"overflow-y":"auto","overflow-x":"hidden"},model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(l["a"],{attrs:{items:t.facilities,label:"Facility","item-text":"name","item-value":"id",rules:[t.rules.requiredNoBlanks]},model:{value:t.rec.facility_id,callback:function(e){t.$set(t.rec,"facility_id",e)},expression:"rec.facility_id"}}),e(l["a"],{attrs:{items:t.areas,label:"Area","item-text":"areaname","item-value":"id",rules:[t.rules.requiredNoBlanks]},model:{value:t.rec.area_id,callback:function(e){t.$set(t.rec,"area_id",e)},expression:"rec.area_id"}})],1):t._e()],1),e(a["a"],[e(c["a"]),e(n["a"],{attrs:{color:"primary",disabled:!t.valid||t.isLoading},on:{click:t.onSave}},[t._v("Move Rack")])],1)],1)},d=[],h=r("d0eb"),f=r("d67f"),p=r("9c4f"),m=r("2f62");function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function y(t,e){return S(t)||x(t,e)||b(t,e)||g()}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function x(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function S(t){if(Array.isArray(t))return t}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=P(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(t){var e=D(t,"string");return"symbol"==v(e)?e:e+""}function D(t,e){if("object"!=v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var k={name:"MovePlatformGroup",mixins:[p["a"]],props:["value"],components:{},beforeMount:function(){this.value&&(this.rec=C({},this.value)),this.refresh()},data:function(){return{rec:{facility_id:null,area_id:null},valid:!0,areas:[],facilities:[],isLoading:!1}},computed:C({},Object(m["c"])(["getUser"])),watch:{value:function(t){t&&(this.rec=C({},this.value)),this.refresh()},"rec.facility_id":{immediate:!0,handler:function(t){t&&this.loadAreas(t)}}},methods:{refresh:function(){this.loadFacilities(),this.loadAreas()},onClose:function(){this.$emit("close")},onSave:function(){this.valid?(this.$emit("input",this.rec),this.$emit("save",this.rec)):f["a"].error("Form Entries Incomplete or Invalid")},loadFacilities:function(){var t=this;h["a"].get("facilities",this.getUser.apitoken).then((function(e){var r=y(e,2),n=r[0];r[1];t.facilities=n}))},loadAreas:function(){var t=this;this.isLoading=!0,h["a"].get("ag_areas",this.getUser.apitoken,{filter:{where:{facility_id:this.rec.facility_id}}}).then((function(e){var r=y(e,2),n=r[0];r[1];t.areas=n,t.isLoading=!1}))}}},T=k,j=r("2877"),E=Object(j["a"])(T,u,d,!1,null,null,null);e["a"]=E.exports},c126:function(t,e,r){"use strict";r("10e88")},c1f1:function(t,e,r){"use strict";r("a52e")},c242:function(t,e,r){var n,i;(function(a){t.exports?(a["default"]=a,t.exports=a):(n=[r("ea7f")],i=function(t){return a(t),a.Highcharts=t,a}.apply(e,n),void 0===i||(t.exports=i))})((function(t){function e(t,e,r,n){t.hasOwnProperty(e)||(t[e]=n.apply(null,r),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}t=t?t._modules:{},e(t,"Extensions/Themes/BrandDark.js",[t["Core/DefaultOptions.js"],t["Core/Utilities.js"]],(function(t,e){var r,n=t.setOptions,i=e.createElement;return function(t){t.options={colors:"#8087E8 #A3EDBA #F19E53 #6699A1 #E1D369 #87B4E7 #DA6D85 #BBBAC5".split(" "),chart:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#1f1836"],[1,"#45445d"]]},style:{fontFamily:"IBM Plex Sans, sans-serif"}},title:{style:{fontSize:"22px",fontWeight:"500",color:"#fff"}},subtitle:{style:{fontSize:"16px",fontWeight:"400",color:"#fff"}},credits:{style:{color:"#f0f0f0"}},caption:{style:{color:"#f0f0f0"}},tooltip:{borderWidth:0,backgroundColor:"#f0f0f0",shadow:!0},legend:{backgroundColor:"transparent",itemStyle:{fontWeight:"400",fontSize:"12px",color:"#fff"},itemHoverStyle:{fontWeight:"700",color:"#fff"}},labels:{style:{color:"#707073"}},plotOptions:{series:{dataLabels:{color:"#46465C",style:{fontSize:"13px"}},marker:{lineColor:"#333"}},boxplot:{fillColor:"#505053"},candlestick:{lineColor:null,upColor:"#DA6D85",upLineColor:"#DA6D85"},errorbar:{color:"white"},dumbbell:{lowColor:"#f0f0f0"},map:{borderColor:"rgba(200, 200, 200, 1)",nullColor:"#78758C"}},drilldown:{activeAxisLabelStyle:{color:"#F0F0F3"},activeDataLabelStyle:{color:"#F0F0F3"},drillUpButton:{theme:{fill:"#fff"}}},xAxis:{gridLineColor:"#707073",labels:{style:{color:"#fff",fontSize:"12px"}},lineColor:"#707073",minorGridLineColor:"#505053",tickColor:"#707073",title:{style:{color:"#fff"}}},yAxis:{gridLineColor:"#707073",labels:{style:{color:"#fff",fontSize:"12px"}},lineColor:"#707073",minorGridLineColor:"#505053",tickColor:"#707073",tickWidth:1,title:{style:{color:"#fff",fontWeight:"300"}}},mapNavigation:{enabled:!0,buttonOptions:{theme:{fill:"#46465C","stroke-width":1,stroke:"#BBBAC5",r:2,style:{color:"#fff"},states:{hover:{fill:"#000","stroke-width":1,stroke:"#f0f0f0",style:{color:"#fff"}},select:{fill:"#000","stroke-width":1,stroke:"#f0f0f0",style:{color:"#fff"}}}},verticalAlign:"bottom"}},rangeSelector:{buttonTheme:{fill:"#46465C",stroke:"#BBBAC5","stroke-width":1,style:{color:"#fff"},states:{hover:{fill:"#1f1836",style:{color:"#fff"},"stroke-width":1,stroke:"white"},select:{fill:"#1f1836",style:{color:"#fff"},"stroke-width":1,stroke:"white"}}},inputBoxBorderColor:"#BBBAC5",inputStyle:{backgroundColor:"#2F2B38",color:"#fff"},labelStyle:{color:"#fff"}},navigator:{handles:{backgroundColor:"#BBBAC5",borderColor:"#2F2B38"},outlineColor:"#CCC",maskFill:"rgba(255,255,255,0.1)",series:{color:"#A3EDBA",lineColor:"#A3EDBA"},xAxis:{gridLineColor:"#505053"}},scrollbar:{barBackgroundColor:"#BBBAC5",barBorderColor:"#808083",buttonArrowColor:"#2F2B38",buttonBackgroundColor:"#BBBAC5",buttonBorderColor:"#2F2B38",rifleColor:"#2F2B38",trackBackgroundColor:"#78758C",trackBorderColor:"#2F2B38"}},t.apply=function(){i("link",{href:"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:200,300,400,600,700",rel:"stylesheet",type:"text/css"},null,document.getElementsByTagName("head")[0]),n(t.options)}}(r||(r={})),r})),e(t,"masters/themes/brand-dark.src.js",[t["Core/Globals.js"],t["Extensions/Themes/BrandDark.js"]],(function(t,e){t.theme=e.options,e.apply()}))}))},c25e:function(t,e,r){},c318:function(t,e,r){"use strict";var n=r("b73d"),i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"deviceToggleSwitch"},[e(n["a"],{attrs:{label:t.label,readonly:t.readonly,inset:"",disabled:!!t.transitionClass||t.disabled,loading:t.transitionClass},on:{change:t.change,click:t.onSwitchClick},model:{value:t.val,callback:function(e){t.val=e},expression:"val"}})],1)},a=[],o=r("d67f"),s={name:"zone-devices-devices-sensor",props:{isSse:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{type:[String],default:""},state:{type:[String,Number],default:0},id:{type:[Number],default:0},type:{type:String,default:""},options:{type:Array,default:function(){return[]}},readonly:{type:Boolean,default:!0},isPolling:{type:Boolean,default:!1},nextFetchTime:{type:String,default:""},pctComplete:{type:[Number],default:0},suspendEvent:{type:Boolean,default:!1}},beforeMount:function(){},data:function(){return{val:!1,inTransition:!1}},watch:{state:function(t){this.setCurrentState(t)},isPolling:function(t){t||(this.inTransition=!1)}},computed:{transitionClass:function(){return this.inTransition&&this.isPolling},nextFetch:function(){return this.inTransition?""==this.nextFetchTime?"Next update within 2 minutes":this.nextFetchTime:""}},methods:{setCurrentState:function(t){t&&(t=t.toLowerCase(),this.val="on"==t||"closed"==t)},onSwitchClick:function(){this.readonly&&o["a"].error("You cannot change settings when AUTOMATIC mode is ON.")},value:function(t,e){this.suspendEvent=!0},change:function(t){if(!this.suspendEvent){this.inTransition=!0;var e="";switch(this.type){case"Curtain":e=t?"CurtainClose":"CurtainOpen";break;case"CO2Valve":e=t?"ValveOn":"ValveOff";break;case"ChilledWaterValve":e=t?"ValveOn":"ValveOff";break;case"VFUHumidifier":e=t?"ValveOn":"ValveOff";break;default:e=this.type+(t?"On":"Off")}var r=this.options.findIndex((function(t){return t.action&&t.action.toLowerCase()==e.toLowerCase()}));if(-1==r)o["a"].error("Error - Could not determine command to send.");else{var n=this.options[r].action_id;this.$emit("changed",{id:this.id,action_id:n})}}}},mounted:function(){this.setCurrentState(this.state)}},l=s,c=(r("978f"),r("2877")),u=Object(c["a"])(l,i,a,!1,null,null,null);e["a"]=u.exports},c5a4:function(t,e,r){"use strict";r("207d")},c5b7:function(t,e,r){"use strict";r("29ad")},c64e:function(t,e,r){var n=r("e1f4"),i=r("2366");function a(t,e,r){var a=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null),t=t||{};var o=t.random||(t.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var s=0;s<16;++s)e[a+s]=o[s];return e||i(o)}t.exports=a},c79c:function(t,e,r){},c865:function(t,e,r){"use strict";var n=r("0789"),i=r("9d26"),a=r("a9ad"),o=r("3206"),s=r("5607"),l=r("80d2"),c=r("58df");const u=Object(c["a"])(a["a"],Object(o["a"])("expansionPanel","v-expansion-panel-header","v-expansion-panel"));e["a"]=u.extend().extend({name:"v-expansion-panel-header",directives:{ripple:s["a"]},props:{disableIconRotate:Boolean,expandIcon:{type:String,default:"$expand"},hideActions:Boolean,ripple:{type:[Boolean,Object],default:!1}},data:()=>({hasMousedown:!1}),computed:{classes(){return{"v-expansion-panel-header--active":this.isActive,"v-expansion-panel-header--mousedown":this.hasMousedown}},isActive(){return this.expansionPanel.isActive},isDisabled(){return this.expansionPanel.isDisabled},isReadonly(){return this.expansionPanel.isReadonly}},created(){this.expansionPanel.registerHeader(this)},beforeDestroy(){this.expansionPanel.unregisterHeader()},methods:{onClick(t){this.$emit("click",t)},genIcon(){const t=Object(l["u"])(this,"actions")||[this.$createElement(i["a"],this.expandIcon)];return this.$createElement(n["d"],[this.$createElement("div",{staticClass:"v-expansion-panel-header__icon",class:{"v-expansion-panel-header__icon--disable-rotate":this.disableIconRotate},directives:[{name:"show",value:!this.isDisabled}]},t)])}},render(t){return t("button",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-header",class:this.classes,attrs:{tabindex:this.isDisabled?-1:null,type:"button","aria-expanded":this.isActive},directives:[{name:"ripple",value:this.ripple}],on:{...this.$listeners,click:this.onClick,mousedown:()=>this.hasMousedown=!0,mouseup:()=>this.hasMousedown=!1}}),[Object(l["u"])(this,"default",{open:this.isActive},!0),this.hideActions||this.genIcon()])}})},ca14:function(t,e,r){"use strict";r("19b5")},cd55:function(t,e,r){"use strict";var n=r("4e82"),i=r("3206"),a=r("80d2"),o=r("58df");e["a"]=Object(o["a"])(Object(n["a"])("expansionPanels","v-expansion-panel","v-expansion-panels"),Object(i["b"])("expansionPanel",!0)).extend({name:"v-expansion-panel",props:{disabled:Boolean,readonly:Boolean},data(){return{content:null,header:null,nextIsActive:!1}},computed:{classes(){return{"v-expansion-panel--active":this.isActive,"v-expansion-panel--next-active":this.nextIsActive,"v-expansion-panel--disabled":this.isDisabled,...this.groupClasses}},isDisabled(){return this.expansionPanels.disabled||this.disabled},isReadonly(){return this.expansionPanels.readonly||this.readonly}},methods:{registerContent(t){this.content=t},unregisterContent(){this.content=null},registerHeader(t){this.header=t,t.$on("click",this.onClick)},unregisterHeader(){this.header=null},onClick(t){t.detail&&this.header.$el.blur(),this.$emit("click",t),this.isReadonly||this.isDisabled||this.toggle()},toggle(){this.$nextTick(()=>this.$emit("change"))}},render(t){return t("div",{staticClass:"v-expansion-panel",class:this.classes,attrs:{"aria-expanded":String(this.isActive)}},Object(a["u"])(this))}})},d054:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("8fea"),s=r("169a"),l=r("132d"),c=r("2fa4"),u=r("3a2f"),d=function(){var t=this,e=t._self._c;return t.selectedContextMenuItem?e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{loading:t.isLoading}},[e(a["d"],[e("h2",[t.controller?e("span",[t._v(t._s(t.controllerName))]):t._e(),e("span",{staticClass:"hidden-sm-and-down"},[t._v(" Assembly")]),t._v(" Tests\n    ")]),e(c["a"]),e("r-button",{staticClass:"mr-1",attrs:{color:"primary",icon:"add",label:"Create",small:!0},on:{onclick:t.onAdd}}),e("r-button",{attrs:{color:"primary",icon:"close",label:"Close",small:!0},on:{onclick:t.onClose}})],1),e(a["c"],{staticClass:"d-flex flex-column flex-grow-auto"},[e(o["a"],{staticClass:"flex-grow-auto",attrs:{"hide-default-footer":"",headers:t.headers,items:t.data,options:t.pagination,height:"400","fixed-header":""},scopedSlots:t._u([{key:"item.actions",fn:function(r){var i=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},[e(u["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(n["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onEdit(i)}}},a),[e(l["a"],[t._v("edit")])],1)]}}],null,!0)},[e("span",[t._v("Edit this record")])]),e(u["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var a=r.on;return[e(n["a"],t._g({attrs:{icon:""},on:{click:function(e){return t.onDelete(i)}}},a),[e(l["a"],[t._v("delete")])],1)]}}],null,!0)},[e("span",[t._v("Delete this record")])])],1)]}},{key:"item.begintime",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.begintime,"MM/DD/YYYY hh:mm a"))}})]}},{key:"item.passed",fn:function(e){return[t._v("\n        "+t._s(e.item.passed?"Yes":"No")+"\n      ")]}}],null,!1,660322179)})],1),e(s["a"],{attrs:{persistent:"",width:"550",scrollable:""},model:{value:t.showTest,callback:function(e){t.showTest=e},expression:"showTest"}},[t.controller&&t.instantiate?e("assembly-test",{attrs:{assemblyTest_id:t.assemblyTest_id,controllerId:t.selectedContextMenuItem.controller_id,controllerName:t.controller.name,platformGroupId:t.platformGroupId,lastEventReceived:t.lastEventReceived},on:{close:t.onCloseTest,save:t.refresh}}):t._e()],1)],1):t._e()},h=[],f=r("2f62"),p=r("c1df"),m=r.n(p),v=r("d67f"),y=r("d0eb"),g=r("a9b3"),b=r("a609"),w=r("ce7e"),x=r("8860"),S=r("da13"),_=r("1800"),C=r("5d23"),O=r("e0c7"),P=function(){var t=this,e=t._self._c;return e(i["a"],{attrs:{flat:"",id:"assemblyTest",loading:t.isLoading}},[e(a["d"],[e("h2",[e("span",{staticClass:"hidden-sm-and-down"},[t._v("\n        "+t._s(t.assemblyTest_id?"Continue":"New"))]),t._v("\n      "+t._s(t.controllerName)+" "),e("span",{staticClass:"hidden-sm-and-down"},[t._v("Assembly")]),t._v("\n      Test\n    ")]),e(c["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],[e(x["a"],{attrs:{"two-line":"",subheader:""}},[t._l(t.items,(function(r,i){return[0==i||t.items[i].device!=t.items[i-1].device&&i+1<t.items.length&&t.items[i].device==t.items[i+1].device?e(O["a"],{key:"subheader"+i},[t._v("\n          "+t._s(r.device)+" "),r.state?e("span",[t._v(" - ")]):t._e(),t._v("\n          "+t._s(r.state)+"\n        ")]):t._e(),e(S["a"],{key:r.device_id+"-"+r.actions.action_id,on:{click:function(e){return t.onListItemTap(r)}},scopedSlots:t._u([{key:"default",fn:function(i){i.active;return[e(C["a"],[e(C["c"],{staticClass:"text--primary"},[t._v(t._s(r.prompt))])],1),e(_["a"],[e(b["a"],{model:{value:r.testResult,callback:function(e){t.$set(r,"testResult",e)},expression:"item.testResult"}},[t.isMobile?e(n["a"],{attrs:{small:"","active-class":"error"},nativeOn:{click:function(t){t.stopPropagation()}}},[e(l["a"],[t._v("error")])],1):e(n["a"],{attrs:{small:"","active-class":"error"},nativeOn:{click:function(t){t.stopPropagation()}}},[t._v("\n                  Fail\n                ")]),t.isMobile?e(n["a"],{attrs:{small:"","active-class":"success"},nativeOn:{click:function(t){t.stopPropagation()}}},[e(l["a"],[t._v("check")])],1):e(n["a"],{attrs:{small:"","active-class":"success"},nativeOn:{click:function(t){t.stopPropagation()}}},[t._v("\n                  Pass\n                ")])],1)],1)]}}],null,!0)}),i<t.items.length-1?e(w["a"],{key:"divider"+i}):t._e()]}))],2)],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{color:"primary",text:"",loading:t.isLoading},on:{click:t.onSave}},[t._v("Save")])],1)],1)},D=[],k=r("12a1"),T=r("b047"),j=r.n(T);function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function I(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */I=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==E(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(E(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function L(t,e){return F(t)||N(t,e)||M(t,e)||A()}function A(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(t,e){if(t){if("string"==typeof t)return U(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function N(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function F(t){if(Array.isArray(t))return t}function G(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function R(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){G(a,n,i,o,s,"next",t)}function s(t){G(a,n,i,o,s,"throw",t)}o(void 0)}))}}function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){V(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t,e,r){return(e=B(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B(t){var e=z(t,"string");return"symbol"==E(e)?e:e+""}function z(t,e){if("object"!=E(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Y={name:"zone-devices-manual-control-options",components:{},props:{controllerName:{type:String},assemblyTest_id:{type:Number,default:0},disabled:{type:Boolean,default:!1},isSse:{type:Boolean,default:!0},platformGroupId:{type:[Number,String],default:0},deviceId:{type:[Number,String],default:0},controllerId:{type:[Number,String],default:0},automaticMode:{type:Boolean,default:!0},type:{type:String,default:"VFU"},lastEventReceived:{type:Object,default:null},zoneDevice:{type:Object,required:!1,default:function(){return null}}},data:function(){return{selected:null,isMobile:"xs"==this.$vuetify.breakpoint.name,controllerSensors:[],ready:!1,loading:!1,visualization:1,isCortex:!1,pctComplete:0,items:[],dimmableLights:!1,supportsMicroclimate:!1,platformGroupDevicesList:[],nextFetchTime:"",isLoadingJog:!1}},beforeMount:function(){this.refresh()},beforeDestroy:function(){},computed:H({},Object(f["c"])(["getUser"])),methods:{onSave:j()(R(I().mark((function t(){var e,r,n,i,a,o,s,l,c,u,d,h,f;return I().wrap((function(t){while(1)switch(t.prev=t.next){case 0:for(this.isLoading=!0,e=!0,r=[],n=0;n<this.items.length;n++)this.items[n].testResult||(e=!1);return i={controller_id:this.controllerId,passed:e},this.assemblyTest_id&&(i.id=this.assemblyTest_id),t.next=8,y["a"].patch("assemblyTests",this.getUser.apitoken,i);case 8:return a=t.sent,o=L(a,2),s=o[0],o[1],l=s.id,t.next=15,y["a"].post("assemblyTestDevices/deleteTestDevices",this.getUser.apitoken,{assemblyTest_id:l});case 15:for(c=t.sent,u=L(c,2),u[0],u[1],d=0;d<this.items.length;d++)r.push({assemblyTest_id:l,virtualDevices_id:this.items[d].device_id,action_id:this.items[d].actions.action_id,passed:this.items[d].testResult});return t.next=22,y["a"].post("assemblyTestDevices",this.getUser.apitoken,r);case 22:h=t.sent,f=L(h,2),f[0],f[1],this.isLoading=!1,this.$emit("save"),this.onClose();case 29:case"end":return t.stop()}}),t,this)}))),250),onListItemTap:function(t){var e=0;e="LightOn"==t.actions.action?0:1,t.actions.action_id>0&&this.changed(t,t.device_id,t.actions.action_id,e)},onClose:function(){this.$emit("close")},getControllerSensors:function(){var t=this,e=this;return new Promise((function(r,n){y["a"].get("controllerSensors/getControllerSensors",t.getUser.apitoken,{controller_id:e.controllerId}).then((function(t){var e=L(t,2),i=e[0],a=e[1];i?r(i):n(a)}))}))},refresh:function(){if(this.platformGroupId){var t=this;this.isLoading=!0;var e=[y["a"].get("ag_platformGroups/getFeatures",this.getUser.apitoken,{platformGroupId:this.platformGroupId,feature:"dimmable"}),y["a"].get("devicesAndPlatforms/getPlatformGroupDevices",this.getUser.apitoken,{controller_id:this.controllerId}),y["a"].get("ag_platformGroups/getFeatures",this.getUser.apitoken,{platformGroupId:this.platformGroupId,feature:"microclimate"}),y["a"].get("ag_platformGroups/contains",this.getUser.apitoken,{platformGroupId:this.platformGroupId,hardware_type_category_label:"ECU Controller Board"}),this.getControllerSensors()];this.assemblyTest_id&&e.push(y["a"].get("assemblyTestDevices",this.getUser.apitoken,{filter:{where:{assemblyTest_id:this.assemblyTest_id}}})),Promise.all(e).then((function(e){var r=L(e,6),n=L(r[0],2),i=n[0],a=(n[1],L(r[1],2)),o=a[0],s=(a[1],L(r[2],2)),l=s[0],c=(s[1],L(r[3],2)),u=c[0],d=(c[1],r[4]),h=r[5];h&&(h=h[0]);var f=o.filter((function(e){return e.platformGroup_id==t.platformGroupId||!e.platformGroup_id}));o=f,1==u.length&&1==u[0].qty&&(t.isCortex=!0),1==l.length&&(t.supportsMicroclimate=l[0].numbervalue),1==i.length&&(t.dimmableLights=i[0].numbervalue);for(var p=0;p<o.length;p++)o[p].isPolling=!1,o[p].suspendEvent=!1;t.isLoading=!1,t.createFilteredDevicesList(o,d,h)}))}},createFilteredDevicesList:function(t,e,r){for(var n=[],i=0;i<t.length;i++)if(t[i].actions&&t[i].actions.length>0||t[i].parameters&&t[i].parameters.length>0){if(!this.supportsMicroclimate&&("CO2"==t[i].device||"Humidity"==t[i].device||"Temperature"==t[i].device))continue;n.push(t[i])}this.createTestDefinitions(n,e,r)},getSensorPrompt:function(t,e,r){var n="",i=null;if(i=r?m()().diff(m.a.utc(r),"minutes"):255,this.isMobile)switch(t){case"TEMPERATURE":n="TEMP: ";break;case"HUMIDITY":n="RH: ";break;case"CO2":n="CO2: ";break}else n="Current "+t+" : ";if(i>15)return n+" FAIL";switch(t){case"HUMIDITY":return e?n+(Math.round(100*e)+"%"):n+"FAIL";case"CO2":return e?n+(e+" ppm"):n+"FAIL";case"TEMPERATURE":return e?y["a"].displayMetric(this.getUser)?n+(e+"C"):n+(Object(k["toFahrenheit"])(e,1)+" F"):n+"FAIL"}},createTestDefinitions:function(t,e,r){if(t&&t.length){var n=[],i=t.filter((function(t){return![15,16,36,44].includes(t.deviceType_id)})),a="";this.isMobile||(a="Click or tap here to ");for(var o=0;o<i.length;o++)for(var s=JSON.parse(JSON.stringify(i[o])),l=0;l<s.actions.length;l++)if(s.actions[l].testPrompt){var c=JSON.parse(JSON.stringify(s));c.actions=s.actions[l],c.prompt=a+s.actions[l].testPrompt,"xs"==this.$vuetify.breakpoint.name&&(c.prompt=c.prompt.charAt(0).toUpperCase()+c.prompt.slice(1)),c.testResult=null,n.push(c)}for(var u=0;u<e.length;u++){var d={device:"Sensors",device_id:e[u].device_id,actions:{action_id:0},sensor:e[u].sensor.toUpperCase(),prompt:null};d.prompt=this.getSensorPrompt(e[u].sensor.toUpperCase(),e[u].reading,e[u].lastUpdate),n.push(d)}if(r)for(var h=0;h<r.length;h++)for(var f=r[h],p=0;p<n.length;p++){var m=n[p];if(f.action_id==m.actions.action_id&&f.virtualDevices_id==m.device_id){null!=f.passed&&(m.testResult=f.passed?1:0);break}}this.items=n,this.ready=!0}},changed:function(t,e,r,n){var i={};i="Light"==t.deviceType?{controller_id:this.controllerId,action_id:r,virtualDevice_id:e,user_id:this.getUser.id,value:n}:{controller_id:this.controllerId,action_id:r,virtualDevice_id:e,user_id:this.getUser.id},y["a"].post("controllerCommands",this.getUser.apitoken,i).then((function(t){var e=L(t,2),r=e[0];e[1];r?v["a"].success("Command Sent"):v["a"].error("Error sending command. Please try again later.")}))}},watch:{lastEventReceived:function(t){for(var e=0;e<this.items.length;e++)if(this.items[e].device_id==t.deviceId&&t.state)switch(t.deviceType){case"Sensor":this.items[e].prompt=this.getSensorPrompt(this.items[e].sensor,parseFloat(t.state),m.a.utc().format("YYYY-MM-DD HH:mm"));break;default:this.items[e].state=t.state}}}},q=Y,W=(r("664e"),r("2877")),J=Object(W["a"])(q,P,D,!1,null,null,null),Z=J.exports,X=r("ea10");function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Q(t,e){return it(t)||nt(t,e)||et(t,e)||tt()}function tt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function et(t,e){if(t){if("string"==typeof t)return rt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rt(t,e):void 0}}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function nt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function it(t){if(Array.isArray(t))return t}function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?at(Object(r),!0).forEach((function(e){st(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function st(t,e,r){return(e=lt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lt(t){var e=ct(t,"string");return"symbol"==K(e)?e:e+""}function ct(t,e){if("object"!=K(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var ut={name:"AssemblyTests",mixins:[g["a"]],components:{AssemblyTest:Z},data:function(){return{instantiate:!1,isMobile:"xs"==this.$vuetify.breakpoint.name,platformGroupId:null,assemblyTest_id:0,controller:null,showTest:!1,pagination:{itemsPerPage:-1,sortBy:["begintime"],sortDesc:[!0]},headers:[{text:"Actions",value:"actions",sortable:!1,width:50,align:"center"},{text:"Date/Time",value:"begintime",sortable:!0},{text:"User",value:"updateuser",sortable:!0},{text:"Passed",value:"passed",sortable:!1,align:"center"}],isLoading:!1,data:[]}},beforeMount:function(){this.refresh()},computed:ot(ot(ot(ot({},Object(f["c"])(["getUser"])),Object(f["c"])("universalDashboard",["showAssemblyTests","selectedContextMenuItem"])),Object(f["c"])("socketMessages",["getLastEventReceivedForControllerId"])),{},{lastEventReceived:function(){return this.selectedContextMenuItem?this.getLastEventReceivedForControllerId(this.selectedContextMenuItem.controller_id):null},controllerName:function(){if(this.controller){var t=this.controller.name.split("-");return 3==t.length?t[1]+"-"+t[2]:this.controller.name.length>=12&&this.isMobile?this.controller.name.substring(0,7)+"...":this.controller.name}return""}}),methods:{onCloseTest:function(){var t=this;this.showTest=!1,setTimeout((function(){t.instantiate=!1}),750)},onEdit:function(t){this.assemblyTest_id=t.id,this.showTest=!0,this.instantiate=!0},onDelete:function(t){var e=this;X["a"].confirm("Confirm Delete","Delete the selected assembly test?",(function(r){r&&y["a"].destroy("assemblyTests",t.id,e.getUser.apitoken).then((function(t){var r=Q(t,2),n=(r[0],r[1]);n?v["a"].error("An error occurred. Please try again later."):(v["a"].success("Record deleted."),e.refresh())}))}))},onAdd:function(){this.assemblyTest_id=0,this.instantiate=!0,this.showTest=!0},onClose:function(){this.$store.dispatch("universalDashboard/setShowAssemblyTests",!1)},refresh:function(){if(this.selectedContextMenuItem){var t=this;this.isLoading=!0,y["a"].get("controllers/"+this.selectedContextMenuItem.controller_id,this.getUser.apitoken).then((function(e){var r=Q(e,2),n=r[0];r[1];t.controller=n})),y["a"].get("ag_platformGroups",this.getUser.apitoken,{filter:{where:{controller_id:this.selectedContextMenuItem.controller_id}}}).then((function(e){var r=Q(e,2),n=r[0];r[1];t.platformGroupId=n[0].id})),y["a"].get("assemblyTests",this.getUser.apitoken,{filter:{where:{controller_id:this.selectedContextMenuItem.controller_id}}}).then((function(e){var r=Q(e,2),n=r[0];r[1];t.isLoading=!1,t.data=n}))}}},watch:{"selectedContextMenuItem.controller_id":function(){this.refresh()}}},dt=ut,ht=Object(W["a"])(dt,d,h,!1,null,null,null);e["a"]=ht.exports},d15d:function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",{class:{"overlay py-3 px-3":t.overlay},staticStyle:{"text-align":"center"}},[e("span",{staticStyle:{"font-weight":"900","text-decoration":"underline"}},[t._v(t._s(t.getPlatformGroupName(t.hotspot)))]),t.platformGroupDisplayRecords[t.hotspot.platformGroup_id]?e("div",[e("div",{staticClass:"telemetry",class:{highvalue:t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].tempHigh,lowvalue:t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].tempLow}},[t._v("\n      "+t._s(t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].temperatureFormatted)+"\n    ")]),e("div",{staticClass:"telemetry",class:{highvalue:t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].humidityHigh,lowvalue:t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].humidityLow}},[t._v("\n      "+t._s((100*t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].humidity).toFixed(0))+"% rh\n    ")]),e("div",{staticClass:"telemetry",class:{highvalue:t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].co2High,lowvalue:t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].co2Low}},[t._v("\n      "+t._s(t.platformGroupDisplayRecords[t.hotspot.platformGroup_id].co2)+"\n      ppm\n    ")])]):t._e()])},i=[],a={name:"CurrentConditionsCard",props:["hotspot","platformGroupDisplayRecords","overlay"],data:function(){return{}},methods:{getPlatformGroupName:function(t){if(t.camera_id){if(t.agPlatformgroups){var e=t.agPlatformgroups.platformGroupName.split("-"),r=e.length>2?e.slice(1).join("-"):t.agPlatformgroups.platformGroupName;return r.toUpperCase()}return""}return t.label.toUpperCase()}}},o=a,s=(r("8af8"),r("2877")),l=Object(s["a"])(o,n,i,!1,null,"7823a202",null);e["a"]=l.exports},d1ad:function(t,e,r){"use strict";r("1e7b")},d2a8:function(t,e,r){},d51e:function(t,e,r){},d720:function(t,e,r){"use strict";var n=r("cc20"),i=function(){var t=this,e=t._self._c;return 86400!=t.duration?e("div",[t._l(t.times,(function(r,i){return e(n["a"],{key:i,staticClass:"mr-1 mb-1",attrs:{color:t.COLORS[t.type],small:"","text-color":"#FFFFFF",close:t.closeable},on:{"click:close":function(e){return t.deleteTime(r)}}},[t._v("\n    "+t._s(r.startTime)+"\n  ")])})),86400==t.duration?e(n["a"],{attrs:{small:""}},[t._v("\n    All Day\n  ")]):t._e()],2):t._e()},a=[];function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var s={name:"schedule-chips-simple",props:["blocks","type","duration","closeable"],data:function(){return{COLORS:{on:"#ff00ff",off:"#383838"}}},computed:{times:function(){return this.blocks.map((function(t){return"object"!==o(t)?{startTime:t,durationSecs:null,designatorId:null}:t}))}},methods:{deleteTime:function(t){this.closeable&&this.$emit("remove",t)}}},l=s,c=r("2877"),u=Object(c["a"])(l,i,a,!1,null,null,null);e["a"]=u.exports},d7f2:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("132d"),s=r("2fa4"),l=function(){var t=this,e=t._self._c;return e(i["a"],[e(a["d"],[e("h2",[t._v("Confirm Curtain State Change")]),e(s["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onCancel}},[e(o["a"],[t._v("close")])],1)],1),e(a["c"],[e("p",[t._v("Set mode to "+t._s(t.curtainsAction.label))])]),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.onConfirm}},[t._v("Confirm")])],1)],1)},c=[],u=r("2f62");function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */h=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var p="suspendedStart",m="suspendedYield",v="executing",y="completed",g={};function b(){}function w(){}function x(){}var S={};c(S,o,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,o)&&(S=C);var O=x.prototype=b.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=f(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==d(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=p;return function(a,o){if(i===v)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var c=f(e,r,n);if("normal"===c.type){if(i=n.done?y:m,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=y,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=f(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(d(e)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function f(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){f(a,n,i,o,s,"next",t)}function s(t){f(a,n,i,o,s,"throw",t)}o(void 0)}))}}function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){y(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function y(t,e,r){return(e=g(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g(t){var e=b(t,"string");return"symbol"==d(e)?e:e+""}function b(t,e){if("object"!=d(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var w={props:["item","action"],data:function(){return{}},computed:v(v({},Object(u["c"])("universalDashboard",["selectedCurtainsAction"])),{},{curtainsAction:function(){var t;return null!==(t=this.action)&&void 0!==t?t:this.selectedCurtainsAction}}),methods:{onCancel:function(){this.$emit("cancel"),this.$store.dispatch("universalDashboard/setSelectedContextMenuItem",null),this.$store.dispatch("universalDashboard/setShowCurtainsConfirm",!1),this.$store.dispatch("universalDashboard/setSelectedCurtainsAction",null)},onConfirm:function(){var t=this;return p(h().mark((function e(){return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("universalDashboard/setIsPerformingContextMenuAction",!0);case 2:return e.next=4,t.$store.dispatch("batchActions/changeBatchAction",t.curtainsAction.id);case 4:return e.next=6,t.$store.dispatch("universalDashboard/setShowCurtainsConfirm",!1);case 6:return e.next=8,t.$store.dispatch("universalDashboard/setSelectedCurtainsAction",null);case 8:case"end":return e.stop()}}),e)})))()}}},x=w,S=r("2877"),_=Object(S["a"])(x,l,c,!1,null,null,null);e["a"]=_.exports},d84d:function(t,e,r){"use strict";r("5940")},d86f:function(t,e,r){},d89d:function(t,e,r){"use strict";var n=r("62ad"),i=r("490a"),a=r("0fd9"),o=function(){var t=this,e=t._self._c;return e("div",{staticClass:"full-area-view-platform-container"},[e("h4",{staticClass:"text-md-center",attrs:{title:"Platform Group Id: "+t.platform.platformGroup_id+" / Platform Id: "+t.platform.id}},[t._v("\n    "+t._s(t.name)+"\n  ")]),t.loading?t._e():e(a["a"],{staticClass:"position-container",attrs:{align:"center","no-gutters":""}},[e(n["a"],{attrs:{cols:"12"}},t._l(t.rows,(function(r,i){return e(a["a"],{key:i,staticClass:"align-stretch",attrs:{"no-gutters":""}},t._l(r,(function(r,a){return e(n["a"],{key:a,staticStyle:{padding:"2px"}},[e("div",{staticClass:"plant-position",class:i+1==t.highlightPosition[0]&&a+1==t.highlightPosition[1]?"highlight":""},[e("plant-container",{attrs:{position:r,"lifecycle-id":t.lifecycleId,isCannabis:t.isCannabis}})],1)])})),1)})),1)],1),e("div",{directives:[{name:"show",rawName:"v-show",value:t.loading,expression:"loading"}],staticClass:"loader-container position-container"},[e(i["a"],{staticClass:"loader",attrs:{indeterminate:!0,color:"primary"}})],1)],1)},s=[],l=r("8336"),c=r("b0af"),u=r("99d9"),d=r("169a"),h=r("132d"),f=r("2fa4"),p=r("3a2f"),m=function(){var t=this,e=t._self._c;return t.position?e("div",{staticStyle:{"min-height":"30px"},on:{click:t.onClick}},[t.position.plantCount>0?e("span",{staticClass:"badge-basin pull-down"},[t._v(t._s(t.position.plantCount))]):t._e(),e(p["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e("div",t._g({staticClass:"plant-container",class:[t.position.lifecycle_id>0&&t.position.lifecycle_id==+t.lifecycleId?"inLifecycle":""],staticStyle:{"min-height":"30px"},attrs:{"data-plantContainerId":t.position.plantContainer_id}},n),[t.position.plantContainer_id?t._e():e("img",{staticClass:"plants-icon",staticStyle:{"min-height":"22px"},attrs:{src:"/img/icons/none.svg"}}),t.position.lifecycle_id>0&&t.position.lifecycle_id==+t.lifecycleId?e("img",{staticClass:"plants-icon",staticStyle:{"min-height":"25px",margin:"auto"},attrs:{src:t.leafIcon1}}):t._e(),t.position.lifecycle_id>0&&t.position.lifecycle_id!=+t.lifecycleId?e("img",{staticClass:"plants-icon-disabled",staticStyle:{"min-height":"25px",margin:"auto"},attrs:{src:t.leafIcon1}}):t._e()])]}}],null,!1,588759502)},[e("span",[t._v(t._s(t.position.plantCount>0?t.position.plantInformation:"Empty Container"))])]),e(d["a"],{attrs:{width:"700",dark:"dark"===t.userData.theme},model:{value:t.dialog,callback:function(e){t.dialog=e},expression:"dialog"}},[e(c["a"],{staticClass:"screen-height-container flex-content",staticStyle:{"max-height":"500px"}},[e(u["d"],[e("h2",[t._v("Container Type: "+t._s(t.position.plantcontainerType)+" / Lifecycle #"+t._s(t.position.lifecycle_id)+" / Container #"+t._s(t.position.plantContainer_id))]),e(f["a"]),e(l["a"],{attrs:{icon:""},on:{click:function(e){t.dialog=!1}}},[e(h["a"],[t._v("close")])],1)],1),e(u["c"],{staticClass:"overflow-auto"},[e("table",{staticStyle:{border:"1px solid silver",margin:"auto"}},t._l(t.plantRows,(function(r,n){return e("tr",{key:n,staticStyle:{"max-height":"300px"},attrs:{align:"center",justify:"center","no-gutters":""}},t._l(r,(function(r,n){return e("td",{key:n,staticStyle:{padding:"2px"}},[e(p["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(n){var i=n.on;return[e("div",t._g({staticClass:"full-area-view-pl-container"},i),[r.plant_id>0&&r.ag_plants&&r.ag_plants.lifecycle_id==t.lifecycleId?e("img",{staticClass:"full-area-view-pl-container-plants-icon",attrs:{src:t.leafIcon1}}):r.plant_id>0?e("img",{staticClass:"full-area-view-pl-container-plants-icon-disabled",attrs:{src:t.leafIcon1}}):e("img",{staticClass:"plants-icon",attrs:{src:"/img/icons/none.svg"}})])]}}],null,!0)},[r.plant_id?e("span",[t._v("Plant ID: "+t._s(r.plant_id)+" | "+t._s(r.strainName)+" | Tag: "+t._s(r.tag||"None")+" | Mother: "+t._s(r.parentTag||"None Specified"))]):e("span",[t._v("Empty")])])],1)})),0)})),0)])],1)],1)],1):t._e()},v=[],y=r("d0eb"),g=r("2f62");function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t,e,r){return(e=_(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t){var e=C(t,"string");return"symbol"==b(e)?e:e+""}function C(t,e){if("object"!=b(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var O={name:"plant-container",props:{position:{type:Object,default:function(){return{}}},lifecycleId:Number,isCannabis:{type:Boolean,default:!0}},data:function(){return{dialog:!1,leafIcon1:"/img/icons/leaf.svg",leafIcon2:"/img/icons/leaf_gray.svg"}},beforeMount:function(){this.isCannabis&&!this.getUser.facility.growsLeafyGreens||(this.leafIcon1="/img/icons/soil.svg",this.leafIcon2="/img/icons/soil_disabled.svg")},methods:{onClick:function(){this.position&&this.position.plantContainer_id>0&&(this.dialog=!this.dialog)}},computed:x(x({},Object(g["c"])(["getUser","userData"])),{},{isSinglePlant:function(){if(1==this.plantRows.length)return!0},plantRows:function(){var t=[];for(var e in this.position.ag_plantContainers){var r=this.position.ag_plantContainers[e];for(var n in r.ag_plantContainerPositions){var i=r.ag_plantContainerPositions[n];t[i.row-1]||(t[i.row-1]=[]),t[i.row-1][i.col-1]=r.ag_plantContainerPositions[n]}}return t}})},P=O,D=(r("9ea0"),r("2877")),k=Object(D["a"])(P,m,v,!1,null,null,null),T=k.exports;function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function E(t,e){return U(t)||M(t,e)||L(t,e)||I()}function I(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function L(t,e){if(t){if("string"==typeof t)return A(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(t,e):void 0}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function M(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function U(t){if(Array.isArray(t))return t}function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){G(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function G(t,e,r){return(e=R(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function R(t){var e=$(t,"string");return"symbol"==j(e)?e:e+""}function $(t,e){if("object"!=j(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var H={name:"platform",props:{lifecycleId:{type:Number,default:0},isCannabis:{type:Boolean,default:!0},highlightPosition:{type:Array,default:function(){return[-1,-1]}},platform:{type:Object,default:function(){return{}}},platformGroup:{type:Object,default:function(){return{}}},positions:{type:Object,default:function(){return{}}}},data:function(){return{loading:!1,rows:[]}},components:{PlantContainer:T},computed:F(F({},Object(g["c"])(["getUser"])),{},{name:function(){return this.platformGroup&&this.platformGroup.platformGroupName?"".concat(this.platformGroup.platformGroupName," - ").concat(this.platform.platformName):this.platform.platformName}}),methods:{containerInfo:function(){var t=this,e=[];t.rows.map((function(t){t.map((function(t){if(t.plantContainer_id){var r=t.ag_plantContainers[t.plantContainer_id],n=r.ag_plantContainerPositions[r.id],i=n.ag_plants.id;t.plantcontainerType=r.plantcontainerType,t.plantId=i,i&&e.push(i)}}))})),y["a"].get("ag_plants",this.getUser.apitoken,{filter:{where:{id:{inq:e}},include:["strain"]}}).then((function(e){var r=E(e,2),n=r[0];r[1];t.rows.map((function(t){t.map((function(t){n.map((function(e){if(e.id==t.plantId)if(t.strainName=e.strain?e.strain.strainName:null,t.tag=e.tag,t.motherTag=e.motherplant_tag,t.destroyPlantReason_id=e.destroyPlantReason_id,t.ag_plantContainers&&1==t.ag_plantContainers[t.plantContainer_id].positions){var r=t.strainName?t.strainName:"";t.tag&&""!==t.tag?r+=" | Tag: ".concat(t.tag):r+=" | No Tag Specified",t.motherTag&&""!==t.motherTag?r+=" | Mother: ".concat(t.motherTag):r+=" | No Mother Specified",t.destroyPlantReason_id&&(r+=" | Marked for Destruction"),t.plantInformation=r}else t.ag_plantContainers&&t.ag_plantContainers[t.plantContainer_id].positions>1?t.plantInformation=t.ag_plantContainers[t.plantContainer_id].positions+"ct. tray with "+t.plantCount+" plants. Click for more detail.":t.plantInformation="No Information Available"})),t.plantInformation||(t.plantInformation=t.ag_plantContainers[t.plantContainer_id].positions+"ct. tray with "+t.plantCount+" plants. Click for more detail.")}))})),t.loading=!1}))},setRows:function(t){var e=this;e.loading=!0;var r=[];Object.keys(t).forEach((function(e){var n=t[e],i=n.row,a=n.col,o=i-1,s=a-1;r[o]||(r[o]=[]),r[o][s]=n,r[o][s].plantCount=0;var l=Object.keys(n.ag_plantContainers);l.length&&l.forEach((function(t){for(var e=n.ag_plantContainers[t],i=Object.keys(e.ag_plantContainerPositions),a=0;a<i.length;a++)e.ag_plantContainerPositions[i[a]].plant_id>0&&r[o][s].plantCount++}))})),e.rows=r}},watch:{positions:function(t){this.setRows(t),this.containerInfo()}},beforeMount:function(){this.positions&&(this.setRows(this.positions),this.containerInfo())}},V=H,B=(r("b6cc"),Object(D["a"])(V,o,s,!1,null,null,null));e["a"]=B.exports},d93d:function(t,e,r){},da52:function(t,e,r){"use strict";var n=r("8fea"),i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chartdatatable h-100"},[e(n["a"],{attrs:{headers:t.headers,items:t.processedData,loading:!1,options:t.pagination,"fixed-header":"",height:"100%","hide-default-footer":""},scopedSlots:t._u([{key:"item.datetime",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.datetime))}})]}},{key:"item.humiditycurrent",fn:function(e){var r=e.item;return[t._v(t._s(r.humiditycurrent?(100*r.humiditycurrent).toFixed(0)+"%":""))]}},{key:"item.humiditymin",fn:function(e){var r=e.item;return[t._v(t._s(r.humiditymin?(100*r.humiditymin).toFixed(0)+"%":""))]}},{key:"item.humidityavg",fn:function(e){var r=e.item;return[t._v(t._s(r.humidityavg?(100*r.humidityavg).toFixed(0)+"%":""))]}},{key:"item.humiditymax",fn:function(e){var r=e.item;return[t._v(t._s(r.humiditymax?(100*r.humiditymax).toFixed(0)+"%":""))]}},{key:"item.co2avg",fn:function(e){var r=e.item;return[t._v(t._s(r.co2avg?r.co2avg.toFixed(0):""))]}}])})],1)},a=[],o=r("d0eb"),s=r("c1df"),l=r.n(s),c=(r("d67f"),r("2f62")),u=r("dd56"),d=r("a9b3"),h=r("6ce0");function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t){var e=g(t,"string");return"symbol"==f(e)?e:e+""}function g(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var b={name:"ChartDataTable",props:["temperature","humidity","co2"],mixins:[d["a"],h["a"]],components:{},beforeMount:function(){this.vpdAdjustment=-1*localStorage.getItem("leafVpdOffset")},mounted:function(){},data:function(){return{Trimaster:o["a"],pagination:{itemsPerPage:-1,sortBy:["datetime"]},headers:[{text:"Date/Time",align:"left",value:"datetime"},{text:"Avg VPD",value:"vpd",align:"right"},{text:"Temp",value:"tempcurrent",align:"right"},{text:"Temp Min",value:"tempmin",align:"right"},{text:"Temp Avg",value:"tempavg",align:"right"},{text:"Temp Max",value:"tempmax",align:"right"},{text:"Hum",value:"humiditycurrent",align:"right"},{text:"Hum Min",value:"humiditymin",align:"right"},{text:"Hum Avg",value:"humidityavg",align:"right"},{text:"Hum Max",value:"humiditymax",align:"right"},{text:"CO2",value:"co2current",align:"right"},{text:"CO2 Min",value:"co2min",align:"right"},{text:"CO2 Avg",value:"co2avg",align:"right"},{text:"CO2 Max",value:"co2max",align:"right"}],vpdAdjustment:0}},computed:m(m({},Object(c["c"])(["getUser"])),{},{userUnitPreference:function(){return this.getUser.preferences.find((function(t){return"units"===t.preference}))},processedData:function(){for(var t={},e=[],r=null,n=0;n<this.temperature.length;n++)"imperial"===this.userUnitPreference.setting?(t[this.temperature[n].date]={tempcurrent:"--",tempavg:Object(u["a"])(this.temperature[n].avgReading).toFixed(1),tempmin:Object(u["a"])(this.temperature[n].minReading).toFixed(1),tempmax:Object(u["a"])(this.temperature[n].maxReading).toFixed(1)},this.temperature[n].reading&&(t[this.temperature[n].date].tempcurrent=Object(u["a"])(this.temperature[n].reading.toFixed(2)).toFixed(1))):(t[this.temperature[n].date]={tempcurrent:"--",tempavg:this.temperature[n].avgReading,tempmin:this.temperature[n].minReading,tempmax:this.temperature[n].maxReading},this.temperature[n].reading&&(t[this.temperature[n].date].tempcurrent=this.temperature[n].reading.toFixed(2)));for(var i=0;i<this.humidity.length;i++)t[this.humidity[i].date]?t[this.humidity[i].date]=Object.assign(t[this.humidity[i].date],{humiditycurrent:"",humidityavg:this.humidity[i].avgReading,humiditymin:this.humidity[i].minReading,humiditymax:this.humidity[i].maxReading}):t[this.humidity[i].date]={humiditycurrent:"",humidityavg:this.humidity[i].avgReading,humiditymin:this.humidity[i].minReading,humiditymax:this.humidity[i].maxReading},this.humidity[i].reading&&(t[this.humidity[i].date].humiditycurrent=this.humidity[i].reading);for(var a=0;a<this.co2.length;a++)t[this.co2[a].date]?t[this.co2[a].date]=Object.assign(t[this.co2[a].date],{co2current:this.co2[a].reading,co2avg:this.co2[a].avgReading,co2min:this.co2[a].minReading,co2max:this.co2[a].maxReading}):t[this.co2[a].date]={co2current:this.co2[a].reading,co2avg:this.co2[a].avgReading,co2min:this.co2[a].minReading,co2max:this.co2[a].maxReading};for(var o in t){if(t[o].tempavg&&t[o].humidityavg){var s=0;s="imperial"===this.userUnitPreference.setting?5*(parseFloat(t[o].tempavg)-32)/9:parseFloat(t[o].tempavg);var l=t[o].humidityavg;r=this.calcVpd(s,l,this.vpdAdjustment)}else r=null;var c={datetime:o,vpd:r,tempcurrent:t[o].tempcurrent,tempavg:t[o].tempavg,tempmin:t[o].tempmin,tempmax:t[o].tempmax,humiditycurrent:t[o].humiditycurrent,humidityavg:t[o].humidityavg,humiditymin:t[o].humiditymin,humiditymax:t[o].humiditymax,co2current:t[o].co2current,co2avg:t[o].co2avg,co2min:t[o].co2min,co2max:t[o].co2max};e.push(c)}return this.$emit("set-vpd-data",e),e}}),watch:{},methods:{downloadCsv:function(){var t=this.processedData;t.sort((function(t,e){var r=l()(t.datetime),n=l()(e.datetime);return r.diff(n)>0?1:-1})),o["a"].csvExport(t,"EnvironmentData.csv",this.getUser.apitoken,["datetime","tempcurrent","tempavg","tempmin","tempmax","vpd","humiditycurrent","humidityavg","humiditymin","humiditymax","co2current","co2avg","co2min","co2max"])}}},w=b,x=r("2877"),S=Object(x["a"])(w,i,a,!1,null,null,null);e["a"]=S.exports},dbd0:function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=r("8fea"),o=function(){var t=this,e=t._self._c;return e(n["a"],{staticClass:"gridcard screen-height-container flex-content",attrs:{id:"lifecycleEvents",flat:""}},[e(i["d"],[e("h3",{staticClass:"text-center",staticStyle:{width:"100%"}},[t._v("\n      Lifecycle "+t._s(t.lifecycleId)+" Events\n      "),""!=t.growplanName?e("span",{staticClass:"text-truncate"},[t._v("- "+t._s(t.growplanName))]):t._e()])]),e(i["c"],[e(a["a"],{attrs:{headers:t.headers,items:t.items,"hide-default-footer":"",options:t.pagination,"fixed-header":"",height:"100%"},scopedSlots:t._u([{key:"item",fn:function(r){var n=r.item;r.select;return[e("tr",[e("td",{class:t.isOld(n.scheduledStart,n.phaseChange),domProps:{innerHTML:t._s(t.moment(n.scheduledStart).fromNow())}}),e("td",{class:t.isOld(n.scheduledStart,n.phaseChange)},[t._v(t._s(n.scheduledStart.split("T")[0]))]),e("td",{class:t.isOld(n.scheduledStart,n.phaseChange)},[t._v(t._s(n.taskName))]),e("td",{class:t.isOld(n.scheduledStart,n.phaseChange)},[t._v(t._s(n.growPhaseName))])])]}}])})],1)],1)},s=[],l=r("2f62"),c=r("d0eb"),u=r("c1df"),d=r.n(u),h=r("a9b3");function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t){var e=g(t,"string");return"symbol"==f(e)?e:e+""}function g(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function b(t,e){return C(t)||_(t,e)||x(t,e)||w()}function w(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){if(t){if("string"==typeof t)return S(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function C(t){if(Array.isArray(t))return t}var O={name:"zone-devices-lifecycles",mixins:[h["a"]],props:{platformGroupId:{type:[Number,String],default:0}},beforeMount:function(){this.refresh(this.platformGroupId)},data:function(){return{lifecycleId:"",growplanName:"",Trimaster:c["a"],moment:d.a,pagination:{itemsPerPage:-1,sortBy:["scheduledStart"]},headers:[{text:"Date/Time",value:"scheduledStart",align:"left",sortable:!0},{text:"On",value:"scheduledStart2",align:"left",sortable:!1},{text:"Task",value:"taskName",align:"left",sortable:!0},{text:"Phase",value:"growPhaseName",align:"left",sortable:!0}],items:[]}},watch:{platformGroupId:function(t){this.refresh(t)}},methods:{refresh:function(t){var e=this;c["a"].get("ag_platformGroups/getInFlightLifecycleTasks",this.getUser.apitoken,{platformGroupId:t}).then((function(t){var r=b(t,2),n=r[0];r[1];e.items=n,e.items.length>0?(e.lifecycleId=e.items[0].ag_lifecycles_id,c["a"].get("ag_growplans/"+e.items[0].growplan_id,e.getUser.apitoken).then((function(t){var r=b(t,2),n=r[0];r[1];return e.growplanName=n.growplanName,c["a"].get("ag_lifecyclePhases",e.getUser.apitoken,{filter:{include:["ag_growPhases"],where:{lifecycle_id:e.lifecycleId}}})})).then((function(t){for(var r=b(t,2),n=r[0],i=(r[1],0);i<n.length;i++){var a=null;a=n[i].starttime?n[i].starttime.split("T")[0]:n[i].scheduledStart.split("T")[0],e.items.push({scheduledStart:a,taskName:"Start New Lifecycle Phase",growPhaseName:n[i].ag_growPhases.growPhaseName,phaseChange:!0})}}))):(e.lifecycleId="",e.growplanName="")}))},isOld:function(t,e){return new Date(t)<new Date&&!e?"linethrough":e?"phaseChange":""}},computed:m({},Object(l["c"])(["getUser"]))},P=O,D=(r("4e2b"),r("2877")),k=Object(D["a"])(P,o,s,!1,null,null,null);e["a"]=k.exports},dc2f:function(t,e,r){"use strict";r("c25e")},ddd7:function(t,e,r){"use strict";r("3aac")},de1e:function(t,e,r){"use strict";var n=r("8fea"),i=r("132d"),a=r("e0c7"),o=r("71a3"),s=r("c671"),l=r("fe57"),c=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100",staticStyle:{"padding-left":"5px","padding-right":"5px","padding-top":"10px"},attrs:{id:"zone-parameters"}},[e(l["a"],{staticClass:"h-100",staticStyle:{border:"1px solid silver"},attrs:{vertical:""},model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},[t._l(t.zones,(function(r,n){return e(o["a"],{key:n},[t._v(t._s(r.zonename))])})),t._l(t.zones,(function(r,o){return e(s["a"],{key:"tab"+r.zonename},[e("div",{staticClass:"h-100",staticStyle:{overflow:"auto","border-left":"1px solid silver"}},[r.tempParameters.length>0?e(a["a"],[e(i["a"],[t._v("satellite")]),t._v("Temperature\n        ")],1):t._e(),r.tempParameters.length>0?e(n["a"],{attrs:{headers:r.tempHeaders,"hide-default-footer":!0,items:r.tempRows,flat:"",height:"auto"}}):t._e(),r.tempParameters.length>0?e("div",{staticClass:"divider"}):t._e(),r.co2Parameters.length>0?e(a["a"],[e(i["a"],[t._v("filter_drama")]),t._v("CO2\n        ")],1):t._e(),r.co2Parameters.length>0?e(n["a"],{attrs:{headers:r.co2Headers,"hide-default-footer":!0,items:r.co2Rows,flat:""},scopedSlots:t._u([{key:"item.CO2WarnMin",fn:function(e){var r=e.item;return[t._v(t._s(r.CO2WarnMin)+" ppm")]}},{key:"item.co2Min",fn:function(e){var r=e.item;return[t._v(t._s(r.co2Min)+" ppm")]}},{key:"item.CO2SetPoint",fn:function(e){var r=e.item;return[t._v(t._s(r.CO2SetPoint)+" ppm")]}},{key:"item.CO2Max",fn:function(e){var r=e.item;return[t._v(t._s(r.CO2Max)+" ppm")]}},{key:"item.CO2WarnMax",fn:function(e){var r=e.item;return[t._v(t._s(r.CO2WarnMax)+" ppm")]}}],null,!0)}):t._e(),r.co2Parameters.length>0?e("div",{staticClass:"divider"}):t._e(),r.humidityParameters.length>0?e(a["a"],[e(i["a"],[t._v("opacity")]),t._v("Humidity\n        ")],1):t._e(),r.humidityParameters.length>0?e(n["a"],{attrs:{headers:r.humidityHeaders,"hide-default-footer":!0,items:r.humidityRows,flat:""},scopedSlots:t._u([{key:"item.humidityWarnMin",fn:function(e){var r=e.item;return[t._v(t._s(r.humidityWarnMin)+" %")]}},{key:"item.humidityMin",fn:function(e){var r=e.item;return[t._v(t._s(r.humidityMin)+" %")]}},{key:"item.humiditySetPoint",fn:function(e){var r=e.item;return[t._v(t._s(r.humiditySetPoint)+" %")]}},{key:"item.humidityMax",fn:function(e){var r=e.item;return[t._v(t._s(r.humidityMax)+" %")]}},{key:"item.humidityWarnMax",fn:function(e){var r=e.item;return[t._v(t._s(r.humidityWarnMax)+" %")]}}],null,!0)}):t._e(),r.humidityParameters.length>0?e("div",{staticClass:"divider"}):t._e(),r.lightParameters.length>0?e(a["a"],[e(i["a"],[t._v("highlight")]),t._v("Lights\n        ")],1):t._e(),r.lightParameters.length>0&&r.parameterName?e(n["a"],{attrs:{headers:r.lightHeaders,"hide-default-footer":!0,items:r.lightRows,flat:""}}):t._e(),r.lightParameters.length>0?e("div",{staticClass:"divider"}):t._e(),r.otherParameters.length>0?e(a["a"],[t._v("Others")]):t._e(),r.otherParameters.length>0?e(n["a"],{attrs:{headers:r.othersHeaders,"hide-default-footer":!0,items:r.othersRows,flat:""}}):t._e()],1)])}))],2)],1)},u=[],d=r("dd56"),h=r("2f62"),f=r("9908"),p=(r("d67f"),r("d0eb"));function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t,e){return x(t)||w(t,e)||g(t,e)||y()}function y(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(t,e){if(t){if("string"==typeof t)return b(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function w(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function x(t){if(Array.isArray(t))return t}function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){C(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function C(t,e,r){return(e=O(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function O(t){var e=P(t,"string");return"symbol"==m(e)?e:e+""}function P(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var D={name:"zone-parameters",props:["device_id","platformGroup_id"],components:{Loading:f["a"]},data:function(){return{Trimaster:p["a"],isLoading:!1,zonesParameters:[],zones:[],zoneIds:[],tab:""}},beforeMount:function(){this.refresh()},computed:_(_({},Object(h["c"])(["getUser"])),{},{userUnitPreference:function(){return this.getUser.preferences.find((function(t){return"units"===t.preference}))},id:function(){return this.device_id}}),methods:{convertTempSetPoint:function(t){return"imperial"===this.userUnitPreference.setting?"".concat(Object(d["a"])(t).toFixed(1)," F"):"".concat(parseFloat(t).toFixed(1)," C")},getZones:function(){var t=this;t.isLoading=!0,p["a"].get("deviceParametersView",t.getUser.apitoken,{filter:{where:{device_id:t.device_id,parameterType:"zone_id",numericValue:{neq:null}}}}).then((function(e){var r=v(e,2),n=r[0];r[1];t.zones=n;for(var i=t.zones.length-1;i>=0;i--)t.zoneIds.push(t.zones[i].numericValue),t.zones[i].growZone={},t.zones[i].co2Headers=[],t.zones[i].co2Parameters=[],t.zones[i].co2Rows=[{}],t.zones[i].humidityHeaders=[],t.zones[i].humidityParameters=[],t.zones[i].humidityRows=[{}],t.zones[i].lightHeaders=[],t.zones[i].lightParameters=[],t.zones[i].lightRows=[{}],t.zones[i].tempHeaders=[],t.zones[i].tempParameters=[],t.zones[i].tempRows=[{}],t.zones[i].othersHeaders=[],t.zones[i].otherParameters=[],t.zones[i].othersRows=[{}];t.getParameters()}))},compareParametersByValue:function(t,e){return isNaN(t.value)?1:isNaN(e.value)||parseFloat(t.value)<parseFloat(e.value)?-1:parseFloat(t.value)>parseFloat(e.value)?1:0},getParameters:function(){var t=this;t.isLoading=!0,p["a"].get("zoneParameters",t.getUser.apitoken,{filter:{where:{zone_id:{inq:t.zoneIds}}}}).then((function(e){var r=v(e,2),n=r[0];r[1];t.zonesParameters=n,t.zonesParameters.sort(t.compareParametersByValue),t.isLoading=!1}))},parseHeader:function(t,e,r){var n=t.replace(e.toUpperCase(),"");return n=n.replace(e.toLowerCase(),""),n=n.replace(/([A-Z])/g," $1").replace(/^./,(function(t){return t.toUpperCase()})).trim(),"Grow"===r&&(n.includes("Point")||(n="".concat(n," Point"))),n},refresh:function(){this.isLoading=!0,this.getZones(),this.getParameters()}},watch:{zonesParameters:function(t){var e="",r=this;this.zones.map((function(e){t.map((function(t){if(e.numericValue==t.zone_id)if(e.parameters=t,t.zoneParameterName.includes("co2")||t.zoneParameterName.includes("CO2"))"growZone"===e.parameterName&&"Grow"===t.zoneType?e.co2Headers.push({text:r.parseHeader(t.zoneParameterName,"co2","Grow"),value:t.zoneParameterName,align:"left",sortable:!1}):e.co2Headers.push({text:t.zoneParameterName,value:t.zoneParameterName,align:"left",sortable:!1}),e.co2Rows[0][t.zoneParameterName]=t.value,e.co2Parameters.push(t);else if(t.zoneParameterName.includes("humidity"))"growZone"===e.parameterName&&"Grow"===t.zoneType?e.humidityHeaders.push({text:r.parseHeader(t.zoneParameterName,"humidity","Grow"),value:t.zoneParameterName,align:"left",sortable:!1}):e.humidityHeaders.push({text:t.zoneParameterName,value:t.zoneParameterName,align:"left",sortable:!1}),e.humidityRows[0][t.zoneParameterName]=t.value,e.humidityParameters.push(t);else if(t.zoneParameterName.includes("light")){"growZone"===e.parameterName&&"Grow"===t.zoneType?e.lightHeaders.push({text:r.parseHeader(t.zoneParameterName,"light","Grow"),value:t.zoneParameterName,align:"left",sortable:!1}):e.lightHeaders.push({text:t.zoneParameterName,value:t.zoneParameterName,align:"left",sortable:!1});var n=t.value.match(/.{1,2}/g);e.lightRows[0][t.zoneParameterName]="".concat(n[0],":").concat(n[1]),e.lightParameters.push(t)}else t.zoneParameterName.includes("temp")?("growZone"===e.parameterName&&"Grow"===t.zoneType?e.tempHeaders.push({text:r.parseHeader(t.zoneParameterName,"temp","Grow"),value:t.zoneParameterName,align:"left",sortable:!1}):e.tempHeaders.push({text:t.zoneParameterName,value:t.zoneParameterName,align:"left",sortable:!1}),e.tempRows[0][t.zoneParameterName]=r.convertTempSetPoint(t.value),e.tempParameters.push(t)):(e.othersHeaders.push({text:t.zoneParameterName,value:t.zoneParameterName,align:"left",sortable:!1}),e.othersRows[0][t.zoneParameterName]=t.value,e.otherParameters.push(t))}))})),e=JSON.stringify(r.zones),r.zones=JSON.parse(e)}}},k=D,T=(r("c5b7"),r("2877")),j=Object(T["a"])(k,c,u,!1,null,"225731da",null);e["a"]=j.exports},df6e:function(t,e,r){"use strict";r("791f")},e0a5:function(t,e,r){"use strict";var n=r("62ad"),i=r("4bd4"),a=r("1d4d"),o=r("0fd9"),s=r("b974"),l=r("8654"),c=r("a844"),u=function(){var t=this,e=t._self._c;return e(i["a"],{ref:"form",staticClass:"h-100 px-3",staticStyle:{"max-width":"720px",margin:"auto"},model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(o["a"],{attrs:{"no-gutters":""}},[e(n["a"],{staticStyle:{"padding-top":"15px","text-align":"center"},attrs:{cols:"12"}},[e("label",{staticClass:"v-label",staticStyle:{"margin-top":"30px"}},[t._v("Plant Health:")])]),e(n["a"],{staticStyle:{"text-align":"center"},attrs:{cols:"12"}},[e(a["a"],{attrs:{label:"Overall Plant Health"},model:{value:t.value.rating,callback:function(e){t.$set(t.value,"rating",e)},expression:"value.rating"}})],1)],1),e(o["a"],{attrs:{justify:"center","no-gutters":""}},[e(n["a"],{attrs:{sm:"12"}},[e(o["a"],{attrs:{justify:"space-between"}},[e(n["a"],{attrs:{cols:"12"}},[e(o["a"],{attrs:{justify:"space-around"}},[e(n["a"],{staticClass:"pt-3",attrs:{cols:"6",sm:"3"},on:{click:function(e){t.numberUpload=1}}},[e("upload-image",{attrs:{imageUploadInfo:t.imageUploadInfo,numberUpload:1,chunked:!0},model:{value:t.value.fileUploadUrl1,callback:function(e){t.$set(t.value,"fileUploadUrl1",e)},expression:"value.fileUploadUrl1"}})],1),e(n["a"],{staticClass:"pt-3",attrs:{cols:"6",sm:"3"},on:{click:function(e){t.numberUpload=2}}},[e("upload-image",{attrs:{imageUploadInfo:t.imageUploadInfo,numberUpload:2,chunked:!0},model:{value:t.value.fileUploadUrl2,callback:function(e){t.$set(t.value,"fileUploadUrl2",e)},expression:"value.fileUploadUrl2"}})],1),e(n["a"],{staticClass:"pt-3",attrs:{cols:"6",sm:"3"},on:{click:function(e){t.numberUpload=3}}},[e("upload-image",{attrs:{imageUploadInfo:t.imageUploadInfo,numberUpload:3,chunked:!0},model:{value:t.value.fileUploadUrl3,callback:function(e){t.$set(t.value,"fileUploadUrl3",e)},expression:"value.fileUploadUrl3"}})],1),e(n["a"],{staticClass:"pt-3",attrs:{cols:"6",sm:"3"},on:{click:function(e){t.numberUpload=4}}},[e("upload-image",{attrs:{imageUploadInfo:t.imageUploadInfo,numberUpload:4,chunked:!0},model:{value:t.value.fileUploadUrl4,callback:function(e){t.$set(t.value,"fileUploadUrl4",e)},expression:"value.fileUploadUrl4"}})],1)],1)],1)],1),e("div",{staticStyle:{"padding-top":"15px"}},[e(s["a"],{staticClass:"no-details",attrs:{dense:"",chips:"","deletable-chips":"",items:t.nutrientDeficiencySymptoms,"item-value":"id","item-text":"label",multiple:"",clearable:"",label:"Adverse Leaf Conditions"},model:{value:t.value.ag_nutrientDeficiencySymptoms,callback:function(e){t.$set(t.value,"ag_nutrientDeficiencySymptoms",e)},expression:"value.ag_nutrientDeficiencySymptoms"}}),""!=t.possibleNutrientDeficiencies?e("div",{staticStyle:{"padding-bottom":"10px","font-size":"0.9em","font-weight":"bold"}},[t._v("Possible nutrient deficiencies: "+t._s(t.possibleNutrientDeficiencies))]):t._e()],1),e(o["a"],{staticClass:"pt-2",attrs:{"no-gutters":""}},[e(n["a"],{staticClass:"pr-2",attrs:{cols:"9",md:"4"}},[e(l["a"],{attrs:{label:"Plant Height",rules:[t.rules.positiveNumber],type:"number"},model:{value:t.value.averagePlantHeight,callback:function(e){t.$set(t.value,"averagePlantHeight",e)},expression:"value.averagePlantHeight"}})],1),e(n["a"],{attrs:{cols:"3"}},[e(s["a"],{attrs:{label:"Units",items:["in","mm"]},model:{value:t.value.averagePlantHeightMeasurement,callback:function(e){t.$set(t.value,"averagePlantHeightMeasurement",e)},expression:"value.averagePlantHeightMeasurement"}})],1),e(n["a"],{attrs:{cols:"9"}},[e(l["a"],{staticClass:"pr-2",attrs:{label:"Root Length",rules:[t.rules.positiveNumber],type:"number"},model:{value:t.value.rootLength,callback:function(e){t.$set(t.value,"rootLength",e)},expression:"value.rootLength"}})],1),e(n["a"],{attrs:{cols:"3"}},[e(s["a"],{attrs:{label:"Units",items:["in","mm"]},model:{value:t.value.rootLengthMeasurement,callback:function(e){t.$set(t.value,"rootLengthMeasurement",e)},expression:"value.rootLengthMeasurement"}})],1)],1),e(o["a"],{attrs:{"no-gutters":""}},[e(n["a"],{attrs:{md:"6",cols:"12"}},[e(s["a"],{attrs:{clearable:"",label:"Leaf Color",items:t.plantColors,"item-text":"label","item-value":"id"},model:{value:t.value.ag_plantColor_id,callback:function(e){t.$set(t.value,"ag_plantColor_id",e)},expression:"value.ag_plantColor_id"}})],1),e(n["a"],{attrs:{md:"6",cols:"12"}},[e(s["a"],{attrs:{label:"Plant Diseases",items:t.plantDiseases,"item-text":"label","item-value":"id",clearable:""},model:{value:t.value.ag_plantDisease_id,callback:function(e){t.$set(t.value,"ag_plantDisease_id",e)},expression:"value.ag_plantDisease_id"}})],1)],1),e(o["a"],{attrs:{"no-gutters":""}},[e(n["a"],{staticClass:"pr-2",attrs:{md:"6"}},[e(s["a"],{attrs:{clearable:"",label:"Root Color",items:t.rootColors,"item-text":"label","item-value":"id"},model:{value:t.value.ag_rootColor_id,callback:function(e){t.$set(t.value,"ag_rootColor_id",e)},expression:"value.ag_rootColor_id"}})],1),e(n["a"],{staticClass:"pl-2",attrs:{md:"6"}},[e(s["a"],{attrs:{clearable:"",label:"Unwanted Plant Present",items:t.unwantedPlants,"item-text":"label","item-value":"id"},model:{value:t.value.ag_unwantedPlant_id,callback:function(e){t.$set(t.value,"ag_unwantedPlant_id",e)},expression:"value.ag_unwantedPlant_id"}})],1)],1),e(c["a"],{staticClass:"pt-2",attrs:{outlined:"",name:"lcrComments",label:"Comments",height:"130",counter:"512"},model:{value:t.value.notes,callback:function(e){t.$set(t.value,"notes",e)},expression:"value.notes"}})],1)],1)],1)},d=[],h=r("d0eb"),f=r("d67f"),p=r("2f62"),m=r("24e5"),v=r("9c4f");function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){return _(t)||S(t,e)||w(t,e)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function _(t){if(Array.isArray(t))return t}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return(e=D(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D(t){var e=k(t,"string");return"symbol"==y(e)?e:e+""}function k(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"});var T={name:"lifecycleStatusReport",mixins:[v["a"]],props:["value"],components:{UploadImage:m["a"]},data:function(){return{isLoading:!1,numberUpload:0,valid:!1,displayUploader:!1,nutrients:{},nutrientMap:{},unwantedPlant:"",plantDisease:"",plantColor:"",diagnoses:[],symptomDiagnosisMap:{},diagnosisMap:{},nutrientDeficiencySymptoms:[],unwantedPlants:[],plantColors:[],rootColors:[],plantDiseases:[],imageUploadInfo:{name:"lifecycleReport",uploadUrl:"ag_lifecycleReports/s3Upload",bucketName:"agrifyinsights/lifecycle_report"}}},beforeMount:function(){var t=this;t.refresh()},mounted:function(){},computed:O(O({},Object(p["c"])(["getUser"])),{},{possibleNutrientDeficiencies:function(){if(this.clearDiagnosisMap(),this.value.ag_nutrientDeficiencySymptoms&&this.diagnoses)for(var t=0;t<this.value.ag_nutrientDeficiencySymptoms.length;t++)for(var e=this.value.ag_nutrientDeficiencySymptoms[t],r=0;r<this.symptomDiagnosisMap[e].length;r++){var n=this.symptomDiagnosisMap[e][r];this.diagnosisMap[n].found++,this.diagnosisMap[n].pct=this.diagnosisMap[n].found/this.diagnosisMap[n].count}var i=[];for(var a in this.diagnosisMap)this.diagnosisMap[a].found>0&&i.push(this.diagnosisMap[a]);i.sort((function(t,e){return e.pct-t.pct}));for(var o=[],s=0;s<i.length;s++)o.push(i[s].label+" ("+Math.round(100*i[s].pct)+"%)");return o.join(",")}}),watch:{},methods:{clearDiagnosisMap:function(){for(var t in this.diagnosisMap)this.diagnosisMap[t].found=0,this.diagnosisMap[t].pct=0},refresh:function(){var t=this;t.isLoading=!0,h["a"].displayMetric(t.getUser)?(this.value.averagePlantHeightMeasurement="mm",this.value.rootLengthMeasurement="mm"):(this.value.averagePlantHeightMeasurement="in",this.value.rootLengthMeasurement="in");var e=[h["a"].get("ag_unwantedPlants",this.getUser.apitoken,{filter:{fields:{id:!0,label:!0},order:"label"}}),h["a"].get("ag_plantColors",this.getUser.apitoken,{filter:{fields:{id:!0,label:!0},order:"seq ASC"}}),h["a"].get("ag_rootColors",this.getUser.apitoken,{filter:{fields:["id","label"],order:"label"}}),h["a"].get("ag_plantDiseases",this.getUser.apitoken,{filter:{fields:["id","label"],order:"label"}}),h["a"].get("ag_nutrientDeficiencyDiagnoses",this.getUser.apitoken),h["a"].get("ag_nutrientDeficiencySymptoms",this.getUser.apitoken,{filter:{order:"label",fields:["id","label"]}})];Promise.all(e).then((function(e){var r=g(e,6),n=g(r[0],1),i=n[0],a=g(r[1],1),o=a[0],s=g(r[2],1),l=s[0],c=g(r[3],1),u=c[0],d=g(r[4],1),h=d[0],f=g(r[5],1),p=f[0];t.isLoading=!1,t.unwantedPlants=i,t.plantColors=o,t.rootColors=l,t.plantDiseases=u;for(var m=0;m<h.length;m++)t.symptomDiagnosisMap[h[m].ag_nutrientDeficiencySymptom_id]||(t.symptomDiagnosisMap[h[m].ag_nutrientDeficiencySymptom_id]=[]),t.diagnosisMap[h[m].ag_nutrientDeficiency_id]||(t.diagnosisMap[h[m].ag_nutrientDeficiency_id]={label:h[m].ag_nutrientDeficiency_label,count:0,found:0,pct:0}),t.symptomDiagnosisMap[h[m].ag_nutrientDeficiencySymptom_id].push(h[m].ag_nutrientDeficiency_id),t.diagnosisMap[h[m].ag_nutrientDeficiency_id].count++;t.diagnoses=h,t.nutrientDeficiencySymptoms=p})).catch((function(e){console.error(JSON.stringify(e)),f["a"].error("Error loading data"),t.isLoading=!1}))},validate:function(){return this.valid?0!==this.value.rating||(f["a"].error("Please Rate Overall Plant Health"),!1):(this.$refs.form.validate(),f["a"].error("Form Entries Incomplete or Invalid"),!1)}}},j=T,E=(r("9e96"),r("2877")),I=Object(E["a"])(j,u,d,!1,null,null,null);e["a"]=I.exports},e1f4:function(t,e){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);t.exports=function(){return r(n),n}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},e2cd:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("ac7c"),s=r("62ad"),l=r("8fea"),c=r("169a"),u=r("132d"),d=r("0fd9"),h=r("b974"),f=r("2fa4"),p=r("3a2f"),m=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100"},[e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{flat:""}},[e(a["c"],{staticClass:"d-flex flex-column"},[e("div",[e(d["a"],{attrs:{justify:"center","no-gutters":""}},[e(s["a"],{staticClass:"hidden-sm-and-down pr-2",attrs:{lg:"2",md:"2"}},[e(h["a"],{attrs:{items:t.modes,label:"Type"},model:{value:t.logType,callback:function(e){t.logType=e},expression:"logType"}})],1),e(s["a"],{attrs:{sm:"8",md:"5",lg:"5"}},[e(h["a"],{staticStyle:{"padding-top":"2px"},attrs:{items:t.devices,placeholder:"All Devices",label:"Filter by Device","item-text":"device","item-value":"device_id",multiple:"",clearable:"","deletable-chips":"",chips:""},model:{value:t.selectedDevice,callback:function(e){t.selectedDevice=e},expression:"selectedDevice"}})],1),e(s["a"],{staticClass:"pl-2 hidden-sm-and-down",attrs:{md:"1",lg:"1"}},[e(h["a"],{attrs:{items:t.limitItems,label:"Records"},on:{change:function(e){return t.refreshGrid()}},model:{value:t.limit,callback:function(e){t.limit=e},expression:"limit"}})],1),e(s["a"],{staticClass:"pl-2",staticStyle:{"text-align":"right"},attrs:{sm:"4",md:"3",lg:"2"}},[e("span",{staticStyle:{"white-space":"nowrap"}},[e(p["a"],{staticClass:"hidden-sm-and-down",attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"mr-1",attrs:{outlined:"",icon:"",disabled:0===t.deviceHistoryItems.length,color:"primary"},on:{click:t.onExport}},i),[e(u["a"],[t._v("save_alt")])],1)]}}])},[e("span",[t._v("Download as CSV")])]),e(p["a"],{staticClass:"hidden-sm-and-down",attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"ml-1 mr-1",attrs:{outlined:"",icon:"",color:t.dateFilterButtonColor},on:{click:function(e){t.openDateFilters=!0}}},i),[e(u["a"],[t._v("calendar_today")])],1)]}}])},[e("span",[e("strong",[t._v(t._s(t.isDateFilterActive?"ACTIVE":"DISABLED")+" DATE\n                    FILTERS:")]),e("br"),e("strong",[t._v("START DATE:")]),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.startDate))}}),e("br"),e("strong",[t._v("END DATE:")]),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.endDate))}})])]),t.isAdmin?e(p["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"ml-1",attrs:{outlined:"",icon:"",color:t.isDebugModeEnabled?"primary":"silver",disabled:t.isSettingDebugMode},on:{click:t.toggleDebugMode}},i),[e(u["a"],[t._v("bug_report")])],1)]}}],null,!1,283982369)},[e("span",[t._v("Enable/Disable Debug Mode")])]):t._e(),e(p["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[e(n["a"],t._g({staticClass:"ml-1",attrs:{outlined:"",icon:"",color:"primary"},on:{click:function(e){return t.refreshGrid()}}},i),[e(u["a"],[t._v("refresh")])],1)]}}])},[e("span",[t._v("Reload Data")])])],1)])],1)],1),e("div",{staticClass:"historyItems flex-grow-auto h-100"},["Actions"==t.logType?e(l["a"],{staticStyle:{border:"1px solid silver"},attrs:{options:t.pagination,headers:t.headers,items:t.deviceHistoryItems,"hide-default-footer":"",loading:t.isLoading,"fixed-header":"",height:"100%"},on:{"update:options":function(e){t.pagination=e}},scopedSlots:t._u([{key:"item.timestamp",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.timestamp,"MM/DD/YYYY h:mm:ss a"))}})]}},{key:"item.reason",fn:function(r){var i=r.item;return[t.isAdmin?t._e():[t._v(t._s(i.reason))],t.isAdmin?[i.stateMachineData?e(n["a"],{attrs:{outlined:"",color:"primary",small:""},on:{click:function(e){return t.onShowStateMachine(i.stateMachineData,i.timestamp)}}},[t._v("Show")]):e("span",[t._v(t._s(i.reason))])]:e("span",[i.stateMachineData&&i.stateMachineData.ruleExpr?[t._v("\n              "+t._s(i.stateMachineData.ruleExpr.replace("{{","").replace("}","").replace("}",""))+"\n              ")]:t._e()],2)]}}],null,!1,3792474251)}):t._e(),"Commands"==t.logType?e("controller-commands-history",{ref:"controllerCommandsHistory",attrs:{startDate:t.selectedStartDate+" "+t.selectedStartTime,endDate:t.selectedEndDate+" "+t.selectedEndTime,isDateFilterActive:t.isDateFilterActive,limit:t.limit,user:t.getUser,selectedDevices:t.selectedDevice,platformGroup_id:t.platformGroupId}}):t._e()],1)])],1),t.isAdmin?e(c["a"],{attrs:{width:"1024"},model:{value:t.showStateMachine,callback:function(e){t.showStateMachine=e},expression:"showStateMachine"}},[t.stateMachine.ag_controlLoopDiagram_version||t.stateMachine.id?e("display-fsa-decision-details",{attrs:{ag_controlLoopDiagramType_id:t.stateMachine.ag_controlLoopDiagramType_id,message:t.stateMachine.message,ag_controlLoopDiagram_version:t.stateMachine.ag_controlLoopDiagram_version,ruleNumber:t.stateMachine.ruleNumber,timestamp:t.stateMachine.timestamp,platformGroupName:t.platformGroupName},on:{close:function(e){t.showStateMachine=!1}},model:{value:t.stateMachine.details,callback:function(e){t.$set(t.stateMachine,"details",e)},expression:"stateMachine.details"}}):t._e()],1):t._e(),e(c["a"],{attrs:{width:"300"},model:{value:t.openDateFilters,callback:function(e){t.openDateFilters=e},expression:"openDateFilters"}},[e(i["a"],[e(a["d"],[e("h2",[t._v("Date Filters")]),e(f["a"]),e(o["a"],{attrs:{label:"Active"},model:{value:t.isDateFilterActive,callback:function(e){t.isDateFilterActive=e},expression:"isDateFilterActive"}})],1),e(a["c"],[e(d["a"],{attrs:{justify:"center","no-gutters":""}},[e(s["a"],{attrs:{cols:"6"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.startDate")},model:{value:t.selectedStartDate,callback:function(e){t.selectedStartDate=e},expression:"selectedStartDate"}}),e("vuetify-timepicker",{attrs:{label:t.$t("common.startTime")},model:{value:t.selectedStartTime,callback:function(e){t.selectedStartTime=e},expression:"selectedStartTime"}})],1),e(s["a"],{staticClass:"pr-3",attrs:{cols:"6"}},[e("vuetify-datepicker",{attrs:{label:t.$t("common.endDate")},model:{value:t.selectedEndDate,callback:function(e){t.selectedEndDate=e},expression:"selectedEndDate"}}),e("vuetify-timepicker",{attrs:{label:t.$t("common.endTime")},model:{value:t.selectedEndTime,callback:function(e){t.selectedEndTime=e},expression:"selectedEndTime"}})],1)],1)],1)],1)],1)],1)},v=[],y=r("d0eb"),g=r("4458"),b=r("dd20"),w=r("c1df"),x=r.n(w),S=r("d67f"),_=r("2f62"),C=r("a9b3"),O=r("b4e3"),P=function(){var t=this,e=t._self._c;return e(l["a"],{staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,items:t.commands,"hide-default-footer":"",loading:t.isLoading,options:t.pagination,"fixed-header":"",height:"100%"},on:{"update:options":function(e){t.pagination=e}},scopedSlots:t._u([{key:"item.timestamp",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"},domProps:{innerHTML:t._s(t.formatDateWithHTML(n.timestamp,"MM/DD/YYYY h:mm:ss a"))}})]}},{key:"item.username",fn:function(r){var n=r.item;return[e("span",{staticStyle:{"white-space":"nowrap"}},[t._v(t._s(n.username))])]}}])})},D=[];function k(t,e){return L(t)||I(t,e)||j(t,e)||T()}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function I(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function L(t){if(Array.isArray(t))return t}var A={name:"",props:["startDate","endDate","isDateFilterActive","limit","user","platformGroup_id","selectedDevices"],mixins:[C["a"]],components:{},beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{commands:[],isLoading:!1,pagination:{sortDesc:[!0],sortBy:["timestamp"],itemsPerPage:-1},headers:[{text:"Time Stamp",align:"left",value:"timestamp",sortable:!0},{text:"Command",align:"left",sortable:!0,value:"commandString"},{text:"Device",align:"left",sortable:!1,value:"deviceName"},{text:"Issued By",align:"left",sortable:!0,value:"username"}]}},computed:{},watch:{startDate:function(t,e){this.refresh()},endDate:function(t,e){this.refresh()},isDateFilterActive:function(t,e){this.refresh()},selectedDevices:function(t,e){this.refresh()}},methods:{onExport:function(){y["a"].csvExport(this.commands,"CommandLog-"+this.platformGroup_Id+".csv",this.user.apitoken)},refresh:function(){var t=this;t.isLoading=!0,y["a"].get("ag_platformGroups/"+this.platformGroup_id,this.user.apitoken).then((function(e){var r=k(e,2),n=r[0],i=(r[1],{order:"timestamp DESC",limit:t.limit,include:[{relation:"user",scope:{fields:["name"]}},{relation:"device",scope:{fields:["name"]}}],where:{controller_id:n.controller_id}});if(t.isDateFilterActive){var a=y["a"].getDateTimeAsUtc(x()(t.startDate),t.user,t.$root.timePreference).format(),o=y["a"].getDateTimeAsUtc(x()(t.endDate),t.user,t.$root.timePreference).format();i.where.and=[{timestamp:{gt:a}},{timestamp:{lt:o}}]}return t.selectedDevices&&t.selectedDevices.length>0&&(i.where.virtualDevice_id={inq:t.selectedDevices}),y["a"].get("controllerCommandsHistories",t.user.apitoken,{filter:i})})).then((function(e){for(var r=k(e,2),n=r[0],i=(r[1],0);i<n.length;i++)n[i].user?n[i].username=n[i].user.name:n[i].username="Unknown",n[i].device&&(n[i].deviceName=n[i].device.name);t.commands=n,t.isLoading=!1}))}}},M=A,U=r("2877"),N=Object(U["a"])(M,P,D,!1,null,null,null),F=N.exports,G=r("b047"),R=r.n(G);function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){V(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t,e,r){return(e=B(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B(t){var e=z(t,"string");return"symbol"==Y(e)?e:e+""}function z(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function q(t){return Z(t)||J(t)||Q(t)||W()}function W(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Z(t){if(Array.isArray(t))return tt(t)}function X(t,e){return rt(t)||et(t,e)||Q(t,e)||K()}function K(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q(t,e){if(t){if("string"==typeof t)return tt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(t,e):void 0}}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function et(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function rt(t){if(Array.isArray(t))return t}var nt={name:"device-picker",props:["platformGroupId","platformGroupName","selectedZone","passedStartDate","passedStartTime","passedEndDate","passedEndTime","zonetype","controller_id"],mixins:[C["a"]],components:{VuetifyDatepicker:g["a"],VuetifyTimepicker:b["a"],DisplayFsaDecisionDetails:O["a"],ControllerCommandsHistory:F},beforeMount:function(){var t=this;this.isAdmin=y["a"].isAdmin(this.getUser)||y["a"].isUserInRole(this.getUser,"Integrator")||y["a"].isUserInRole(this.getUser,"Maintenance");var e=this.loadDevicePreference("limit");this.limit=e||250;var r=this.loadDevicePreference("logType");this.logType=r||"Actions",t.isLoading=!0,t.start();var n=this.loadDevicePreference("isDateFilterActive");if(null!==n){this.isDateFilterActive=n;var i=this.loadDevicePreference("selectedEndDate"),a=this.loadDevicePreference("selectedStartDate"),o=this.loadDevicePreference("selectedEndTime"),s=this.loadDevicePreference("selectedStartTime");this.selectedEndDate=i||x()().subtract(12,"hour").format("YYYY-MM-DD"),this.selectedStartDate=a||x()().format("YYYY-MM-DD"),this.selectedEndTime=o||x()().subtract(12,"hour").format("HH:mm"),this.selectedStartTime=s||x()().format("HH:mm")}else this.platformGroupId>0&&!this.selectedZone?(this.isDateFilterActive=!1,this.selectedStartDate=x()().subtract(12,"hour").format("YYYY-MM-DD"),this.selectedEndDate=x()().format("YYYY-MM-DD"),this.selectedStartTime=x()().subtract(12,"hour").format("HH:mm"),this.selectedEndTime=x()().format("HH:mm")):(this.isDateFilterActive=!0,this.selectedEndDate=this.passedEndDate,this.selectedStartDate=this.passedStartDate,this.selectedEndTime=this.passedEndTime,this.selectedStartTime=this.passedStartTime)},data:function(){return{isAdmin:!1,isSettingDebugMode:!1,isDebugModeEnabled:!1,modes:["Actions","Commands"],logType:"Actions",stateMachine:{ag_controlLoopDiagramType_id:null,message:null,ag_controlLoopDiagram_version:null,ruleNumber:null},limitItems:[100,250,500,1e3],showStateMachine:!1,limit:250,Trimaster:y["a"],dateFilterButtonColor:"primary",isDateFilterActive:!1,showDeviceName:!0,allDeviceIds:"",selectedDevice:null,index:0,item:null,deviceHistoryItems:[],zoneDevices:[],startDate:x()().subtract(12,"hour").format("MM/DD/YYYY hh:mm A"),endDate:x()().format("MM/DD/YYYY hh:mm A"),selectedStartDate:x()().subtract(12,"hour").format("YYYY-MM-DD"),selectedEndDate:x()().format("YYYY-MM-DD"),selectedStartTime:x()().subtract(12,"hour").format("HH:mm"),selectedEndTime:x()().format("HH:mm"),isSensor:!1,showBoth:!0,isLoading:!1,openDateFilters:!1,devices:[],pagination:{sortDesc:[!0],sortBy:["timestamp"],itemsPerPage:-1},headers:[{text:"Time Stamp",align:"left",value:"timestamp",sortable:!0},{text:"Device",align:"left",sortable:!0,value:"deviceName"},{text:"State",align:"left",sortable:!0,value:"stateName"},{text:"Reason",align:"left",sortable:!1,value:"reason"}]}},methods:{toggleDebugMode:function(){var t=this;this.isSettingDebugMode=!0;var e="";y["a"].get("controllers/"+this.controller_id,t.getUser.apitoken,{filter:{fields:["logLevel"]}}).then((function(r){var n=X(r,2),i=n[0];n[1];"NONE"==i.logLevel?(e="DEBUG",t.isDebugModeEnabled=!0):(e="NONE",t.isDebugModeEnabled=!1),y["a"].post("controllerCommands",t.getUser.apitoken,{controller_id:t.controller_id,action_id:50,loglevel:e}).then((function(r){var n=X(r,2),i=n[0];n[1];t.isSettingDebugMode=!1,i?S["a"].success("Set debug mode to "+e):Object(S["a"])("An error occurred. Please try again later")}))}))},onExport:function(){if("Actions"==this.logType){var t="";t=this.platformGroupId?this.platformGroupId:"Zone-ID-"+this.selectedZone,y["a"].csvExport(this.deviceHistoryItems,"DeviceLog-"+t+".csv",this.getUser.apitoken,null,!0)}else this.$refs.controllerCommandsHistory.onExport()},onShowStateMachine:function(t,e){t.id=t.stateMachineId,this.stateMachine={id:t.stateMachineId,ag_controlLoopDiagramType_id:t.ag_controlLoopDiagramType_id,message:t.reason,ag_controlLoopDiagram_version:t.ag_controlLoopDiagram_version,ruleNumber:t.ruleNumber,details:t,timestamp:e},this.stateMachine.details.currentState=t.environment.ecuState.current,this.showStateMachine=!0},refreshGrid:R()((function(){this.persistDevicePreference("limit",this.limit),"Actions"===this.logType?this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices):this.$refs.controllerCommandsHistory.refresh()}),500),start:function(){var t=this;if(t.isLoading=!0,this.platformGroupId&&this.platformGroupId>0)y["a"].get("devicesAndPlatforms/getPlatformGroupDevices",this.getUser.apitoken,{controller_id:this.controller_id}).then((function(e){var r=X(e,2),n=r[0];r[1];t.devices=n.filter((function(e){return e.platformGroup_id==t.platformGroupId||!e.platformGroup_id})),t.devices.sort((function(t,e){return t.device>e.device?1:-1}));for(var i=[],a=0;t.devices&&a<t.devices.length;a++)i.push(t.devices[a].device_id);t.allDeviceIds=i.join(",");var o=t.loadDevicePreference("deviceIds");o?t.selectedDevice=o.map((function(t){return parseInt(t)})):t.refresh(t.allDeviceIds)}));else if(this.selectedZone){var e={facility_id:t.getUser.facility_id,includeAll:1==this.zonetype||2==this.zonetype};switch(this.zonetype){case 1:e.objType=["Valve"];break;case 2:e.objType=["CO2Valve"];break}""!==t.selectedZone&&(e.zone_id=t.selectedZone),y["a"].get("zoneDevices/getZoneDevices",t.getUser.apitoken,e).then((function(e){var r=X(e,2),n=r[0],i=(r[1],n);i.forEach((function(e,r){e.key=r,1!=t.zonetype&&2!=t.zonetype||(e.device=e.platformGroupName+" "+e.device)})),i.sort((function(t,e){return t.device>e.device?1:-1})),t.devices=i,t.zoneDevices=q(new Set(n.map((function(t){return t.device_id})))),t.isLoading=!1,t.refresh(t.zoneDevices)}))}this.render||(t.zoneDevices=[]),t.isLoading=!1},refresh:function(t){var e=this;e.isLoading=!0,this.controller_id&&y["a"].get("controllers/"+this.controller_id,e.getUser.apitoken,{filter:{fields:["logLevel"]}}).then((function(t){var r=X(t,2),n=r[0];r[1];"NONE"==n.logLevel?e.isDebugModeEnabled=!1:e.isDebugModeEnabled=!0}));var r=x()(this.selectedStartDate+" "+this.selectedStartTime),n=x()(this.selectedEndDate+" "+this.selectedEndTime);this.startDate=r.format(),this.endDate=n.format(),t&&0!=t.length||(t=this.allDeviceIds),"object"==Y(t)&&(t=t.join(","));var i=y["a"].displayMetric(e.getUser),a={order:"timestamp DESC",limit:this.limit};this.isDateFilterActive?(a.startDate=this.startDate,a.endDate=this.endDate):a.startDate=x()().subtract(2,"days").format("YYYY-MM-DD"),t?y["a"].get("virtualDevices/history",e.getUser.apitoken,{device_ids:t,filter:a}).then((function(t){var r=X(t,2),n=r[0];r[1];n=n||[];for(var a=["(Last)","(Max)","(Avg)","(Min)"],o=0;n&&o<n.length;o++){if(1!=e.zonetype&&2!=e.zonetype||(n[o].deviceName=n[o].platformGroupName+" "+n[o].deviceName),-1!==n[o].deviceName.indexOf("Temp")&&n[o].reason&&n[o].reason.length>0){for(var s=[],l=n[o].reason.split("|"),c=0;c<l.length;c++){var u="",d=parseFloat(l[c]);isNaN(d)||(u+=i?d.toFixed(1)+"C ":(9*d/5+32).toFixed(1)+"F ",u+=a[c],s.push(u))}n[o].stateName=s.join(" | "),n[o].reason=null}else if(-1!==n[o].deviceName.indexOf("CO2")&&n[o].reason&&n[o].reason.length>0){if(n[o].deviceName.toLowerCase().indexOf("valve")<0){for(var h=n[o].reason.split("|"),f=[],p=0;p<h.length;p++){var m="",v=parseFloat(h[p]);isNaN(v)||(m+=v.toFixed(1)+" PPM ",m+=a[p],f.push(m))}n[o].stateName=f.join(" | "),n[o].reason=null}}else if(-1!==n[o].deviceName.indexOf("Hum")&&n[o].reason&&n[o].reason.length>0){for(var y=n[o].reason.split("|"),g=[],b=0;b<y.length;b++){var w="",x=parseFloat(y[b]);isNaN(x)||(w+=(100*x).toFixed(0)+"% ",w+=a[b],g.push(w))}n[o].stateName=g.join(" | "),n[o].reason=null}if(n[o].reason&&"{"==n[o].reason.trim().charAt(0))try{n[o].stateMachineData=JSON.parse(n[o].reason),n[o].reason=n[o].stateMachineData.reason}catch(S){}}e.deviceHistoryItems=n,e.isLoading=!1})):e.isLoading=!1},persistDevicePreference:function(t,e){var r=localStorage.getItem("deviceHistoryPreferences");r=r?JSON.parse(r):{};var n=r[this.controller_id]?r[this.controller_id]:{};n[t]=e,r[this.controller_id]=n,localStorage.setItem("deviceHistoryPreferences",JSON.stringify(r))},loadDevicePreference:function(t){var e=localStorage.getItem("deviceHistoryPreferences");e=e?JSON.parse(e):{};var r=e[this.controller_id]?e[this.controller_id]:{};return r[t]?r[t]:null}},computed:H(H(H({},Object(_["c"])(["getUser"])),Object(_["c"])("socketMessages",["getLastEventReceivedForControllerId"])),{},{lastEventReceived:function(){return this.getLastEventReceivedForControllerId(this.controller_id)}}),watch:{lastEventReceived:function(t){t&&"heartbeat"!==t.message&&(console.log("device message received - autorefreshing"),this.refreshGrid())},logType:function(t){switch(t){case"Actions":this.refreshGrid();break;case"Commands":break}this.persistDevicePreference("logType",t)},selectedZone:function(t){t>0&&this.start()},platformGroupId:function(t){t>0&&this.start()},selectedDevice:function(t){this.persistDevicePreference("deviceIds",t),t&&0==t.length?this.allDeviceIds&&this.allDeviceIds.length?this.refresh(this.allDeviceIds):this.refresh(this.zoneDevices):this.refresh(t.join(","))},selectedStartDate:function(t){this.persistDevicePreference("selectedStartDate",t),this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices),this.$root.$emit("startDate",t)},selectedStartTime:function(t){this.persistDevicePreference("selectedStartTime",t),this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices),this.$root.$emit("startTime",t)},selectedEndDate:function(t){this.persistDevicePreference("selectedEndDate",t),this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices),this.$root.$emit("endDate",t)},selectedEndTime:function(t){this.persistDevicePreference("selectedEndTime",t),this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices),this.$root.$emit("endTime",t)},passedStartDate:function(t){this.selectedStartDate=t,this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices),this.$root.$emit("startDate",t)},passedStartTime:function(t){this.selectedStartTime=t,this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices),this.$root.$emit("startTime",t)},passedEndDate:function(t){this.selectedEndDate=t,this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices),this.$root.$emit("endDate",t)},passedEndTime:function(t){this.selectedEndTime=t,this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices),this.$root.$emit("endTime",t)},isDateFilterActive:function(t,e){this.persistDevicePreference("isDateFilterActive",t),this.dateFilterButtonColor=t?"green":"primary",this.selectedDevice?this.refresh(this.selectedDevice):this.refresh(this.zoneDevices)}}},it=nt,at=Object(U["a"])(it,m,v,!1,null,null,null);e["a"]=at.exports},e387:function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=r("8fea"),o=r("2fa4"),s=function(){var t=this,e=t._self._c;return e(n["a"],{staticClass:"screen-height-container flex-content",attrs:{loading:t.isLoading}},[e(i["d"],[e("h2",[e("span",{staticClass:"hidden-sm-and-down"},[t._v("\n        "+t._s(t.microclimateParams.platformGroupName)+"\n      ")]),t._v("\n      Averages vs Settings\n    ")]),e(o["a"]),e("r-button",{directives:[{name:"show",rawName:"v-show",value:"table"==t.mode,expression:"mode == 'table'"}],staticClass:"mr-2",attrs:{color:"primary",icon:"insights",label:"Chart",small:!0},on:{onclick:t.onChart}}),e("r-button",{directives:[{name:"show",rawName:"v-show",value:"chart"==t.mode,expression:"mode == 'chart'"}],staticClass:"mr-2",attrs:{color:"primary",icon:"insights",label:"Table",small:!0},on:{onclick:t.onTable}}),e("r-button",{staticClass:"mr-2",attrs:{color:"primary",icon:"download",label:"Download",small:!0},on:{onclick:t.onDownload}}),e("r-button",{attrs:{color:"primary",icon:"close",label:"Close",small:!0},on:{onclick:t.onClose}})],1),e(i["c"],{staticClass:"d-flex flex-column flex-grow-auto"},[e("div",{staticStyle:{"text-align":"center"}},[t._v("\n      (Date/Time reported as "+t._s(t.timezoneAbbrev)+")\n    ")]),e(a["a"],{directives:[{name:"show",rawName:"v-show",value:"table"===t.mode,expression:"mode === 'table'"}],staticClass:"flex-grow-auto",attrs:{"hide-default-footer":"",headers:t.headers,items:t.data,options:t.pagination,height:"100%","fixed-header":"","must-sort":""},scopedSlots:t._u([{key:"item.sortDate",fn:function(e){return[t._v("\n        "+t._s(e.item.localDate)+"\n      ")]}},{key:"item.temp",fn:function(e){return[t._v("\n        "+t._s(e.item.temp)+"\n        vs\n        "+t._s(e.item.tempSetpoint)+"\n      ")]}},{key:"item.rh",fn:function(e){return[t._v("\n        "+t._s(e.item.rh)+"% vs "+t._s(e.item.rhSetpoint)+"%\n      ")]}},{key:"item.co2",fn:function(e){return[t._v("\n        "+t._s(e.item.co2)+" ppm vs "+t._s(e.item.co2Setpoint)+" ppm\n      ")]}}])}),"chart"==t.mode?e("chart",{model:{value:t.data,callback:function(e){t.data=e},expression:"data"}}):t._e()],1)],1)},l=[],c=r("2f62"),u=r("c1df"),d=r.n(u),h=r("d0eb"),f=r("6ce0"),p=r("e6b0");function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */v=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",y="completed",g={};function b(){}function w(){}function x(){}var S={};c(S,o,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,o)&&(S=C);var O=x.prototype=b.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==m(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?y:f,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=y,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(m(e)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function y(t,e){return S(t)||x(t,e)||b(t,e)||g()}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function x(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function S(t){if(Array.isArray(t))return t}function _(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function C(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){_(a,n,i,o,s,"next",t)}function s(t){_(a,n,i,o,s,"throw",t)}o(void 0)}))}}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return(e=k(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k(t){var e=T(t,"string");return"symbol"==m(e)?e:e+""}function T(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var j={name:"ReviewMicroclimatePerformance",mixins:[f["a"]],components:{Chart:p["a"]},data:function(){return{mode:"chart",pagination:{itemsPerPage:-1,sortBy:["sortDate"],sortDesc:[!0]},headers:[{text:"Date/Time",value:"sortDate",sortable:!0},{text:"Lights",value:"lightState",sortable:!1},{text:"Temp",value:"temp",sortable:!1,align:"center"},{text:"RH",value:"rh",sortable:!1,align:"center"},{text:"CO2",value:"co2",sortable:!1,align:"center"}],isLoading:!1,data:[]}},beforeMount:function(){this.refresh()},computed:P(P(P({},Object(c["c"])(["getUser"])),Object(c["c"])("universalDashboard",["microclimateParams"])),{},{timezoneAbbrev:function(){var t=d.a.tz.guess();return d.a.tz(t).zoneAbbr()}}),methods:{onTable:function(){this.mode="table"},onChart:function(){this.mode="chart"},onDownload:function(){h["a"].csvExport(this.data,"MicroclimateCompliance.csv",this.getUser.apitoken,["date","lightState","temp","tempSetpoint","rh","rhSetpoint","co2","co2Setpoint"])},onClose:function(){this.data=[],this.$store.dispatch("universalDashboard/setShowComplianceDialog",!1)},getPrioritySensor:function(t){var e=null;return t.forEach((function(t){e=e&&e.priority>t.priority?e:t})),e},refresh:function(){var t=this;return C(v().mark((function e(){var r,n,i,a,o,s,l;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=4,h["a"].get("ag_lifecycles/validateEnvironmentV2",t.getUser.apitoken,{controller_id:t.microclimateParams.controller_id,lifecycle_id:t.microclimateParams.lifecycle_id,facility_id:t.microclimateParams.facility_id});case 4:r=e.sent,n=y(r,2),i=n[0],n[1],t.isLoading=!1,a=[],e.t0=v().keys(i.data);case 11:if((e.t1=e.t0()).done){e.next=22;break}o=e.t1.value,s=v().mark((function e(){var r,n,s,c,u,h,f,p,m;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=i.data[o][l],n=d.a.utc(l),s=n.clone().local().format("YYYY-MM-DD"),c=n.clone().local().format("YYYY-MM-DD (ha)"),u=i.lifecyclePhases.filter((function(t){if(!t.starttime)return!1;t.starttime&&!t.endtime&&(t.endtime=d.a.utc().format("YYYY-MM-DDTHH:mm"));var e=d.a.utc(t.starttime.split("T")[0]+" "+t.starttime.split("T")[1].substring(0,5),"YYYY-MM-DD hh:mm"),r=d.a.utc(t.endtime.split("T")[0]+" "+t.endtime.split("T")[1].substring(0,5),"YYYY-MM-DD hh:mm");return n.isBetween(e,r)})),u=u.filter((function(t){var e=d.a.utc(s).set("hour",parseInt(t.photoperiodStarttime.substring(0,2))).set("minute",parseInt(t.photoperiodStarttime.substring(2,4)-1)),r=e.clone().add("hours",t.photoperiod);return"Lights On"==t.lightState?n.isBetween(e,r):!n.isBetween(e,r)})),h=t.getPrioritySensor(r.hum),f=t.getPrioritySensor(r.co2),p=t.getPrioritySensor(r.temp),m={sortDate:l,localDate:c,rh:h?h.theavg:null,co2:f?f.theavg:null,temp:p?t.calculateTemperatureDisplay(p.theavg):null,tempSensors:r.temp,co2Sensors:r.co2,rhSensors:r.hum,lightSensors:r.light,moistureSensors:r.moisture,ecSensors:r.ec},1===u.length?(m.co2Setpoint=u[0].CO2Setpoint,m.rhSetpoint=u[0].humiditySetpoint,m.tempSetpoint=t.calculateTemperatureDisplay(u[0].tempSetpoint),m.lightState=u[0].lightState,m.lifecyclePhase=u[0]):(m.co2Setpoint=null,m.rhSetpoint=null,m.tempSetpoint=null,m.lightState=null),a.push(m);case 12:case"end":return e.stop()}}),e)})),e.t2=v().keys(i.data[o]);case 15:if((e.t3=e.t2()).done){e.next=20;break}return l=e.t3.value,e.delegateYield(s(),"t4",18);case 18:e.next=15;break;case 20:e.next=11;break;case 22:a.shift(),t.data=a;case 24:case"end":return e.stop()}}),e)})))()}},watch:{microclimateParams:function(){this.refresh()}}},E=j,I=r("2877"),L=Object(I["a"])(E,s,l,!1,null,null,null);e["a"]=L.exports},e4b4:function(t,e,r){"use strict";r("6dd6")},e516:function(t,e,r){"use strict";var n=r("0789"),i=r("3206"),a=r("80d2"),o=r("58df");const s=Object(o["a"])(Object(i["a"])("stepper","v-stepper-content","v-stepper"));e["a"]=s.extend().extend({name:"v-stepper-content",inject:{isVerticalProvided:{from:"isVertical"}},props:{step:{type:[Number,String],required:!0}},data(){return{height:0,isActive:null,isReverse:!1,isVertical:this.isVerticalProvided}},computed:{computedTransition(){const t=this.$vuetify.rtl?!this.isReverse:this.isReverse;return t?n["g"]:n["h"]},styles(){return this.isVertical?{height:Object(a["i"])(this.height)}:{}}},watch:{isActive(t,e){t&&null==e?this.height="auto":this.isVertical&&(this.isActive?this.enter():this.leave())}},mounted(){this.$refs.wrapper.addEventListener("transitionend",this.onTransition,!1),this.stepper&&this.stepper.register(this)},beforeDestroy(){this.$refs.wrapper.removeEventListener("transitionend",this.onTransition,!1),this.stepper&&this.stepper.unregister(this)},methods:{onTransition(t){this.isActive&&"height"===t.propertyName&&(this.height="auto")},enter(){let t=0;requestAnimationFrame(()=>{t=this.$refs.wrapper.scrollHeight}),this.height=0,setTimeout(()=>this.isActive&&(this.height=t||"auto"),450)},leave(){this.height=this.$refs.wrapper.clientHeight,setTimeout(()=>this.height=0,10)},toggle(t,e){this.isActive=t.toString()===this.step.toString(),this.isReverse=e}},render(t){const e={staticClass:"v-stepper__content"},r={staticClass:"v-stepper__wrapper",style:this.styles,ref:"wrapper"};this.isVertical||(e.directives=[{name:"show",value:this.isActive}]);const n=t("div",r,[this.$slots.default]),i=t("div",e,[n]);return t(this.computedTransition,{on:this.$listeners},[i])}})},e580:function(t,e,r){"use strict";r("1f26")},e620:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("8fea"),s=r("169a"),l=r("132d"),c=r("2fa4"),u=function(){var t=this,e=t._self._c;return e(s["a"],{attrs:{persistent:"",width:"600"},model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[e(i["a"],[e(a["d"],[e("h2",[t._v("Grid Column Selector")]),e(c["a"]),e(n["a"],{attrs:{icon:""},on:{click:function(e){t.showDialog=!1}}},[e(l["a"],[t._v("close")])],1)],1),e(a["c"],{attrs:{id:"gridcolumns"}},[t.renderComponent?e(o["a"],{attrs:{headers:t.headers,items:t.items,loading:t.isLoading,"item-key":"value","hide-default-footer":"","fixed-header":"",height:"400px","must-sort":"","show-select":"",options:t.pagination},scopedSlots:t._u([{key:"item.handle",fn:function(r){r.item;return[e("div",{staticClass:"handle",staticStyle:{"max-width":"28px"}},[e(l["a"],[t._v("drag_indicator")])],1)]}},{key:"item.text",fn:function(e){var r=e.item;return[t._v("\n          "+t._s(r.text?r.text:r.value)+"\n        ")]}}],null,!1,2193322154),model:{value:t.selectedColumns,callback:function(e){t.selectedColumns=e},expression:"selectedColumns"}}):t._e()],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.save}},[t._v("Save")]),e(n["a"],{attrs:{text:"",color:"primary"},on:{click:t.reset}},[t._v("Reset to Defaults")])],1)],1)],1)},d=[],h=r("2f62"),f=r("d67f"),p=r("d0eb"),m=r("aa47");function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function y(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */y=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof b?e:b,o=Object.create(a.prototype),s=new I(n||[]);return i(o,"_invoke",{value:k(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function b(){}function w(){}function x(){}var S={};c(S,o,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(L([])));C&&C!==r&&n.call(C,o)&&(S=C);var O=x.prototype=b.prototype=Object.create(S);function P(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==v(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function k(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function T(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(v(e)+" is not iterable")}return w.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},P(D.prototype),c(D.prototype,s,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new D(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},P(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function g(t,e){return _(t)||S(t,e)||w(t,e)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return x(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function _(t){if(Array.isArray(t))return t}function C(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function O(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){C(a,n,i,o,s,"next",t)}function s(t){C(a,n,i,o,s,"throw",t)}o(void 0)}))}}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=j(t,"string");return"symbol"==v(e)?e:e+""}function j(t,e){if("object"!=v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var E={name:"",props:["value","gridName","defaultColumns"],components:{},mounted:function(){},data:function(){return{showDialog:!1,selectedColumns:[],gridCustomizationId:null,pagination:{itemsPerPage:-1,sortBy:["seq"]},isLoading:!1,renderComponent:!0,items:[],headers:[{text:"",align:"left",value:"handle",sortable:!1,width:20},{text:"Seq",value:"seq",align:"center",sortable:!1,width:50},{text:"Column",value:"text",align:"left",sortable:!1},{value:"data-table-select",width:50,groupable:!1}]}},beforeMount:function(){this.refresh()},computed:D(D({},Object(h["c"])(["getUser"])),{},{userIsAdmin:function(){return p["a"].isAdmin(this.getUser)},userIsIntegrator:function(){return p["a"].isUserInRole(this.getUser,"Integrator")}}),watch:{showDialog:function(t,e){t&&this.refresh()}},methods:{refresh:function(){var t=O(y().mark((function t(){var e,r,n,i,a,o,s,l=this;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.isLoading=!0,t.next=3,p["a"].get("ag_gridCustomizations",this.getUser.apitoken,{filter:{where:{user_id:this.getUser.id,grid_id:this.gridName}}});case 3:if(e=t.sent,r=g(e,2),n=r[0],r[1],0!=n.length){t.next=12;break}this.useDefaults(),this.gridCustomizationId=null,t.next=24;break;case 12:this.useDefaults(!0),this.gridCustomizationId=n[0].id,this.selectedColumns=[],i=y().mark((function t(e){var r;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:r=l.items.find((function(t){return t.value==n[0].columnsJson[e].value})),void 0!=r&&(r.seq=e+1,l.selectedColumns.push(r));case 2:case"end":return t.stop()}}),t)})),a=0;case 17:if(!(a<n[0].columnsJson.length)){t.next=22;break}return t.delegateYield(i(a),"t0",19);case 19:a++,t.next=17;break;case 22:for(o=n[0].columnsJson.length+1,s=0;s<this.items.length;s++)this.items[s].seq||(this.items[s].seq=o++);case 24:this.isLoading=!1,setTimeout(this.gridDraggable,250);case 26:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),show:function(){this.showDialog=!0},hide:function(){this.showDialog=!1},gridDraggable:function(){var t=this,e=document.querySelector("#gridcolumns tbody");e&&m["a"].create(e,{handle:".handle",onEnd:function(e){var r=e.newIndex,n=e.oldIndex,i=t.items.splice(n,1)[0];t.items.splice(r,0,i);for(var a=t.items.length-1;a>=0;a--)t.items[a].seq=a+1}})},reRenderComponent:function(){var t=this;this.renderComponent=!1,this.$nextTick().then((function(){t.renderComponent=!0,setTimeout(t.gridDraggable,250)}))},save:function(){var t=O(y().mark((function t(){var e,r,n,i,a,o;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:for(e=JSON.parse(JSON.stringify(this.selectedColumns)),e.sort((function(t,e){return t.seq>e.seq?1:-1})),r=0;r<e.length;r++)delete e[r].seq;return this.isLoading=!0,n={user_id:this.getUser.id,grid_id:this.gridName,columnsJson:e},this.gridCustomizationId&&(n.id=this.gridCustomizationId),t.next=8,p["a"].patch("ag_gridCustomizations",this.getUser.apitoken,n);case 8:i=t.sent,a=g(i,2),o=a[0],a[1],o?(f["a"].success("Grid customization profile saved."),this.$emit("change",e),this.showDialog=!1):f["a"].error("An error occurred. Please try again later.");case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),reset:function(){this.useDefaults()},useDefaults:function(t){var e=this,r=this;this.selectedColumns=[],this.items=JSON.parse(JSON.stringify(this.value)),this.userIsAdmin||this.userIsIntegrator||(this.items=this.items.filter((function(t){return!t.adminOnly})));for(var n=function(n){t||(e.items[n].seq=n+1),e.defaultColumns?e.defaultColumns.find((function(t){return t.value==r.items[n].value}))&&e.selectedColumns.push(e.items[n]):e.selectedColumns.push(e.items[n])},i=0;i<this.items.length;i++)n(i)}}},I=E,L=(r("6b5e"),r("2877")),A=Object(L["a"])(I,u,d,!1,null,null,null);e["a"]=A.exports},e6b0:function(t,e,r){"use strict";var n=r("8336"),i=r("62ad"),a=r("132d"),o=r("0fd9"),s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100 d-flex flex-column",staticStyle:{"padding-left":"5px","padding-right":"5px","padding-top":"10px"}},[t._m(0),e(o["a"],{staticClass:"justify-center"},[e(i["a"],{staticStyle:{"padding-top":"25px","padding-right":"0px","text-align":"right"},attrs:{cols:"1"}},[e(n["a"],{attrs:{fab:"",dark:"","x-small":"",color:"primary",disabled:t.date<=t.minDate},on:{click:function(e){return t.changeDate(-1)}}},[e(a["a"],{attrs:{dark:""}},[t._v(" keyboard_arrow_left ")])],1)],1),e(i["a"],{staticClass:"text-center",attrs:{cols:"3",lg:"2"}},[e("div",{staticStyle:{width:"120px",display:"inline-block"}},[e("vuetify-datepicker",{attrs:{label:"Date","auto-close":!0,min:t.minDate,max:t.maxDate},model:{value:t.date,callback:function(e){t.date=e},expression:"date"}})],1)]),e(i["a"],{staticClass:"text-right",staticStyle:{"padding-top":"25px","padding-left":"0px"},attrs:{cols:"1"}},[e(n["a"],{attrs:{fab:"",dark:"","x-small":"",color:"primary",disabled:t.date>=t.maxDate},on:{click:function(e){return t.changeDate(1)}}},[e(a["a"],{attrs:{dark:""}},[t._v(" keyboard_arrow_right ")])],1)],1)],1)],1)},l=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex-grow-auto overflow-auto"},[e("div",{attrs:{id:"FullScreenMultiChart2"}})])}],c=r("d0eb"),u=r("3488"),d=r("c1df"),h=r.n(d),f=r("2f62"),p=r("ea7f"),m=r.n(p),v=r("ee40"),y=r.n(v),g=r("a9b3"),b=r("12a1"),w=r("12dc"),x=(r("b047"),r("aa47"),r("4458")),S=r("6ce0");function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function O(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return(e=D(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D(t){var e=k(t,"string");return"symbol"==_(e)?e:e+""}function k(t,e){if("object"!=_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}y()(m.a);var T={name:"",props:["value"],mixins:[g["a"],u["a"],w["a"],S["a"]],components:{VuetifyDatepicker:x["a"]},beforeMount:function(){window.moment=h.a,m.a.setOptions({time:{timezone:this.tzPref()}}),m.a.Pointer.prototype.reset=function(){},m.a.Point.prototype.highlight=function(t){t=this.series.chart.pointer.normalize(t),this.onMouseOver()}},mounted:function(){this.date=h()().format("YYYY-MM-DD"),this.setMinMaxDate()},data:function(){return{dataset:[],sortableObj:null,date:null,starttime:null,endtime:null,startDate:null,endDate:null,minDate:h()().format("YYYY-MM-DD"),maxDate:h()().format("YYYY-MM-DD"),charts:[],chartsToDisplay:[1,2,3],chartTypes:[{id:1,text:"Temperature"},{id:2,text:"Humidity"},{id:3,text:"CO2"}]}},computed:O(O({},Object(f["c"])(["getUser","userData"])),{},{filteredData:function(){var t=this,e=this.value.filter((function(e){var r=h.a.utc(e.sortDate,"YYYY-MM-DD HH:mm:ss");return r.isBetween(t.starttime,t.endtime)}));return e}}),watch:{date:function(t,e){this.starttime=h()(this.date,"YYYY-MM-DD"),this.endtime=h()(this.date,"YYYY-MM-DD").add(1,"day"),this.refresh()},value:{immediate:!1,handler:function(t,e){this.setMinMaxDate(),this.refresh()}}},beforeDestroy:function(){this.removeEventListeners(),this.destroyCharts()},methods:{setMinMaxDate:function(){var t=JSON.parse(JSON.stringify(this.value));t.sort((function(t,e){return t.sortDate>e.sortDate?1:-1})),t.length>0&&(this.minDate=h.a.utc(t[0].sortDate,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD"),this.maxDate=h.a.utc(t[t.length-1].sortDate,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD"))},changeDate:function(t){var e=h.a.utc(this.date).add(t,"days");this.date=e.format("YYYY-MM-DD")},onClose:function(){this.$emit("close")},syncExtremes:function(t){var e=this.chart;"syncExtremes"!==t.trigger&&m.a.each(m.a.charts,(function(r){r!==e&&r.xAxis[0].setExtremes&&r.xAxis[0].setExtremes(t.min,t.max,void 0,!1,{trigger:"syncExtremes"})}))},syncChartHandler:function(t){var e,r,n,i,a=this,o=a.charts.length;for(n=0;n<o;n+=1)e=a.charts[n],i=e.pointer.normalize(t),r=e.series[0].searchPoint(i,!0),r&&r.highlight(t)},destroyCharts:function(){for(var t=this.charts.length,e=0;e<t;e++)this.charts[e].destroy();var r=document.getElementById("FullScreenMultiChart2");r&&(r.innerHTML=""),this.charts=[]},removeEventListeners:function(){var t=this,e=document.getElementById("FullScreenMultiChart2");e&&["mousemove","touchmove","touchstart"].forEach((function(r){e.removeEventListener(r,t.syncChartHandler)}))},attachEventListeners:function(){var t=this;["mousemove","touchmove","touchstart"].forEach((function(e){document.getElementById("FullScreenMultiChart2").addEventListener(e,t.syncChartHandler)}))},getDateTimeValue:function(t){return h.a.utc(t,"YYYY-MM-DD HH:mm:ss").valueOf()},formatData:function(){var t=this,e={};return this.filteredData.forEach((function(r){var n=t.getDateTimeValue(r.sortDate);r.tempSensors.forEach((function(r){t.addSensorRecord(n,e,r,parseFloat(t.calculateTemperatureDisplay(r.theavg)))})),r.co2Sensors.forEach((function(r){t.addSensorRecord(n,e,r,r.theavg)})),r.rhSensors.forEach((function(r){t.addSensorRecord(n,e,r,r.theavg)})),r.lightSensors.forEach((function(r){t.addSensorRecord(n,e,r,r.theavg)})),r.moistureSensors.forEach((function(r){t.addSensorRecord(n,e,r,r.theavg)})),r.ecSensors.forEach((function(r){t.addSensorRecord(n,e,r,r.theavg)}))})),e},addSensorRecord:function(t,e,r,n){e[r.device_id]?e[r.device_id].data.push([t,n]):e[r.device_id]={sensor:{device_id:r.device_id,priority:r.priority,designator_id:r.designator_id,designatorName:r.designatorName,name:r.name,sensorDevice_id:r.sensorDevice_id},data:[[t,n]]}},generateChart:function(){var t=this;this.destroyCharts();var e=this,r=this.formatData(),n=[];Object.keys(r).forEach((function(t){n.push(r[t])}));var i=["Temperature","Humidity","CO2"];n.sort((function(t,e){return"Temperature"===t.designatorName?"Temperature"===e.designatorName?t.priority>e.priority?-1:1:-1:"Humidity"===t.designatorName||"CO2"===t.designatorName?i.includes(e.designatorName)?t.priority>e.priority?-1:1:-1:i.includes(e.designatorName)?1:t.priority>e.priority?-1:1}));var a=[];n.forEach((function(t){var e=a.find((function(e){return e.sensor.designator_id===t.sensor.designator_id}));e?e.others.push(t):(t.others=[],a.push(t))})),a.forEach((function(r){var n=null;r.data;var i="",a="",o="",s="";switch(r.sensor.designatorName){case"Temperature":o="line",i="red",a="F",s="Temperature";break;case"SoilTemperature":o="line",i="red",a="F",s="Soil Temperature";break;case"Humidity":o="line",i="blue",a="%",s="Humidity";break;case"CO2":o="line",i="green",a="ppm",s="CO2";break;case"LightSensor":o="line",i="rgb(255,234,0)",a="Lux",s="Light";break;case"MoistureSensor":o="line",i="rgba(0,0,255,1)",a="VWC%",s="Moisture";break;case"ECPoreSensor":o="line",i="rgba(0,255,0,1)",a="mS/cm",s="Soil Pore EC";break;case"ECSensor":o="line",i="rgba(0,255,0,1)",a="mS/cm",s="Soil EC";break}var l=document.createElement("div");if(l.className="multichart",document.getElementById("FullScreenMultiChart2").appendChild(l),"line"===o){var u=[{data:r.data,name:"".concat(s).concat(r.others.length&&r.sensor.sensorDevice_id?" ("+r.sensor.name+")":""),type:"line",color:i,fillOpacity:.3,tooltip:{valueSuffix:" "+a},unit:a}];r.others.forEach((function(t){u.push({data:t.data,name:"".concat(s).concat(t.sensor.sensorDevice_id?" ("+t.sensor.name+")":""),type:"line",color:i,fillOpacity:.3,tooltip:{valueSuffix:" "+a},unit:a})})),n=P(P(P(P(P(P({exporting:t.highchartsExporting,plotOptions:{series:{turboThreshold:2e3}},chart:{marginLeft:40,spacingTop:20,spacingBottom:20,backgroundColor:null,zoomType:"x"},title:{text:s,align:"left",margin:0,x:30},credits:{enabled:!1}},"exporting",{enabled:!1}),"legend",{enabled:!1}),"xAxis",{crosshair:!0,type:"datetime",dateTimeLabelFormats:{minute:"%I:%M %P",hour:"%I:%M %P"},events:{setExtremes:t.syncExtremes},gridLineColor:"silver",gridLineWidth:1}),"yAxis",{title:{text:null}}),"tooltip",{formatter:function(){var t="<b>"+h()(this.x).format("hh:mm a")+"</b>",e="";return[t].concat(this.points?[this.points.map((function(t){return e=t.series.userOptions.unit?t.series.userOptions.unit:e,"arearange"!==t.series.type?t.series.name+": "+t.y.toFixed(2)+" "+e:"".concat(t.series.name,": ").concat(t.point.low.toFixed(2)," - ").concat(t.point.high.toFixed(2)," ").concat(e)})).join("<br/>")]:[])},shared:!0,split:!0,backgroundColor:"rgba(247,247,247,0.95)"}),"series",u);var d=[],f=c["a"].displayMetric(e.getUser);switch(n.xAxis.plotLines=[],r.sensor.designatorName){case"Temperature":n.xAxis.plotLines=[];for(var p=0;p<e.filteredData.length;p++){var v=e.filteredData[p].lifecyclePhase.tempMin,y=e.filteredData[p].lifecyclePhase.tempMax,g=h.a.utc(e.filteredData[p].sortDate,"YYYY-MM-DD HH:mm:ss");d.push([g.valueOf(),f?v:Object(b["toFahrenheit"])(v),f?y:Object(b["toFahrenheit"])(y)])}n.series.push({data:d,name:"Compliance Range",type:"arearange",color:m.a.getOptions().colors[0],fillOpacity:.3,zIndex:0,linkedTo:":previous",marker:{enabled:!1},states:{hover:{enabled:!1}},tooltip:{valueSuffix:" "+a}});break;case"Humidity":n.xAxis.plotLines=[];for(var w=0;w<e.filteredData.length;w++){var x=e.filteredData[w].lifecyclePhase.humidityMin,S=e.filteredData[w].lifecyclePhase.humidityMax,_=h.a.utc(e.filteredData[w].sortDate,"YYYY-MM-DD HH:mm:ss");d.push([_.valueOf(),x,S])}n.series.push({data:d,name:"Compliance Range",type:"arearange",color:m.a.getOptions().colors[0],fillOpacity:.3,zIndex:0,linkedTo:":previous",marker:{enabled:!1},states:{hover:{enabled:!1}}});break;case"CO2":n.xAxis.plotLines=[];for(var C=0;C<e.filteredData.length;C++){var O=e.filteredData[C].lifecyclePhase.CO2Min,D=e.filteredData[C].lifecyclePhase.CO2Max,k=h.a.utc(e.filteredData[C].sortDate,"YYYY-MM-DD HH:mm:ss").local();d.push([k.valueOf(),O,D])}n.series.push({data:d,name:"Compliance Range",type:"arearange",color:m.a.getOptions().colors[0],fillOpacity:.3,zIndex:0,linkedTo:":previous",marker:{enabled:!1},states:{hover:{enabled:!1}}});break}e.charts.push(m.a.chart(l,n))}t.attachEventListeners()}))},refresh:function(){this.$nextTick(this.generateChart)}}},j=T,E=(r("888e"),r("2877")),I=Object(E["a"])(j,s,l,!1,null,null,null);e["a"]=I.exports},e911:function(t,e,r){},e96a:function(t,e,r){"use strict";r("90b2")},ead4:function(t,e,r){"use strict";var n=r("8654"),i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100 d-flex flex-column",attrs:{id:"lifecycleselector"}},[e("div",{staticStyle:{"text-align":"center"}},[e("div",{staticStyle:{display:"inline-block",width:"150px"}},[e(n["a"],{staticClass:"pt-0 mt-0 mb-1",attrs:{"append-icon":"search",label:"","single-line":"","hide-details":"",clearable:""},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1)]),e("vuetify-datatable",{staticClass:"flex-grow-auto",staticStyle:{border:"1px solid silver"},attrs:{headers:t.headers,"must-sort":"",items:t.growplans,"single-select":!t.multiple,"show-select":!0,loading:t.isLoading,"hide-default-footer":"",search:t.search,options:t.options,"fixed-header":!0,height:"100%","show-group-by":!0},model:{value:t.selected,callback:function(e){t.selected=e},expression:"selected"}})],1)},a=[],o=r("2f62"),s=(r("d67f"),r("d0eb")),l=r("ed53");function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){return m(t)||p(t,e)||h(t,e)||d()}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(t,e){if(t){if("string"==typeof t)return f(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function p(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function m(t){if(Array.isArray(t))return t}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){g(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t){var e=w(t,"string");return"symbol"==c(e)?e:e+""}function w(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var x={name:"growplans-component",components:{VuetifyDatatable:l["a"]},props:["value","multiple","exclusions","ag_growplanCultivationType_id"],data:function(){return{growplans:[],search:"",selectedGrowplan:{},isLoading:!1,selected:[],selectedPhase:{},options:{sortBy:["growplanName"],itemsPerPage:-1},headers:[{value:"data-table-select",groupable:!1},{text:"Name",value:"growplanName",groupable:!1},{text:"Category",value:"category",groupable:!0},{text:"Strain",value:"ag_growPlanStrain.strainName",groupable:!0},{text:"Type",value:"type",groupable:!0}]}},mounted:function(){this.getGrowplans()},beforeMount:function(){s["a"].isCannabisFacility()||(this.headers[3].text="Variety")},computed:y({},Object(o["c"])(["getUser"])),methods:{onSelect:function(t){this.selectedGrowplan=t,this.selected=item.id},getGrowplans:function(){var t=this;t.isLoading=!0;var e={facility_id:this.getUser.facility_id,isDisabled:0};this.exclusions&&(e.id={nin:this.exclusions}),this.ag_growplanCultivationType_id&&(e.ag_growplanCultivationType_id=parseInt(this.ag_growplanCultivationType_id)),s["a"].get("ag_growplans",this.getUser.apitoken,{filter:{where:e,include:[{ag_growPhases:["ag_growTasks"]},"ag_growPlanCategory","ag_growPlanStrain","ag_lifecycles","agGrowplancultivationtype"],order:"id DESC"}}).then((function(e){for(var r=u(e,2),n=r[0],i=(r[1],[]),a=0;a<n.length;a++){var o=n[a];o.ag_growPlanCategory?o.category=o.ag_growPlanCategory.categoryName:o.category="Not specified",o.ag_growPhases.length>1&&o.ag_growPhases[0].ag_growTasks&&o.ag_growPhases[o.ag_growPhases.length-1].ag_growTasks&&o.ag_growPhases[o.ag_growPhases.length-1].ag_growTasks.length>0&&(n[a].agGrowplancultivationtype&&(n[a].type=n[a].agGrowplancultivationtype.label),i.push(n[a]))}t.growplans=i,t.value&&(t.selected=t.value),t.isLoading=!1}))}},watch:{exclusions:function(t){this.selected=[],this.getGrowplans()},selected:function(t){if(Array.isArray(t))this.multiple?this.selectedGrowplan=t:this.selectedGrowplan=t[0];else if(!isNaN(parseInt(t)))for(var e=0;e<this.growplans.length;e++)if(this.growplans[e].id==t){this.selectedGrowplan=this.growplans[e],this.selected=[this.growplans[e]];break}this.$emit("selection",this.selectedGrowplan),this.multiple?this.$emit("input",this.selectedGrowplan):this.$emit("input",this.selectedGrowplan.id)}}},S=x,_=r("2877"),C=Object(_["a"])(S,i,a,!1,null,null,null);e["a"]=C.exports},ee40:function(t,e,r){var n,i;(function(a){t.exports?(a["default"]=a,t.exports=a):(n=[r("ea7f")],i=function(t){return a(t),a.Highcharts=t,a}.apply(e,n),void 0===i||(t.exports=i))})((function(t){function e(t,e,r,n){t.hasOwnProperty(e)||(t[e]=n.apply(null,r),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}t=t?t._modules:{},e(t,"Series/XRange/XRangePoint.js",[t["Core/Series/Point.js"],t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],(function(t,e,r){var n=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();return r=r.extend,e=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.options=void 0,t.series=void 0,t}return n(r,e),r.getColorByCategory=function(t,e){var r=t.options.colors||t.chart.options.colors;return t=e.y%(r?r.length:t.chart.options.chart.colorCount),{colorIndex:t,color:r&&r[t]}},r.prototype.resolveColor=function(){var t=this.series;if(t.options.colorByPoint&&!this.options.color){var e=r.getColorByCategory(t,this);t.chart.styledMode||(this.color=e.color),this.options.colorIndex||(this.colorIndex=e.colorIndex)}else this.color||(this.color=t.color)},r.prototype.init=function(){return t.prototype.init.apply(this,arguments),this.y||(this.y=0),this},r.prototype.setState=function(){t.prototype.setState.apply(this,arguments),this.series.drawPoint(this,this.series.getAnimationVerb())},r.prototype.getLabelConfig=function(){var e=t.prototype.getLabelConfig.call(this),r=this.series.yAxis.categories;return e.x2=this.x2,e.yCategory=this.yCategory=r&&r[this.y],e},r.prototype.isValid=function(){return"number"===typeof this.x&&"number"===typeof this.x2},r}(e.seriesTypes.column.prototype.pointClass),r(e.prototype,{ttBelow:!1,tooltipDateKeys:["x","x2"]}),e})),e(t,"Series/XRange/XRangeComposition.js",[t["Core/Axis/Axis.js"],t["Core/Utilities.js"]],(function(t,e){var r=e.addEvent,n=e.pick;r(t,"afterGetSeriesExtremes",(function(){var t,e=this.series;if(this.isXAxis){var r=n(this.dataMax,-Number.MAX_VALUE);e.forEach((function(e){e.x2Data&&e.x2Data.forEach((function(e){e>r&&(r=e,t=!0)}))})),t&&(this.dataMax=r)}}))})),e(t,"Series/XRange/XRangeSeries.js",[t["Core/Globals.js"],t["Core/Color/Color.js"],t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"],t["Series/XRange/XRangePoint.js"]],(function(t,e,r,n,i){var a=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=e.parse,s=r.series,l=r.seriesTypes.column,c=l.prototype,u=n.clamp,d=n.correctFloat,h=n.defined;e=n.extend;var f=n.find,p=n.isNumber,m=n.isObject,v=n.merge,y=n.pick;return n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.data=void 0,e.options=void 0,e.points=void 0,e}return a(e,t),e.prototype.init=function(){l.prototype.init.apply(this,arguments),this.options.stacking=void 0},e.prototype.getColumnMetrics=function(){function t(){e.series.forEach((function(t){var e=t.xAxis;t.xAxis=t.yAxis,t.yAxis=e}))}var e=this.chart;t();var r=c.getColumnMetrics.call(this);return t(),r},e.prototype.cropData=function(t,e,r,n){return e=s.prototype.cropData.call(this,this.x2Data,e,r,n),e.xData=t.slice(e.start,e.end),e},e.prototype.findPointIndex=function(t){var e=this.cropped,r=this.cropStart,n=this.points,i=t.id;if(i)var a=(a=f(n,(function(t){return t.id===i})))?a.index:void 0;return"undefined"===typeof a&&(a=(a=f(n,(function(e){return e.x===t.x&&e.x2===t.x2&&!e.touched})))?a.index:void 0),e&&p(a)&&p(r)&&a>=r&&(a-=r),a},e.prototype.translatePoint=function(t){var e=this.xAxis,r=this.yAxis,n=this.columnMetrics,i=this.options,a=i.minPointLength||0,o=(t.shapeArgs&&t.shapeArgs.width||0)/2,s=this.pointXOffset=n.offset,l=t.plotX,c=y(t.x2,t.x+(t.len||0)),d=e.translate(c,0,0,0,1);c=Math.abs(d-l);var f=this.chart.inverted,g=y(i.borderWidth,1)%2/2,b=n.offset,w=Math.round(n.width);a&&(a-=c,0>a&&(a=0),l-=a/2,d+=a/2),l=Math.max(l,-10),d=u(d,-10,e.len+10),h(t.options.pointWidth)&&(b-=(Math.ceil(t.options.pointWidth)-w)/2,w=Math.ceil(t.options.pointWidth)),i.pointPlacement&&p(t.plotY)&&r.categories&&(t.plotY=r.translate(t.y,0,1,0,1,i.pointPlacement)),i=Math.floor(Math.min(l,d))+g,i={x:i,y:Math.floor(t.plotY+b)+g,width:Math.floor(Math.max(l,d))+g-i,height:w,r:this.options.borderRadius},t.shapeArgs=i,f?t.tooltipPos[1]+=s+o:t.tooltipPos[0]-=o+s-i.width/2,o=i.x,s=o+i.width,0>o||s>e.len?(o=u(o,0,e.len),s=u(s,0,e.len),d=s-o,t.dlBox=v(i,{x:o,width:s-o,centerX:d?d/2:null})):t.dlBox=null,o=t.tooltipPos,s=f?1:0,d=f?0:1,n=this.columnMetrics?this.columnMetrics.offset:-n.width/2,o[s]=f?o[s]+i.width/2:o[s]+(e.reversed?-1:0)*i.width,o[d]=u(o[d]+(f?-1:1)*n,0,r.len-1),(r=t.partialFill)&&(m(r)&&(r=r.amount),p(r)||(r=0),t.partShapeArgs=v(i,{r:this.options.borderRadius}),l=Math.max(Math.round(c*r+t.plotX-l),0),t.clipRectArgs={x:e.reversed?i.x+c-l:i.x,y:i.y,width:l,height:i.height})},e.prototype.translate=function(){c.translate.apply(this,arguments),this.points.forEach((function(t){this.translatePoint(t)}),this)},e.prototype.drawPoint=function(t,e){var r=this.options,n=this.chart.renderer,i=t.graphic,a=t.shapeType,s=t.shapeArgs,l=t.partShapeArgs,c=t.clipRectArgs,u=t.partialFill,d=r.stacking&&!r.borderRadius,h=t.state,f=r.states[h||"normal"]||{},p="undefined"===typeof h?"attr":e;h=this.pointAttribs(t,h),f=y(this.chart.options.chart.animation,f.animation),t.isNull||!1===t.visible?i&&(t.graphic=i.destroy()):(i?i.rect[e](s):(t.graphic=i=n.g("point").addClass(t.getClassName()).add(t.group||this.group),i.rect=n[a](v(s)).addClass(t.getClassName()).addClass("highcharts-partfill-original").add(i)),l&&(i.partRect?(i.partRect[e](v(l)),i.partialClipRect[e](v(c))):(i.partialClipRect=n.clipRect(c.x,c.y,c.width,c.height),i.partRect=n[a](l).addClass("highcharts-partfill-overlay").add(i).clip(i.partialClipRect))),this.chart.styledMode||(i.rect[e](h,f).shadow(r.shadow,null,d),l&&(m(u)||(u={}),m(r.partialFill)&&(u=v(r.partialFill,u)),t=u.fill||o(h.fill).brighten(-.3).get()||o(t.color||this.color).brighten(-.3).get(),h.fill=t,i.partRect[p](h,f).shadow(r.shadow,null,d))))},e.prototype.drawPoints=function(){var t=this,e=t.getAnimationVerb();t.points.forEach((function(r){t.drawPoint(r,e)}))},e.prototype.getAnimationVerb=function(){return this.chart.pointCount<(this.options.animationLimit||250)?"animate":"attr"},e.prototype.isPointInside=function(e){var r=e.shapeArgs,n=e.plotX,i=e.plotY;return r?"undefined"!==typeof n&&"undefined"!==typeof i&&0<=i&&i<=this.yAxis.len&&0<=(r.x||0)+(r.width||0)&&n<=this.xAxis.len:t.prototype.isPointInside.apply(this,arguments)},e.defaultOptions=v(l.defaultOptions,{colorByPoint:!0,dataLabels:{formatter:function(){var t=this.point.partialFill;if(m(t)&&(t=t.amount),p(t)&&0<t)return d(100*t)+"%"},inside:!0,verticalAlign:"middle"},tooltip:{headerFormat:'<span style="font-size: 10px">{point.x} - {point.x2}</span><br/>',pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.yCategory}</b><br/>'},borderRadius:3,pointRange:0}),e}(l),e(n.prototype,{type:"xrange",parallelArrays:["x","x2","y"],requireSorting:!1,animate:s.prototype.animate,cropShoulder:1,getExtremesFromAll:!0,autoIncrement:t.noop,buildKDTree:t.noop,pointClass:i}),r.registerSeriesType("xrange",n),n})),e(t,"masters/modules/xrange.src.js",[],(function(){}))}))},efa3:function(t,e,r){},f03e:function(t,e,r){},f23e:function(t,e,r){"use strict";r("8aae")},f36f:function(t,e,r){"use strict";var n=r("ac7c"),i=r("62ad"),a=r("169a"),o=r("0fd9"),s=r("b974"),l=function(){var t=this,e=t._self._c;return e("div",{staticClass:"h-100"},[e(o["a"],{staticClass:"pt-0 mt-0",attrs:{align:"start",justify:"center","no-gutters":""}},[e(i["a"],{staticClass:"pr-2",attrs:{md:"3",cols:"12"}},[e(s["a"],{attrs:{items:t.areas,label:"Area","item-value":"id","item-text":"areaname"},model:{value:t.selectedArea,callback:function(e){t.selectedArea=e},expression:"selectedArea"}})],1),e(i["a"],{staticClass:"text-center",attrs:{md:"3"}},[e("div",{staticStyle:{height:"20px",display:"flex","justify-content":"flex-center"}},[e(n["a"],{staticStyle:{margin:"auto","padding-top":"20px"},attrs:{label:"IGR Racks Only"},model:{value:t.showCloneRacksOnly,callback:function(e){t.showCloneRacksOnly=e},expression:"showCloneRacksOnly"}})],1)]),e(i["a"],{staticClass:"pl-2",attrs:{md:"3",cols:"12"}},[e(s["a"],{attrs:{items:t.platformGroups,label:"Growing Platforms","item-value":"platformGroup_id","item-text":"platformGroupName",multiple:"","deletable-chips":"",clearable:""},model:{value:t.selectedGrowPlatforms,callback:function(e){t.selectedGrowPlatforms=e},expression:"selectedGrowPlatforms"}})],1)],1),e("div",{staticStyle:{overflow:"auto",padding:"5px",height:"calc(100% - 95px)"}},[t.showArea?e(o["a"],{key:t.areaRefresher,staticStyle:{"padding-right":"10px"},attrs:{justify:"center","no-gutters":""}},t._l(t.selectedPlatformGroups,(function(r,n){return e(i["a"],{key:"platgroup"+(n-1),class:[(n+1)%3!==0&&n+1<t.selectedPlatformGroups.length?"right-border pr-2":"",(n+1)%4!==0&&0!=n?"pl-2":""],staticStyle:{"border-bottom":"1px silver dashed","margin-top":"5px"},attrs:{md:"4"}},[e("platform-group",{key:"platgroupGroup"+n,attrs:{side:"none",platformGroup:r,plantContainerType:t.value.plantContainerType?t.value.plantContainerType:t.firstEventPlantContainerType,platformGroupName:r.platformGroupName,containers:t.containers,platformPlantCount:t.platformPlantCount,"expected-lifecycle-id":t.expectedLifecycleId}})],1)})),1):t._e()],1),e("div",{staticStyle:{"text-align":"center","margin-top":"5px"}},[e("span",{staticStyle:{"font-weight":"bold","font-size":"1.3em","margin-top":"10px"}},[e("span",{class:{"red--text":t.targetCount&&t.placedPlantTotal>t.targetCount}},[t._v(t._s(t.placedPlantTotal)),t.rec.numberOfPlants?[t._v("/"+t._s(t.rec.numberOfPlants))]:t._e()],2),t.targetCount?e("span",[t._v("/"+t._s(t.targetCount)+" ")]):t._e(),t._v("  Placed Plants\n    ")])]),e(a["a"],{attrs:{width:"650"},model:{value:t.showPlantContainerDialog,callback:function(e){t.showPlantContainerDialog=e},expression:"showPlantContainerDialog"}},[t.showContainer&&t.showPlantContainerDialog?e("plant-container",{attrs:{selectedPlants:t.containers,ContainerType:t.plantContainerTypesMap[t.showContainer.plantcontainerType_id],containerClass:t.containerClassAttribute(t.showContainer.plantcontainerType),name:t.showContainer.name,size:t.showContainer.positions,area:t.selectedArea,positions:t.showContainer.positions,defaultFill:!0,"plant-target":t.targetCount},on:{close:function(e){t.showPlantContainerDialog=!1}},model:{value:t.plantContainerPositions,callback:function(e){t.plantContainerPositions=e},expression:"plantContainerPositions"}}):t._e()],1)],1)},c=[],u=r("2f62"),d=r("d67f"),h=r("d0eb"),f=function(){var t=this,e=t._self._c;return e("div",t._l(t.platformGroup.platforms,(function(r,n){return e("div",{key:"platplat-"+n,staticStyle:{"margin-bottom":"20px"}},[e("platform",{attrs:{plantCount:t.platformPlantCount,positions:r.platformPositions,plantContainerType:t.plantContainerType,platformName:t.platformGroupName+":"+r.platformName,platformGroupName:t.platformGroupName,clickable:!0,Containers:t.containers,platform_id:r.platform_id,"expected-lifecycle-id":t.expectedLifecycleId}})],1)})),0)},p=[],m=r("a523"),v=function(){var t=this,e=t._self._c;return e("div",{staticClass:"platform-id",attrs:{"data-platform-id":t.platform_id}},[e("h4",{staticStyle:{"text-align":"center"}},[t._v("\n    "+t._s(t.platformName)+"\n    ")]),t.isReady?e(o["a"],{staticClass:"platform",style:{border:"1px solid lightgrey","min-height":"140px",height:45*t.rowsPerPlatform+"px"},attrs:{"no-gutters":"","align-content":"space-between",justify:"center"},on:{click:t.fillWithPots}},[e(i["a"],{staticClass:"basin mt-2",attrs:{md:"12"}},[e(m["a"],{staticClass:"fill-height pt-0"},t._l(t.rowsPerPlatform,(function(r,n){return e(o["a"],{key:"row"+n,attrs:{"no-gutters":"",justify:"space-around",align:"center"}},t._l(t.platformPositionLength,(function(r,a){return e(i["a"],{key:a,staticClass:"border-all platformtype-3",staticStyle:{position:"relative"},style:t.colStyle,attrs:{cols:t.colsize,"data-platform-position-id":t.positions[a+n*t.platformPositionLength].platformPosition_id}},[t.positions[a+n*t.platformPositionLength].plantCount>0?e("span",{staticClass:"badge-basin"},[t._v("\n              "+t._s(t.positions[a+n*t.platformPositionLength].plantCount)+"\n            ")]):t._e(),t.positions[a+n*t.platformPositionLength].plantContainer_id?t._e():e("div",{staticClass:"plants-icon",style:{backgroundImage:"url("+t.getIconUrl(t.positions[a+n*t.platformPositionLength])+")"},on:{click:function(e){return t.showEmptyContainer(t.plantContainerType,t.positions[a+n*t.platformPositionLength],e)}}}),t.clickable&&t.positions[a+n*t.platformPositionLength].plantContainer_id?e("div",{staticClass:"plants-icon-disabled",style:{backgroundImage:"url("+t.getIconUrl(t.positions[a+n*t.platformPositionLength])+")"},on:{click:function(e){return t.showContainer(t.positions[a+n*t.platformPositionLength],a,e)}}}):t._e()])})),1)})),1)],1)],1):t._e()],1)},y=[],g=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"text-left col-md-12"},[e("h3",[t._v(t._s(t.name))]),e("div",{staticClass:"col-md-12 border-all m-b-lg"},[e("div",{staticClass:"col-md-12 no-padding m-t-sm basin-clone"},t._l(t.containerPositions,(function(r,n){return e("div",{staticClass:"border-all",class:t.containerClass},[r.plant_id?t._e():e("img",{staticClass:"plants-icon",attrs:{src:"/img/icons/none.svg"}}),r.plant_id?e("img",{staticClass:"plants-icon",attrs:{src:t.leafIcon1}}):t._e()])})),0)])])])},b=[];function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){_(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _(t,e,r){return(e=C(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t){var e=O(t,"string");return"symbol"==w(e)?e:e+""}function O(t,e){if("object"!=w(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var P={name:"plant-container",props:["containerClass","name","ContainerType","containerPositions"],data:function(){return{leafIcon1:"/img/icons/leaf.svg"}},beforeMount:function(){this.getUser.facility.growsLeafyGreens&&(this.leafIcon1="/img/icons/soil.svg")},computed:S({},Object(u["c"])(["getUser"]))},D=P,k=r("2877"),T=Object(k["a"])(D,g,b,!1,null,null,null),j=T.exports;function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function I(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */I=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==E(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(E(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function L(t){return N(t)||U(t)||M(t)||A()}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}function U(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function N(t){if(Array.isArray(t))return F(t)}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function G(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function R(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){G(a,n,i,o,s,"next",t)}function s(t){G(a,n,i,o,s,"throw",t)}o(void 0)}))}}function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){V(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t,e,r){return(e=B(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B(t){var e=z(t,"string");return"symbol"==E(e)?e:e+""}function z(t,e){if("object"!=E(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Y={name:"",components:{PlantContainer:j},props:["positions","plantContainerType","platformName","clickable","plantCount","Containers","platform_id","expectedLifecycleId","platformGroupName"],data:function(){return{callFrom:"",selectedPlantContainerPosition:"",selectedPlantContainerType:"",rowsPerPlatform:0,platformPositionLength:0,colsize:1,isReady:!1,colStyle:{}}},beforeMount:function(){this.rowsPerPlatform=this.positions[this.positions.length-1].row,this.platformPositionLength=this.positions[this.positions.length-1].col;var t=Math.floor(100/this.platformPositionLength);this.colStyle={width:"".concat(t,"%"),maxWidth:"8.33%",flex:"0 0 ".concat(t,"%")}},mounted:function(){this.isReady=!0},computed:H(H({},Object(u["c"])(["emptyContainer","getUser","selectedPlatformContainer","plantContainerError","emptyPlantContainers"])),{},{getExcluded:function(){var t=this.Containers.map((function(t){return t.plantContainer_id}));return t.join()||""},lifecycle_id:function(){var t=this.positions.find((function(t){return t.lifecycles&&+t.lifecycles>0}));return t&&t.lifecycles?+t.lifecycles:0},disableClick:function(){return!(!(this.expectedLifecycleId&&+this.lifecycle_id>0)||isNaN(this.expectedLifecycleId)||+this.expectedLifecycleId==+this.lifecycle_id)}}),methods:H(H({},Object(u["b"])(["getEmptyPlantContainer","updateSelectedContainer","setEmptyPlantContainer","setEmptyPlantContainers"])),{},{setNewEmptyContainer:function(){var t=this;return R(I().mark((function e(){var r,n;return I().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.callFrom="",t.selectedPlantContainerPosition.plantContainer_id){e.next=28;break}if(!t.emptyPlantContainers.length){e.next=19;break}return r=L(t.emptyPlantContainers),n=r.splice(0,1)[0],t.selectedPlantContainerPosition.new=!0,t.selectedPlantContainerPosition.plantContainer_id=n.plantContainer_id,n.platformPosition_id=t.selectedPlantContainerPosition.platformPosition_id,n.platform_id=t.platform_id,n.name=t.name,n.platformGroupName=t.platformGroupName,e.next=13,t.setEmptyPlantContainers(r);case 13:return e.next=15,t.setEmptyPlantContainer(n);case 15:return e.next=17,t.updateSelectedContainer(n);case 17:e.next=28;break;case 19:return t.selectedPlantContainerPosition.new=!0,t.selectedPlantContainerPosition.plantContainer_id=t.emptyContainer.plantContainer_id,t.emptyContainer.platformPosition_id=t.selectedPlantContainerPosition.platformPosition_id,t.emptyContainer.platform_id=t.platform_id,t.emptyContainer.name=t.name,t.emptyContainer.platformGroupName=t.platformGroupName,1===t.emptyContainer.positions.length&&(t.emptyContainer.positions[0].plant_id=!0),e.next=28,t.updateSelectedContainer(t.emptyContainer);case 28:case"end":return e.stop()}}),e)})))()},checkDuplicatesEmptyContainers:function(){var t=this;this.positions.forEach((function(e){e.new&&!e.plantCount&&e.platformPosition_id!==t.emptyContainer.platformPosition_id&&(e.plantContainer_id=null,e.new=!1,e.count="")})),this.$forceUpdate()},fillWithPots:function(){var t=this;return R(I().mark((function e(){var r,n,i;return I().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.emptyPlantContainers.length){e.next=11;break}r=t.emptyPlantContainers.length,n=0;case 3:if(!(n<r)){e.next=11;break}if(i=t.getNextEmptyPosition(),!i){e.next=8;break}return e.next=8,t.showEmptyContainer(t.plantContainerType,i);case 8:n++,e.next=3;break;case 11:case"end":return e.stop()}}),e)})))()},getNextEmptyPosition:function(){return this.positions.find((function(t){return!(t.plantCount>0)}))},showEmptyContainer:function(t,e){var r=arguments,n=this;return R(I().mark((function i(){var a;return I().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(a=r.length>2&&void 0!==r[2]?r[2]:null,a&&a.stopPropagation(),n.updateSelectedContainer({}),n.selectedPlantContainerPosition=e,n.selectedPlantContainerType=t,!(n.emptyContainer&&0===n.emptyContainer.plants||n.emptyPlantContainers.length)){i.next=10;break}return i.next=8,n.setNewEmptyContainer();case 8:i.next=11;break;case 10:n.getEmptyContainer(t,e,n.getExcluded);case 11:case"end":return i.stop()}}),i)})))()},getEmptyContainer:function(t,e,r){this.callFrom=this.platform_id,this.clickable&&t&&this.getEmptyPlantContainer({apitoken:this.getUser.apitoken,plantContainerType_id:t.id||t.plantcontainerType_id,facility_id:this.getUser.facility_id,exclude:r||""})},getIconUrl:function(t){return t.plantContainer_id?t.plantCount<=0?this.getUser.facility.growsLeafyGreens?"/img/icons/spade.svg":"/img/icons/leaf_wait.svg":t.new||t.lifecycles&&-1!==t.lifecycles.split(",").indexOf(String(this.lifecycleId))?this.getUser.facility.growsLeafyGreens?"/img/icons/soil.svg":"/img/icons/leaf.svg":t.lifecycles&&-1===t.lifecycles.split(",").indexOf(String(this.lifecycleId))?this.getUser.facility.growsLeafyGreens?"/img/icons/soil.svg":"/img/icons/leaf_gray.svg":void 0:"/img/icons/none.svg"},showContainer:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r&&r.stopPropagation();var n=t.plantContainer_id,i=this.Containers.find((function(t){return t.plantContainer_id==n}));if(i&&i.plantContainer_id){if(0!==i.plants&&1===i.positions.length){var a=L(this.emptyPlantContainers);i=H(H({},i),{},{plants:0});var o=H(H({},i),{},{platformPosition_id:null,platform_id:null,name:null,platformGroupName:null});a.push(o),this.setEmptyPlantContainer(o),this.setEmptyPlantContainers(a),i=H(H({},i),{},{positions:[],plantCount:0})}this.updateSelectedContainer(i)}}}),watch:{selectedPlatformContainer:function(t){t.plantContainer_id&&this.checkDuplicatesEmptyContainers()},emptyContainer:function(t){if(t&&t.plantContainer_id&&this.platform_id==this.callFrom)return this.showEmptyContainer(this.selectedPlantContainerType,this.selectedPlantContainerPosition)},plantContainerError:function(t){d["a"].error("Error: ".concat(t))},plantCount:function(t){var e=this;this.positions.forEach((function(r){r.platformPosition_id===e.selectedPlatformContainer.platformPosition_id&&(r.plantCount=t?t.length:0,r.plantCount||(r.plantContainer_id=null,r.new=!1,r.count=""))}))}}},q=Y,W=Object(k["a"])(q,v,y,!1,null,null,null),J=W.exports,Z={name:"platform-group",props:["platformGroup","plantContainerType","platformPlantCount","platformGroupName","containers","expectedLifecycleId"],components:{Platform:J},data:function(){return{platformClass:"platform"}},methods:{platformClassAttribute:function(t){return this.platformClass.concat("type-"+t.platformType_id)}}},X=Z,K=Object(k["a"])(X,f,p,!1,null,null,null),Q=K.exports,tt=r("8336"),et=r("b0af"),rt=r("99d9"),nt=r("132d"),it=r("2fa4"),at=function(){var t=this,e=t._self._c;return e("div",{staticClass:"plant-container"},[e(et["a"],[e(rt["d"],[e("h2",[t._v(t._s(t.name)+" Container - "+t._s(t.plantCount)+" Plants")]),e(it["a"]),e(tt["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(nt["a"],[t._v("close")])],1)],1),e(rt["c"],{staticStyle:{"text-align":"center"}},[e("table",{staticClass:"plantcontainer"},t._l(t.ContainerType.rows,(function(r,n){return e("tr",{key:"row-".concat(r)},t._l(t.getRowPositions(r),(function(i,a){return e("td",{key:"col-".concat(a),staticStyle:{margin:"2px",padding:"2px"},on:{click:function(e){return t.individualClick(i.plantContainerPosition_id,n*t.ContainerType.cols+a,!i.plant_id)},dblclick:function(e){return t.rowClick(r)}}},[e("div",{staticStyle:{"min-width":"40px"}},[i.plant_id?t._e():e("img",{staticClass:"plants-icon",attrs:{src:"/img/icons/none.svg"}}),!0===i.plant_id||""!==i.plant_id&&i.lifecycle_id===Number(t.lifecycleId)?e("img",{staticClass:"plants-icon",attrs:{src:t.leafIcon1}}):t._e(),i.plant_id&&i.lifecycle_id&&i.lifecycle_id!==Number(t.lifecycleId)?e("img",{staticClass:"plants-icon-disabled",attrs:{src:t.leafIcon1}}):t._e()])])})),0)})),0)]),e(rt["a"],{staticClass:"justify-center"},[e(tt["a"],{attrs:{outlined:"",color:"primary"},on:{click:function(e){return t.allClick()}}},[t._v(t._s(t.plantCount<t.positions.length?"Select All":"Unselect All"))])],1)],1)],1)},ot=[];function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function lt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?lt(Object(r),!0).forEach((function(e){ut(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ut(t,e,r){return(e=dt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dt(t){var e=ht(t,"string");return"symbol"==st(e)?e:e+""}function ht(t,e){if("object"!=st(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var ft={name:"plant-container",props:["containerClass","name","size","ContainerType","area","positions","selectedPlants","lifecycleId","plantContainerId","platformId","defaultFill","plantTarget"],beforeMount:function(){for(var t=0;t<this.size;t++)this.containerPositions[t]=!1;for(var e=0;e<this.ContainerType.rows;e++)this.rows[e]={val:!1};this.getUser.facility.growsLeafyGreens&&(this.leafIcon1="/img/icons/soil.svg",this.leafIcon2="/img/icons/soil_disabled.svg")},mounted:function(){this.defaultFill&&0==this.plantCount&&this.allClick()},data:function(){return{containerPositions:[],plantContainerPositions:[],rows:[],allPlants:!1,allCount:!1,leafIcon1:"/img/icons/leaf.svg",leafIcon2:"/img/icons/leaf_gray.svg"}},watch:{positions:function(){for(var t=0;t<this.ContainerType.rows;t++)this.rows[t].val=!1;this.allPlants=!1,this.allCount=!1,this.verifyRows()}},computed:ct(ct({},Object(u["c"])(["getUser"])),{},{plantCount:function(){var t=0;return this.positions.forEach((function(e){e.plant_id&&t++})),t},checkboxClass:function(){return this.containerClass+"-check"},full:function(){for(var t=0;t<this.positions.length;t++)if(!this.positions[t].lifecycle_id)return!1;return!0},hasCurrentLifecyclePlants:function(){for(var t=0;t<this.positions.length;t++)if(this.positions[t].lifecycle_id==this.lifecycleId)return!0;return!1}}),methods:{onClose:function(){this.$emit("close")},showPlant:function(t,e,r){this.positions[e].plant_id=r,this.sendPositions(t)},sendPositions:function(t){for(var e in this.plantContainerPositions=[],this.positions)this.positions[e].plant_id&&this.plantContainerPositions.push(this.positions[e].plantContainerPosition_id);this.$emit("input",this.plantContainerPositions)},getRowPositions:function(t){return this.positions.filter((function(e){return e.row===t}))},rowClick:function(t){for(var e=this.ContainerType.cols*(t-1),r=e;r<e+this.ContainerType.cols;r++)this.showPlant(this.positions[r].plantContainerPosition_id,r,!this.rows[t-1].val);this.verifyRows()},individualClick:function(t,e,r){this.showPlant(t,e,r),this.verifyRows()},allClick:function(){if(this.plantCount<this.positions.length){var t=this.plantTarget?this.plantTarget:this.ContainerType.positions;t>this.ContainerType.positions&&this.ContainerType.positions;for(var e=0;e<t;e++)this.showPlant(this.positions[e].plantContainerPosition_id,e,!this.allCount)}else for(var r=0;r<this.ContainerType.positions;r++)this.showPlant(this.positions[r].plantContainerPosition_id,r,0);this.verifyRows()},verifyRows:function(){for(var t=0,e=0;e<this.ContainerType.rows;e++){for(var r=this.ContainerType.cols*e,n=0,i=r;i<r+this.ContainerType.cols;i++)this.existsSelectedPlant(this.positions[i].plantContainerPosition_id)&&(n++,t++);n===this.ContainerType.cols?this.rows[e].val=!0:this.rows[e].val=!1}t===this.ContainerType.positions?this.allPlants=!0:this.allPlants=!1,this.allCount=this.allPlants},existsSelectedPlant:function(t){var e=!1;if(this.selectedPlants)for(var r=0;r<this.selectedPlants.length;r++)for(var n=0;n<this.selectedPlants[r].positions.length;n++)if(this.selectedPlants[r].positions[n].plantContainerPosition_id==t&&this.selectedPlants[r].positions[n].plant_id){e=!0;break}return e}}},pt=ft,mt=(r("f9fa"),Object(k["a"])(pt,at,ot,!1,null,"65dadea6",null)),vt=mt.exports;function yt(t){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(t)}function gt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */gt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new j(n||[]);return i(o,"_invoke",{value:P(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(E([])));S&&S!==r&&n.call(S,o)&&(w=S);var _=b.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==yt(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function P(e,r,n){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=D(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?m:f,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function D(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(yt(e)+" is not iterable")}return g.prototype=b,i(_,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},C(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new O(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(_),c(_,l,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function bt(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function wt(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){bt(a,n,i,o,s,"next",t)}function s(t){bt(a,n,i,o,s,"throw",t)}o(void 0)}))}}function xt(t,e){return Pt(t)||Ot(t,e)||_t(t,e)||St()}function St(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _t(t,e){if(t){if("string"==typeof t)return Ct(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ct(t,e):void 0}}function Ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ot(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Pt(t){if(Array.isArray(t))return t}function Dt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function kt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dt(Object(r),!0).forEach((function(e){Tt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Tt(t,e,r){return(e=jt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jt(t){var e=Et(t,"string");return"symbol"==yt(e)?e:e+""}function Et(t,e){if("object"!=yt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var It={name:"platform-selection",props:["value","expectedLifecycleId","filter","targetCount","clonePlatformGroupsFilter"],components:{PlatformGroup:Q,PlantContainer:vt},data:function(){return{allPlatformGroups:[],rec:{},selectedGrowPlatforms:[],selectedArea:"",areas:[],areaRefresher:0,showArea:!1,platformPlantCount:[],containers:[],showPlantContainerDialog:!1,showContainer:null,plantContainerPositions:[],containerClass:"container",showCloneRacksOnly:!1}},beforeMount:function(){this.rec=JSON.parse(JSON.stringify(this.value)),this.showCloneRacksOnly=this.clonePlatformGroupsFilter,this.init()},computed:kt(kt(kt({},Object(u["c"])(["firstEvent","plantContainerTypes","getUser","selectedPlatformContainer","emptyContainer"])),Object(u["c"])("universalDashboard",["selectedContextMenuItem"])),{},{placedPlantTotal:function(){return this.allPlatformPositions.reduce((function(t,e){return t+e.plantContainerPositions.length}),0)},platformGroups:function(){return this.showCloneRacksOnly?this.allPlatformGroups.filter((function(t){return"PGU"==t.platformGroupType||"IGR"==t.platformGroupType})):this.allPlatformGroups},selectedPlatformGroups:function(){if(this.areaRefresher++,0==this.selectedGrowPlatforms.length)return this.platformGroups;for(var t=[],e=0;e<this.platformGroups.length;e++)this.selectedGrowPlatforms.includes(this.platformGroups[e].platformGroup_id)&&t.push(this.platformGroups[e]);return t},plantContainerTypesMap:function(){return this.plantContainerTypes?this.plantContainerTypes.reduce((function(t,e){return t[e.id]=e,t}),{}):{}},allPlatformPositions:function(){var t=[];for(var e in this.containers)this.containers[e].positions&&this.containers[e].plants>0&&t.push({platformPosition_id:this.containers[e].platformPosition_id,plantContainer_id:this.containers[e].plantContainer_id,platformGroupName:this.containers[e].platformGroupName,plantContainerPositions:this.positionsID(this.containers[e].positions)});return t},firstEventPlantContainerType:function(){return this.rec.donateCuttings&&this.rec.donateCuttings.plantContainerType_id?this.plantContainerTypesMap[this.rec.donateCuttings.plantContainerType_id]:this.firstEvent.plantContainerType&&this.firstEvent.plantContainerType.length>0?this.firstEvent.plantContainerType[0]:{plantcontainerType:"Not found"}}}),methods:kt(kt({},Object(u["b"])(["updateSelectedContainer","getPlantContainerTypes","setEmptyPlantContainers"])),{},{getPlatformGroups:function(t){var e=this;h["a"].get("infrastructure/getPlatformGroups",this.getUser.apitoken,t).then((function(t){var r=xt(t,2),n=r[0];r[1];e.allPlatformGroups=n.getPlatformGroups,e.selectedContextMenuItem&&e.selectedContextMenuItem.platformGroup_id&&(e.selectedGrowPlatforms=[e.selectedContextMenuItem.platformGroup_id])}))},updatePlantContainers:function(t){var e=this;return wt(gt().mark((function r(){var n,i,a;return gt().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(!t){r.next=10;break}return e.plantContainerTypesMap[e.rec.plantContainerType_id]&&e.plantContainerTypesMap[e.rec.plantContainerType_id].positions>1&&(t=1),r.next=4,h["a"].post("ag_plantContainers/createPlantContainer",e.getUser.apitoken,{facility_id:e.getUser.facility_id,plantcontainerType_id:e.rec.plantContainerType_id,quantity:parseInt(t)});case 4:n=r.sent,i=xt(n,1),a=i[0],a.success&&a.data?e.setEmptyPlantContainers(a.data.map((function(t){return{plantContainer_id:t.id,facility_id:t.facility_id,plantcontainerType_id:t.plantcontainerType_id,plantcontainerType:e.value.plantContainerType,positions:t.positions.map((function(t){return{plantContainerPosition_id:t.id,row:t.row,col:t.col,plant_id:!0,lifecycle_id:null,growplanName:null,tag:null,inflight:null}})),plants:0,platformPosition_id:null,platform_id:null,name:null,platformGroupName:null}}))):e.setEmptyPlantContainers([]),r.next=11;break;case 10:e.setEmptyPlantContainers([]);case 11:case"end":return r.stop()}}),r)})))()},init:function(){var t=this,e=this;e.getPlantContainerTypes(e.getUser.apitoken),h["a"].get("ag_areas",e.getUser.apitoken,{filter:{where:{facility_id:e.getUser.facility_id},sort:"areaname"}}).then((function(r){var n=xt(r,2),i=n[0],a=n[1];if(a)return d["a"].error(a);if(e.areas=i,t.selectedContextMenuItem.area_id)t.selectedArea=t.selectedContextMenuItem.area_id;else if(1===e.areas.length)e.selectedArea=e.areas[0].id;else for(var o=1!==e.value.plantContainerType_id,s=0;s<e.areas.length;s++)if(o&&e.areas[s].motherRoom||!o&&!e.areas[s].motherRoom){e.selectedArea=e.areas[s].id;break}}))},positionsID:function(t){var e=[];for(var r in t)t[r].plant_id&&e.push(t[r].plantContainerPosition_id);return e},containerClassAttribute:function(t){var e="";return e="object"===yt(t)?t.plantcontainerType:t,t?this.containerClass.concat("-",e.replace(" ","")):this.containerClass},addContainer:function(t){for(var e=!1,r=0;r<this.containers.length;r++)if(this.containers[r].plantContainer_id===t.plantContainer_id){e=!0,this.containers[r]=t;break}e||this.containers.push(t)},removeContainer:function(t){this.containers=this.containers.filter((function(e){return e.plantContainer_id!==t.plantContainer_id}))}}),watch:{value:function(t,e){this.rec=JSON.parse(JSON.stringify(this.value))},targetCount:function(t){this.rec.targetCount=t},"selectedContextMenuItem.area_id":function(){this.selectedContextMenuItem&&this.selectedContextMenuItem.area_id&&(this.selectedArea=this.selectedContextMenuItem.area_id)},"value.plantContainerType_id":function(t){if(this.selectedContextMenuItem&&this.selectedContextMenuItem.area_id)this.selectedArea=this.selectedContextMenuItem.area_id;else if(1===this.areas.length)this.selectedArea=this.areas[0].id;else for(var e=1!==t,r=0;r<this.areas.length;r++)if(e&&this.areas[r].motherRoom||!e&&!this.areas[r].motherRoom){this.selectedArea=this.areas[r].id;break}},"value.cuttings":function(t,e){this.rec.cuttings=JSON.parse(JSON.stringify(t))},"value.donateCuttings":function(t,e){this.rec.donateCuttings=JSON.parse(JSON.stringify(t))},allPlatformPositions:function(t){this.rec.platformPositions=t,this.rec.selectedPlatformContainerType=this.firstEventPlantContainerType,this.$emit("input",this.rec)},showPlantContainerDialog:function(t){t||this.updateSelectedContainer({})},selectedArea:function(t){t&&(this.getPlatformGroups({area_id:t}),this.showArea=!0)},selectedPlatformContainer:function(t){t.plantContainer_id&&(t.positions&&t.positions.length>1?(this.showContainer=t,this.showPlantContainerDialog=!0,this.plantContainerPositions=t.positions):t.positions&&1===t.positions.length?this.plantContainerPositions=[t.positions[0].plantContainerPosition_id]:t.positions&&!t.positions.length&&(this.plantContainerPositions=[]))},plantContainerPositions:function(t){this.platformPlantCount=[],t&&(this.platformPlantCount=t,this.emptyContainer.plants=t.length,t.length?this.addContainer(this.selectedPlatformContainer):this.removeContainer(this.selectedPlatformContainer))},"rec.numberOfPlants":function(){var t=wt(gt().mark((function t(e){return gt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.updatePlantContainers(e);case 2:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),"rec.plantContainerType_id":function(){var t=wt(gt().mark((function t(e){return gt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.updatePlantContainers(e);case 2:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()}},Lt=It,At=Object(k["a"])(Lt,l,c,!1,null,null,null);e["a"]=At.exports},f590:function(t,e,r){"use strict";var n=r("b0af"),i=r("99d9"),a=r("2fa4"),o=function(){var t=this,e=t._self._c;return e(n["a"],[e(i["d"],[e("h2",[t._v("Generic Device")]),e(a["a"])],1),e(i["c"],[t._v("Coming soon!")])],1)},s=[],l=r("35d5"),c=r("a6e5"),u=r("da52"),d=r("4458"),h=r("dd20"),f=r("0583"),p=r("dbd0"),m=r("de1e"),v=r("4b5c"),y=r("2fa3"),g=r("0276"),b=r("b7dd"),w={name:"generic-controller-viewer",props:{platformGroup_id:{type:Number},presetTab:{type:Number},currentDevice:{type:Object},isSse:{type:Boolean},lastEventReceived:{type:Object}},components:{ServiceHistory:l["a"],EnvironmentGraph:c["a"],ManualControlOptions:f["a"],Lifecycles:p["a"],VuetifyDatepicker:d["a"],VuetifyTimepicker:h["a"],ChartDataTable:u["a"],ZoneParameters:m["a"],DeviceLifecycles:v["a"],IpmScoutingReports:y["a"],Lgu:g["a"],LifecycleReport:b["a"]},beforeMount:function(){},mounted:function(){},data:function(){return{}},computed:{},watch:{},methods:{}},x=w,S=r("2877"),_=Object(S["a"])(x,o,s,!1,null,null,null);e["a"]=_.exports},f675:function(t,e,r){"use strict";var n=r("cd55"),i=r("49e2"),a=r("c865"),o=function(){var t=this,e=t._self._c;return e(n["a"],{directives:[{name:"show",rawName:"v-show",value:t.isVisibleDisplayUnitType,expression:"isVisibleDisplayUnitType"}],staticClass:"flex-grow-auto flex-column",class:{"d-flex":t.isVisibleDisplayUnitType}},[e(a["a"],{staticClass:"d-flex justify-between"},[e("span",{staticClass:"flex-grow-auto"},[t._v(t._s(t.displayUnits.length)+" Bucking Units")])]),e(i["a"],{staticClass:"flex-grow-auto"},[e("unit-results",{attrs:{"display-units":t.displayUnits}})],1),e("edit-phase-modal",{on:{refresh:t.refresh},model:{value:t.growPhase_id,callback:function(e){t.growPhase_id=e},expression:"growPhase_id"}})],1)},s=[],l=r("c1df"),c=r.n(l),u=r("ab66"),d=r("b3c5"),h=r("ea10"),f=r("d0eb"),p=r("d67f"),m=r("2f62"),v=r("a9b3"),y=r("8ac5"),g=r("12ad");function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){return O(t)||C(t,e)||S(t,e)||x()}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function O(t){if(Array.isArray(t))return t}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T(t){var e=j(t,"string");return"symbol"==b(e)?e:e+""}function j(t,e){if("object"!=b(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var E={name:"BuckingUnitExpansionPanel",mixins:[v["a"]],components:{UnitResults:g["a"],LifecyclePlatforms:y["a"],LockedColumnDatatable:u["a"],EditPhaseModal:d["a"]},props:{selectedDisplayTypes:{type:Array,required:!1,default:function(){return[]}},displayUnits:{type:Array,required:!1,default:function(){return[]}},maximizedDisplayType:{type:Number,required:!1,default:function(){return null}},isLockingEnabled:{type:Boolean,required:!1,default:function(){return!1}},isLockingColumns:{type:Boolean,required:!1,default:function(){return!1}},displayUnitsLoading:{type:Boolean,required:!1,default:function(){return!1}},searchText:{type:String,required:!1,default:function(){return""}}},data:function(){return{moment:c.a,pagination:{itemsPerPage:250},footerprops:{"items-per-page-options":[25,50,75,100,250]},displayUnitsHeaders:[{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"Type",value:"platformGroupType",align:"center"},{text:"Area",value:"areaname",align:"center",width:200},{text:"",value:"data-table-expand"}],displayUnitsExpanded:[],growPhase_id:null,isAdmin:!1}},computed:D(D({},Object(m["c"])(["getUser"])),{},{isVisibleDisplayUnitType:function(){return this.selectedDisplayTypes.find((function(t){return 3===t.id}))&&this.displayUnits&&this.displayUnits.length&&(!this.maximizedDisplayType||3===this.maximizedDisplayType)},filteredDisplayUnits:function(){var t=this;return""!==this.searchText&&this.searchText?this.displayUnits.filter((function(e){return e.platformGroupName.toLowerCase().includes(t.searchText.toLowerCase())})):this.displayUnits}}),beforeMount:function(){this.isAdmin=f["a"].isAdmin(this.getUser)||f["a"].isUserInRole(this.getUser,"Maintenance")},watch:{filteredDisplayUnits:function(){""!==this.searchText&&this.$emit("searched-length",this.filteredDisplayUnits.length)}},methods:{isExpanded:function(t){var e=this.displayUnitsExpanded.find((function(e){return e.id===t.id}));return!!e},fullscreenPanel:function(){this.$emit("fullscreen-panel",3)},minimizePanel:function(){this.$emit("minimize-panel")},refresh:function(){this.$emit("refresh")},goToDevice:function(){},onShowDisplayUnitLifecycle:function(t){var e=this.displayUnitsExpanded.findIndex((function(e){return e.platformGroup_id===t.platformGroup_id}));-1===e?this.displayUnitsExpanded.push(t):this.displayUnitsExpanded.splice(e,1)},createOperationalTask2:function(t,e){this.$router.push({name:"operational-task",params:{growplanId:t,lifecycleId:e}})},onEditPhase:function(t){this.growPhase_id=t.id},onToggleLifecycle:function(t){var e=this,r="";r=t.isSuspended?"Resume Lifecycle  "+t.lifecycle_id+"?":"Suspend Lifecycle  "+t.lifecycle_id+"?",h["a"].confirm("Please Confirm",r,(function(r){r&&f["a"].post("ag_lifecycles/toggleSuspend",e.getUser.apitoken,{lifecycle_id:t.lifecycle_id}).then((function(e){var r=w(e,2),n=r[0];r[1];n?(p["a"].success("Function Complete"),t.isSuspended=!t.isSuspended):p["a"].error("An error occurred. Please try again later")}))}))},getPhotoPeriodText:function(t){var e="Photo period: "+t.currentPhase.photoperiod+" hours at ";return t.currentPhase.photoPeriodIntensity!==t.currentPhase.photoPeriodInterlightIntensity?(e+=100*t.currentPhase.photoPeriodIntensity+"% Downlight, ",e+=Math.round(100*t.currentPhase.photoPeriodInterlightIntensity)+"% Interlight intensity, "):e+=Math.round(100*t.currentPhase.photoPeriodIntensity)+"% intensity, ",e+="starting at "+this.convertTime(t.currentPhase.photoperiodStartTime)+".",e},convertTime:function(t){return 12===+this.$root.timePreference?c.a.utc(t,"HH:mm").add(this.getUser.facility_UTCOffset,"hours").format("h:mm a"):c.a.utc(t,"HH:mm").local().format("h:mm a")}}},I=E,L=r("2877"),A=Object(L["a"])(I,o,s,!1,null,null,null);e["a"]=A.exports},f704:function(t,e,r){"use strict";r("9be9")},f721:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("132d"),s=r("2fa4"),l=function(){var t=this,e=t._self._c;return t.showDeviceHistory?e(i["a"],{staticClass:"screen-height-container flex-content vh90"},[e(a["d"],[e("h2",[t._v("\n      "+t._s(t.selectedContextMenuItem.platformGroupName)+" Device History\n    ")]),e(s["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.closeModal}},[e(o["a"],[t._v("close")])],1)],1),e(a["c"],[e("device-history-viewer",{attrs:{platformGroupId:t.selectedContextMenuItem.platformGroup_id,platformGroupName:t.selectedContextMenuItem.platformGroupName,controller_id:t.selectedContextMenuItem.controller_id}})],1)],1):t._e()},c=[],u=r("e2cd"),d=r("2f62");function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t,e,r){return(e=v(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t){var e=y(t,"string");return"symbol"==h(e)?e:e+""}function y(t,e){if("object"!=h(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var g={name:"DeviceHistoryViewerModal",components:{DeviceHistoryViewer:u["a"]},computed:p({},Object(d["c"])("universalDashboard",["selectedContextMenuItem","showDeviceHistory"])),methods:{closeModal:function(){this.$store.dispatch("universalDashboard/setShowDeviceHistory",!1)}}},b=g,w=r("2877"),x=Object(w["a"])(b,l,c,!1,null,null,null);e["a"]=x.exports},f749:function(t,e,r){"use strict";r.r(e);var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("ac7c"),s=r("62ad"),l=r("2e4b"),c=r("169a"),u=r("ce7e"),d=r("132d"),h=r("8860"),f=r("da13"),p=r("1800"),m=r("5d23"),v=r("e449"),y=r("67b6"),g=r("43a6"),b=r("0fd9"),w=r("b974"),x=r("2fa4"),S=r("8654"),_=r("3a2f"),C=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"alerts-container screen-height-container",class:[t.compact?"fullHeight":"",{isMaximized:t.maximized}],attrs:{id:"alertdisplay",loading:t.isLoading}},[e(a["d"],{staticClass:"pl-4 pr-0"},[e("h2",{staticClass:"expandable",staticStyle:{display:"inline-block"},on:{click:t.onMaximize}},[t._v(t._s(t.title)+" "+t._s(t.admin?"Critical Alerts":"Alerts"))]),e(x["a"]),e("help-button",{staticClass:"mr-0 ml-0",attrs:{"help-topic-key":"dashboards-alerts-overview"}}),e(n["a"],{staticClass:"mr-0 ml-0",attrs:{icon:""}},[e(_["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(d["a"],t._g({on:{click:t.onDownload}},n),[t._v("download")])]}}])},[e("span",[t._v("Download as CSV")])])],1),t.admin?t._e():e(n["a"],{staticClass:"mr-0 ml-0",attrs:{icon:""}},[e(_["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(d["a"],t._g({on:{click:t.resetDates}},n),[t._v("format_clear")])]}}],null,!1,1222263792)},[e("span",[t._v("Reset Form")])])],1),e(n["a"],{staticClass:"mr-0 ml-0",attrs:{icon:"",loading:t.isLoading}},[e(_["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(d["a"],t._g({on:{click:t.refresh}},n),[t._v("refresh")])]}}])},[e("span",[t._v("Reload Data")])])],1),t.maximized||t.controller_id?t._e():e(n["a"],{staticClass:"mr-0 ml-0",attrs:{icon:""},on:{click:t.onMaximize}},[e(_["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(d["a"],t._g({},n),[t._v("open_in_new")])]}}],null,!1,3754507201)},[e("span",[t._v("Maximize")])])],1),t.modal?e(n["a"],{staticClass:"mr-0 ml-0",attrs:{icon:""}},[e(_["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(d["a"],t._g({on:{click:t.close}},n),[t._v("close")])]}}],null,!1,3451726567)},[e("span",[t._v("Close")])])],1):t._e()],1),e("div",{staticClass:"pt-0 pl-4 pr-4"},[!t.admin&&t.typesItems&&t.typesItems.length?e(b["a"],{attrs:{align:"center","no-gutters":""}},[e(s["a"],{attrs:{cols:"12"}},[e(w["a"],{attrs:{items:t.typesItems,"item-text":"name","item-value":"id",label:"Select a type"},model:{value:t.selectedExceptionType,callback:function(e){t.selectedExceptionType=e},expression:"selectedExceptionType"}})],1),e(s["a"],{class:t.compact?"md12":"md9"},[e(g["a"],{staticClass:"errorTypes",attrs:{row:""},model:{value:t.selectedType,callback:function(e){t.selectedType=e},expression:"selectedType"}},[e(y["a"],{staticClass:"pr-2",attrs:{label:"Crit",value:1}}),e(y["a"],{staticClass:"pr-2",attrs:{label:"Warn",value:2}}),e(y["a"],{staticClass:"pr-2",attrs:{label:"Info",value:3}}),e(y["a"],{attrs:{label:"All",value:0}})],1)],1),t.compact?t._e():e(s["a"],{staticClass:"hidden-sm-and-down",attrs:{md:"3"}},[e(o["a"],{attrs:{label:"Hide Resolved"},model:{value:t.hideResolved,callback:function(e){t.hideResolved=e},expression:"hideResolved"}})],1)],1):t._e(),t.controller_id?t._e():[t.admin?t._e():e(b["a"],{attrs:{"no-gutters":""}},[e(s["a"],{staticClass:"pr-1",attrs:{md:"6"}},[e(v["a"],{attrs:{"nudge-right":40,transition:"scale-transition","offset-y":"","min-width":"290px"},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(S["a"],t._g({attrs:{label:"From"},model:{value:t.gtDate,callback:function(e){t.gtDate=e},expression:"gtDate"}},n))]}}],null,!1,1976435112)},[e(l["a"],{attrs:{color:"primary",max:(new Date).toISOString().substr(0,10),"no-title":"",scrollable:""},model:{value:t.gtDate,callback:function(e){t.gtDate=e},expression:"gtDate"}})],1)],1),e(s["a"],{staticClass:"pl-1",attrs:{md:"6"}},[e(v["a"],{attrs:{"nudge-right":40,transition:"scale-transition","offset-y":"","min-width":"290px"},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[e(S["a"],t._g({attrs:{label:"To"},model:{value:t.ltDate,callback:function(e){t.ltDate=e},expression:"ltDate"}},n))]}}],null,!1,3952375758)},[e(l["a"],{attrs:{color:"primary",min:(new Date).toISOString().substr(0,10),"no-title":"",scrollable:""},model:{value:t.ltDate,callback:function(e){t.ltDate=e},expression:"ltDate"}})],1)],1)],1)]],2),e(a["c"],{staticClass:"alerts-notes-list momentumscrolling pl-4 pr-4",class:[{smallScroll:t.compact},{popup:t.controller_id}],style:t.admin?"min-height:calc(100% - 100px)":"min-height:0px"},[0!=t.exceptionList.length||t.isLoading?t._e():e("div",[t._v("No alerts matched the filter criteria.")]),t.exceptionList&&t.exceptionList.length&&!t.exceptionListLoading&&(t.admin&&t.facilities||!t.admin&&!t.facilities)?e(h["a"],{attrs:{"three-line":"",dense:""}},[t._l(t.exceptionList,(function(r){return[e(b["a"],{key:r.id,attrs:{"no-gutters":""}},[e(s["a"],{attrs:{cols:"1"}},[e(o["a"],{attrs:{disabled:"RESOLVED"===r.status},model:{value:r.isResolved,callback:function(e){t.$set(r,"isResolved",e)},expression:"exception.isResolved"}})],1),e(s["a"],{staticClass:"pr-1 pb-2",attrs:{cols:"11"}},[e(f["a"],{key:r.id,staticClass:"pr-0"},[e(m["a"],{on:{dblclick:function(e){t.remediateAlertDialog=!0,t.currentException=r}}},[e(m["c"],[e(_["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(n){var i=n.on;return[e("span",t._g({class:{"resolved-alert":"RESOLVED"===r.status}},i),[t._v(t._s(t.admin?t.facilities[r.facility_id].name+":":"")+" "+t._s(r.exceptionTypeName)+" ("+t._s(r.status)+")")])]}}],null,!0)},[e("span",[t._v(t._s(r.exceptionTypeName))])])],1),e(m["b"],[t._v(t._s(t.getExceptionDate(r))+" @ "+t._s(t.getExceptionTime(r)))]),e(m["b"],[e(_["a"],{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function(n){var i=n.on;return[e("span",t._g({},i),[t._v(t._s(r.name)+" - "+t._s(r.message))])]}}],null,!0)},[e("span",[t._v(t._s(r.name)+" - "+t._s(r.message))])])],1)],1),e(p["a"],[e(n["a"],{attrs:{icon:"",ripple:""},on:{click:function(e){t.remediateAlertDialog=!0,t.currentException=r}}},[e(d["a"],{attrs:{color:t.getColor(r)}},[t._v("info")])],1)],1)],1)],1)],1),e(u["a"],{key:"div"+r.id})]})),!t.exceptionList||t.exceptionList.length||t.exceptionListLoading?t._e():[e(f["a"],[e(m["a"],[e(m["c"],[t._v("No Alerts Available")])],1)],1)]],2):t._e()],1),e(a["a"],{staticClass:"justify-center",staticStyle:{"border-top":"1px solid silver"}},[e(n["a"],{attrs:{text:"",small:"",color:"primary"},on:{click:t.selectAll}},[t._v("Select all")]),e(n["a"],{attrs:{ripple:"",text:"",small:"",disabled:t.disableMarkAsResolved,color:"primary"},on:{click:t.markAsResolved}},[t._v("Mark as resolved")])],1),e(c["a"],{attrs:{width:"600",persistent:""},model:{value:t.remediateAlertDialog,callback:function(e){t.remediateAlertDialog=e},expression:"remediateAlertDialog"}},[t.remediateAlertDialog?e("alert-remediation",{staticStyle:{height:"450px"},attrs:{exceptionStatuses:t.exceptionStatuses,exception:t.currentException,exceptionId:t.currentException.id,user:t.getUser},on:{save:t.updateException,close:function(e){t.remediateAlertDialog=!1}}}):t._e()],1),t.maximized||t.controller_id?t._e():e(c["a"],{attrs:{width:"600",persistent:""},model:{value:t.showMaximized,callback:function(e){t.showMaximized=e},expression:"showMaximized"}},[e("full-screen",{staticStyle:{height:"90vh !important"},attrs:{compact:t.compact,admin:t.admin,facilities:t.facilities,maximized:!0,modal:!0},on:{close:function(e){t.showMaximized=!1}}})],1)],1)},O=[],P=r("2f62"),D=r("c1df"),k=r.n(D),T=r("d67f"),j=r("8212"),E=r("4bd4"),I=r("adda"),L=r("71a3"),A=r("c671"),M=r("fe57"),U=r("a844"),N=function(){var t=this,e=t._self._c;return e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{id:"remediatealert"}},[e(a["d"],[e("h2",[t._v("Remediate Alert "+t._s(t.exception.id))]),e(x["a"]),e("help-button",{staticClass:"mr-0 ml-0",attrs:{"help-topic-key":t.tabHelpTopicKey}}),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(d["a"],[t._v("close")])],1)],1),e(a["c"],[e(M["a"],{staticClass:"pr-2 h-100",attrs:{vertical:""},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e(L["a"],[t._v("Update Ticket")]),e(L["a"],[t._v("Details")]),e(L["a"],[t._v("History")]),e(L["a"],[t._v("Notifications")]),e(A["a"],[e(E["a"],{staticClass:"pt-4",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[e(w["a"],{attrs:{dense:"",items:t.exceptionStatuses,"item-text":"label","item-value":"id",label:"Status","return-object":"",Standard:"",rules:[t.rules.required]},model:{value:t.selectedStatus,callback:function(e){t.selectedStatus=e},expression:"selectedStatus"}}),e(U["a"],{attrs:{label:"Notes",outlined:""},model:{value:t.notes,callback:function(e){t.notes=e},expression:"notes"}}),e(o["a"],{attrs:{label:"Resolved"},model:{value:t.isResolved,callback:function(e){t.isResolved=e},expression:"isResolved"}})],1)],1),e(A["a"],[e("div",{staticClass:"details"},[e("div",[e("label",{staticClass:"datalabel"},[t._v("Exception Type:")]),e("span",[t._v(t._s(t.exception.exceptionTypeName))])]),e("div",[e("label",{staticStyle:{"font-weight":"bold"}},[t._v("Details:")]),e("br"),e("span",[t._v(t._s(t.exception.message))])]),e("div",[e("label",{staticClass:"datalabel"},[t._v("Reported By:")]),e("span",[t._v(t._s(t.exception.name))])]),e("div",[e("label",{staticClass:"datalabel"},[t._v("First Occurred:")]),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.exception.firstOccurred))}})]),e("div",[e("label",{staticClass:"datalabel"},[t._v("Last Occurred:")]),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(t.exception.lastOccurred))}})]),e("div",[e("label",{staticClass:"datalabel"},[t._v("# Occurrences:")]),e("span",[t._v(t._s(t.exception.occurrences))])])])]),e(A["a"],[e("div",{staticClass:"exceptions-notes-list"},[e(h["a"],{attrs:{"three-line":""}},[t._l(t.exceptionRemediations,(function(r){return[e(f["a"],{key:"rem"+r.id},[e(j["a"],[e("img",{attrs:{src:r.profileImg}})]),e(m["a"],[e(m["c"],[e("strong",[t._v(t._s(r.statusLabel))])]),e("v-list-item-sub-title",[t._v("\n                    "+t._s(r.notes)+"\n                    "),e("br"),t._v("\n                    Reported by "+t._s(r.firstname)+" "+t._s(r.lastname)+" at\n                    "),e("span",{domProps:{innerHTML:t._s(t.formatDateWithHTML(r.begintime))}})])],1)],1),e(u["a"],{key:"divider"+r.id})]}))],2)],1)]),e(A["a"],[e("div",{staticClass:"exceptions-notes-list",staticStyle:{height:"300px",overflow:"auto"}},[e(h["a"],{attrs:{"three-line":""}},[t._l(t.exceptionNotifications,(function(r){return[e(f["a"],{key:"notification"+r.id},[e(j["a"],{staticStyle:{"margin-right":"5px"}},[e(I["a"],{attrs:{src:r.user.profileImg}})],1),e(m["a"],[e(m["c"],{staticStyle:{"font-size":"14px"}},[t._v(t._s(t.formatDate(r.begintime))+" - "+t._s(r.user.name)+" "+t._s(r.user.lastname))]),e("v-list-item-sub-title",[t._v(t._s(r.message.recipientAddress))]),r.response?e("div",[t._v("Response: "+t._s(r.response))]):t._e()],1)],1),e(u["a"],{key:"notificationdivider"+r.id})]}))],2)],1)])],1)],1),0==t.activeTab?e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{disabled:!t.valid,text:"",color:"primary"},on:{click:function(e){return t.updateException()}}},[t._v("Save Update")])],1):t._e()],1)},F=[],G=r("d0eb"),R=r("a9b3"),$=r("7ce3");function H(t,e){return q(t)||Y(t,e)||B(t,e)||V()}function V(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function B(t,e){if(t){if("string"==typeof t)return z(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?z(t,e):void 0}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Y(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function q(t){if(Array.isArray(t))return t}var W={name:"AlertRemediation",components:{HelpButton:$["a"]},mixins:[R["a"]],props:["exceptionStatuses","exception","exceptionId","user"],beforeMount:function(){},data:function(){return{Trimaster:G["a"],selectedExceptionType:0,selectedStatus:null,notes:null,isResolved:0,activeTab:null,currentException:{},exceptionRemediations:[],exceptionNotifications:[],isLoading:!1,rules:{required:function(t){return!!t||"Required."}},valid:null,tabHelpTopicKey:"dashboards-alerts-update-ticket"}},mounted:function(){this.loadHistory(),this.getNotifications(),"New"==this.exception.status&&(this.selectedStatus=this.exceptionStatuses[0])},methods:{onClose:function(){this.$emit("close")},updateException:function(){var t={statusId:this.selectedStatus.id,statusLabel:this.selectedStatus.label,notes:this.notes,isResolved:this.isResolved};this.$emit("save",t)},loadHistory:function(){var t=this;this.isLoading=!0,G["a"].get("vExceptionRemediations",this.user.apitoken,{filter:{where:{exceptions_id:this.exceptionId},order:"begintime DESC"}}).then((function(e){var r=H(e,1),n=r[0];t.isLoading=!1,t.exceptionRemediations=n}))},getNotifications:function(){var t=this;this.isLoading=!0,G["a"].get("exceptionNotifications",t.user.apitoken,{filter:{include:["user","message"],where:{exception_id:t.exceptionId},order:"begintime"}}).then((function(e){var r=H(e,1),n=r[0];t.isLoading=!1;for(var i=0;i<n.length;i++)n[i].user.profileImg||(n[i].user.profileImg="https://s3.amazonaws.com/agrinamics-images/logos/profile.png");t.exceptionNotifications=n}))}},watch:{exceptionId:function(t){this.loadHistory(),this.getNotifications()},activeTab:function(t){switch(t){case 1:this.tabHelpTopicKey="dashboards-alerts-ticket-details";break;case 2:this.tabHelpTopicKey="dashboards-alerts-ticket-history";break;case 3:this.tabHelpTopicKey="dashboards-alerts-notifications";break;default:this.tabHelpTopicKey="dashboards-alerts-update-ticket";break}}}},J=W,Z=(r("52f4"),r("2877")),X=Object(Z["a"])(J,N,F,!1,null,null,null),K=X.exports,Q=r("a026");function tt(t){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(t)}function et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function rt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?et(Object(r),!0).forEach((function(e){nt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function nt(t,e,r){return(e=it(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function it(t){var e=at(t,"string");return"symbol"==tt(e)?e:e+""}function at(t,e){if("object"!=tt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var ot={name:"alerts",props:["compact","admin","facilities","maximized","controller_id","title","modal","facility_id"],components:{HelpButton:$["a"],AlertRemediation:K,FullScreen:function(){return Promise.resolve().then(r.bind(null,"f749"))}},data:function(){return{disableMarkAsResolved:!0,showMaximized:!1,selectedAlerts:[],selectedUnresolvedExceptions:[],selectedExceptionType:0,hideResolved:!0,selectedType:1,gtDate:"",ltDate:"",typesItems:[],remediateAlertDialog:!1,activeTab:0,selectedStatus:{},isResolved:!1,notes:"",currentException:{},isLoading:!1,initialized:!1}},beforeMount:function(){this.getExceptionTypes({apitoken:this.getUser.apitoken,filters:this.orderFilters}),this.getExceptionStatuses({apitoken:this.getUser.apitoken}),this.refresh()},computed:rt(rt({},Object(P["c"])(["exceptionTypes","exceptionList","exceptionListLoading","getUser","exceptionStatuses","ExceptionRemediationResult","exceptionRemediations","updatedExceptionRemediation"])),{},{filters:function(){var t,e={order:"lastOccurred DESC",limit:100,where:{}};this.admin?e.where.escalationLevel=1:(e.where.facility_id=null!==(t=this.facility_id)&&void 0!==t?t:this.getUser.facility_id,this.selectedType&&(e.where.escalationLevel=this.selectedType));return this.selectedExceptionType&&(e.where.exceptionType_id=this.selectedExceptionType),""===this.gtDate&&""===this.ltDate||(e.where.lastOccurred={},""!==this.gtDate&&(e.where.lastOccurred.gt=new Date(this.gtDate)),""!==this.ltDate&&(e.where.lastOccurred.lt=new Date(this.ltDate))),this.hideResolved&&(e.where.resolvedOn=null),this.controller_id&&(e.where.controllerId=this.controller_id),encodeURI(JSON.stringify(e))},orderFilters:function(){var t={order:"name ASC"};return encodeURI(JSON.stringify(t))}}),methods:rt(rt({},Object(P["b"])(["getExceptionTypes","getExceptionList","getExceptionStatuses"])),{},{close:function(){this.$emit("close")},onDownload:function(){G["a"].csvExport(this.exceptionList,"Alerts.csv",this.getUser.apitoken,["name","code","exceptionTypeName","exceptionTypeMessage","firstOccurred","lastOccurred","message","occurrences"])},onMaximize:function(){this.showMaximized=!0},onChange:function(t){!0===t.isResolved?Q["default"].set(t,"isResolved",!1):(t.isResolved,Q["default"].set(t,"isResolved",!0))},selectAll:function(){var t=this;t.selectedAlerts=[],t.exceptionList.map((function(e){e.isResolved||e.resolvedOn?Q["default"].set(e,"isResolved",!1):(Q["default"].set(e,"isResolved",!0),e.resolvedOn||t.selectedAlerts.push(e))}))},markAsResolved:function(){var t=this;t.exceptionList.map((function(e){e.isResolved&&"RESOLVED"!=e.status&&t.selectedUnresolvedExceptions.push(e.id)})),t.selectedUnresolvedExceptions.length>0&&G["a"].post("exceptions/update",this.getUser.apitoken,{status:"RESOLVED",resolvedOn:(new Date).toISOString()},{},{where:{id:{inq:t.selectedUnresolvedExceptions}}}).then((function(){t.refresh(),T["a"].success("Updated successfully")}))},getExceptionDate:function(t){return k()(t.lastOccurred).format("MM-DD-YYYY")},refresh:function(){this.isLoading=!0,this.getExceptionList({apitoken:this.getUser.apitoken,filters:this.filters})},getExceptionTime:function(t){return k()(t.lastOccurred).format("hh:mm a")},updateException:function(t){var e=this;this.isLoading=!0,G["a"].post("ExceptionRemediations",this.getUser.apitoken,{user_id:this.getUser.id,exceptions_id:this.currentException.id,notes:t.notes,resolved:t.isResolved,exceptionstatus_id:t.statusId}).then((function(t){t?T["a"].success("Alert update saved."):T["a"].error(t.message),e.remediateAlertDialog=!1}));var r=k.a.utc(),n=new Date(r.format());t.isResolved?G["a"].patch("exceptions",this.getUser.apitoken,{id:this.currentException.id,status:"RESOLVED",resolvedOn:n}).then(e.handleUpdate):G["a"].patch("exceptions",this.getUser.apitoken,{id:this.currentException.id,status:t.statusLabel}).then(e.handleUpdate)},handleUpdate:function(t){1==t.length?T["a"].success("Alert update saved."):T["a"].error(t[1].message),this.isLoading=!1,this.getExceptionList({apitoken:this.getUser.apitoken,filters:this.filters})},resetDates:function(){this.gtDate="",this.ltDate="",this.selectedExceptionType=0,this.selectedType=1},getColor:function(t){return"RESOLVED"===t.status&&t.resolvedBgColor?t.resolvedBgColor:"RESOLVED"!==t.status&&t.activeBgColor?t.activeBgColor:"RESOLVED"===t.status&&t.resolvedBgColor?t.resolvedBgColor:"RESOLVED"!==t.status&&t.activeFgColor?t.activeFgColor:"gray"}}),watch:{showMaximized:function(t){t||this.refresh()},exceptionTypes:function(t){var e=this;this.typesItems=[{id:0,name:"All Types"}],t&&t.length&&t.forEach((function(t){e.typesItems.push(t)}))},exceptionList:{handler:function(t){var e=this,r=!1;t.map((function(t){t.isResolved&&!t.resolvedOn&&(r=!0)})),e.disableMarkAsResolved=!r,e.initialized=!0,e.isLoading=!1},deep:!0},filters:function(){this.initialized&&this.getExceptionList({apitoken:this.getUser.apitoken,filters:this.filters})},remediateAlertDialog:function(t){this.notes="",this.selectedStatus="",this.isResolved=!1}}},st=ot,lt=(r("0add"),Object(Z["a"])(st,C,O,!1,null,null,null));e["default"]=lt.exports},f92f:function(t,e,r){"use strict";r("5ba5")},f941:function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{height:"100%"},attrs:{id:t.canvasId}})},i=[],a=r("2ef0"),o=r.n(a),s=r("c1df"),l=r.n(s),c=r("ea7f"),u=r.n(c),d=r("144e"),h=r.n(d),f=(r("4452"),r("5b01")),p=r.n(f),m=r("a9b3"),v=r("2f62");function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){w(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function w(t,e,r){return(e=x(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x(t){var e=S(t,"string");return"symbol"==y(e)?e:e+""}function S(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}p()(u.a);var _={name:"hc-status-chart",props:["type","title","datasets","plotBandsData","plotLinesData","showPlotBands","showPlotLines","annotations","yAxes","xAxes","tz","verticalLegend"],mixins:[m["a"]],data:function(){return{backgroundColors:[],borderColors:[],chart:null,chartData:{datasets:[]},series:[],plotBands:[],plotLines:[],fixedColors:["rgba(255,0,0,1)","rgba(0,0,255,1)","rgba(0,255,0,1)","rgba(255,0,255,0.5)"]}},beforeMount:function(){window.moment=l.a,u.a.setOptions({time:{timezone:this.tzPref()}}),h()(u.a),this.chartData.labels=this.labels,this.applySeries(),this.applyPlotBands(),this.applyPlotLines()},mounted:function(){this.refresh()},methods:{applySeries:function(){var t=this;if(this.series=this.datasets.map((function(e,r){return{id:e.id,color:t.fixedColors[r],type:e.type||"line",name:e.label,data:e.data,yAxis:e.yAxisID,tooltip:e.tooltip||{},marker:{enabled:void 0,radius:3}}})),null!=this.chart){var e=this.chart.series.map((function(t){return t.options.id})),r=this.series.map((function(t){return t.id})),n=o.a.difference(e,r),i=o.a.difference(r,e);n.map((function(e){t.chart.get(e).remove()})),i.map((function(e){for(var r=0;r<t.series.length;r++)if(t.series[r].id===e){t.chart.addSeries(t.series[r],!1);break}})),this.refresh()}},refresh:function(){var t=this,e={layout:"horizontal",align:"center",floating:!0,verticalAlign:"top",itemStyle:{color:this.userData&&"dark"===this.userData.theme?"white":"#333333"},itemHoverStyle:{color:this.userData&&"dark"===this.userData.theme?"white":"#1e1e1e"}};this.verticalLegend&&(e={layout:"vertical",align:"right",verticalAlign:"top",itemStyle:{color:this.userData&&"dark"===this.userData.theme?"white":"#333333"},itemHoverStyle:{color:this.userData&&"dark"===this.userData.theme?"white":"#1e1e1e"}}),this.chart&&this.chart.destroy();var r=this.xAxes[0];r.plotBands=this.plotBands,r.plotLines=this.plotLines,this.chart=u.a.chart(this.canvasId,{credits:{enabled:!1},chart:{backgroundColor:null,zoomType:"x"},title:void 0,tooltip:{formatter:function(){var e="";return e+="<b>".concat(t.formatDateWithTZPref(l()(this.x).format()),"</b><br />"),this.points.map((function(t){e+=t.point.series.userOptions.tooltip.pointFormatter?"<span>\n                ".concat(t.point.series.userOptions.tooltip.pointFormatter.apply(t),"\n              </span><br />"):""})),e},shared:!0},legend:e,plotOptions:{line:{turboThreshold:0}},xAxis:r,yAxis:this.yAxes,series:this.series,annotations:this.showPlotLines?this.annotations:[],exporting:{sourceWidth:1400,sourceHeight:768,chartOptions:{subtitle:null}}})},applyPlotBands:function(){var t=this;this.plotBands=[],this.showPlotBands&&(this.plotBandsData||[]).map((function(e){e.data.map((function(e,r){t.plotBands.push({color:e.color,from:e.x,to:e.y,zIndex:1})}))})),null!=this.chart&&(this.chart.xAxis[0].update({plotBands:this.plotBands},!1),this.chart.redraw())},applyPlotLines:function(){var t=this;this.plotLines=[],this.showPlotLines&&(this.plotLines=[],(this.plotLinesData||[]).map((function(e){e.data.map((function(e,r){t.plotLines.push({color:"black",value:e.x,width:1,zIndex:2})}))}))),null!=this.chart&&(this.chart.xAxis[0].update({plotLines:this.plotLines},!1),this.chart.redraw())}},computed:b(b({},Object(v["c"])(["userData"])),{},{canvasId:function(){return"environment-chart"}}),watch:{annotations:function(t,e){},datasets:function(t){this.applySeries()},plotBandsData:function(){this.applyPlotBands()},plotLinesData:function(){this.applyPlotLines()},showPlotBands:function(t){this.applyPlotBands()},showPlotLines:function(){this.refresh()}}},C=_,O=(r("c126"),r("2877")),P=Object(O["a"])(C,n,i,!1,null,null,null);e["a"]=P.exports},f977:function(t,e,r){"use strict";function n(t,e,r){const{self:n=!1}=e.modifiers||{},i=e.value,a="object"===typeof i&&i.options||{passive:!0},o="function"===typeof i||"handleEvent"in i?i:i.handler,s=n?t:e.arg?document.querySelector(e.arg):window;s&&(s.addEventListener("scroll",o,a),t._onScroll=Object(t._onScroll),t._onScroll[r.context._uid]={handler:o,options:a,target:n?void 0:s})}function i(t,e,r){var n;if(!(null===(n=t._onScroll)||void 0===n?void 0:n[r.context._uid]))return;const{handler:i,options:a,target:o=t}=t._onScroll[r.context._uid];o.removeEventListener("scroll",i,a),delete t._onScroll[r.context._uid]}r.d(e,"a",(function(){return a}));const a={inserted:n,unbind:i};e["b"]=a},f9fa:function(t,e,r){"use strict";r("e911")},faef:function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",[e("unit-results",{attrs:{"search-text":t.searchText,"display-units":t.displayUnits,"is-search":!0}})],1)},i=[],a=r("a026"),o=r("2f62"),s=r("c1df"),l=r.n(s),c=r("d0eb"),u=r("6ce0"),d=r("a9b3"),h=r("b047"),f=r.n(h),p=r("4216"),m=(r("81f6"),r("1cf8")),v=r("12ad");function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){return x(t)||w(t,e)||C(t,e)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function x(t){if(Array.isArray(t))return t}function S(t){return P(t)||O(t)||C(t)||_()}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.")}function C(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}function O(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function P(t){if(Array.isArray(t))return D(t)}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){j(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function j(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t){var e=I(t,"string");return"symbol"==y(e)?e:e+""}function I(t,e){if("object"!=y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var L={name:"UnitSearchResults",mixins:[d["a"],u["a"],p["a"],m["a"]],components:{UnitResults:v["a"]},props:{searchText:{type:String,required:!1,default:function(){return""}},displayUnits:{type:Array,required:!0}},data:function(){return{bashSettings:null,showBashCommands:!1,refreshKey:1,setDnD:!1,isAdmin:!1,renameDevice:null,showActiveSoilSensors:!1,refreshLightIntensityQueue:[],openAssemblyTests:!1,openDevices:!1,selectedController:null,gridName:"VFU/IGR Dashboard",microclimateparams:{lifecycle_id:null,facility_id:null,controller_id:null},showComplianceDialog:!1,Trimaster:c["a"],clickedRec:{item:null},showStateMachine:!1,stateMachine:{},growPhase_id:null,showEditPhaseModal:!1,vpdAdjustment:0,showLifecycleStatusReport:!1,moment:l.a,displayAirToLeafVpdAdjuster:!1,isScrolling:!1,isScrollingHandle:null,flushQueueHandle:null,co2DevicesOpen:0,displayRecQueue:{},deviceControlPresetTab:0,autoRefresh:!0,irrDevices:0,listenerInitialized:!1,vfusLoading:!1,facility:null,showBatchIntensityOptions:!1,intensitySettings:0,selectedControllerIds:[],showBatchControlLoopOptions:!1,controlLoopSettings:[],showBatchIrrigationOptions:!1,showBatchCo2CalibrationOptions:!1,showDehumidifyOptions:!1,showCurtainsConfirm:!1,showEcuOptions:!1,selectedStateItem:null,showStateOptions:!1,co2CalibrationSettings:{ppm:null},irrigationSettings:{designatorName:null,designator_id:null,durationSeconds:null,setAutoWhenComplete:!1},viewType:"standard",autoPlantFilter:!1,currentDevice:null,deviceId:"",platformGroupId:"",showVfuControls:!1,expand:!1,vfusList:[],selectedDevice:null,offlineFilter:!1,warningFilter:!1,irrigatingFilter:!1,co2ActiveValvesFilter:!1,selected:[],offlineDevices:0,warnDevices:0,zone_devices:[],search:"",expanded:[],pagination:{itemsPerPage:250},footerprops:{"items-per-page-options":[25,50,75,100,250]},activeHeaders:[],advancedHeaders:["Media EC","Media Temp","Media Moisture","Light","Dew Pt","Strain","Days/Flwr","Tkts","Type","Area","Ctrl Version","FW Version","Uptime","IP Address","ID"],tableHeaders:[{value:"data-table-select",width:35},{text:"Actions",value:"actions",sortable:!1,align:"center",width:50},{text:"Name",value:"platformGroupName"},{text:"Status",value:"statusicons",sortable:!1,align:"center",width:225},{text:"Plants",value:"hasLifecycles",sortable:!1,align:"center",width:30},{text:"State",sortable:!0,align:"center",value:"currentState",width:120},{text:"Temp",value:"temperature",align:"center",width:90},{text:"RH",value:"humidity",align:"center",width:70},{text:"Dew Pt",value:"dewpoint",align:"center",width:50},{text:"Air VPD",value:"vpd",align:"center",width:80},{text:"CO2",value:"co2",align:"center",width:80},{text:"Last Irrigated",value:"lastIrrigated",width:100,align:"center"},{text:"Days/Flwr",value:"daysInFlower",align:"center",width:80},{text:"Strain",value:"strainName",align:"left",width:120},{text:"Media EC",value:"xFertility",align:"right",width:100},{text:"Media Temp",value:"xTemp",align:"right",width:100},{text:"Media Moisture",value:"xMoisture",align:"center",width:100},{text:"Light",value:"xLux",align:"right",width:100},{text:"Tkts",value:"ticketCount",align:"center"},{text:"Type",value:"platformGroupType",align:"center"},{text:"IP Address",value:"ipAddress",align:"center"},{text:"Area",value:"area",align:"center",width:200},{text:"Ctrl Version",value:"softwareVersion",align:"center",width:175},{text:"FW Version",value:"firmwareVersion",align:"center",width:100},{text:"ID",value:"controller_id",align:"center",width:100},{text:"Uptime",value:"uptime",align:"center",width:150},{text:"Updated",value:"lastCommandFetch",align:"center",width:120},{text:"",value:"data-table-expand"}],tableGroupBy:null,eventSource:null,platformGroups:{},platformGroupDisplayRecords:{},filteredZoneDevices:[],filteredZoneDevicesIndex:{},filteredZoneControllerIndex:{},isLoading:!1,showContextMenu:!1,contextMenuX:0,contextMenuY:0,showStateContextMenu:!1,stateContextMenuX:0,stateContextMenuY:0,selectedCurtainsAction:null,showDeviceHistory:!1,isLockingEnabled:!1,isLockingColumns:!1,recMove:null,isMovingPlatformGroup:!1,isUpgradingFirmware:!1,isUpdatingHostname:!1}},computed:T(T(T(T({},Object(o["c"])(["getUser","zonesList","pgusLoading","userData"])),Object(o["c"])("universalDashboard",["isPerformingContextMenuAction","isLoadingSearchResults","searchParams","selectedBatchAction","selectedContextMenuItem"])),Object(o["c"])("socketMessages",["getLastEventReceivedForControllerId"])),{},{lastEventReceived:function(){return this.selectedContextMenuItem?this.getLastEventReceivedForControllerId(this.selectedContextMenuItem.controller_id):null},userPlatformNamePreference:function(){return this.getUser.preferences.find((function(t){return"full-unit-name"===t.preference}))},userStateMenuPreference:function(){return this.getUser.preferences.find((function(t){return"Preferred VFU State Interaction"===t.preference}))},standardHeaders:function(){var t=this;return t.tableHeaders.filter((function(e){return!t.advancedHeaders.includes(e.text)}))},userIsAdmin:function(){return c["a"].isAdmin(this.getUser)},searchHeaders:function(){var t=S(this.activeHeaders),e=2;return this.searchParams.facility_id||t.splice(e++,0,{text:"Facility",value:"facilityName"}),this.searchParams.area_id||t.splice(e++,0,{text:"Area",value:"area"}),this.searchParams.dashboardDisplayType_id||t.splice(e++,0,{text:"Unit Type",value:"platformGroupType"}),t}}),watch:{isLoadingSearchResults:function(t){t&&(this.vfusLoading=!0)},displayUnits:function(t){this.vfusList=t,this.zone_devices=[];for(var e=0;e<this.vfusList.length;e++)this.platformGroups[this.vfusList[e].platformGroup_id]=this.vfusList[e];this.onVfusListChange(this.vfusList),this.vfusLoading=!1},showContextMenu:function(t){this.isScrolling=t,t||(this.isPerformingContextMenuAction=!1)},showStateContextMenu:function(t){this.isScrolling=t},search:function(t){this.setFilteredZoneDevices()},searchText:function(t){this.search=t},filteredZoneDevices:function(t){""!==this.searchText&&this.$emit("searched-length",this.filteredZoneDevices.length)}},beforeMount:function(){var t=this;t.isAdmin=c["a"].isAdmin(this.getUser)||c["a"].isUserInRole(this.getUser,"Maintenance"),t.activeHeaders=this.standardHeaders,this.getGridColumns(this.gridName,(function(e){t.activeHeaders=e})),this.flushQueueHandle=setInterval(this.flushDisplayRecQueue,1500),this.vpdAdjustment=-1*localStorage.getItem("leafVpdOffset"),this.$store.dispatch("batchActions/loadBatchActions")},mounted:function(){this.$route.query.search&&(this.search=this.$route.query.search)},beforeDestroy:function(){clearInterval(this.flushQueueHandle);var t=this.$el.querySelector("#unitSearchResultsTable .v-data-table__wrapper");t&&t.removeEventListener("scroll",this.scrollListener)},methods:T(T({getUnitFacility:function(t){return{co2Enabled:t.facilityCo2Enabled,commandCommunicationsType:t.commandCommunicationsType}},isExpanded:function(t){var e=this.expanded.find((function(e){return e.id===t.id}));return!!e}},Object(o["b"])(["getZones","storeControllerCommand"])),{},{scrollListener:function(){var t=this;t.isScrolling=!0,window.clearTimeout(t.isScrollingHandle),t.isScrollingHandle=setTimeout((function(){t.isScrolling=!1}),100)},startListening:function(){if(!this.listenerInitialized){Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"}),this.highlightRow.bind(this);this.listenerInitialized=!0}},flushDisplayRecQueue:function(){if(this.isScrolling)return!1;for(var t in this.pagination.disabled=!0,this.displayRecQueue){this.highlightRow(t);var e=this.filteredZoneDevicesIndex[t];if(e){for(var r in delete this.displayRecQueue[t].changedProps,this.displayRecQueue[t])e[r]=this.displayRecQueue[t][r];e.state,e=this.onVfuDataChange(e)}else console.warn("displayRecRef not found for ",t)}this.displayRecQueue={},this.pagination.disabled=!1,this.refreshLights()},refreshLights:f()((function(){var t=this,e=S(this.refreshLightIntensityQueue);this.refreshLightIntensityQueue=[],e.length>0&&c["a"].get("platformGroupLightsViews",this.getUser.apitoken,{filter:{where:{controller_id:{inq:e}}}}).then((function(e){for(var r=g(e,2),n=r[0],i=(r[1],0);i<n.length;i++){var a=t.filteredZoneDevicesIndex[n[i].platformGroup_id];a.lightIntensityAverage=Math.round(100*n[i].lightIntensityAverage)}}))}),250),setFilteredZoneDevices:function(){var t=this.zone_devices;this.warningFilter&&(t=t.filter((function(t){return"WARN"==t.state}))),this.offlineFilter&&(t=t.filter((function(t){return"OFFLINE"==t.state}))),this.irrigatingFilter&&(t=t.filter((function(t){return"ON"==t.irrigationState}))),this.co2ActiveValvesFilter&&(t=t.filter((function(t){return"ON"==t.co2ValveState})));for(var e=0;e<t.length;e++)this.filteredZoneDevicesIndex[t[e].platformGroup_id]=t[e],this.filteredZoneControllerIndex[t[e].controller_id]||(this.filteredZoneControllerIndex[t[e].controller_id]=[]),this.filteredZoneControllerIndex[t[e].controller_id].push(t[e]),t[e].updated=l()(t[e].lastCommandFetch).fromNow();this.filteredZoneDevices=t},highlightRow:function(t){var e=document.getElementById("pg-"+t);e&&(e=e.parentElement.parentElement,e.classList.add("highlight"),setTimeout((function(){e.classList.remove("highlight")}),750))},onVfusListChange:function(t){var e=this,r=[],n=0,i=0,o=0,s=0;t&&t.length&&t.forEach((function(t){"ON"===t.co2ValveState&&s++,"ON"==t.irrigationState&&o++,t.deployed&&("WARN"===t.state?i++:"OFFLINE"===t.state&&n++),e.platformGroupDisplayRecords[t.platformGroup_id]=t,r.push(t)}));for(var l=0;l<r.length;l++)a["default"].set(this.zone_devices,this.zone_devices.length,r[l]);this.offlineDevices=n,this.warnDevices=i,this.irrDevices=o,this.co2DevicesOpen=s,this.setFilteredZoneDevices(),this.startListening()},getVfus:function(){this.vfusLoading=!0,this.$emit("do-refresh")},getControllerData:function(){this.getVfus()},refresh:function(t){var e=this;Object({NODE_ENV:"production",VUE_APP_agrinamics:"https://api.agrinamics.com",VUE_APP_trimaster:"https://api.agrifyinsights.com",VUE_APP_trimaster_websockets:"wss://api.agrifyinsights.com",VUE_APP_metrc:"https://metrc.agxion.com",VUE_APP_autogrow:"https://api.autogrow.com",VUE_APP_env:"production",VUE_APP_AWS_ACCESS_KEY:"AKIARIHXLOHWP7JB2JGI",VUE_APP_AWS_SECRET:"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",BASE_URL:"/"});e.zone_devices=[],e.vfusLoading=!0,e.getControllerData()}})},A=L,M=(r("a511"),r("2877")),U=Object(M["a"])(A,n,i,!1,null,null,null);e["a"]=U.exports},fcb6:function(t,e,r){},fec3:function(t,e,r){"use strict";var n=r("8336"),i=r("b0af"),a=r("99d9"),o=r("62ad"),s=r("132d"),l=r("0fd9"),c=r("b974"),u=r("2fa4"),d=function(){var t=this,e=t._self._c;return e(l["a"],{staticClass:"mainCardHeight row-eq-height",attrs:{"no-gutters":""}},[e(o["a"],{staticClass:"py-0"},[e(i["a"],{staticClass:"screen-height-container flex-content",attrs:{id:"standaloneLifecycleStatusReport"}},[e(a["d"],[e("h2",[t._v(t._s(t.title)+" Status Report")]),e(u["a"]),e(n["a"],{attrs:{icon:""},on:{click:t.onClose}},[e(s["a"],[t._v("close")])],1)],1),e(a["c"],{staticClass:"overflow-auto d-flex flex-column"},[t.lifecycles.length>1?e(l["a"],{attrs:{justify:"center","no-gutters":""}},[e(o["a"],{attrs:{sm:"12"}},[e(c["a"],{attrs:{items:t.lifecycles,"item-text":"text","item-value":"id",label:"Select a Lifecycle"},model:{value:t.lifecycle_id,callback:function(e){t.lifecycle_id=e},expression:"lifecycle_id"}})],1)],1):t._e(),e("report-form",{staticClass:"flex-grow-auto",model:{value:t.formData,callback:function(e){t.formData=e},expression:"formData"}})],1),e(a["a"],{staticClass:"justify-center"},[e(n["a"],{attrs:{color:"primary",loading:t.isLoading},on:{click:t.onSave}},[t._v("Save")])],1)],1)],1)],1)},h=[],f=r("81f6"),p=r("d0eb"),m=(r("c1df"),r("d67f")),v=r("2f62"),y=r("e0a5");function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function b(t,e){return C(t)||_(t,e)||x(t,e)||w()}function w(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){if(t){if("string"==typeof t)return S(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function C(t){if(Array.isArray(t))return t}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return(e=k(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k(t){var e=T(t,"string");return"symbol"==g(e)?e:e+""}function T(t,e){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var j={name:"",props:["platformGroup_id","title","lifecycleId"],components:{ReportForm:y["a"]},beforeMount:function(){this.refresh()},mounted:function(){},data:function(){return{formData:null,lifecycle_id:null,lifecycles:[],isLoading:!1}},computed:P({},Object(v["c"])(["getUser"])),watch:{platformGroup_id:function(t,e){this.refresh()},lifecycleId:function(t,e){this.refresh()}},methods:{onClose:function(){this.$emit("close"),this.clearForm()},onSave:function(){var t=this,e=P({},this.formData);e.ag_lifecycle_id=parseInt(this.lifecycle_id),e.ag_platformGroup_id=this.platformGroup_id,e.facility_id=this.getUser.facility_id,t.isLoading=!0,p["a"].post("ag_lifecycleReports",this.getUser.apitoken,e).then((function(e){var r=b(e,2),n=r[0];r[1];t.isLoading=!1,n?(m["a"].success("Report saved"),f["a"].$emit("lifecyclestatusreportsaved",n.id),t.onClose()):m["a"].error("An error occurred. Please try again later.")}))},clearForm:function(){this.formData={averagePlantHeight:null,averagePlantHeightMeasurement:null,rootLength:null,rootLengthMeasurement:null,ag_plantColor_id:null,ag_plantDisease_id:null,ag_unwantedPlant_id:null,ag_rootColor_id:null,ag_nutrientDeficiencySymptoms:null,fileUploadUrl1:null,fileUploadUrl2:null,fileUploadUrl3:null,fileUploadUrl4:null,notes:null,rating:null}},refresh:function(){var t=this;if(t.clearForm(),this.platformGroup_id||this.lifecycleId){var e={filter:{where:{facility_jd:this.getUser.facility_id}}};this.platformGroup_id&&(e.filter.where.platformGroup_id=this.platformGroup_id),this.lifecycleId&&(e.filter.where.lifecycle_id=this.lifecycleId),p["a"].get("ag_inFlightLifecycles",this.getUser.apitoken,e).then((function(e){for(var r=b(e,2),n=r[0],i=(r[1],{}),a=[],o=0;o<n.length;o++)i[n[o].lifecycle_id]={strainName:n[o].strainName,growplanName:n[o].growplanName};for(var s in i)a.push({id:s,text:s+" : "+i[s].growplanName+" ("+i[s].strainName+")"});t.lifecycles=a,t.lifecycle_id=t.lifecycles[0].id}))}}}},E=j,I=r("2877"),L=Object(I["a"])(E,d,h,!1,null,null,null);e["a"]=L.exports},ffc9:function(t,e,r){"use strict";r("96eb")}}]);
//# sourceMappingURL=chunk-0c4608c5.7fc702a4.js.map