var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { LitElement, html, css } from 'lit';
import { property } from 'lit/decorators.js';
export class AnnotativeKnobSwitch extends LitElement {
    constructor() {
        super(...arguments);
        this.checked = false;
        this.onChange = () => { };
    }
    render() {
        return html `
      <label class="toggle">
        <input
          class="toggle-checkbox"
          type="checkbox"
          .checked=${this.checked}
          @change=${this.onChange}
        />
        <div class="toggle-switch"></div>
      </label>
    `;
    }
}
AnnotativeKnobSwitch.styles = [
    css `
      .toggle {
        cursor: pointer;
        display: inline-block;
      }

      .toggle-switch {
        display: inline-block;
        background: #ccc;
        border-radius: 12px;
        width: 42px;
        height: 24px;
        position: relative;
        vertical-align: middle;
        transition: background 0.25s;
      }
      .toggle-switch:before,
      .toggle-switch:after {
        content: '';
      }
      .toggle-switch:before {
        display: block;
        background: linear-gradient(to bottom, #fff 0%, #eee 100%);
        border-radius: 50%;
        width: 18px;
        height: 18px;
        position: absolute;
        top: 3px;
        left: 3px;
        transition: left 0.25s;
      }
      .toggle:hover .toggle-switch:before {
        background: linear-gradient(to bottom, #fff 0%, #fff 100%);
      }
      .toggle-checkbox:checked + .toggle-switch {
        background: #56c080;
      }
      .toggle-checkbox:checked + .toggle-switch:before {
        left: 21px;
      }

      .toggle-checkbox {
        position: absolute;
        visibility: hidden;
      }

      .toggle-label {
        margin-left: 5px;
        position: relative;
        top: 2px;
      }
    `,
];
__decorate([
    property({ attribute: 'checked' })
], AnnotativeKnobSwitch.prototype, "checked", void 0);
__decorate([
    property({ attribute: 'onChange' })
], AnnotativeKnobSwitch.prototype, "onChange", void 0);
customElements.get('annotative-code-knob-switch') ||
    customElements.define('annotative-code-knob-switch', AnnotativeKnobSwitch);
//# sourceMappingURL=switch.js.map