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 './../button';
import { WithDisposable } from '@blockeditor/lit';
import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { getEmbedCardIcons } from '../../utils/url.js';
let EmbedCardStyleMenu = class EmbedCardStyleMenu extends WithDisposable(LitElement) {
    _setEmbedCardStyle(style) {
        this.model.page.updateBlock(this.model, { style });
        this.requestUpdate();
        this.abortController.abort();
    }
    render() {
        const { EmbedCardHorizontalIcon, EmbedCardListIcon } = getEmbedCardIcons();
        return html `
      <icon-button
        width="76px"
        height="76px"
        class=${classMap({
            selected: this.model.style === 'horizontal',
        })}
        @click=${() => this._setEmbedCardStyle('horizontal')}
      >
        ${EmbedCardHorizontalIcon}
        <affine-tooltip .offset=${4}
          >${'Large horizontal style'}</affine-tooltip
        >
      </icon-button>

      <icon-button
        width="76px"
        height="76px"
        class=${classMap({
            selected: this.model.style === 'list',
        })}
        @click=${() => this._setEmbedCardStyle('list')}
      >
        ${EmbedCardListIcon}
        <affine-tooltip .offset=${4}
          >${'Small horizontal style'}</affine-tooltip
        >
      </icon-button>
    `;
    }
};
EmbedCardStyleMenu.styles = css `
    :host {
      border-radius: 8px;
      padding: 8px;
      gap: 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--affine-background-overlay-panel-color);
      box-shadow: var(--affine-shadow-2);
    }

    icon-button {
      padding: var(--1, 0px);
    }

    icon-button.selected {
      border: 1px solid var(--affine-brand-color);
    }
  `;
__decorate([
    property({ attribute: false })
], EmbedCardStyleMenu.prototype, "model", void 0);
__decorate([
    property({ attribute: false })
], EmbedCardStyleMenu.prototype, "std", void 0);
__decorate([
    property({ attribute: false })
], EmbedCardStyleMenu.prototype, "abortController", void 0);
EmbedCardStyleMenu = __decorate([
    customElement('embed-card-style-menu')
], EmbedCardStyleMenu);
export { EmbedCardStyleMenu };
//# sourceMappingURL=embed-card-style-popper.js.map