homebridge-smartsystem
Version:
SmartServer (Proxy TCP sockets to the cloud, Smappee MQTT, Duotecno IP Nodes, Homekit interface)
1 lines • 13.6 kB
JavaScript
function _createForOfIteratorHelper(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function asyncGeneratorStep(e,t,r,i,n,o,a){try{var s=e[o](a),l=s.value}catch(c){return void r(c)}s.done?t(l):Promise.resolve(l).then(i,n)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var o=e.apply(t,r);function a(e){asyncGeneratorStep(o,i,n,a,s,"next",e)}function s(e){asyncGeneratorStep(o,i,n,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{h11V:function(e,t,r){"use strict";r.r(t),r.d(t,"ion_radio",(function(){return s})),r.d(t,"ion_radio_group",(function(){return c}));var i=r("wEJo"),n=r("E/Mt"),o=r("1vRN"),a=r("74mu"),s=function(){function e(t){var r=this;_classCallCheck(this,e),Object(i.o)(this,t),this.ionStyle=Object(i.g)(this,"ionStyle",7),this.ionFocus=Object(i.g)(this,"ionFocus",7),this.ionBlur=Object(i.g)(this,"ionBlur",7),this.inputId="ion-rb-"+l++,this.radioGroup=null,this.checked=!1,this.buttonTabindex=-1,this.name=this.inputId,this.disabled=!1,this.updateState=function(){r.radioGroup&&(r.checked=r.radioGroup.value===r.value)},this.onFocus=function(){r.ionFocus.emit()},this.onBlur=function(){r.ionBlur.emit()}}var t,r;return _createClass(e,[{key:"setFocus",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.stopPropagation(),t.preventDefault(),this.el.focus();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setButtonTabindex",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.buttonTabindex=t;case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"connectedCallback",value:function(){void 0===this.value&&(this.value=this.inputId);var e=this.radioGroup=this.el.closest("ion-radio-group");e&&(this.updateState(),Object(o.a)(e,"ionChange",this.updateState))}},{key:"disconnectedCallback",value:function(){var e=this.radioGroup;e&&(Object(o.b)(e,"ionChange",this.updateState),this.radioGroup=null)}},{key:"componentWillLoad",value:function(){this.emitStyle()}},{key:"emitStyle",value:function(){this.ionStyle.emit({"radio-checked":this.checked,"interactive-disabled":this.disabled})}},{key:"render",value:function(){var e,t=this.inputId,r=this.disabled,s=this.checked,l=this.color,c=this.el,d=this.buttonTabindex,u=Object(n.b)(this),h=Object(o.d)(c,t),b=h.label,p=h.labelId,f=h.labelText;return Object(i.j)(i.c,{"aria-checked":""+s,"aria-hidden":r?"true":null,"aria-labelledby":b?p:null,role:"radio",tabindex:d,onFocus:this.onFocus,onBlur:this.onBlur,class:Object(a.a)(l,(e={},_defineProperty(e,u,!0),_defineProperty(e,"in-item",Object(a.c)("ion-item",c)),_defineProperty(e,"interactive",!0),_defineProperty(e,"radio-checked",s),_defineProperty(e,"radio-disabled",r),e))},Object(i.j)("div",{class:"radio-icon",part:"container"},Object(i.j)("div",{class:"radio-inner",part:"mark"}),Object(i.j)("div",{class:"radio-ripple"})),Object(i.j)("label",{htmlFor:t},f),Object(i.j)("input",{type:"radio",checked:s,disabled:r,tabindex:"-1",id:t}))}},{key:"el",get:function(){return Object(i.k)(this)}}],[{key:"watchers",get:function(){return{color:["emitStyle"],checked:["emitStyle"],disabled:["emitStyle"]}}}]),e}(),l=0;s.style={ios:':host{--inner-border-radius:50%;display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.radio-disabled){pointer-events:none}.radio-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;contain:layout size style}.radio-icon,.radio-inner{-webkit-box-sizing:border-box;box-sizing:border-box}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}:host(:focus){outline:none}:host{--color-checked:var(--ion-color-primary, #3880ff);width:15px;height:24px}:host(.ion-color.radio-checked) .radio-inner{border-color:var(--ion-color-base)}.item-radio.item-ios ion-label{margin-left:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-radio.item-ios ion-label{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.radio-inner{width:33%;height:50%}:host(.radio-checked) .radio-inner{-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--color-checked)}:host(.radio-disabled){opacity:0.3}:host(.ion-focused) .radio-icon::after{border-radius:var(--inner-border-radius);left:-9px;top:-8px;display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint, #4c8dff);content:"";opacity:0.2}:host-context([dir=rtl]):host(.ion-focused) .radio-icon::after,:host-context([dir=rtl]).ion-focused .radio-icon::after{left:unset;right:unset;right:-9px}:host(.in-item){margin-left:10px;margin-right:11px;margin-top:8px;margin-bottom:8px;display:block;position:static}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:11px;margin-inline-end:11px}}:host(.in-item[slot=start]){margin-left:3px;margin-right:21px;margin-top:8px;margin-bottom:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:3px;margin-inline-start:3px;-webkit-margin-end:21px;margin-inline-end:21px}}',md:':host{--inner-border-radius:50%;display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.radio-disabled){pointer-events:none}.radio-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;contain:layout size style}.radio-icon,.radio-inner{-webkit-box-sizing:border-box;box-sizing:border-box}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}:host(:focus){outline:none}:host{--color:var(--ion-color-step-400, #999999);--color-checked:var(--ion-color-primary, #3880ff);--border-width:2px;--border-style:solid;--border-radius:50%;width:20px;height:20px}:host(.ion-color) .radio-inner{background:var(--ion-color-base)}:host(.ion-color.radio-checked) .radio-icon{border-color:var(--ion-color-base)}.radio-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:var(--border-radius);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--color)}.radio-inner{border-radius:var(--inner-border-radius);width:calc(50% + var(--border-width));height:calc(50% + var(--border-width));-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0);-webkit-transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);background:var(--color-checked)}:host(.radio-checked) .radio-icon{border-color:var(--color-checked)}:host(.radio-checked) .radio-inner{-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1)}:host(.radio-disabled){opacity:0.3}:host(.ion-focused) .radio-icon::after{border-radius:var(--inner-border-radius);left:-12px;top:-12px;display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint, #4c8dff);content:"";opacity:0.2}:host-context([dir=rtl]):host(.ion-focused) .radio-icon::after,:host-context([dir=rtl]).ion-focused .radio-icon::after{left:unset;right:unset;right:-12px}:host(.in-item){margin-left:0;margin-right:0;margin-top:9px;margin-bottom:9px;display:block;position:static}:host(.in-item[slot=start]){margin-left:4px;margin-right:36px;margin-top:11px;margin-bottom:10px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px}}'};var c=function(){function e(t){var r=this;_classCallCheck(this,e),Object(i.o)(this,t),this.ionChange=Object(i.g)(this,"ionChange",7),this.inputId="ion-rg-"+d++,this.labelId=this.inputId+"-lbl",this.allowEmptySelection=!1,this.name=this.inputId,this.setRadioTabindex=function(e){var t=r.getRadios(),i=t.find((function(e){return!e.disabled})),n=t.find((function(t){return t.value===e&&!t.disabled}));if(i||n){var o,a=n||i,s=_createForOfIteratorHelper(t);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.setButtonTabindex(l===a?0:-1)}}catch(c){s.e(c)}finally{s.f()}}},this.onClick=function(e){e.preventDefault();var t=e.target&&e.target.closest("ion-radio");if(t){var i=t.value;i!==r.value?r.value=i:r.allowEmptySelection&&(r.value=void 0)}}}var t;return _createClass(e,[{key:"valueChanged",value:function(e){this.setRadioTabindex(e),this.ionChange.emit({value:e})}},{key:"componentDidLoad",value:function(){this.setRadioTabindex(this.value)}},{key:"connectedCallback",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=this.el.querySelector("ion-list-header")||this.el.querySelector("ion-item-divider"))&&(r=this.label=t.querySelector("ion-label"))&&(this.labelId=r.id=this.name+"-lbl");case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getRadios",value:function(){return Array.from(this.el.querySelectorAll("ion-radio"))}},{key:"onKeydown",value:function(e){var t=!!this.el.closest("ion-select-popover");if(!e.target||this.el.contains(e.target)){var r=Array.from(this.el.querySelectorAll("ion-radio")).filter((function(e){return!e.disabled}));if(e.target&&r.includes(e.target)){var i,n=r.findIndex((function(t){return t===e.target})),o=r[n];["ArrowDown","ArrowRight"].includes(e.code)&&(i=n===r.length-1?r[0]:r[n+1]),["ArrowUp","ArrowLeft"].includes(e.code)&&(i=0===n?r[r.length-1]:r[n-1]),i&&r.includes(i)&&(i.setFocus(e),t||(this.value=i.value)),["Space"].includes(e.code)&&(this.value=o.value,e.preventDefault())}}}},{key:"render",value:function(){var e=this.label,t=this.labelId,r=Object(n.b)(this);return Object(i.j)(i.c,{role:"radiogroup","aria-labelledby":e?t:null,onClick:this.onClick,class:r})}},{key:"el",get:function(){return Object(i.k)(this)}}],[{key:"watchers",get:function(){return{value:["valueChanged"]}}}]),e}(),d=0}}]);