{"version":3,"sources":["webpack:///./src/views/components/Sensors/GasValveListItem.vue?daec","webpack:///./src/views/components/Sensors/GasValveListItem.vue","webpack:///./src/views/components/Sensors/GasValveListItem.vue?0db0","webpack:///./src/views/components/Sensors/GasValveListItem.vue?06b9"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","paired","responsive","switchStatus","_t","staticClass","name","params","id","value","attachedDeviceTypeId","_e","_v","on","onEnroll","switchToogle","scopedSlots","_u","key","fn","proxy","model","callback","$$v","expression","imgSrc","showEnroll","noconfirm","successOk","showSuccess","timeoutOk","showTimeout","staticRenderFns","defineComponent","components","SensorHeader","EnrollDialog","PairToggle","ConfirmDialog","props","Object","setup","emit","GetStatus","turnOn","turnOff","useShorePower","computed","attachedDeviceId","age","alarm","gasValveOpen","ref","deviceAdded","deviceTimedOut","SetNewDeviceAdded","SetNewDeviceTimedOut","sensor","GetData","showGraphics","require","sensorSyncronising","syncSensor","alarm1","component","VCol","VExpansionPanel","VExpansionPanelContent","VImg","VProgressCircular","VRow","VSwitch"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,oBAAoB,CAACA,EAAG,eAAe,CAACE,MAAM,CAAC,KAAO,YAAY,OAASN,EAAIO,OAAO,WAAaP,EAAIQ,WAAW,OAASR,EAAIO,OAAUP,EAAIS,aAAe,KAAO,MAAS,QAAQ,CAACT,EAAIU,GAAG,YAAY,GAAGN,EAAG,4BAA4B,CAACA,EAAG,QAAQ,CAACE,MAAM,CAAC,MAAQ,SAAS,QAAU,WAAW,CAACF,EAAG,QAAQ,CAACO,YAAY,QAAQL,MAAM,CAAC,KAAO,MAAM,CAACF,EAAG,QAAQ,CAACE,MAAM,CAAC,MAAQ,SAAS,QAAU,WAAW,CAACF,EAAG,QAAQ,CAACO,YAAY,mBAAmBL,MAAM,CAAC,KAAO,MAAM,CAAEN,EAAS,M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Y,eACd,EACAvE,EACAuC,GACA,EACA,KACA,KACA,MAIa,aAAAgC,EAAiB,QAWhC,IAAkBA,EAAW,CAACC,OAAA,KAAKC,kBAAA,KAAgBC,yBAAA,KAAuBC,OAAA,KAAKC,oBAAA,KAAkBC,OAAA,KAAKC,UAAA","file":"js/chunk-2d0d5fce.aa8fec53.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-expansion-panel',[_c('SensorHeader',{attrs:{\"icon\":\"gas_valve\",\"paired\":_vm.paired,\"responsive\":_vm.responsive,\"status\":_vm.paired ? (_vm.switchStatus ? 'On' : 'Off') : 'N/A'}},[_vm._t(\"default\")],2),_c('v-expansion-panel-content',[_c('v-row',{attrs:{\"align\":\"center\",\"justify\":\"center\"}},[_c('v-col',{staticClass:\"py-0 \",attrs:{\"cols\":\"8\"}},[_c('v-row',{attrs:{\"align\":\"center\",\"justify\":\"center\"}},[_c('v-col',{staticClass:\"py-0 text-center\",attrs:{\"cols\":\"4\"}},[(_vm.value)?_c('router-link',{attrs:{\"to\":{ name: 'history', params: { id: _vm.value.attachedDeviceTypeId } }}},[_c('v-img',{staticClass:\"mx-auto mt-4\",attrs:{\"src\":require(\"@/assets/icons/log.svg\"),\"max-width\":\"40px\",\"width\":\"40px\"}})],1):_vm._e(),_c('div',{staticClass:\"text-center text-caption white--text\"},[_vm._v(\"Sensor Log\")])],1),_c('v-col',{staticClass:\"py-0 text-center\",attrs:{\"cols\":\"4\"}}),_c('v-col',{staticClass:\"py-0 text-center\",attrs:{\"cols\":\"4\"}})],1)],1),_c('v-col',{staticClass:\"text-right pr-0\",attrs:{\"cols\":\"4\"}},[_c('PairToggle',{attrs:{\"value\":_vm.paired},on:{\"click\":_vm.onEnroll}})],1)],1),_c('v-row',{staticClass:\"mt-4\"},[_c('v-col',{staticClass:\"text-center\",attrs:{\"cols\":\"6\",\"align-self\":\"end\"}},[_c('v-img',{attrs:{\"position\":\"bottom\",\"max-width\":\"150px\",\"max-height\":\"150px\",\"contain\":\"\",\"src\":require(\"@/assets/img/gas-valve.png\")}})],1),_c('v-col',{attrs:{\"cols\":\"3\"}},[_c('div',{staticClass:\"text-caption white--text\"},[_vm._v(\"Power\")]),_c('v-switch',{staticClass:\"mt-2\",attrs:{\"color\":\"#81b13e\",\"flat\":\"\",\"disabled\":!_vm.paired || !_vm.responsive},on:{\"click\":_vm.switchToogle},scopedSlots:_vm._u([{key:\"label\",fn:function(){return [(_vm.switchStatus)?_c('span',{staticClass:\"text-caption white--text\"},[_vm._v(\"On\")]):_c('span',{staticClass:\"text-caption white--text\"},[_vm._v(\"Off\")]),(_vm.sensorSyncronising)?_c('span',[_c('v-progress-circular',{staticClass:\"ml-2\",attrs:{\"indeterminate\":\"\",\"size\":24,\"width\":3,\"color\":\"white70\"}})],1):_vm._e()]},proxy:true}]),model:{value:(_vm.switchStatus),callback:function ($$v) {_vm.switchStatus=$$v},expression:\"switchStatus\"}})],1),_c('v-col',{attrs:{\"cols\":\"3\"}},[_c('div',{staticClass:\"text-center text-caption white--text\"},[_vm._v(\"Paired\")]),(_vm.paired)?_c('v-img',{staticClass:\"mx-auto mt-1\",attrs:{\"src\":require(\"@/assets/icons/responsive.svg\"),\"max-width\":\"40px\",\"width\":\"40px\"}}):_c('v-img',{staticClass:\"mx-auto mt-1\",attrs:{\"src\":require(\"@/assets/icons/unresponsive.svg\"),\"max-width\":\"40px\",\"width\":\"40px\"}})],1)],1),(_vm.value)?_c('EnrollDialog',{attrs:{\"imgSrc\":_vm.imgSrc,\"deviceType\":_vm.value.attachedDeviceTypeId},model:{value:(_vm.showEnroll),callback:function ($$v) {_vm.showEnroll=$$v},expression:\"showEnroll\"}}):_vm._e(),_c('ConfirmDialog',{attrs:{\"options\":{ noconfirm: true },\"title\":\"Success\",\"message\":\"Device added successfully.\"},on:{\"OnOk\":_vm.successOk},model:{value:(_vm.showSuccess),callback:function ($$v) {_vm.showSuccess=$$v},expression:\"showSuccess\"}}),_c('ConfirmDialog',{attrs:{\"options\":{ noconfirm: true },\"title\":\"Timeout\",\"message\":\"Device pairing timed out.\"},on:{\"OnOk\":_vm.timeoutOk},model:{value:(_vm.showTimeout),callback:function ($$v) {_vm.showTimeout=$$v},expression:\"showTimeout\"}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { defineComponent, computed, PropType, ref } from \"@vue/composition-api\";\nimport AttachedDeviceModel from \"@/models/AttachedDeviceModel\";\nimport useShorePower from \"@/store/modules/useShorePower\";\nimport { alarm, sensor } from \"@/store\";\n\nexport default defineComponent({\n components: {\n SensorHeader: () =>\n import(/* webpackChunkName: \"components\" */ \"./SensorHeader.vue\"),\n EnrollDialog: () =>\n import(/* webpackChunkName: \"settings\" */ \"../Dialogs/EnrollDialog.vue\"),\n PairToggle: () =>\n import(/*webpackChunkName: \"components\"*/ \"../PairToggle.vue\"),\n ConfirmDialog: () =>\n import(/* webpackChunkName: \"settings\" */ \"../Dialogs/ConfirmDialog.vue\")\n },\n props: {\n value: Object as PropType\n },\n setup(props, { emit }) {\n const { GetStatus, turnOn, turnOff } = useShorePower();\n\n const paired = computed(() => {\n if (\n props.value &&\n props.value.attachedDeviceId &&\n props.value.attachedDeviceId !== \"\"\n ) {\n return true;\n } else {\n return false;\n }\n });\n\n const responsive = computed(() => {\n if (props.value.attachedDeviceId != null) {\n if (props.value.age < 4) {\n return true;\n } else {\n return false;\n }\n }\n });\n\n let switchStatus = computed(() => {\n if (responsive.value) {\n return alarm.gasValveOpen;\n } else {\n return false;\n }\n });\n\n const showEnroll = ref(false);\n\n const showSuccess = computed(() => {\n return alarm.deviceAdded;\n });\n\n const showTimeout = computed(() => {\n return alarm.deviceTimedOut;\n });\n\n const successOk = () => {\n alarm.SetNewDeviceAdded(false);\n alarm.SetNewDeviceTimedOut(false);\n sensor.GetData();\n };\n\n const timeoutOk = () => {\n alarm.SetNewDeviceTimedOut(false);\n sensor.GetData();\n };\n const showGraphics = ref(false);\n\n const imgSrc = computed(() => {\n return require(`@/assets/img/gas-valve.png`);\n });\n\n const onEnroll = () => {\n showEnroll.value = true;\n };\n\n const sensorSyncronising = computed(() => {\n return sensor.syncSensor;\n });\n\n const switchToogle = () => {\n if (props.value) {\n if (switchStatus.value == true) {\n turnOff(props.value.attachedDeviceId);\n } else {\n turnOn(props.value.attachedDeviceId);\n }\n props.value.alarm1 = !props.value.alarm1;\n }\n };\n\n //GetStatus();\n\n return {\n onEnroll,\n paired,\n showEnroll,\n showGraphics,\n imgSrc,\n responsive,\n switchStatus,\n sensorSyncronising,\n switchToogle,\n showSuccess,\n showTimeout,\n successOk,\n timeoutOk,\n };\n }\n});\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GasValveListItem.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GasValveListItem.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./GasValveListItem.vue?vue&type=template&id=ce8be4fa&\"\nimport script from \"./GasValveListItem.vue?vue&type=script&lang=ts&\"\nexport * from \"./GasValveListItem.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VCol } from 'vuetify/lib/components/VGrid';\nimport { VExpansionPanel } from 'vuetify/lib/components/VExpansionPanel';\nimport { VExpansionPanelContent } from 'vuetify/lib/components/VExpansionPanel';\nimport { VImg } from 'vuetify/lib/components/VImg';\nimport { VProgressCircular } from 'vuetify/lib/components/VProgressCircular';\nimport { VRow } from 'vuetify/lib/components/VGrid';\nimport { VSwitch } from 'vuetify/lib/components/VSwitch';\ninstallComponents(component, {VCol,VExpansionPanel,VExpansionPanelContent,VImg,VProgressCircular,VRow,VSwitch})\n"],"sourceRoot":""}