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 { Component, Host, h, Element, Prop, State, Event } from '@stencil/core';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer } from 'vega-slimmer/core';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../../helpers/slimmers/component-usage-runtime-metrics';
import { sanitizeVegaComponent } from '../../../utils/component';
import { VegaRichTextImageEditorRenderer } from './slimmers/renderers/vega-rich-text-image-editor-renderer';
import { createEventEmitSlimmer, } from '../../../helpers/event-manager/slimmers/event-emit-slimmer';
import { VegaChange } from '../../../helpers/event-manager/event-id/vega-event-id';
import { TranslationSlimmer } from '../../../helpers/slimmers/translation';
/**
 * This is an internal used component and shouldn't be used by clients,
 *    it doesn't show up in storybook either.
 *
 * @vegaVersion 2.34.0
 */
export class VegaRichTextImageEditor {
  constructor() {
    this.globalSlimmers = {};
    this.translationSlimmer = new TranslationSlimmer();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    this.renderer = new VegaRichTextImageEditorRenderer();
    this.changeEventEmitter = createEventEmitSlimmer(VegaRichTextImageEditor, VegaChange);
    this.currentPage = 1;
    this.selected = false;
    /**
     * Specifies the value of image alt
     *
     * @vegaVersion 2.34.0
     */
    this.alt = '';
    /**
     * Specifies the size of the image to the container
     *
     * @vegaVersion 2.34.0
     */
    /* eslint-disable-next-line @stencil/strict-mutable */
    this.size = 'md';
  }
  render() {
    return sanitizeVegaComponent(h(Host, { class: { 'rte-image-selected': this.selected } }, this.renderer.render()), this.host);
  }
  static get is() { return "vega-rich-text-image-editor"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-rich-text-image-editor.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-rich-text-image-editor.css"]
  }; }
  static get properties() { return {
    "alt": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.34.0"
          }],
        "text": "Specifies the value of image alt"
      },
      "attribute": "alt",
      "reflect": true,
      "defaultValue": "''"
    },
    "size": {
      "type": "string",
      "mutable": true,
      "complexType": {
        "original": "VegaRichTextImageEditorSizeType",
        "resolved": "\"lg\" | \"md\" | \"sm\"",
        "references": {
          "VegaRichTextImageEditorSizeType": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.34.0"
          }],
        "text": "Specifies the size of the image to the container"
      },
      "attribute": "size",
      "reflect": true,
      "defaultValue": "'md'"
    }
  }; }
  static get states() { return {
    "currentPage": {},
    "selected": {}
  }; }
  static get events() { return [{
      "method": "vegaChange",
      "name": "vegaChange",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.34.0"
          }],
        "text": "An event emitter notifying content change."
      },
      "complexType": {
        "original": "VegaRichTextImageEditorChangeDetail",
        "resolved": "{ action: \"delete\"; } | { action: \"edit\"; payload: VegaRTEImageEditorRecord; }",
        "references": {
          "VegaRichTextImageEditorChangeDetail": {
            "location": "import",
            "path": "./types"
          }
        }
      }
    }, {
      "method": "change",
      "name": "change",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.34.0"
          }],
        "text": "An event emitter notifying content change."
      },
      "complexType": {
        "original": "VegaRichTextImageEditorChangeDetail",
        "resolved": "{ action: \"delete\"; } | { action: \"edit\"; payload: VegaRTEImageEditorRecord; }",
        "references": {
          "VegaRichTextImageEditorChangeDetail": {
            "location": "import",
            "path": "./types"
          }
        }
      }
    }]; }
  static get elementRef() { return "host"; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaRichTextImageEditor.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextImageEditor.prototype, "translationSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextImageEditor.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextImageEditor.prototype, "renderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaRichTextImageEditor.prototype, "changeEventEmitter", void 0);
