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, css, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { repeat } from 'lit/directives/repeat.js';
import { Bubble } from '../bubble.js';
import './play-button.js';
import './play-details.js';
let PlayTemplateSelect = class PlayTemplateSelect extends LitElement {
    render() {
        return html `<play-details
      appearance="plain"
      ?disabled=${!Object.keys(this.srcByLabel ?? {}).length}
      ?open=${this.open}
      size="medium"
      icon="add-outline"
      title="Reset Program Template"
      @open=${(ev) => (this.open = ev.detail)}
      ><span slot="summary">New</span>
      <ul>
        ${repeat(Object.entries(this.srcByLabel ?? {}), ([label]) => label, ([label, src]) => html `<play-button
              appearance="plain"
              size="small"
              @click=${() => {
            this.dispatchEvent(Bubble('edit-src', src));
            this.open = false;
        }}
              >${label}</play-button
            >`)}
      </ul></play-details
    >`;
    }
};
PlayTemplateSelect.styles = css ``;
__decorate([
    property({ attribute: false })
], PlayTemplateSelect.prototype, "srcByLabel", void 0);
__decorate([
    property({ type: Boolean })
], PlayTemplateSelect.prototype, "open", void 0);
PlayTemplateSelect = __decorate([
    customElement('play-template-select')
], PlayTemplateSelect);
export { PlayTemplateSelect };
//# sourceMappingURL=play-template-select.js.map