define(["exports","./../../layoutmanager.js","./../../input/keyboard.js"],function(_exports,_layoutmanager,_keyboard){function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}function onKeyDown(e){var key=_keyboard.default.normalizeKeyFromEvent(e);if("Enter"===key&&(e.preventDefault(),!e.repeat))return this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),!1}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["css!modules/emby-elements/emby-checkbox/emby-checkbox.css"]);var EmbyCheckbox=function(_HTMLInputElement){function EmbyCheckbox(){var t,o,e;babelHelpers.classCallCheck(this,EmbyCheckbox),t=this,o=EmbyCheckbox,o=babelHelpers.getPrototypeOf(o),o=babelHelpers.possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],babelHelpers.getPrototypeOf(t).constructor):o.apply(t,e));return babelHelpers.possibleConstructorReturn(o,o)}return babelHelpers.inherits(EmbyCheckbox,_HTMLInputElement),babelHelpers.createClass(EmbyCheckbox,[{key:"connectedCallback",value:function(){var labelElement;!this.hasAttribute("data-classes")&&(_layoutmanager.default.tv?this.classList.add("emby-checkbox","emby-checkbox-tv"):this.classList.add("emby-checkbox"),(labelElement=this.parentNode).classList.add("emby-checkbox-label"),labelElement=labelElement.querySelector("span"))&&(labelElement.classList.add("checkboxLabel"),labelElement.insertAdjacentHTML("afterend",'<div class="emby-checkbox-focusoutline"></div>')),-1!==this.tabIndex&&this.addEventListener("keydown",onKeyDown)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("keydown",onKeyDown)}}])}(babelHelpers.wrapNativeSuper(HTMLInputElement));customElements.define("emby-checkbox",EmbyCheckbox,{extends:"input"}),_exports.default=EmbyCheckbox});