/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@dreamworld/dw-checkbox@3.1.2/dw-checkbox.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/**
@license
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
import{LitElement,html,css}from"@dreamworld/pwa-helpers/lit.js";import"@dreamworld/dw-form/dw-form-field";import{DwFormElement}from"@dreamworld/dw-form/dw-form-element";import"./base-checkbox.js";export class DwCheckbox extends(DwFormElement(LitElement)){static get styles(){return[css`
        :host {
          display: block;
          outline:none;

          --mdc-checkbox-unchecked-color: var(--mdc-theme-text-secondary-on-background);
          --mdc-checkbox-disabled-color: var(--mdc-theme-text-disabled-on-background);
        }

        :host[hidden] {
          display: none;
        }
      `]}static get properties(){return{name:{type:String},value:{type:String},label:{type:String},alignEnd:{type:Boolean},disabled:{type:Boolean},checked:{type:Boolean},indeterminate:{type:Boolean},reducedTouchTarget:{type:Boolean}}}render(){return html`
      <dw-form-field .label="${this.label}" ?alignEnd="${this.alignEnd}" ?disabled="${this.disabled}">

        <base-checkbox
         ?disabled="${this.disabled}"
         ?checked="${this.checked}"
         ?indeterminate="${this.indeterminate}"
         ?reducedTouchTarget="${this.reducedTouchTarget}"
         @change="${this._onChange}"
         @click="${e=>{setTimeout((()=>{e.target.blur()}),1)}}">
        </base-checkbox>

        <div slot="label">
          <slot name="label"></slot>
        </div>

      </dw-form-field>
    `}constructor(){super(),this.disabled=!1,this.alignEnd=!1,this.checked=!1,this.indeterminate=!1,this.label="",this.value=""}toggle(){this.shadowRoot.querySelector("dw-form-field").input.focus(),this.shadowRoot.querySelector("dw-form-field").input.click()}focus(){const e=this.shadowRoot.querySelector("base-checkbox");e&&e.focus()}_onChange(e){this.checked=e.target.checked,this.dispatchEvent(new Event("checked-changed",e)),this.dispatchEvent(new CustomEvent("change"))}}customElements.define("dw-checkbox",DwCheckbox);
//# sourceMappingURL=/sm/2e19a321546d37601fe21de6f05c09567842a37b2ca65ba27fe4dbaecf530455.map