'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-58ea899e.js');
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
const componentUsageRuntimeMetrics = require('./component-usage-runtime-metrics-389d1548.js');
const internalIconManager = require('./internal-icon-manager-66c48800.js');
const component = require('./component-1e352960.js');
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-ba6a95f3.js');
const vegaEventId = require('./vega-event-id-f95480b7.js');
const designToken = require('./design-token-3bc36220.js');
const staticSubjectTitle = require('./static-subject-title-5829a298.js');
const changeManager = require('./change-manager-a297e4d2.js');
const object = require('./object-b53e9416.js');
const index$1 = require('./index-592b4052.js');
const eventEmitSlimmer = require('./event-emit-slimmer-73c42d7e.js');
const formFieldControllerSlimmer = require('./form-field-controller-slimmer-44091874.js');
const requiredFieldRule = require('./required-field-rule-d73c1d8c.js');
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-273d62ef.js');
const breakpoints = require('./breakpoints-1cc2c4c6.js');
const translationSlimmer = require('./translation-slimmer-a4a7f0eb.js');
require('./icon-manager-e855446d.js');
require('./create-public-api-runtime-metrics-slimmer-122350c3.js');
require('./dynamic-slimmer-f31fdfd7.js');
require('./misc-3d30df91.js');
require('./observer-f49483e8.js');
require('./ui-3727d685.js');
require('./type-guard-c1195e50.js');
require('./breakpoints-ebde4837.js');
require('./ui-32120990.js');
require('./typography-4560e7f1.js');
require('./internal-translation-controller-f0da24b2.js');
require('./responsive-format-facade-9647775d.js');
require('./number-4816603d.js');
require('./pixel-98f2a10c.js');
require('./array-249289f2.js');
require('./feature-flag-controller-5fa21654.js');
require('./index-3ca118c4.js');
require('./state-border-formatter-1a483a9b.js');
require('./try-get-document-c0ebd39a.js');
require('./internal-vega-event-manager-063c17cb.js');
require('./string-39438062.js');
require('./vega-internal-event-id-e138d4d6.js');
require('./internal-form-field-validation-rule.abstract-07cdff46.js');
require('./mutation-observer-slimmer-749d5020.js');
require('./mutation-observer-filters-38cebc6d.js');
require('./sub-state-observer-slimmer-aa93ab4f.js');

var __decorate$3 = (undefined && undefined.__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;
};
class VegaSignatureCaptureRenderer extends globalSlimmerRegistry.VegaSlimmer {
  render() {
    return index.h(index.Host, null, this.mode === 'written' && this.writtenModeRenderer.render());
  }
}
__decorate$3([
  globalSlimmerRegistry.MapToComponentField()
], VegaSignatureCaptureRenderer.prototype, "mode", void 0);
__decorate$3([
  globalSlimmerRegistry.MapToComponentField()
], VegaSignatureCaptureRenderer.prototype, "writtenModeRenderer", void 0);

const Icons = {
  signature: {
    icon: `<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M176 128c0-26.5 21.5-48 48-48s48 21.5 48 48v7.9c0 27.5-2.3 55-7 82.1L158 251.1c-36.9 11.4-62 45.5-62 84.1V410c0 38.6 31.3 70 70 70c24.6 0 47.4-12.9 60-34l15.9-26.4c29.6-49.4 51.1-103.3 63.6-159.5l1-4.7 110.8-34.3-23.9 66.8c-2.6 7.4-1.5 15.5 3 21.9s11.8 10.2 19.6 10.2H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H450.1l28.5-79.9c3.1-8.6 1-18.1-5.3-24.7s-15.7-9-24.4-6.3l-133 41.2c2.7-22 4.1-44.2 4.1-66.4V128c0-53-43-96-96-96s-96 43-96 96v40c0 13.3 10.7 24 24 24s24-10.7 24-24V128zm-3.8 169l80.9-25c-11.7 43.2-29.4 84.5-52.4 123l-15.9 26.4c-4 6.6-11.1 10.7-18.8 10.7c-12.1 0-22-9.8-22-22V335.2c0-17.5 11.4-33 28.2-38.2zM64 368H24c-13.3 0-24 10.7-24 24s10.7 24 24 24H64.2c-.1-2-.2-4-.2-6V368zm216.8 48H616c13.3 0 24-10.7 24-24s-10.7-24-24-24H304.1c-7 16.3-14.8 32.4-23.3 48z"/></svg>`,
  },
};

var __decorate$2 = (undefined && undefined.__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;
};
class WrittenModeRenderer extends globalSlimmerRegistry.VegaSlimmer {
  constructor() {
    super(...arguments);
    /**
     * The below method is e2e-test covered in
     * @see{module:vega-signature-capture-focus-e2e}
     */
    /* istanbul ignore next */
    this.signatureCaptureFocus = () => {
      this.signatureCaptureContainerRef.focus();
    };
  }
  getSignatureCaptureContainer() {
    return this.signatureCaptureContainerRef;
  }
  render() {
    return (index.h("vega-flex", { direction: "col", gap: "size-8" },
      this.renderLabel(),
      this.renderContainer(),
      this.renderFooter()));
  }
  renderLabel() {
    return (this.label && (index.h("vega-field-label", { onClick: this.signatureCaptureFocus, isFieldRequired: this.required, label: this.label, disabled: this.disabled })));
  }
  renderContainer() {
    return (index.h("div", { class: {
        'signature-capture-written-container': true,
        'disabled': this.disabled,
      }, "aria-label": "Please sign here", role: "textbox", tabIndex: this.disabled ? -1 : 0, ref: (ref) => (this.signatureCaptureContainerRef = ref) },
      this.renderPlaceholder(),
      this.renderSignaturePad()));
  }
  renderPlaceholder() {
    if (this.isDrawing || this.value)
      return;
    return (this.placeholder && (index.h("vega-flex", { class: "placeholder-container", gap: "size-8", justifyContent: "center", alignItems: "center", margin: {
        left: 'size-24',
        right: 'size-24',
      } },
      this.placeholderIcon && (index.h("vega-icon", { class: "placeholder-container-icon", size: "size-20", color: "text-secondary", icon: this.placeholderIcon })),
      index.h("div", { class: "placeholder-container-content" }, this.translationSlimmer.t(this.placeholder)))));
  }
  /*
   * When the clear button is displayed, since the error message and the clear button are in the same line, this element is displayed.
   */
  renderSignaturePad() {
    // TODO: Adding the SVG attribute will cause changes to the generated base64 value, leading to problems. https://gethired.atlassian.net/browse/VD-7854
    return (index.h("svg", { width: "100%", height: designToken.formatAndValidResponsiveToken(this.height, 'widthAndHeight'), "touch-action": "none", ref: (ref) => this.writtenModeSvgController.setSignatureContainerRef(ref) }));
  }
  renderFooter() {
    return (this.showClearBtn && (index.h("vega-flex", { class: "signature-capture-written-footer", justifyContent: "space-between" },
      index.h("div", { class: "vega-error vega-hidden vega-error-content" }),
      this.renderClearBtn())));
  }
  renderClearBtn() {
    return (index.h("div", { class: "clear-button" },
      index.h("vega-button-link", { size: "small", disabled: this.disabled, ref: (ref) => {
          domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, vegaEventId.VegaClick, () => {
            this.writtenModeSvgController.clear();
          });
        }, label: this.translationSlimmer.t('Clear Signature') })));
  }
}
(() => {
  internalIconManager.VegaInternalIconManager.register(Icons);
})();
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "label", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "required", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "showClearBtn", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "placeholder", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "placeholderIcon", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "disabled", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "value", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "isDrawing", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "height", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "writtenModeSvgController", void 0);
__decorate$2([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeRenderer.prototype, "translationSlimmer", void 0);

var __decorate$1 = (undefined && undefined.__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;
};
/**
 * Signature written mode controller
 */
class WrittenModeSvgController extends globalSlimmerRegistry.VegaSlimmer {
  constructor() {
    super(...arguments);
    this.penWidth = '4px';
    /**
     * Clear the signature
     */
    this.clear = () => {
      this.signatureContainerRef.innerHTML = index$1.htmlSanitizer.sanitize('', index$1.emptySanitizeStrategy);
      this.value = null;
    };
    /*
     * The below method is e2e-test covered in
     * @see{module:vega-signature-capture-on-draw-signature}
     */
    /* istanbul ignore next */
    /**
     * Start drawing the current path
     *
     * @param {MouseEvent} e - MouseEvent
     */
    this.startDrawing = (e) => {
      if (this.disabled)
        return;
      this.isDrawing = true;
      const { x, y } = this.getPoint(e);
      // eslint-disable-next-line no-restricted-globals
      this.currentPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
      this.currentPath.setAttribute('d', `M ${x} ${y}`);
      this.currentPath.setAttribute('stroke', 'rgba(4, 4, 28, 1)');
      this.currentPath.setAttribute('stroke-width', this.penWidth);
      this.currentPath.setAttribute('fill', 'none');
      this.currentPath.setAttribute('stroke-linecap', 'round');
      this.currentPath.setAttribute('stroke-linejoin', 'round');
      this.signatureContainerRef.appendChild(this.currentPath);
    };
    /*
     * The below method is e2e-test covered in
     * @see{module:vega-signature-capture-on-draw-signature}
     */
    /* istanbul ignore next */
    /**
     * Get the current mouse position.
     * In cypress case, when the mousedown event signature is triggered, the event type is 'Event', which adds compatibility
     *
     * @param {MouseEvent | TouchEvent} e - MouseEvent on desktop or TouchEvent on mobile
     * @returns {VegaSignatureMousePosition} - Current mouse position
     */
    this.getPoint = (e) => {
      var _a, _b;
      const rect = this.signatureContainerRef.getBoundingClientRect();
      const clientX = (_a = e['clientX']) !== null && _a !== void 0 ? _a : e['touches'][0].clientX;
      const clientY = (_b = e['clientY']) !== null && _b !== void 0 ? _b : e['touches'][0].clientY;
      return {
        x: clientX - rect.left,
        y: clientY - rect.top,
      };
    };
    /*
     * The below method is e2e-test covered in
     * @see{module:vega-signature-capture-on-draw-signature}
     */
    /* istanbul ignore next */
    /**
     * Draw the current path to the end point
     *
     * @param {MouseEvent} e - Mouse event
     */
    this.draw = (e) => {
      if (!this.isDrawing)
        return;
      const { x, y } = this.getPoint(e);
      const d = this.currentPath.getAttribute('d');
      this.currentPath.setAttribute('d', `${d} L ${x} ${y}`);
    };
    /*
     * The below method is e2e-test covered in
     * @see{module:vega-signature-capture-on-draw-signature}
     */
    /* istanbul ignore next */
    /**
     * Stop drawing and update the value
     */
    this.stopDrawing = () => {
      if (!this.isDrawing)
        return;
      this.isDrawing = false;
      this.value = { type: 'written', img: this.generateSignatureImage() };
    };
  }
  /**
   * Setup written listeners
   */
  componentDidLoad() {
    this.setupListeners();
    this.fillSignature(this.value);
  }
  /**
   * Clear the signature
   */
  handleClear() {
    this.clear();
  }
  /**
   * Emit the vegaChange event when value changed
   *
   * @param {VegaSignatureValue} newValue - The `newValue` parameter is a object representing the new value for the signature capture.
   * @param {VegaSignatureValue} oldValue - The `oldValue` parameter is a object representing the old value for the signature capture.
   */
  watchValue(newValue, oldValue) {
    if (object.deepEqual(newValue, oldValue))
      return;
    this.changeEventEmitter.emit(newValue);
    this.fillSignature(newValue);
    changeManager.ChangeManager.notify(staticSubjectTitle.FORM_ELEMENT_VALUE_CHANGE, {
      host: this.host,
      detail: newValue,
    });
  }
  /**
   * Set the signature container ref
   *
   * @param {SVGElement} ref - signature container ref
   */
  setSignatureContainerRef(ref) {
    this.signatureContainerRef = ref;
  }
  /**
   * Setup the listeners, for desktop and mobile
   */
  setupListeners() {
    const container = this.signatureContainerRef;
    container.addEventListener('mousedown', this.startDrawing);
    container.addEventListener('mousemove', this.draw);
    container.addEventListener('mouseup', this.stopDrawing);
    container.addEventListener('mouseleave', this.stopDrawing);
    // For mobile
    container.addEventListener('touchstart', this.startDrawing);
    container.addEventListener('touchmove', this.draw);
    container.addEventListener('touchend', this.stopDrawing);
  }
  /*
   * The below method is e2e-test covered in
   * @see{module:vega-signature-capture-on-draw-signature}
   */
  /* istanbul ignore next */
  /**
   * Generate the signature base64 image string
   *
   * @returns {string} - base64 image string
   */
  generateSignatureImage() {
    const serializer = new XMLSerializer();
    // TODO: Adding the SVG attribute will cause changes to the generated base64 value, leading to problems. https://gethired.atlassian.net/browse/VD-7854
    const svgData = serializer.serializeToString(this.signatureContainerRef);
    const base64Svg = btoa(unescape(encodeURIComponent(svgData)));
    return `data:image/svg+xml;base64,${base64Svg}`;
  }
  /**
   * Parse the value to svg
   *
   * @param {VegaSignatureValue} value - Signature value
   * @returns {Nullable<HTMLElement>} - SVG element
   */
  fromDataURL(value) {
    if (!value || !value.img)
      return;
    const base64Svg = this.value.img.replace('data:image/svg+xml;base64,', '');
    return new DOMParser().parseFromString(atob(base64Svg), 'image/svg+xml').documentElement;
  }
  /**
   * Fill the signature from the value.
   * Not fill the signature if the signature container already has child nodes, that means in written status.
   *
   * @param {VegaSignatureValue} value - Signature value
   */
  fillSignature(value) {
    this.signatureContainerRef.replaceChildren();
    const signature = this.fromDataURL(value);
    if (signature) {
      const paths = Array.from(signature.childNodes);
      this.signatureContainerRef.append(...paths);
    }
  }
}
__decorate$1([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeSvgController.prototype, "changeEventEmitter", void 0);
__decorate$1([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeSvgController.prototype, "host", void 0);
__decorate$1([
  globalSlimmerRegistry.MapToComponentField({ writable: true })
], WrittenModeSvgController.prototype, "value", void 0);
__decorate$1([
  globalSlimmerRegistry.MapToComponentField({ writable: true })
], WrittenModeSvgController.prototype, "isDrawing", void 0);
__decorate$1([
  globalSlimmerRegistry.MapToComponentField()
], WrittenModeSvgController.prototype, "disabled", void 0);
__decorate$1([
  globalSlimmerRegistry.MapToComponentMethod('componentDidLoad')
], WrittenModeSvgController.prototype, "componentDidLoad", null);
__decorate$1([
  globalSlimmerRegistry.MapToComponentMethod('clear')
], WrittenModeSvgController.prototype, "handleClear", null);
__decorate$1([
  globalSlimmerRegistry.MapToComponentMethod('watchValue')
], WrittenModeSvgController.prototype, "watchValue", null);

const vegaSignatureCaptureCss = ":host{display:block}.signature-capture-written-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;overflow:hidden;width:100%;position:relative;background-color:rgb(252, 252, 252)}.signature-capture-written-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.signature-capture-written-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}.signature-capture-written-container .placeholder-container{height:100%;position:absolute;top:0px;right:0px;bottom:0px;left:0px;pointer-events:none}.signature-capture-written-container .placeholder-container-content{font-family:\"Inter\", sans-serif;font-size:18px;font-weight:500;line-height:28px;letter-spacing:0px;color:rgba(4, 4, 28, 0.64)}@media screen and (min-width: 768px) and (max-width: 1023px){.signature-capture-written-container .placeholder-container-content{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.signature-capture-written-container .placeholder-container-content{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.signature-capture-written-container .placeholder-container-content{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.signature-capture-written-container .placeholder-container-icon{flex-shrink:0;color:rgba(4, 4, 28, 0.64)}.signature-capture-written-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.signature-capture-written-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.signature-capture-written-container.error:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1))}.signature-capture-written-container.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.signature-capture-written-container.disabled:hover,.signature-capture-written-container.disabled:focus-within{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.signature-capture-written-container.disabled:focus-within{outline:none}.signature-capture-written-container.disabled .placeholder-container-content,.signature-capture-written-container.disabled .placeholder-container-icon{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}.signature-capture-written-footer .clear-button{flex-grow:1;padding-right:8px;text-align:right}.signature-capture-written-footer .vega-error-content{padding-top:0px;padding-right:0px;flex-grow:1}.vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}";

var __decorate = (undefined && undefined.__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;
};
const VegaSignatureCapture = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.vegaChange = index.createEvent(this, "vegaChange", 7);
    this.change = index.createEvent(this, "change", 7);
    this.globalSlimmers = {};
    this.translationSlimmer = new translationSlimmer.TranslationSlimmer();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new componentUsageRuntimeMetrics.VegaComponentUsageRuntimeMetricsSlimmer();
    this.vegaSignatureCaptureRenderer = new VegaSignatureCaptureRenderer();
    this.writtenModeRenderer = new WrittenModeRenderer();
    this.writtenModeSvgController = new WrittenModeSvgController();
    this.changeEventEmitter = eventEmitSlimmer.createEventEmitSlimmer(VegaSignatureCapture, vegaEventId.VegaChange);
    this.formFieldController = new formFieldControllerSlimmer.FormFieldControllerSlimmer({
      propertyRules: [
        {
          propertyName: 'required',
          ruleFactory: (isRequired) => (isRequired ? new requiredFieldRule.RequiredFieldRule() : null),
        },
      ],
      validationRulesName: 'validationRules',
      defaultValue: null,
      attributeGetter: (propertyName) => this[propertyName],
      inputContainerGetter: () => this.writtenModeRenderer.getSignatureCaptureContainer(),
      touchableAreaGetter: () => [this.writtenModeRenderer.getSignatureCaptureContainer()],
    });
    this.pageResizeSlimmer = new pageResizeObserverSlimmer.PageResizeObserverSlimmer();
    this.currentBreakpoint = breakpoints.getCurrentBreakpoint();
    /**
     * Specifies the state of the signature
     */
    this.isDrawing = false;
    /**
     * Specifies the mode of the signature capture
     *
     * @vegaVersion 2.19.0
     */
    this.mode = 'written';
    /**
     * Specifies the label or title for the signature capture.
     *
     * It provides descriptive text that helps identify the
     *    purpose or content expected in the signature capture.
     *
     * @vegaVersion 2.19.0
     */
    this.label = '';
    /**
     * Determines whether the signature capture field is required.
     *
     * @vegaVersion 2.19.0
     */
    this.required = false;
    /**
     * Determines whether the clear button is displayed.
     *
     * @vegaVersion 2.19.0
     */
    this.showClearBtn = true;
    /**
     * Specifies a placeholder string that displays as a temporary hint
     *    or example inside the signature capture.
     *
     * It indicates the expected format or pattern of the signature capture.
     *
     * @vegaVersion 2.19.0
     */
    this.placeholder = 'Please sign here';
    /**
     * Specifies an icon or symbol that appears before the placeholder,
     *    providing visual context or enhancing the aesthetic appearance
     *    of the signature capture.
     *
     * @vegaVersion 2.19.0
     * @defaultValue v-internal-icon signature
     */
    this.placeholderIcon = internalIconManager.VegaInternalIconManager.getIconKey('signature');
    /**
     * Specifies whether the signature capture is disabled.
     *
     * @vegaVersion 2.19.0
     */
    this.disabled = false;
    /**
     * Specifies the value of the signature capture
     *
     * @vegaVersion 2.19.0
     */
    /* eslint-disable-next-line @stencil/strict-mutable */
    this.value = null;
    /**
     * Indicates whether the current value in the field is considered valid or
     *    invalid based on the defined validation rules.
     *
     * @vegaVersion 2.19.0
     */
    /* eslint-disable-next-line @stencil/strict-mutable */
    this.isValid = null;
    /**
     * Determines whether the signature capture field should undergo automatic validation
     *    during the user's sign.
     *
     * @vegaVersion 2.19.0
     */
    this.autoValidation = true;
    /**
     * Defines custom validation rules for the signature capture field.
     *
     * @vegaVersion 2.19.0
     */
    this.validationRules = [];
    /**
     * Defines the height of the signature capture field.
     *
     * @vegaVersion 2.20.0
     */
    this.height = '320px';
  }
  watchValue(newValue, oldValue) {
  }
  watchValidationRules() {
  }
  /**
   * Invoke this method to clear the signature
   *
   * @vegaVersion 2.19.0
   */
  async clear() {
  }
  render() {
    return component.sanitizeVegaComponent(this.vegaSignatureCaptureRenderer.render(), this.host);
  }
  get host() { return index.getElement(this); }
  static get watchers() { return {
    "value": ["watchValue"],
    "validationRules": ["watchValidationRules"]
  }; }
};
__decorate([
  componentUsageRuntimeMetrics.InjectVegaGlobalSlimmer()
], VegaSignatureCapture.prototype, "globalSlimmers", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaSignatureCapture.prototype, "translationSlimmer", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaSignatureCapture.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaSignatureCapture.prototype, "vegaSignatureCaptureRenderer", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaSignatureCapture.prototype, "writtenModeRenderer", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaSignatureCapture.prototype, "writtenModeSvgController", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaSignatureCapture.prototype, "changeEventEmitter", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaSignatureCapture.prototype, "formFieldController", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaSignatureCapture.prototype, "pageResizeSlimmer", void 0);
VegaSignatureCapture.style = vegaSignatureCaptureCss;

exports.vega_signature_capture = VegaSignatureCapture;
