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 { css, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
/**
 * Renders a the block selection.
 *
 * @example
 * ```ts
 * class Block extends LitElement {
 *   state override styles = css`
 *     :host {
 *       position: relative;
 *     }
 *   `
 *   render() {
 *     return html`${this.selected?.is('block')
 *       ? html`<affine-block-selection></affine-block-selection>`
 *       : null}`;
 *   };
 * }
 * ```
 */
let BlockSelection = class BlockSelection extends LitElement {
    constructor() {
        super(...arguments);
        this.borderRadius = 5;
        this.borderWidth = 0;
    }
    connectedCallback() {
        super.connectedCallback();
        this.style.borderRadius = `${this.borderRadius}px`;
        if (this.borderWidth !== 0) {
            this.style.boxSizing = 'content-box';
            this.style.transform = `translate(-${this.borderWidth}px, -${this.borderWidth}px)`;
        }
        this.style.borderWidth = `${this.borderWidth}px`;
    }
};
BlockSelection.styles = css `
    :host {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      background-color: var(--affine-hover-color);
      border-color: transparent;
      border-style: solid;
    }
  `;
__decorate([
    property({ attribute: false })
], BlockSelection.prototype, "borderRadius", void 0);
__decorate([
    property({ attribute: false })
], BlockSelection.prototype, "borderWidth", void 0);
BlockSelection = __decorate([
    customElement('affine-block-selection')
], BlockSelection);
export { BlockSelection };
//# sourceMappingURL=block-selection.js.map