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 { MapToComponentField, VegaSlimmer } from 'vega-slimmer/core';
/** The `VegaInputCopyPasteController` class extends `VegaSlimmer` and provides methods to handle copy, cut, and paste events based on the `disableCopyPaste` property of a `VegaInput` component. */
export class VegaInputCopyPasteController extends VegaSlimmer {
  /**
   * The function `getCopyPasteProps` returns an object with event handlers that prevent default behavior for copy, cut, and paste events if `disableCopyPaste` is true.
   *
   * @returns {Record<string, (e: ClipboardEvent) => void>} If `this.disableCopyPaste` is true, an object with `onCopy`, `onCut`, and `onPaste`
   * properties is being returned. Each property is a function that takes a `ClipboardEvent` parameter
   * and prevents the default behavior of the event. If `this.disableCopyPaste` is false, an empty
   * object is being returned.
   */
  getCopyPasteProps() {
    if (this.disableCopyPaste) {
      return {
        onCopy: this.preventDefault,
        onCut: this.preventDefault,
        onPaste: this.preventDefault,
      };
    }
    else {
      return {};
    }
  }
  /**
   * The `preventDefault` function in TypeScript prevents the default behavior of a ClipboardEvent.
   *
   * @param {ClipboardEvent} e - The parameter "e" in the function "preventDefault" is of type
   * ClipboardEvent. This parameter represents the event object that is passed to the function when it
   * is called.
   */
  preventDefault(e) {
    e.preventDefault();
  }
}
__decorate([
  MapToComponentField()
], VegaInputCopyPasteController.prototype, "disableCopyPaste", void 0);
