"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const objects = require("../../../base/common/objects.js");
const codeEditorService = require("../services/codeEditorService.js");
const codeEditorWidget = require("./codeEditorWidget.js");
const commands = require("../../../platform/commands/common/commands.js");
const contextkey = require("../../../platform/contextkey/common/contextkey.js");
const instantiation = require("../../../platform/instantiation/common/instantiation.js");
const notification = require("../../../platform/notification/common/notification.js");
const themeService = require("../../../platform/theme/common/themeService.js");
const accessibility = require("../../../platform/accessibility/common/accessibility.js");
const languageConfigurationRegistry = require("../../common/languages/languageConfigurationRegistry.js");
const languageFeatures = require("../../common/services/languageFeatures.js");
var __decorate = globalThis && globalThis.__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;
};
var __param = globalThis && globalThis.__param || function(paramIndex, decorator) {
  return function(target, key) {
    decorator(target, key, paramIndex);
  };
};
exports.EmbeddedCodeEditorWidget = class EmbeddedCodeEditorWidget extends codeEditorWidget.CodeEditorWidget {
  constructor(domElement, options, parentEditor, instantiationService, codeEditorService2, commandService, contextKeyService, themeService2, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService) {
    super(domElement, Object.assign(Object.assign({}, parentEditor.getRawOptions()), { overflowWidgetsDomNode: parentEditor.getOverflowWidgetsDomNode() }), {}, instantiationService, codeEditorService2, commandService, contextKeyService, themeService2, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService);
    this._parentEditor = parentEditor;
    this._overwriteOptions = options;
    super.updateOptions(this._overwriteOptions);
    this._register(parentEditor.onDidChangeConfiguration((e) => this._onParentConfigurationChanged(e)));
  }
  getParentEditor() {
    return this._parentEditor;
  }
  _onParentConfigurationChanged(e) {
    super.updateOptions(this._parentEditor.getRawOptions());
    super.updateOptions(this._overwriteOptions);
  }
  updateOptions(newOptions) {
    objects.mixin(this._overwriteOptions, newOptions, true);
    super.updateOptions(this._overwriteOptions);
  }
};
exports.EmbeddedCodeEditorWidget = __decorate([
  __param(3, instantiation.IInstantiationService),
  __param(4, codeEditorService.ICodeEditorService),
  __param(5, commands.ICommandService),
  __param(6, contextkey.IContextKeyService),
  __param(7, themeService.IThemeService),
  __param(8, notification.INotificationService),
  __param(9, accessibility.IAccessibilityService),
  __param(10, languageConfigurationRegistry.ILanguageConfigurationService),
  __param(11, languageFeatures.ILanguageFeaturesService)
], exports.EmbeddedCodeEditorWidget);
